{
"type": "object",
"required": ["transaction_id", "shop_id", "region", "savings", "amount"],
"properties": {
"transaction_id": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for the transaction"
},
"student_id": {
"type": "string",
"format": "uuid",
"nullable": true,
"description": "ID of the student making the purchase"
},
"shop_id": {
"type": "string",
"format": "uuid",
"description": "ID of the shop where the transaction occurred (must reference an existing shop)"
},
"offer_id": {
"type": "string",
"format": "uuid",
"nullable": true,
"description": "ID of the offer used"
},
"branch_id": {
"type": "string",
"format": "uuid",
"nullable": true,
"description": "ID of the branch location"
},
"region": {
"type": "string",
"description": "Geographic region of the transaction (2-letter country code, ISO 3166-1 alpha-2)"
},
"source": {
"type": "string",
"nullable": true,
"description": "Source of the transaction (e.g., 'online', 'in-store')"
},
"savings": {
"type": "number",
"format": "float",
"description": "Amount saved in the transaction (must be a non-negative number)"
},
"amount": {
"type": "number",
"format": "float",
"description": "Total transaction amount (must be a positive number)"
},
"created": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "Timestamp when the record was created"
},
"updated": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "Timestamp when the record was last updated"
},
"is_deleted": {
"type": "boolean",
"nullable": true,
"description": "Flag indicating if the record is marked as deleted"
},
"discount_name": {
"type": "string",
"nullable": true,
"description": "Name of the discount applied"
},
"discount_type": {
"type": "string",
"nullable": true,
"description": "Type of discount (e.g., 'percentage', 'fixed')"
},
"discount_value": {
"type": "number",
"format": "float",
"nullable": true,
"description": "Value of the discount"
}
}
}