{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "PurchaseOrder", "description": "Schema for purchase order data in Bakery-IA system", "type": "object", "required": [ "id", "tenant_id", "po_number", "supplier_id", "order_date", "expected_delivery_date", "status", "total_amount", "created_at" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the purchase order" }, "tenant_id": { "type": "string", "format": "uuid", "description": "Tenant identifier" }, "po_number": { "type": "string", "minLength": 1, "maxLength": 50, "description": "Purchase order number" }, "supplier_id": { "type": "string", "format": "uuid", "description": "Supplier identifier" }, "order_date": { "type": "string", "format": "date-time", "description": "Order date" }, "expected_delivery_date": { "type": "string", "format": "date-time", "description": "Expected delivery date" }, "status": { "type": "string", "enum": ["DRAFT", "PENDING", "APPROVED", "DELIVERED", "CANCELLED", "REJECTED"], "description": "Purchase order status" }, "total_amount": { "type": "number", "minimum": 0, "description": "Total order amount in EUR" }, "created_at": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "notes": { "type": "string", "description": "Additional notes" }, "reasoning_data": { "type": "object", "description": "Reasoning data for urgent orders", "properties": { "type": { "type": "string", "description": "Reasoning type" }, "parameters": { "type": "object", "description": "Reasoning parameters" } } }, "enterprise_order": { "type": "boolean", "description": "Enterprise-level order" }, "contract_reference": { "type": "string", "description": "Contract reference" }, "payment_terms": { "type": "string", "description": "Payment terms" }, "delivery_location": { "type": "string", "description": "Delivery location" }, "incoterms": { "type": "string", "description": "International commercial terms" } }, "additionalProperties": false }