436 lines
17 KiB
JSON
436 lines
17 KiB
JSON
{
|
|
"purchase_orders": [
|
|
{
|
|
"id": "50000000-0000-0000-0000-0000000000c1",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-LATE-0001",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000001",
|
|
"order_date": "BASE_TS - 1d",
|
|
"status": "pending_approval",
|
|
"priority": "high",
|
|
"required_delivery_date": "BASE_TS - 4h",
|
|
"estimated_delivery_date": "BASE_TS - 4h",
|
|
"expected_delivery_date": "BASE_TS - 4h",
|
|
"subtotal": 500.00,
|
|
"tax_amount": 105.00,
|
|
"shipping_cost": 20.00,
|
|
"discount_amount": 0.00,
|
|
"total_amount": 625.00,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "URGENTE: Entrega en almacén trasero",
|
|
"delivery_contact": "Carlos Almacén",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": true,
|
|
"sent_to_supplier_at": "BASE_TS - 1d",
|
|
"supplier_confirmation_date": "BASE_TS - 23h",
|
|
"supplier_reference": "SUP-REF-LATE-001",
|
|
"notes": "⚠️ EDGE CASE: Delivery should have arrived 4 hours ago - will trigger red supplier delay alert",
|
|
"created_by": "50000000-0000-0000-0000-000000000005"
|
|
},
|
|
{
|
|
"id": "50000000-0000-0000-0000-0000000000c2",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-UPCOMING-0001",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000002",
|
|
"order_date": "BASE_TS - 1h",
|
|
"status": "pending_approval",
|
|
"priority": "medium",
|
|
"required_delivery_date": "BASE_TS + 2h30m",
|
|
"estimated_delivery_date": "BASE_TS + 2h30m",
|
|
"expected_delivery_date": "BASE_TS + 2h30m",
|
|
"subtotal": 300.00,
|
|
"tax_amount": 63.00,
|
|
"shipping_cost": 15.00,
|
|
"discount_amount": 0.00,
|
|
"total_amount": 378.00,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "Mantener refrigerado",
|
|
"delivery_contact": "Carlos Almacén",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": true,
|
|
"sent_to_supplier_at": "BASE_TS - 1h",
|
|
"supplier_confirmation_date": "BASE_TS - 30m",
|
|
"supplier_reference": "SUP-REF-UPCOMING-001",
|
|
"notes": "⚠️ EDGE CASE: Delivery expected in 2.5 hours - will show in upcoming deliveries",
|
|
"created_by": "50000000-0000-0000-0000-000000000005"
|
|
},
|
|
{
|
|
"id": "50000000-0000-0000-0000-000000000001",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-2025-001",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000001",
|
|
"order_date_offset_days": -7,
|
|
"status": "completed",
|
|
"priority": "normal",
|
|
"required_delivery_date_offset_days": -2,
|
|
"estimated_delivery_date_offset_days": -2,
|
|
"expected_delivery_date_offset_days": -2,
|
|
"subtotal": 850.00,
|
|
"tax_amount": 178.50,
|
|
"shipping_cost": 25.00,
|
|
"discount_amount": 0.00,
|
|
"total_amount": 1053.50,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "Entrega en almacén trasero",
|
|
"delivery_contact": "Carlos Almacén",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": false,
|
|
"sent_to_supplier_at_offset_days": -7,
|
|
"supplier_confirmation_date_offset_days": -6,
|
|
"supplier_reference": "SUP-REF-2025-001",
|
|
"notes": "Pedido habitual semanal de harinas",
|
|
"created_by": "50000000-0000-0000-0000-000000000005"
|
|
},
|
|
{
|
|
"id": "50000000-0000-0000-0000-000000000002",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-2025-002",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000002",
|
|
"order_date_offset_days": -5,
|
|
"status": "completed",
|
|
"priority": "normal",
|
|
"required_delivery_date_offset_days": -1,
|
|
"estimated_delivery_date_offset_days": -1,
|
|
"expected_delivery_date_offset_days": -1,
|
|
"subtotal": 320.00,
|
|
"tax_amount": 67.20,
|
|
"shipping_cost": 15.00,
|
|
"discount_amount": 0.00,
|
|
"total_amount": 402.20,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "Mantener refrigerado",
|
|
"delivery_contact": "Carlos Almacén",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": false,
|
|
"sent_to_supplier_at_offset_days": -5,
|
|
"supplier_confirmation_date_offset_days": -4,
|
|
"supplier_reference": "LGIPUZ-2025-042",
|
|
"notes": "Pedido de lácteos para producción semanal",
|
|
"created_by": "50000000-0000-0000-0000-000000000005"
|
|
},
|
|
{
|
|
"id": "50000000-0000-0000-0000-000000000003",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-2025-003",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000003",
|
|
"order_date_offset_days": -3,
|
|
"status": "approved",
|
|
"priority": "high",
|
|
"required_delivery_date_offset_days": 1,
|
|
"estimated_delivery_date_offset_days": 2,
|
|
"expected_delivery_date_offset_days": 2,
|
|
"subtotal": 450.00,
|
|
"tax_amount": 94.50,
|
|
"shipping_cost": 20.00,
|
|
"discount_amount": 22.50,
|
|
"total_amount": 542.00,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "Requiere inspección de calidad",
|
|
"delivery_contact": "Pedro Calidad",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": true,
|
|
"auto_approved": true,
|
|
"auto_approval_rule_id": "10000000-0000-0000-0000-000000000001",
|
|
"approved_at_offset_days": -2,
|
|
"approved_by": "50000000-0000-0000-0000-000000000006",
|
|
"notes": "Pedido urgente para nueva línea de productos ecológicos - Auto-aprobado por IA",
|
|
"reasoning_data": {
|
|
"job": "ensure_quality_ingredients",
|
|
"context": {
|
|
"en": "Organic ingredients needed for new product line",
|
|
"es": "Ingredientes ecológicos necesarios para nueva línea de productos",
|
|
"eu": "Produktu lerro berrirako osagai ekologikoak behar dira"
|
|
},
|
|
"decision": {
|
|
"en": "Auto-approved: Under €500 threshold and from certified supplier",
|
|
"es": "Auto-aprobado: Bajo umbral de €500 y de proveedor certificado",
|
|
"eu": "Auto-onartuta: €500ko mugaren azpian eta hornitzaile ziurtatutik"
|
|
}
|
|
},
|
|
"created_by": "50000000-0000-0000-0000-000000000005"
|
|
},
|
|
{
|
|
"id": "50000000-0000-0000-0000-000000000004",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-2025-004-URGENT",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000001",
|
|
"order_date_offset_days": -0.5,
|
|
"status": "confirmed",
|
|
"priority": "urgent",
|
|
"required_delivery_date_offset_days": -0.167,
|
|
"estimated_delivery_date_offset_days": 0.083,
|
|
"expected_delivery_date_offset_days": -0.167,
|
|
"subtotal": 1200.00,
|
|
"tax_amount": 252.00,
|
|
"shipping_cost": 35.00,
|
|
"discount_amount": 60.00,
|
|
"total_amount": 1427.00,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "URGENTE - Entrega antes de las 10:00 AM",
|
|
"delivery_contact": "Isabel Producción",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": false,
|
|
"sent_to_supplier_at_offset_days": -0.5,
|
|
"supplier_confirmation_date_offset_days": -0.4,
|
|
"supplier_reference": "SUP-URGENT-2025-005",
|
|
"notes": "EDGE CASE: Entrega retrasada - debió llegar hace 4 horas. Stock crítico de harina",
|
|
"reasoning_data": {
|
|
"job": "avoid_production_stoppage",
|
|
"context": {
|
|
"en": "Critical flour shortage - production at risk",
|
|
"es": "Escasez crítica de harina - producción en riesgo",
|
|
"eu": "Irina-faltagatik ekoizpena arriskuan"
|
|
},
|
|
"urgency": {
|
|
"en": "Urgent: Delivery delayed 4 hours, affecting today's production",
|
|
"es": "Urgente: Entrega retrasada 4 horas, afectando la producción de hoy",
|
|
"eu": "Presazkoa: Entrega 4 ordu berandu, gaurko ekoizpena eraginda"
|
|
}
|
|
},
|
|
"created_by": "50000000-0000-0000-0000-000000000006"
|
|
},
|
|
{
|
|
"id": "50000000-0000-0000-0000-000000000007",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-2025-007",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000004",
|
|
"order_date_offset_days": -7,
|
|
"status": "completed",
|
|
"priority": "normal",
|
|
"required_delivery_date_offset_days": -5,
|
|
"estimated_delivery_date_offset_days": -5,
|
|
"expected_delivery_date_offset_days": -5,
|
|
"subtotal": 450.00,
|
|
"tax_amount": 94.50,
|
|
"shipping_cost": 25.00,
|
|
"discount_amount": 0.00,
|
|
"total_amount": 569.50,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "Entrega en horario de mañana",
|
|
"delivery_contact": "Carlos Almacén",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": false,
|
|
"sent_to_supplier_at_offset_days": -7,
|
|
"supplier_confirmation_date_offset_days": -6,
|
|
"supplier_reference": "SUP-REF-2025-007",
|
|
"notes": "Pedido de ingredientes especiales para línea premium - Entregado hace 5 días",
|
|
"created_by": "50000000-0000-0000-0000-000000000005"
|
|
},
|
|
{
|
|
"id": "50000000-0000-0000-0000-000000000005",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-2025-005",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000004",
|
|
"order_date_offset_days": 0,
|
|
"status": "draft",
|
|
"priority": "normal",
|
|
"required_delivery_date_offset_days": 3,
|
|
"estimated_delivery_date_offset_days": 3,
|
|
"expected_delivery_date_offset_days": 3,
|
|
"subtotal": 280.00,
|
|
"tax_amount": 58.80,
|
|
"shipping_cost": 12.00,
|
|
"discount_amount": 0.00,
|
|
"total_amount": 350.80,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "Llamar antes de entregar",
|
|
"delivery_contact": "Carlos Almacén",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": false,
|
|
"notes": "Pedido planificado para reposición semanal",
|
|
"created_by": "50000000-0000-0000-0000-000000000005"
|
|
},
|
|
{
|
|
"id": "50000000-0000-0000-0000-000000000006",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"po_number": "PO-2025-006",
|
|
"supplier_id": "40000000-0000-0000-0000-000000000002",
|
|
"order_date_offset_days": -0.5,
|
|
"status": "sent_to_supplier",
|
|
"priority": "high",
|
|
"required_delivery_date_offset_days": 0.25,
|
|
"estimated_delivery_date_offset_days": 0.25,
|
|
"expected_delivery_date_offset_days": 0.25,
|
|
"subtotal": 195.00,
|
|
"tax_amount": 40.95,
|
|
"shipping_cost": 10.00,
|
|
"discount_amount": 0.00,
|
|
"total_amount": 245.95,
|
|
"currency": "EUR",
|
|
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
|
|
"delivery_instructions": "Mantener cadena de frío - Entrega urgente para producción",
|
|
"delivery_contact": "Carlos Almacén",
|
|
"delivery_phone": "+34 910 123 456",
|
|
"requires_approval": false,
|
|
"sent_to_supplier_at_offset_days": -0.5,
|
|
"notes": "⏰ EDGE CASE: Entrega esperada en 6 horas - mantequilla para producción de croissants de mañana",
|
|
"created_by": "50000000-0000-0000-0000-000000000006"
|
|
}
|
|
],
|
|
"purchase_order_items": [
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000001",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000001",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000001",
|
|
"product_name": "Harina de Trigo T55",
|
|
"product_code": "HAR-T55-001",
|
|
"ordered_quantity": 500.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 0.85,
|
|
"line_total": 425.00,
|
|
"received_quantity": 500.0,
|
|
"remaining_quantity": 0.0
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000002",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000001",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000002",
|
|
"product_name": "Harina de Trigo T65",
|
|
"product_code": "HAR-T65-002",
|
|
"ordered_quantity": 200.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 0.95,
|
|
"line_total": 190.00,
|
|
"received_quantity": 200.0,
|
|
"remaining_quantity": 0.0
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000003",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000001",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000005",
|
|
"product_name": "Harina Centeno",
|
|
"product_code": "HAR-CENT-005",
|
|
"ordered_quantity": 100.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 1.15,
|
|
"line_total": 115.00,
|
|
"received_quantity": 100.0,
|
|
"remaining_quantity": 0.0
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000004",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000001",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000006",
|
|
"product_name": "Sal Marina",
|
|
"product_code": "SAL-MAR-006",
|
|
"ordered_quantity": 50.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 2.40,
|
|
"line_total": 120.00,
|
|
"received_quantity": 50.0,
|
|
"remaining_quantity": 0.0
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000005",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000002",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000011",
|
|
"product_name": "Mantequilla sin Sal 82% MG",
|
|
"product_code": "MANT-001",
|
|
"ordered_quantity": 80.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 4.00,
|
|
"line_total": 320.00,
|
|
"received_quantity": 80.0,
|
|
"remaining_quantity": 0.0
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000006",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000004",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000001",
|
|
"product_name": "Harina de Trigo T55",
|
|
"product_code": "HAR-T55-001",
|
|
"ordered_quantity": 1000.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 0.80,
|
|
"line_total": 800.00,
|
|
"received_quantity": 0.0,
|
|
"remaining_quantity": 1000.0,
|
|
"notes": "URGENTE - Stock crítico"
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000007",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000004",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000011",
|
|
"product_name": "Levadura Fresca",
|
|
"product_code": "LEV-FRESC-001",
|
|
"ordered_quantity": 50.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 8.00,
|
|
"line_total": 400.00,
|
|
"received_quantity": 0.0,
|
|
"remaining_quantity": 50.0,
|
|
"notes": "Stock agotado - prioridad máxima"
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000008",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000006",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000011",
|
|
"product_name": "Mantequilla sin Sal 82% MG",
|
|
"product_code": "MANT-001",
|
|
"ordered_quantity": 30.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 6.50,
|
|
"line_total": 195.00,
|
|
"received_quantity": 0.0,
|
|
"remaining_quantity": 30.0
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000009",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000007",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000041",
|
|
"product_name": "Chocolate Negro 70% Cacao",
|
|
"product_code": "CHO-NEG-001",
|
|
"ordered_quantity": 20.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 15.50,
|
|
"line_total": 310.00,
|
|
"received_quantity": 20.0,
|
|
"remaining_quantity": 0.0
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000010",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000007",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000042",
|
|
"product_name": "Almendras Laminadas",
|
|
"product_code": "ALM-LAM-001",
|
|
"ordered_quantity": 15.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 8.90,
|
|
"line_total": 133.50,
|
|
"received_quantity": 15.0,
|
|
"remaining_quantity": 0.0
|
|
},
|
|
{
|
|
"id": "51000000-0000-0000-0000-000000000011",
|
|
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
|
|
"purchase_order_id": "50000000-0000-0000-0000-000000000007",
|
|
"inventory_product_id": "10000000-0000-0000-0000-000000000043",
|
|
"product_name": "Pasas de Corinto",
|
|
"product_code": "PAS-COR-001",
|
|
"ordered_quantity": 10.0,
|
|
"unit_of_measure": "kilograms",
|
|
"unit_price": 4.50,
|
|
"line_total": 45.00,
|
|
"received_quantity": 10.0,
|
|
"remaining_quantity": 0.0
|
|
}
|
|
]
|
|
} |