Files
varsity/test/schemas/order-schema.json
2025-10-01 20:01:42 +00:00

45 lines
929 B
JSON

{
"type": "object",
"required": ["id", "status", "items", "total"],
"properties": {
"id": {
"type": "string",
"pattern": "^ORD-[0-9]{8}$"
},
"status": {
"type": "string",
"enum": ["pending", "processing", "shipped", "delivered", "cancelled"]
},
"items": {
"type": "array",
"items": {
"$ref": "./order-item-schema.json"
}
},
"total": {
"$ref": "./price-schema.json"
},
"shippingAddress": {
"$ref": "./address-schema.json"
},
"billingAddress": {
"$ref": "./address-schema.json"
},
"paymentMethod": {
"$ref": "./payment-method-schema.json"
},
"trackingNumber": {
"type": "string",
"pattern": "^[A-Z0-9]{10,20}$"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
}
}