Initial commit - production deployment

This commit is contained in:
2026-01-21 17:17:16 +01:00
commit c23d00dd92
2289 changed files with 638440 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
{
"tenant": {
"id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Panadería Artesana Madrid - Demo",
"subdomain": "demo-artesana",
"email": "demo.professional@panaderiaartesana.com",
"subscription_tier": "professional",
"tenant_type": "standalone",
"description": "Professional tier demo tenant for bakery operations",
"is_active": true,
"created_at": "2025-01-15T06:00:00Z",
"updated_at": "2025-01-15T06:00:00Z"
},
"owner": {
"id": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6",
"name": "María García López",
"email": "maria.garcia@panaderiaartesana.com",
"role": "owner"
},
"subscription": {
"id": "80000000-0000-0000-0000-000000000001",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"plan": "professional",
"status": "active",
"monthly_price": 299.00,
"billing_cycle": "monthly",
"max_users": 10,
"max_locations": 3,
"max_products": 500,
"features": {
"production_planning": true,
"procurement_management": true,
"inventory_management": true,
"sales_analytics": true,
"multi_location": true,
"advanced_reporting": true,
"api_access": true,
"priority_support": true
},
"trial_ends_at": "BASE_TS+30d",
"next_billing_date": "BASE_TS+30d",
"stripe_subscription_id": null,
"stripe_customer_id": null,
"cancelled_at": null,
"cancellation_effective_date": null,
"created_at": "BASE_TS-30d",
"updated_at": "BASE_TS-30d",
"is_tenant_linked": true
}
}

View File

@@ -0,0 +1,74 @@
{
"users": [
{
"id": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "María García López",
"email": "maria.garcia@panaderiaartesana.com",
"role": "owner",
"is_active": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS"
},
{
"id": "50000000-0000-0000-0000-000000000001",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Juan Panadero",
"email": "juan.panadero@panaderiaartesana.com",
"role": "baker",
"is_active": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS"
},
{
"id": "50000000-0000-0000-0000-000000000002",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Ana Ventas",
"email": "ana.ventas@panaderiaartesana.com",
"role": "sales",
"is_active": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS"
},
{
"id": "50000000-0000-0000-0000-000000000003",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Pedro Calidad",
"email": "pedro.calidad@panaderiaartesana.com",
"role": "quality_control",
"is_active": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS"
},
{
"id": "50000000-0000-0000-0000-000000000004",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Laura Admin",
"email": "laura.admin@panaderiaartesana.com",
"role": "admin",
"is_active": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS"
},
{
"id": "50000000-0000-0000-0000-000000000005",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Carlos Almacén",
"email": "carlos.almacen@panaderiaartesana.com",
"role": "warehouse",
"is_active": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS"
},
{
"id": "50000000-0000-0000-0000-000000000006",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Isabel Producción",
"email": "isabel.produccion@panaderiaartesana.com",
"role": "production_manager",
"is_active": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,840 @@
{
"recipes": [
{
"id": "30000000-0000-0000-0000-000000000001",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Baguette Francesa Tradicional",
"recipe_code": null,
"version": "1.0",
"finished_product_id": "20000000-0000-0000-0000-000000000001",
"description": "Baguette francesa tradicional con corteza crujiente y miga alveolada. Perfecta para acompañar cualquier comida.",
"category": "Panes",
"cuisine_type": "Francesa",
"difficulty_level": 2,
"yield_quantity": 10.0,
"yield_unit": "units",
"prep_time_minutes": 20,
"cook_time_minutes": 25,
"total_time_minutes": 165,
"rest_time_minutes": 120,
"estimated_cost_per_unit": null,
"last_calculated_cost": null,
"cost_calculation_date": null,
"target_margin_percentage": null,
"suggested_selling_price": null,
"instructions": {
"steps": [
{
"step": 1,
"title": "Amasado",
"description": "Mezclar harina, agua, sal y levadura. Amasar durante 15 minutos hasta obtener una masa lisa y elástica.",
"duration_minutes": 15
},
{
"step": 2,
"title": "Primera Fermentación",
"description": "Dejar reposar la masa en un recipiente tapado durante 60 minutos a temperatura ambiente (22-24°C).",
"duration_minutes": 60
},
{
"step": 3,
"title": "División y Formado",
"description": "Dividir la masa en 10 piezas de 250g cada una. Formar las baguettes dándoles la forma alargada característica.",
"duration_minutes": 20
},
{
"step": 4,
"title": "Segunda Fermentación",
"description": "Colocar las baguettes en un lienzo enharinado y dejar fermentar 60 minutos más.",
"duration_minutes": 60
},
{
"step": 5,
"title": "Greñado y Horneado",
"description": "Hacer cortes diagonales en la superficie con una cuchilla. Hornear a 240°C con vapor inicial durante 25 minutos.",
"duration_minutes": 25
}
]
},
"preparation_notes": "Es crucial usar vapor al inicio del horneado para lograr una corteza crujiente. La temperatura del agua debe estar entre 18-20°C.",
"storage_instructions": "Consumir el mismo día de producción. Se puede congelar después del horneado.",
"serves_count": null,
"nutritional_info": null,
"allergen_info": null,
"dietary_tags": null,
"batch_size_multiplier": 1.0,
"minimum_batch_size": null,
"maximum_batch_size": null,
"optimal_production_temperature": null,
"optimal_humidity": null,
"quality_check_configuration": null,
"status": "ACTIVE",
"is_seasonal": false,
"season_start_month": null,
"season_end_month": null,
"is_signature_item": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"created_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6",
"updated_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6"
},
{
"id": "30000000-0000-0000-0000-000000000002",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Croissant de Mantequilla Artesanal",
"recipe_code": null,
"version": "1.0",
"finished_product_id": "20000000-0000-0000-0000-000000000002",
"description": "Croissant de mantequilla con laminado perfecto y textura hojaldrada. Elaboración artesanal con mantequilla de alta calidad.",
"category": "Bollería",
"cuisine_type": "Francesa",
"difficulty_level": 4,
"yield_quantity": 12.0,
"yield_unit": "units",
"prep_time_minutes": 45,
"cook_time_minutes": 18,
"total_time_minutes": 333,
"rest_time_minutes": 270,
"estimated_cost_per_unit": null,
"last_calculated_cost": null,
"cost_calculation_date": null,
"target_margin_percentage": null,
"suggested_selling_price": null,
"instructions": {
"steps": [
{
"step": 1,
"title": "Preparación de la Masa Base",
"description": "Mezclar todos los ingredientes excepto la mantequilla de laminado. Amasar hasta obtener una masa homogénea.",
"duration_minutes": 20
},
{
"step": 2,
"title": "Reposo en Frío",
"description": "Envolver la masa en film y refrigerar durante 2 horas.",
"duration_minutes": 120
},
{
"step": 3,
"title": "Laminado",
"description": "Extender la masa en rectángulo. Colocar la mantequilla en el centro y hacer 3 dobleces sencillos con 30 minutos de reposo entre cada uno.",
"duration_minutes": 90
},
{
"step": 4,
"title": "Formado",
"description": "Extender a 3mm de grosor, cortar triángulos y enrollar para formar los croissants.",
"duration_minutes": 25
},
{
"step": 5,
"title": "Fermentación Final",
"description": "Dejar fermentar a 26°C durante 2-3 horas hasta que dupliquen su volumen.",
"duration_minutes": 150
},
{
"step": 6,
"title": "Horneado",
"description": "Pintar con huevo batido y hornear a 200°C durante 18 minutos hasta dorar.",
"duration_minutes": 18
}
]
},
"preparation_notes": "La mantequilla para laminar debe estar a 15-16°C, flexible pero no blanda. Trabajar en ambiente fresco.",
"storage_instructions": "Consumir el día de producción. Se puede congelar la masa formada antes de la fermentación final.",
"serves_count": null,
"nutritional_info": null,
"allergen_info": null,
"dietary_tags": null,
"batch_size_multiplier": 1.0,
"minimum_batch_size": null,
"maximum_batch_size": null,
"optimal_production_temperature": null,
"optimal_humidity": null,
"quality_check_configuration": null,
"status": "ACTIVE",
"is_seasonal": false,
"season_start_month": null,
"season_end_month": null,
"is_signature_item": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"created_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6",
"updated_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6"
},
{
"id": "30000000-0000-0000-0000-000000000003",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Pan de Pueblo con Masa Madre",
"recipe_code": null,
"version": "1.0",
"finished_product_id": "20000000-0000-0000-0000-000000000003",
"description": "Hogaza de pan rústico elaborada con masa madre natural. Corteza gruesa y miga densa con sabor ligeramente ácido.",
"category": "Panes Artesanales",
"cuisine_type": "Española",
"difficulty_level": 3,
"yield_quantity": 4.0,
"yield_unit": "units",
"prep_time_minutes": 30,
"cook_time_minutes": 45,
"total_time_minutes": 435,
"rest_time_minutes": 360,
"estimated_cost_per_unit": null,
"last_calculated_cost": null,
"cost_calculation_date": null,
"target_margin_percentage": null,
"suggested_selling_price": null,
"instructions": {
"steps": [
{
"step": 1,
"title": "Autolisis",
"description": "Mezclar harinas y agua, dejar reposar 30 minutos para desarrollar el gluten.",
"duration_minutes": 30
},
{
"step": 2,
"title": "Incorporación de Masa Madre y Sal",
"description": "Añadir la masa madre y la sal. Amasar suavemente hasta integrar completamente.",
"duration_minutes": 15
},
{
"step": 3,
"title": "Fermentación en Bloque con Pliegues",
"description": "Realizar 4 series de pliegues cada 30 minutos durante las primeras 2 horas. Luego dejar reposar 2 horas más.",
"duration_minutes": 240
},
{
"step": 4,
"title": "División y Preformado",
"description": "Dividir en 4 piezas de 800g. Preformar en bolas y dejar reposar 30 minutos.",
"duration_minutes": 30
},
{
"step": 5,
"title": "Formado Final",
"description": "Formar las hogazas dándoles tensión superficial. Colocar en banneton o lienzo enharinado.",
"duration_minutes": 15
},
{
"step": 6,
"title": "Fermentación Final",
"description": "Dejar fermentar a temperatura ambiente durante 2 horas o en frío durante la noche.",
"duration_minutes": 120
},
{
"step": 7,
"title": "Horneado",
"description": "Hacer cortes en la superficie. Hornear a 230°C con vapor inicial durante 45 minutos.",
"duration_minutes": 45
}
]
},
"preparation_notes": "La masa madre debe estar activa y en su punto óptimo. La temperatura final de la masa debe ser 24-25°C.",
"storage_instructions": "Se conserva hasta 5-7 días en bolsa de papel. Mejora al segundo día.",
"serves_count": null,
"nutritional_info": null,
"allergen_info": null,
"dietary_tags": null,
"batch_size_multiplier": 1.0,
"minimum_batch_size": null,
"maximum_batch_size": null,
"optimal_production_temperature": null,
"optimal_humidity": null,
"quality_check_configuration": null,
"status": "ACTIVE",
"is_seasonal": false,
"season_start_month": null,
"season_end_month": null,
"is_signature_item": true,
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"created_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6",
"updated_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6"
},
{
"id": "30000000-0000-0000-0000-000000000004",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Napolitana de Chocolate",
"recipe_code": null,
"version": "1.0",
"finished_product_id": "20000000-0000-0000-0000-000000000004",
"description": "Bollería de hojaldre rectangular rellena de chocolate. Clásico de las panaderías españolas.",
"category": "Bollería",
"cuisine_type": "Española",
"difficulty_level": 3,
"yield_quantity": 16.0,
"yield_unit": "units",
"prep_time_minutes": 40,
"cook_time_minutes": 15,
"total_time_minutes": 325,
"rest_time_minutes": 270,
"estimated_cost_per_unit": null,
"last_calculated_cost": null,
"cost_calculation_date": null,
"target_margin_percentage": null,
"suggested_selling_price": null,
"instructions": {
"steps": [
{
"step": 1,
"title": "Masa Base y Laminado",
"description": "Preparar masa de hojaldre siguiendo el mismo proceso que los croissants.",
"duration_minutes": 180
},
{
"step": 2,
"title": "Corte y Formado",
"description": "Extender la masa y cortar rectángulos de 10x15cm. Colocar barritas de chocolate en el centro.",
"duration_minutes": 20
},
{
"step": 3,
"title": "Sellado",
"description": "Doblar la masa sobre sí misma para cubrir el chocolate. Sellar bien los bordes.",
"duration_minutes": 20
},
{
"step": 4,
"title": "Fermentación",
"description": "Dejar fermentar a 26°C durante 90 minutos.",
"duration_minutes": 90
},
{
"step": 5,
"title": "Horneado",
"description": "Pintar con huevo y hornear a 190°C durante 15 minutos.",
"duration_minutes": 15
}
]
},
"preparation_notes": "El chocolate debe ser de buena calidad para un mejor resultado. No sobrecargar de chocolate.",
"storage_instructions": "Consumir preferiblemente el día de producción.",
"serves_count": null,
"nutritional_info": null,
"allergen_info": null,
"dietary_tags": null,
"batch_size_multiplier": 1.0,
"minimum_batch_size": null,
"maximum_batch_size": null,
"optimal_production_temperature": null,
"optimal_humidity": null,
"quality_check_configuration": null,
"status": "ACTIVE",
"is_seasonal": false,
"season_start_month": null,
"season_end_month": null,
"is_signature_item": false,
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"created_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6",
"updated_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6"
}
],
"recipe_ingredients": [
{
"id": "473debdb-ab7c-4a79-9b41-985715695710",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000001",
"ingredient_id": "10000000-0000-0000-0000-000000000001",
"quantity": 1000.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "tamizada",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 1,
"ingredient_group": "Secos",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "545c7899-d893-41f4-a839-963235f128cd",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000001",
"ingredient_id": "10000000-0000-0000-0000-000000000033",
"quantity": 650.0,
"unit": "ml",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "temperatura ambiente",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 2,
"ingredient_group": "Líquidos",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "4e9ec9cc-6339-4191-bad5-c52b604106c9",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000001",
"ingredient_id": "10000000-0000-0000-0000-000000000031",
"quantity": 20.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 3,
"ingredient_group": "Secos",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "f89b85f2-e18e-451a-8048-668bcfb6bc51",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000001",
"ingredient_id": "10000000-0000-0000-0000-000000000021",
"quantity": 15.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "desmenuzada",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 4,
"ingredient_group": "Fermentos",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "5e25c0c8-17b9-4db1-b099-8dc459def206",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000002",
"ingredient_id": "10000000-0000-0000-0000-000000000001",
"quantity": 500.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 1,
"ingredient_group": "Masa base",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "89a9872d-4bf4-469f-8c84-37f7bf0c9a92",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000002",
"ingredient_id": "10000000-0000-0000-0000-000000000012",
"quantity": 120.0,
"unit": "ml",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "tibia",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 2,
"ingredient_group": "Masa base",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "1843a05b-d3dd-4963-afa1-1c76fcd6922f",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000002",
"ingredient_id": "10000000-0000-0000-0000-000000000033",
"quantity": 80.0,
"unit": "ml",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 3,
"ingredient_group": "Masa base",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "af984d98-3b75-458f-8fdd-02699dc33e9d",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000002",
"ingredient_id": "10000000-0000-0000-0000-000000000032",
"quantity": 50.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 4,
"ingredient_group": "Masa base",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "b09b738f-d24c-4dde-be76-6b88ea99511e",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000002",
"ingredient_id": "10000000-0000-0000-0000-000000000031",
"quantity": 10.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 5,
"ingredient_group": "Masa base",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "119496cd-e7e3-40a4-b298-09a434b679fc",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000002",
"ingredient_id": "10000000-0000-0000-0000-000000000021",
"quantity": 20.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 6,
"ingredient_group": "Masa base",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "c8fe9422-3000-42b4-a74a-cb00b6277130",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000002",
"ingredient_id": "10000000-0000-0000-0000-000000000011",
"quantity": 25.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "en la masa",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 7,
"ingredient_group": "Masa base",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "107a15bf-d2df-4e25-95fe-aee64febf112",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000002",
"ingredient_id": "10000000-0000-0000-0000-000000000011",
"quantity": 250.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "para laminar (15-16°C)",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 8,
"ingredient_group": "Laminado",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "242e8508-3adf-4b11-b482-33d740bd5397",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000003",
"ingredient_id": "10000000-0000-0000-0000-000000000002",
"quantity": 800.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 1,
"ingredient_group": "Harinas",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "ea701cf5-0c6b-45aa-9519-e4dc42a40662",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000003",
"ingredient_id": "10000000-0000-0000-0000-000000000004",
"quantity": 200.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 2,
"ingredient_group": "Harinas",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "3a4f0c61-8451-42fe-b3bc-4b0f4527af87",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000003",
"ingredient_id": "10000000-0000-0000-0000-000000000023",
"quantity": 300.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "activa y alimentada",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 3,
"ingredient_group": "Fermentos",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "ededf3a3-b58a-4f10-8d12-324aa3400349",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000003",
"ingredient_id": "10000000-0000-0000-0000-000000000033",
"quantity": 650.0,
"unit": "ml",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "temperatura ambiente",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 4,
"ingredient_group": "Líquidos",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "93177be7-24e5-4e97-8d46-df373d6a04bc",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000003",
"ingredient_id": "10000000-0000-0000-0000-000000000031",
"quantity": 22.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 5,
"ingredient_group": "Condimentos",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "c27a4fbb-d451-4a14-b0e2-09e5cbd07bad",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000004",
"ingredient_id": "10000000-0000-0000-0000-000000000001",
"quantity": 500.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 1,
"ingredient_group": "Masa",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "dd8a0784-ead1-483b-b183-21c71b692a7d",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000004",
"ingredient_id": "10000000-0000-0000-0000-000000000011",
"quantity": 300.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 2,
"ingredient_group": "Laminado",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "6434bf78-48e5-469d-a8d0-6f4dbe5c69ca",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000004",
"ingredient_id": "10000000-0000-0000-0000-000000000041",
"quantity": 200.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": "en barritas",
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 3,
"ingredient_group": "Relleno",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "38661b92-03e9-4dcd-ac90-86832eee9455",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000004",
"ingredient_id": "10000000-0000-0000-0000-000000000032",
"quantity": 60.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 4,
"ingredient_group": "Masa",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "1ff5fb46-3361-4978-b248-a6b3bb6592f7",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000004",
"ingredient_id": "10000000-0000-0000-0000-000000000031",
"quantity": 10.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 5,
"ingredient_group": "Masa",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "aa85612a-f99b-4c8b-a100-08ae4a9898a5",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000004",
"ingredient_id": "10000000-0000-0000-0000-000000000021",
"quantity": 15.0,
"unit": "g",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 6,
"ingredient_group": "Masa",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
},
{
"id": "33c542c8-bf36-4041-957f-765bf28cc68a",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"recipe_id": "30000000-0000-0000-0000-000000000004",
"ingredient_id": "10000000-0000-0000-0000-000000000012",
"quantity": 150.0,
"unit": "ml",
"quantity_in_base_unit": null,
"alternative_quantity": null,
"alternative_unit": null,
"preparation_method": null,
"ingredient_notes": null,
"is_optional": false,
"ingredient_order": 7,
"ingredient_group": "Masa",
"substitution_options": null,
"substitution_ratio": null,
"unit_cost": null,
"total_cost": null,
"cost_updated_at": null
}
]
}

View File

@@ -0,0 +1,201 @@
{
"suppliers": [
{
"id": "40000000-0000-0000-0000-000000000001",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Harinas del Norte",
"supplier_code": "SUP-HARINA-001",
"business_name": "Harinas del Norte S.L.",
"tax_id": "B12345678",
"contact_person": "José Martínez",
"email": "pedidos@harinasdelnorte.es",
"phone": "+34 945 123 456",
"address": "Pol. Industrial Norte, Calle 5",
"city": "Vitoria-Gasteiz",
"postal_code": "01000",
"country": "España",
"status": "ACTIVE",
"rating": 4.5,
"payment_terms": "30_DAYS",
"minimum_order_amount": 200.0,
"lead_time_days": 2,
"contract_start_date": "2024-01-01T00:00:00Z",
"contract_end_date": "2025-12-31T23:59:59Z",
"created_at": "BASE_TS",
"specialties": [
"flour",
"bread_improvers"
],
"delivery_areas": [
"Madrid",
"Basque Country",
"Navarra"
]
},
{
"id": "40000000-0000-0000-0000-000000000002",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Lácteos Gipuzkoa",
"supplier_code": "SUP-LACTEO-001",
"business_name": "Lácteos Gipuzkoa S.A.",
"tax_id": "B87654321",
"contact_person": "María López",
"email": "ventas@lacteosgipuzkoa.com",
"phone": "+34 943 234 567",
"address": "Calle Urola, 12",
"city": "Donostia-San Sebastián",
"postal_code": "20001",
"country": "España",
"status": "ACTIVE",
"rating": 4.8,
"payment_terms": "15_DAYS",
"minimum_order_amount": 150.0,
"lead_time_days": 1,
"contract_start_date": "2024-03-15T00:00:00Z",
"contract_end_date": "2025-12-31T23:59:59Z",
"created_at": "BASE_TS",
"specialties": [
"milk",
"butter",
"cream"
],
"delivery_areas": [
"Madrid",
"Basque Country",
"Cantabria"
]
},
{
"id": "40000000-0000-0000-0000-000000000003",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Frutas Frescas",
"supplier_code": "SUP-FRUTA-001",
"business_name": "Frutas Frescas S.L.",
"tax_id": "B23456789",
"contact_person": "Carlos Ruiz",
"email": "info@frutasfrescas.es",
"phone": "+34 915 345 678",
"address": "Mercado Central, Pabellón 3",
"city": "Madrid",
"postal_code": "28013",
"country": "España",
"status": "ACTIVE",
"rating": 4.2,
"payment_terms": "7_DAYS",
"minimum_order_amount": 100.0,
"lead_time_days": 1,
"contract_start_date": "2024-06-01T00:00:00Z",
"contract_end_date": "2025-12-31T23:59:59Z",
"created_at": "BASE_TS",
"specialties": [
"fruits",
"vegetables",
"citrus"
],
"delivery_areas": [
"Madrid",
"Toledo",
"Guadalajara"
]
},
{
"id": "40000000-0000-0000-0000-000000000004",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Sal de Mar",
"supplier_code": "SUP-SAL-001",
"business_name": "Sal de Mar S.A.",
"tax_id": "B34567890",
"contact_person": "Ana Martínez",
"email": "ventas@saldemar.com",
"phone": "+34 965 456 789",
"address": "Calle Salinera, 8",
"city": "Alicante",
"postal_code": "03001",
"country": "España",
"status": "ACTIVE",
"rating": 4.7,
"payment_terms": "30_DAYS",
"minimum_order_amount": 50.0,
"lead_time_days": 3,
"contract_start_date": "2024-01-01T00:00:00Z",
"contract_end_date": "2025-12-31T23:59:59Z",
"created_at": "BASE_TS",
"specialties": [
"salt",
"sea_salt",
"gourmet_salt"
],
"delivery_areas": [
"Madrid",
"Valencia",
"Murcia"
]
},
{
"id": "40000000-0000-0000-0000-000000000005",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Envases Pro",
"supplier_code": "SUP-ENVASE-001",
"business_name": "Envases Pro S.L.",
"tax_id": "B45678901",
"contact_person": "Luis Gómez",
"email": "comercial@envasespro.es",
"phone": "+34 932 345 678",
"address": "Calle Industrial, 15",
"city": "Barcelona",
"postal_code": "08019",
"country": "España",
"status": "ACTIVE",
"rating": 4.0,
"payment_terms": "60_DAYS",
"minimum_order_amount": 300.0,
"lead_time_days": 5,
"contract_start_date": "2024-01-01T00:00:00Z",
"contract_end_date": "2025-12-31T23:59:59Z",
"created_at": "BASE_TS",
"specialties": [
"packaging",
"bags",
"boxes"
],
"delivery_areas": [
"Madrid",
"Barcelona",
"Zaragoza"
]
},
{
"id": "40000000-0000-0000-0000-000000000006",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"name": "Levaduras Spain",
"supplier_code": "SUP-LEVADURA-001",
"business_name": "Levaduras Spain S.A.",
"tax_id": "B56789012",
"contact_person": "Sofía Fernández",
"email": "ventas@levadurasspain.com",
"phone": "+34 976 567 890",
"address": "Calle Fermentación, 3",
"city": "Zaragoza",
"postal_code": "50001",
"country": "España",
"status": "ACTIVE",
"rating": 4.9,
"payment_terms": "30_DAYS",
"minimum_order_amount": 100.0,
"lead_time_days": 2,
"contract_start_date": "2024-01-01T00:00:00Z",
"contract_end_date": "2025-12-31T23:59:59Z",
"created_at": "BASE_TS",
"specialties": [
"yeast",
"baking_yeast",
"dry_yeast"
],
"delivery_areas": [
"Madrid",
"Zaragoza",
"Navarra"
]
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,795 @@
{
"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": "confirmed",
"priority": "high",
"required_delivery_date": "BASE_TS - 4h",
"estimated_delivery_date": "BASE_TS - 4h",
"expected_delivery_date": "BASE_TS - 4h",
"subtotal": 558.0,
"tax_amount": 117.18,
"shipping_cost": 20.0,
"discount_amount": 0.0,
"total_amount": 695.18,
"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",
"reasoning_data": {
"type": "low_stock_detection",
"parameters": {
"supplier_name": "Harinas del Norte",
"product_names": [
"Harina de Trigo T55"
],
"product_count": 1,
"current_stock": 15,
"required_stock": 150,
"days_until_stockout": 1,
"threshold_percentage": 20,
"stock_percentage": 10
},
"consequence": {
"type": "stockout_risk",
"severity": "high",
"impact_days": 1,
"affected_products": [
"Baguette Tradicional",
"Pan de Pueblo"
],
"estimated_lost_orders": 25
},
"metadata": {
"trigger_source": "orchestrator_auto",
"ai_assisted": true,
"delivery_delayed": true,
"delay_hours": 4
}
},
"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": "confirmed",
"priority": "medium",
"required_delivery_date": "BASE_TS + 2h30m",
"estimated_delivery_date": "BASE_TS + 2h30m",
"expected_delivery_date": "BASE_TS + 2h30m",
"subtotal": 324.2,
"tax_amount": 68.08,
"shipping_cost": 20.0,
"discount_amount": 0.0,
"total_amount": 412.28,
"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",
"reasoning_data": {
"type": "production_requirement",
"parameters": {
"supplier_name": "Lácteos Gipuzkoa",
"product_names": [
"Mantequilla sin Sal",
"Leche Entera"
],
"product_count": 2,
"production_batches": 3,
"required_by_date": "tomorrow morning"
},
"consequence": {
"type": "production_delay",
"severity": "high",
"impact": "blocked_production"
},
"metadata": {
"trigger_source": "orchestrator_auto",
"ai_assisted": true,
"upcoming_delivery": true,
"hours_until_delivery": 2.5
}
},
"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",
"status": "completed",
"priority": "normal",
"subtotal": 801.0,
"tax_amount": 168.21,
"shipping_cost": 20.0,
"discount_amount": 0.0,
"total_amount": 989.21,
"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,
"supplier_reference": "SUP-REF-2025-001",
"notes": "Pedido habitual semanal de harinas",
"reasoning_data": {
"type": "safety_stock_replenishment",
"parameters": {
"supplier_name": "Harinas del Norte",
"product_names": [
"Harina de Trigo T55",
"Harina de Trigo T65",
"Harina de Centeno",
"Sal Marina Fina"
],
"product_count": 4,
"current_safety_stock": 120,
"target_safety_stock": 300,
"reorder_point": 150
},
"consequence": {
"type": "stockout_risk",
"severity": "medium",
"impact": "reduced_buffer"
},
"metadata": {
"trigger_source": "orchestrator_auto",
"ai_assisted": true,
"recurring_order": true,
"schedule": "weekly"
}
},
"created_by": "50000000-0000-0000-0000-000000000005",
"order_date": "BASE_TS - 7d",
"required_delivery_date": "BASE_TS - 2d",
"estimated_delivery_date": "BASE_TS - 2d",
"expected_delivery_date": "BASE_TS - 2d",
"sent_to_supplier_at": "BASE_TS - 7d",
"supplier_confirmation_date": "BASE_TS - 6d"
},
{
"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",
"status": "completed",
"priority": "normal",
"subtotal": 573.6,
"tax_amount": 120.46,
"shipping_cost": 20.0,
"discount_amount": 0.0,
"total_amount": 714.06,
"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,
"supplier_reference": "LGIPUZ-2025-042",
"notes": "Pedido de lácteos para producción semanal",
"reasoning_data": {
"type": "forecast_demand",
"parameters": {
"supplier_name": "Lácteos Gipuzkoa",
"product_names": [
"Mantequilla sin Sal 82% MG"
],
"product_count": 1,
"forecast_period_days": 7,
"total_demand": 80,
"forecast_confidence": 88
},
"consequence": {
"type": "insufficient_supply",
"severity": "medium",
"impact_days": 7
},
"metadata": {
"trigger_source": "orchestrator_auto",
"forecast_confidence": 0.88,
"ai_assisted": true,
"perishable_goods": true
}
},
"created_by": "50000000-0000-0000-0000-000000000005",
"order_date": "BASE_TS - 5d",
"required_delivery_date": "BASE_TS - 1d",
"estimated_delivery_date": "BASE_TS - 1d",
"expected_delivery_date": "BASE_TS - 1d",
"sent_to_supplier_at": "BASE_TS - 5d",
"supplier_confirmation_date": "BASE_TS - 4d"
},
{
"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",
"status": "pending_approval",
"priority": "high",
"subtotal": 490.0,
"tax_amount": 102.9,
"shipping_cost": 20.0,
"discount_amount": 24.5,
"total_amount": 588.4,
"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,
"notes": "Pedido urgente para nueva línea de productos ecológicos - Requiere aprobación del gerente",
"reasoning_data": {
"type": "supplier_contract",
"parameters": {
"supplier_name": "Productos Ecológicos del Norte",
"product_names": [
"Harina de Espelta Ecológica"
],
"product_count": 1,
"contract_terms": "certified_supplier",
"contract_quantity": 200.0,
"current_stock": 186.36,
"reorder_point": 50.0
},
"consequence": {
"type": "quality_assurance",
"severity": "medium",
"impact": "new_product_line_delay"
},
"metadata": {
"trigger_source": "manual",
"ai_assisted": true
}
},
"created_by": "50000000-0000-0000-0000-000000000005",
"order_date": "BASE_TS - 3d",
"required_delivery_date": "BASE_TS + 1d",
"estimated_delivery_date": "BASE_TS + 2d",
"expected_delivery_date": "BASE_TS + 2d"
},
{
"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",
"status": "confirmed",
"priority": "urgent",
"subtotal": 1130.5,
"tax_amount": 237.41,
"shipping_cost": 15.0,
"discount_amount": 52.0,
"total_amount": 1330.9,
"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,
"supplier_reference": "SUP-URGENT-2025-005",
"notes": "EDGE CASE: Entrega retrasada - debió llegar hace 4 horas. Stock crítico de harina",
"reasoning_data": {
"type": "low_stock_detection",
"parameters": {
"supplier_name": "Harinas del Norte",
"product_names": [
"Harina de Trigo T55",
"Levadura Fresca"
],
"product_count": 2,
"current_stock": 0,
"required_stock": 1000,
"days_until_stockout": 0,
"threshold_percentage": 20,
"stock_percentage": 0
},
"consequence": {
"type": "stockout_risk",
"severity": "critical",
"impact_days": 0,
"affected_products": [
"Baguette Tradicional",
"Croissant"
],
"estimated_lost_orders": 50
},
"metadata": {
"trigger_source": "orchestrator_auto",
"ai_assisted": true,
"delivery_delayed": true,
"delay_hours": 4
}
},
"created_by": "50000000-0000-0000-0000-000000000006",
"order_date": "BASE_TS - 0.5d",
"required_delivery_date": "BASE_TS - 0.167d",
"estimated_delivery_date": "BASE_TS + 0.083d",
"expected_delivery_date": "BASE_TS - 0.167d",
"sent_to_supplier_at": "BASE_TS - 0.5d",
"supplier_confirmation_date": "BASE_TS - 0.4d"
},
{
"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",
"status": "completed",
"priority": "normal",
"subtotal": 488.5,
"tax_amount": 102.58,
"shipping_cost": 20.0,
"discount_amount": 0.0,
"total_amount": 611.09,
"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,
"supplier_reference": "SUP-REF-2025-007",
"notes": "Pedido de ingredientes especiales para línea premium - Entregado hace 5 días",
"reasoning_data": {
"type": "seasonal_demand",
"parameters": {
"supplier_name": "Ingredientes Premium del Sur",
"product_names": [
"Chocolate Negro 70% Cacao",
"Almendras Laminadas",
"Pasas de Corinto"
],
"product_count": 3,
"season": "winter",
"expected_demand_increase_pct": 35
},
"consequence": {
"type": "missed_opportunity",
"severity": "medium",
"impact": "lost_seasonal_sales"
},
"metadata": {
"trigger_source": "orchestrator_auto",
"ai_assisted": true,
"premium_line": true,
"seasonal": true
}
},
"created_by": "50000000-0000-0000-0000-000000000005",
"order_date": "BASE_TS - 7d",
"required_delivery_date": "BASE_TS - 5d",
"estimated_delivery_date": "BASE_TS - 5d",
"expected_delivery_date": "BASE_TS - 5d",
"sent_to_supplier_at": "BASE_TS - 7d",
"supplier_confirmation_date": "BASE_TS - 6d"
},
{
"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",
"status": "draft",
"priority": "normal",
"subtotal": 303.7,
"tax_amount": 63.78,
"shipping_cost": 20.0,
"discount_amount": 0.0,
"total_amount": 387.48,
"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",
"reasoning_data": {
"type": "forecast_demand",
"parameters": {
"supplier_name": "Ingredientes Premium del Sur",
"product_names": [
"Specialty ingredients"
],
"product_count": 1,
"forecast_period_days": 7,
"total_demand": 280,
"forecast_confidence": 82
},
"consequence": {
"type": "insufficient_supply",
"severity": "low",
"impact_days": 7
},
"metadata": {
"trigger_source": "orchestrator_auto",
"forecast_confidence": 0.82,
"ai_assisted": true,
"draft_order": true
}
},
"created_by": "50000000-0000-0000-0000-000000000005",
"order_date": "BASE_TS",
"required_delivery_date": "BASE_TS + 3d",
"estimated_delivery_date": "BASE_TS + 3d",
"expected_delivery_date": "BASE_TS + 3d"
},
{
"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",
"status": "sent_to_supplier",
"priority": "high",
"subtotal": 219.9,
"tax_amount": 46.18,
"shipping_cost": 20.0,
"discount_amount": 0.0,
"total_amount": 286.08,
"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,
"notes": "⏰ EDGE CASE: Entrega esperada en 6 horas - mantequilla para producción de croissants de mañana",
"reasoning_data": {
"type": "production_requirement",
"parameters": {
"supplier_name": "Lácteos Gipuzkoa",
"product_names": [
"Mantequilla sin Sal 82% MG"
],
"product_count": 1,
"production_batches": 5,
"required_by_date": "tomorrow 06:00"
},
"consequence": {
"type": "production_delay",
"severity": "high",
"impact": "blocked_production"
},
"metadata": {
"trigger_source": "orchestrator_auto",
"ai_assisted": true,
"urgent_production": true,
"hours_until_needed": 12
}
},
"created_by": "50000000-0000-0000-0000-000000000006",
"order_date": "BASE_TS - 0.5d",
"required_delivery_date": "BASE_TS + 0.25d",
"estimated_delivery_date": "BASE_TS + 0.25d",
"expected_delivery_date": "BASE_TS + 0.25d",
"sent_to_supplier_at": "BASE_TS - 0.5d"
},
{
"id": "50000000-0000-0000-0000-000000000008",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"po_number": "PO-2025-008",
"supplier_id": "40000000-0000-0000-0000-000000000004",
"order_date": "BASE_TS - 0.25d",
"status": "pending_approval",
"priority": "medium",
"required_delivery_date": "BASE_TS + 2d",
"estimated_delivery_date": "BASE_TS + 2d",
"expected_delivery_date": "BASE_TS + 2d",
"subtotal": 220.0,
"tax_amount": 46.2,
"shipping_cost": 20.0,
"discount_amount": 0.0,
"total_amount": 286.2,
"currency": "EUR",
"delivery_address": "Calle Panadería, 45, 28001 Madrid",
"delivery_instructions": "Entrega en almacén seco - Zona A",
"delivery_contact": "Carlos Almacén",
"delivery_phone": "+34 910 123 456",
"requires_approval": true,
"notes": "Reposición de ingredientes básicos - Stock bajo en azúcar",
"reasoning_data": {
"type": "low_stock_detection",
"parameters": {
"supplier_name": "Distribuciones Alimentarias del Sur",
"product_names": [
"Azúcar Blanco Refinado"
],
"product_count": 1,
"current_stock": 24.98,
"required_stock": 120.0,
"days_until_stockout": 3,
"threshold_percentage": 66,
"stock_percentage": 20
},
"consequence": {
"type": "stockout_risk",
"severity": "medium",
"impact_days": 3,
"affected_products": [
"Croissants",
"Napolitanas",
"Pan Dulce"
],
"estimated_lost_orders": 15
},
"metadata": {
"trigger_source": "orchestrator_auto",
"ai_assisted": true
}
},
"created_by": "50000000-0000-0000-0000-000000000005"
}
],
"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.92,
"line_total": 460.0,
"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.98,
"line_total": 196.0,
"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 de Centeno",
"product_code": "HAR-CEN-005",
"ordered_quantity": 100.0,
"unit_of_measure": "kilograms",
"unit_price": 1.15,
"line_total": 115.0,
"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-000000000031",
"product_name": "Sal Marina Fina",
"product_code": "BAS-SAL-001",
"ordered_quantity": 50.0,
"unit_of_measure": "kilograms",
"unit_price": 0.6,
"line_total": 30.0,
"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": "LAC-MAN-001",
"ordered_quantity": 80.0,
"unit_of_measure": "kilograms",
"unit_price": 7.17,
"line_total": 573.6,
"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.91,
"line_total": 910.0,
"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-000000000021",
"product_name": "Levadura Fresca de Panadería",
"product_code": "LEV-FRE-001",
"ordered_quantity": 50.0,
"unit_of_measure": "kilograms",
"unit_price": 4.41,
"line_total": 220.5,
"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": "LAC-MAN-001",
"ordered_quantity": 30.0,
"unit_of_measure": "kilograms",
"unit_price": 7.33,
"line_total": 219.9,
"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": "ESP-CHO-001",
"ordered_quantity": 20.0,
"unit_of_measure": "kilograms",
"unit_price": 15.5,
"line_total": 310.0,
"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": "ESP-ALM-002",
"ordered_quantity": 15.0,
"unit_of_measure": "kilograms",
"unit_price": 8.9,
"line_total": 133.5,
"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": "ESP-PAS-003",
"ordered_quantity": 10.0,
"unit_of_measure": "kilograms",
"unit_price": 4.5,
"line_total": 45.0,
"received_quantity": 10.0,
"remaining_quantity": 0.0
},
{
"id": "51000000-0000-0000-0000-0000000000a1",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"purchase_order_id": "50000000-0000-0000-0000-0000000000c1",
"inventory_product_id": "10000000-0000-0000-0000-000000000001",
"product_name": "Harina de Trigo T55",
"product_code": "HAR-T55-001",
"ordered_quantity": 600.0,
"unit_of_measure": "kilograms",
"unit_price": 0.93,
"line_total": 558.0,
"received_quantity": 0.0,
"remaining_quantity": 600.0,
"notes": "URGENTE - Pedido retrasado 4 horas"
},
{
"id": "51000000-0000-0000-0000-0000000000a2",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"purchase_order_id": "50000000-0000-0000-0000-0000000000c2",
"inventory_product_id": "10000000-0000-0000-0000-000000000011",
"product_name": "Mantequilla sin Sal 82% MG",
"product_code": "LAC-MAN-001",
"ordered_quantity": 35.0,
"unit_of_measure": "kilograms",
"unit_price": 7.16,
"line_total": 250.6,
"received_quantity": 0.0,
"remaining_quantity": 35.0
},
{
"id": "51000000-0000-0000-0000-0000000000a3",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"purchase_order_id": "50000000-0000-0000-0000-0000000000c2",
"inventory_product_id": "10000000-0000-0000-0000-000000000012",
"product_name": "Leche Entera Fresca",
"product_code": "LAC-LEC-002",
"ordered_quantity": 80.0,
"unit_of_measure": "liters",
"unit_price": 0.92,
"line_total": 73.6,
"received_quantity": 0.0,
"remaining_quantity": 80.0
},
{
"id": "51000000-0000-0000-0000-0000000000a4",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"purchase_order_id": "50000000-0000-0000-0000-000000000003",
"inventory_product_id": "10000000-0000-0000-0000-000000000006",
"product_name": "Harina de Espelta Ecológica",
"product_code": "HAR-ESP-006",
"ordered_quantity": 200.0,
"unit_of_measure": "kilograms",
"unit_price": 2.45,
"line_total": 490.0,
"received_quantity": 0.0,
"remaining_quantity": 200.0,
"notes": "Ingrediente ecológico certificado para nueva línea"
},
{
"id": "51000000-0000-0000-0000-0000000000a5",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"purchase_order_id": "50000000-0000-0000-0000-000000000005",
"inventory_product_id": "10000000-0000-0000-0000-000000000041",
"product_name": "Chocolate Negro 70% Cacao",
"product_code": "ESP-CHO-001",
"ordered_quantity": 15.0,
"unit_of_measure": "kilograms",
"unit_price": 15.5,
"line_total": 232.5,
"received_quantity": 0.0,
"remaining_quantity": 15.0
},
{
"id": "51000000-0000-0000-0000-0000000000a6",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"purchase_order_id": "50000000-0000-0000-0000-000000000005",
"inventory_product_id": "10000000-0000-0000-0000-000000000042",
"product_name": "Almendras Laminadas",
"product_code": "ESP-ALM-002",
"ordered_quantity": 8.0,
"unit_of_measure": "kilograms",
"unit_price": 8.9,
"line_total": 71.2,
"received_quantity": 0.0,
"remaining_quantity": 8.0
},
{
"id": "51000000-0000-0000-0000-0000000000a7",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"purchase_order_id": "50000000-0000-0000-0000-000000000008",
"inventory_product_id": "10000000-0000-0000-0000-000000000032",
"product_name": "Azúcar Blanco Refinado",
"product_code": "BAS-AZU-002",
"ordered_quantity": 200.0,
"unit_of_measure": "kilograms",
"unit_price": 1.1,
"line_total": 220.0,
"received_quantity": 0.0,
"remaining_quantity": 200.0,
"notes": "Reposición stock bajo - Nivel crítico detectado"
}
]
}

View File

@@ -0,0 +1,306 @@
{
"customers": [
{
"id": "60000000-0000-0000-0000-000000000001",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_code": "CUST-001",
"name": "Restaurante El Buen Yantar",
"customer_type": "WHOLESALE",
"contact_person": "Luis Gómez",
"email": "compras@buenyantar.es",
"phone": "+34 912 345 678",
"address": "Calle Mayor, 45",
"city": "Madrid",
"postal_code": "28013",
"country": "España",
"status": "ACTIVE",
"total_orders": 45,
"total_spent": 3250.75,
"created_at": "BASE_TS",
"notes": "Regular wholesale customer - weekly orders"
},
{
"id": "60000000-0000-0000-0000-000000000002",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_code": "CUST-002",
"name": "Cafetería La Esquina",
"customer_type": "RETAIL",
"contact_person": "Marta Ruiz",
"email": "cafeteria@laesquina.com",
"phone": "+34 913 456 789",
"address": "Plaza del Sol, 12",
"city": "Madrid",
"postal_code": "28012",
"country": "España",
"status": "ACTIVE",
"total_orders": 12,
"total_spent": 850.2,
"created_at": "BASE_TS",
"notes": "Small retail customer - biweekly orders"
},
{
"id": "60000000-0000-0000-0000-000000000003",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_code": "CUST-003",
"name": "Hotel Madrid Plaza",
"customer_type": "WHOLESALE",
"contact_person": "Carlos Fernández",
"email": "compras@hotelmadridplaza.com",
"phone": "+34 914 567 890",
"address": "Calle Gran Vía, 25",
"city": "Madrid",
"postal_code": "28013",
"country": "España",
"status": "ACTIVE",
"total_orders": 28,
"total_spent": 2150.5,
"created_at": "BASE_TS",
"notes": "Hotel chain - large volume orders"
},
{
"id": "60000000-0000-0000-0000-000000000004",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_code": "CUST-004",
"name": "Panadería Los Nogales",
"customer_type": "RETAIL",
"contact_person": "Ana López",
"email": "panaderia@losnogales.es",
"phone": "+34 915 678 901",
"address": "Calle Alcala, 120",
"city": "Madrid",
"postal_code": "28009",
"country": "España",
"status": "ACTIVE",
"total_orders": 8,
"total_spent": 620.4,
"created_at": "BASE_TS",
"notes": "Local bakery - frequent small orders"
},
{
"id": "60000000-0000-0000-0000-000000000005",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_code": "CUST-005",
"name": "Supermercado EcoMarket",
"customer_type": "WHOLESALE",
"contact_person": "Pedro Martínez",
"email": "compras@ecomarket.es",
"phone": "+34 916 789 012",
"address": "Avenida América, 35",
"city": "Madrid",
"postal_code": "28002",
"country": "España",
"status": "ACTIVE",
"total_orders": 15,
"total_spent": 1250.75,
"created_at": "BASE_TS",
"notes": "Organic supermarket chain - premium products"
}
],
"customer_orders": [
{
"id": "60000000-0000-0000-0000-000000000001",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000001",
"order_number": "ORD-20250115-001",
"order_date": "BASE_TS - 1d 5h",
"delivery_date": "BASE_TS + 3h",
"status": "DELIVERED",
"total_amount": 125.5,
"created_at": "BASE_TS",
"notes": "Regular weekly order"
},
{
"id": "60000000-0000-0000-0000-000000000002",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000002",
"order_number": "ORD-20250115-002",
"order_date": "BASE_TS - 1d 8h",
"delivery_date": "BASE_TS + 4h",
"status": "DELIVERED",
"total_amount": 45.2,
"created_at": "BASE_TS",
"notes": "Small retail order"
},
{
"id": "60000000-0000-0000-0000-000000000099",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000001",
"order_number": "ORD-URGENT-001",
"order_date": "BASE_TS + 1h",
"delivery_date": "BASE_TS + 2h 30m",
"status": "PENDING",
"total_amount": 185.75,
"is_urgent": true,
"created_at": "BASE_TS",
"notes": "Urgent order - special event at restaurant",
"reasoning_data": {
"type": "urgent_delivery",
"parameters": {
"event_type": "special_event",
"required_time": "2025-01-15T08:30:00Z",
"priority": "high"
}
}
},
{
"id": "60000000-0000-0000-0000-000000000100",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000005",
"order_number": "ORD-20250115-003",
"order_date": "BASE_TS + 2h",
"delivery_date": "BASE_TS + 4h",
"status": "PENDING",
"total_amount": 215.5,
"created_at": "BASE_TS",
"notes": "Regular wholesale order - organic products",
"reasoning_data": {
"type": "standard_delivery",
"parameters": {
"delivery_window": "morning",
"priority": "medium"
}
}
}
],
"order_items": [
{
"id": "60000000-0000-0000-0000-000000000101",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"order_id": "60000000-0000-0000-0000-000000000001",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 50.0,
"unit_price": 2.5,
"total_price": 125.0,
"created_at": "BASE_TS"
},
{
"id": "60000000-0000-0000-0000-000000000102",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"order_id": "60000000-0000-0000-0000-000000000002",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 12.0,
"unit_price": 3.75,
"total_price": 45.0,
"created_at": "BASE_TS"
},
{
"id": "60000000-0000-0000-0000-000000000199",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"order_id": "60000000-0000-0000-0000-000000000099",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 75.0,
"unit_price": 2.45,
"total_price": 183.75,
"created_at": "BASE_TS",
"notes": "Urgent delivery - priority processing"
},
{
"id": "60000000-0000-0000-0000-000000000103",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"order_id": "60000000-0000-0000-0000-000000000100",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 20.0,
"unit_price": 3.25,
"total_price": 65.0,
"created_at": "BASE_TS"
}
],
"completed_orders": [
{
"id": "60000000-0000-0000-0000-000000000201",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000001",
"order_number": "ORD-20250114-001",
"order_date": "BASE_TS - 2d 4h",
"delivery_date": "BASE_TS - 2d 6h",
"status": "DELIVERED",
"total_amount": 150.25,
"created_at": "BASE_TS - 2d 4h",
"notes": "Regular weekly order - delivered on time"
},
{
"id": "60000000-0000-0000-0000-000000000202",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000003",
"order_number": "ORD-20250114-002",
"order_date": "BASE_TS - 2d 8h",
"delivery_date": "BASE_TS - 1d 2h",
"status": "DELIVERED",
"total_amount": 225.75,
"created_at": "BASE_TS - 2d 8h",
"notes": "Hotel order - large quantity for breakfast service"
},
{
"id": "60000000-0000-0000-0000-000000000203",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000002",
"order_number": "ORD-20250113-001",
"order_date": "BASE_TS - 3d 3h",
"delivery_date": "BASE_TS - 3d 5h",
"status": "DELIVERED",
"total_amount": 55.5,
"created_at": "BASE_TS - 3d 3h",
"notes": "Small retail order - delivered on time"
},
{
"id": "60000000-0000-0000-0000-000000000204",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000004",
"order_number": "ORD-20250113-002",
"order_date": "BASE_TS - 3d 5h",
"delivery_date": "BASE_TS - 3d 8h",
"status": "DELIVERED",
"total_amount": 42.75,
"created_at": "BASE_TS - 3d 5h",
"notes": "Local bakery order - small quantity"
},
{
"id": "60000000-0000-0000-0000-000000000205",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000005",
"order_number": "ORD-20250112-001",
"order_date": "BASE_TS - 4d 4h",
"delivery_date": "BASE_TS - 4d 10h",
"status": "DELIVERED",
"total_amount": 185.25,
"created_at": "BASE_TS - 4d 4h",
"notes": "Organic supermarket order - premium products"
},
{
"id": "60000000-0000-0000-0000-000000000206",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000001",
"order_number": "ORD-20250111-001",
"order_date": "BASE_TS - 5d 2h",
"delivery_date": "BASE_TS - 5d 4h",
"status": "DELIVERED",
"total_amount": 135.5,
"created_at": "BASE_TS - 5d 2h",
"notes": "Regular wholesale order - delivered on time"
},
{
"id": "60000000-0000-0000-0000-000000000207",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000003",
"order_number": "ORD-20250110-001",
"order_date": "BASE_TS - 6d 9h",
"delivery_date": "BASE_TS - 5d 1h",
"status": "DELIVERED",
"total_amount": 195.75,
"created_at": "BASE_TS - 6d 9h",
"notes": "Hotel order - evening delivery for next morning"
},
{
"id": "60000000-0000-0000-0000-000000000208",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"customer_id": "60000000-0000-0000-0000-000000000002",
"order_number": "ORD-20250109-001",
"order_date": "BASE_TS - 7d 4h",
"delivery_date": "BASE_TS - 7d 6h",
"status": "DELIVERED",
"total_amount": 48.25,
"created_at": "BASE_TS - 7d 4h",
"notes": "Small retail order - delivered on time"
}
]
}

View File

@@ -0,0 +1,620 @@
{
"sales_data": [
{
"id": "SALES-202501-2287",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 51.11,
"unit_price": 6.92,
"total_amount": 335.29,
"sales_date": "BASE_TS - 7d 4h",
"sales_channel": "online",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 7d 4h",
"updated_at": "BASE_TS - 7d 4h"
},
{
"id": "SALES-202501-1536",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 48.29,
"unit_price": 3.81,
"total_amount": 267.17,
"sales_date": "BASE_TS - 7d 6h",
"sales_channel": "in_store",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 7d 6h",
"updated_at": "BASE_TS - 7d 6h"
},
{
"id": "SALES-202501-7360",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 28.45,
"unit_price": 6.04,
"total_amount": 209.32,
"sales_date": "BASE_TS - 7d 3h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 7d 3h",
"updated_at": "BASE_TS - 7d 3h"
},
{
"id": "SALES-202501-2548",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 28.42,
"unit_price": 3.79,
"total_amount": 201.24,
"sales_date": "BASE_TS - 7d 4h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 7d 4h",
"updated_at": "BASE_TS - 7d 4h"
},
{
"id": "SALES-202501-5636",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 25.07,
"unit_price": 6.12,
"total_amount": 184.07,
"sales_date": "BASE_TS - 7d 4h",
"sales_channel": "online",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 7d 4h",
"updated_at": "BASE_TS - 7d 4h"
},
{
"id": "SALES-202501-6202",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 26.71,
"unit_price": 2.97,
"total_amount": 113.78,
"sales_date": "BASE_TS - 6d 23h",
"sales_channel": "online",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 6d 23h",
"updated_at": "BASE_TS - 6d 23h"
},
{
"id": "SALES-202501-0751",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 26.69,
"unit_price": 6.47,
"total_amount": 190.52,
"sales_date": "BASE_TS - 6d 4h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 6d 4h",
"updated_at": "BASE_TS - 6d 4h"
},
{
"id": "SALES-202501-7429",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 29.68,
"unit_price": 6.31,
"total_amount": 139.19,
"sales_date": "BASE_TS - 6d 7h",
"sales_channel": "wholesale",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 6d 7h",
"updated_at": "BASE_TS - 6d 7h"
},
{
"id": "SALES-202501-1170",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 22.88,
"unit_price": 6.15,
"total_amount": 80.7,
"sales_date": "BASE_TS - 6d 8h",
"sales_channel": "online",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 6d 8h",
"updated_at": "BASE_TS - 6d 8h"
},
{
"id": "SALES-202501-9126",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 32.61,
"unit_price": 3.82,
"total_amount": 144.97,
"sales_date": "BASE_TS - 4d 23h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 4d 23h",
"updated_at": "BASE_TS - 4d 23h"
},
{
"id": "SALES-202501-6573",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 40.54,
"unit_price": 4.11,
"total_amount": 152.66,
"sales_date": "BASE_TS - 5d 0h",
"sales_channel": "online",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 5d 0h",
"updated_at": "BASE_TS - 5d 0h"
},
{
"id": "SALES-202501-6483",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 33.25,
"unit_price": 7.81,
"total_amount": 211.39,
"sales_date": "BASE_TS - 5d 1h",
"sales_channel": "in_store",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 5d 1h",
"updated_at": "BASE_TS - 5d 1h"
},
{
"id": "SALES-202501-9578",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 22.4,
"unit_price": 5.07,
"total_amount": 134.46,
"sales_date": "BASE_TS - 5d 4h",
"sales_channel": "wholesale",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 5d 4h",
"updated_at": "BASE_TS - 5d 4h"
},
{
"id": "SALES-202501-8086",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 26.22,
"unit_price": 3.05,
"total_amount": 72.96,
"sales_date": "BASE_TS - 5d 5h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 5d 5h",
"updated_at": "BASE_TS - 5d 5h"
},
{
"id": "SALES-202501-6917",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 22.98,
"unit_price": 6.08,
"total_amount": 110.52,
"sales_date": "BASE_TS - 5d 0h",
"sales_channel": "online",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 5d 0h",
"updated_at": "BASE_TS - 5d 0h"
},
{
"id": "SALES-202501-0189",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 22.12,
"unit_price": 6.58,
"total_amount": 70.51,
"sales_date": "BASE_TS - 4d 23h",
"sales_channel": "online",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 4d 23h",
"updated_at": "BASE_TS - 4d 23h"
},
{
"id": "SALES-202501-7434",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 26.8,
"unit_price": 2.52,
"total_amount": 183.11,
"sales_date": "BASE_TS - 4d 3h",
"sales_channel": "online",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 4d 3h",
"updated_at": "BASE_TS - 4d 3h"
},
{
"id": "SALES-202501-8318",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 37.72,
"unit_price": 7.98,
"total_amount": 291.3,
"sales_date": "BASE_TS - 4d 0h",
"sales_channel": "wholesale",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 4d 0h",
"updated_at": "BASE_TS - 4d 0h"
},
{
"id": "SALES-202501-6127",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 31.83,
"unit_price": 7.08,
"total_amount": 182.56,
"sales_date": "BASE_TS - 4d 5h",
"sales_channel": "online",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 4d 5h",
"updated_at": "BASE_TS - 4d 5h"
},
{
"id": "SALES-202501-5039",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 15.31,
"unit_price": 3.94,
"total_amount": 60.42,
"sales_date": "BASE_TS - 4d 2h",
"sales_channel": "online",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 4d 2h",
"updated_at": "BASE_TS - 4d 2h"
},
{
"id": "SALES-202501-1134",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 15.82,
"unit_price": 8.37,
"total_amount": 90.09,
"sales_date": "BASE_TS - 4d 6h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 4d 6h",
"updated_at": "BASE_TS - 4d 6h"
},
{
"id": "SALES-202501-2706",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 20.17,
"unit_price": 4.09,
"total_amount": 156.0,
"sales_date": "BASE_TS - 4d 2h",
"sales_channel": "wholesale",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 4d 2h",
"updated_at": "BASE_TS - 4d 2h"
},
{
"id": "SALES-202501-6538",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 38.0,
"unit_price": 8.47,
"total_amount": 243.18,
"sales_date": "BASE_TS - 3d 1h",
"sales_channel": "wholesale",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 3d 1h",
"updated_at": "BASE_TS - 3d 1h"
},
{
"id": "SALES-202501-1050",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 34.63,
"unit_price": 4.53,
"total_amount": 208.83,
"sales_date": "BASE_TS - 3d 5h",
"sales_channel": "in_store",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 3d 5h",
"updated_at": "BASE_TS - 3d 5h"
},
{
"id": "SALES-202501-0965",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 31.37,
"unit_price": 3.87,
"total_amount": 248.81,
"sales_date": "BASE_TS - 3d 6h",
"sales_channel": "wholesale",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 3d 6h",
"updated_at": "BASE_TS - 3d 6h"
},
{
"id": "SALES-202501-7954",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 35.52,
"unit_price": 3.79,
"total_amount": 116.99,
"sales_date": "BASE_TS - 3d 4h",
"sales_channel": "online",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 3d 4h",
"updated_at": "BASE_TS - 3d 4h"
},
{
"id": "SALES-202501-1589",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"quantity": 27.73,
"unit_price": 6.45,
"total_amount": 128.29,
"sales_date": "BASE_TS - 3d 5h",
"sales_channel": "wholesale",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 3d 5h",
"updated_at": "BASE_TS - 3d 5h"
},
{
"id": "SALES-202501-1613",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"quantity": 28.29,
"unit_price": 2.86,
"total_amount": 194.33,
"sales_date": "BASE_TS - 3d 7h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 3d 7h",
"updated_at": "BASE_TS - 3d 7h"
},
{
"id": "SALES-202501-2297",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"quantity": 21.65,
"unit_price": 5.03,
"total_amount": 90.3,
"sales_date": "BASE_TS - 3d 3h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 3d 3h",
"updated_at": "BASE_TS - 3d 3h"
},
{
"id": "SALES-202501-8857",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 21.19,
"unit_price": 7.52,
"total_amount": 176.21,
"sales_date": "BASE_TS - 2d 1h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 2d 1h",
"updated_at": "BASE_TS - 2d 1h"
},
{
"id": "SALES-202501-6571",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 24.31,
"unit_price": 7.91,
"total_amount": 84.79,
"sales_date": "BASE_TS - 2d 2h",
"sales_channel": "in_store",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 2d 2h",
"updated_at": "BASE_TS - 2d 2h"
},
{
"id": "SALES-202501-7455",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 22.89,
"unit_price": 4.21,
"total_amount": 152.86,
"sales_date": "BASE_TS - 2d 0h",
"sales_channel": "online",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 2d 0h",
"updated_at": "BASE_TS - 2d 0h"
},
{
"id": "SALES-202501-3112",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 26.89,
"unit_price": 4.28,
"total_amount": 223.54,
"sales_date": "BASE_TS - 2d 2h",
"sales_channel": "online",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 2d 2h",
"updated_at": "BASE_TS - 2d 2h"
},
{
"id": "SALES-202501-7812",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 15.28,
"unit_price": 5.52,
"total_amount": 116.36,
"sales_date": "BASE_TS - 2d 10h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 2d 10h",
"updated_at": "BASE_TS - 2d 10h"
},
{
"id": "SALES-202501-3045",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 19.55,
"unit_price": 2.91,
"total_amount": 56.85,
"sales_date": "BASE_TS - 2d 9h",
"sales_channel": "in_store",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 2d 9h",
"updated_at": "BASE_TS - 2d 9h"
},
{
"id": "SALES-202501-4034",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 14.0,
"unit_price": 5.97,
"total_amount": 38.34,
"sales_date": "BASE_TS - 2d 3h",
"sales_channel": "in_store",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 2d 3h",
"updated_at": "BASE_TS - 2d 3h"
},
{
"id": "SALES-202501-5184",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"quantity": 17.55,
"unit_price": 8.11,
"total_amount": 65.38,
"sales_date": "BASE_TS - 2d 5h",
"sales_channel": "online",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 2d 5h",
"updated_at": "BASE_TS - 2d 5h"
},
{
"id": "SALES-202501-7492",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 32.64,
"unit_price": 4.4,
"total_amount": 228.85,
"sales_date": "BASE_TS - 1d 1h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 1d 1h",
"updated_at": "BASE_TS - 1d 1h"
},
{
"id": "SALES-202501-1639",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 37.66,
"unit_price": 2.94,
"total_amount": 142.3,
"sales_date": "BASE_TS - 0d 23h",
"sales_channel": "wholesale",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 0d 23h",
"updated_at": "BASE_TS - 0d 23h"
},
{
"id": "SALES-202501-4003",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"quantity": 44.93,
"unit_price": 4.72,
"total_amount": 154.86,
"sales_date": "BASE_TS - 0d 23h",
"sales_channel": "online",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 0d 23h",
"updated_at": "BASE_TS - 0d 23h"
},
{
"id": "SALES-202501-9087",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 27.58,
"unit_price": 4.3,
"total_amount": 178.72,
"sales_date": "BASE_TS - 1d 1h",
"sales_channel": "in_store",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 1d 1h",
"updated_at": "BASE_TS - 1d 1h"
},
{
"id": "SALES-202501-9065",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 23.07,
"unit_price": 3.43,
"total_amount": 96.68,
"sales_date": "BASE_TS - 1d 6h",
"sales_channel": "in_store",
"payment_method": "transfer",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 1d 6h",
"updated_at": "BASE_TS - 1d 6h"
},
{
"id": "SALES-202501-4326",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 25.55,
"unit_price": 5.53,
"total_amount": 102.37,
"sales_date": "BASE_TS - 1d 1h",
"sales_channel": "in_store",
"payment_method": "cash",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 1d 1h",
"updated_at": "BASE_TS - 1d 1h"
},
{
"id": "SALES-202501-0723",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"quantity": 28.73,
"unit_price": 2.52,
"total_amount": 204.74,
"sales_date": "BASE_TS - 1d 0h",
"sales_channel": "online",
"payment_method": "card",
"customer_id": "50000000-0000-0000-0000-000000000001",
"created_at": "BASE_TS - 1d 0h",
"updated_at": "BASE_TS - 1d 0h"
}
]
}

View File

@@ -0,0 +1,352 @@
{
"forecasts": [
{
"id": "559ad124-ce3f-4cfa-8f24-9ad447d8a236",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"forecast_date": "2025-01-16T06:00:00Z",
"predicted_quantity": 22.91,
"confidence_percentage": 90.8,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 90.8% (seed=42)"
},
{
"id": "23e13d19-90d3-47ec-bac1-7f561041571f",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"forecast_date": "2025-01-16T06:00:00Z",
"predicted_quantity": 21.23,
"confidence_percentage": 91.8,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.8% (seed=42)"
},
{
"id": "02c052ae-b45d-4ec0-91f1-b140c22ee086",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"forecast_date": "2025-01-16T06:00:00Z",
"predicted_quantity": 18.65,
"confidence_percentage": 88.1,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 88.1% (seed=42)"
},
{
"id": "7ea9daba-bced-44d5-9595-66e6a482154e",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"forecast_date": "2025-01-16T06:00:00Z",
"predicted_quantity": 8.8,
"confidence_percentage": 89.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 89.7% (seed=42)"
},
{
"id": "10bf8324-66a1-4776-b08c-5a55a3a86cb4",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"forecast_date": "2025-01-17T06:00:00Z",
"predicted_quantity": 20.16,
"confidence_percentage": 91.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.7% (seed=42)"
},
{
"id": "8133e0de-0431-4392-97ad-b5e0b385431a",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"forecast_date": "2025-01-17T06:00:00Z",
"predicted_quantity": 26.32,
"confidence_percentage": 89.4,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 89.4% (seed=42)"
},
{
"id": "4bc052cb-dae1-4f06-815e-d822e843ae5c",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"forecast_date": "2025-01-17T06:00:00Z",
"predicted_quantity": 21.04,
"confidence_percentage": 89.4,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 89.4% (seed=42)"
},
{
"id": "4d29380e-5ed4-466d-a421-1871149b0cf0",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"forecast_date": "2025-01-17T06:00:00Z",
"predicted_quantity": 11.55,
"confidence_percentage": 91.9,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.9% (seed=42)"
},
{
"id": "9794cffd-2bc6-4461-8ff6-f97bcb5ef94c",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"forecast_date": "2025-01-18T06:00:00Z",
"predicted_quantity": 38.56,
"confidence_percentage": 88.9,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 88.9% (seed=42)"
},
{
"id": "e6e5f60e-ac4e-43dc-9ed5-0140f5e1eaef",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"forecast_date": "2025-01-18T06:00:00Z",
"predicted_quantity": 18.69,
"confidence_percentage": 88.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 88.7% (seed=42)"
},
{
"id": "57bbc0fb-14a4-4688-8ef8-f1bcf31b449e",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"forecast_date": "2025-01-18T06:00:00Z",
"predicted_quantity": 14.94,
"confidence_percentage": 91.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.7% (seed=42)"
},
{
"id": "a1b48396-f046-4a8c-bbbf-1c0c64da942b",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"forecast_date": "2025-01-18T06:00:00Z",
"predicted_quantity": 12.55,
"confidence_percentage": 90.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 90.7% (seed=42)"
},
{
"id": "c3a89c08-0382-41bc-9be6-cc0fe5822b63",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"forecast_date": "2025-01-19T06:00:00Z",
"predicted_quantity": 32.6,
"confidence_percentage": 88.6,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 88.6% (seed=42)"
},
{
"id": "a7746915-f4bb-459f-9b11-7dd5cc161e19",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"forecast_date": "2025-01-19T06:00:00Z",
"predicted_quantity": 24.8,
"confidence_percentage": 88.2,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 88.2% (seed=42)"
},
{
"id": "96731957-9727-424d-8227-3d1bf51800ca",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"forecast_date": "2025-01-19T06:00:00Z",
"predicted_quantity": 15.83,
"confidence_percentage": 91.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.7% (seed=42)"
},
{
"id": "19737618-eb42-47c0-8ad4-7e37f913a78a",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"forecast_date": "2025-01-19T06:00:00Z",
"predicted_quantity": 9.15,
"confidence_percentage": 91.5,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.5% (seed=42)"
},
{
"id": "b4c3b4ad-6487-49d5-9663-56046f577332",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"forecast_date": "2025-01-20T06:00:00Z",
"predicted_quantity": 25.4,
"confidence_percentage": 89.6,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 89.6% (seed=42)"
},
{
"id": "31b217eb-d71c-457a-8915-692dc701a6b9",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"forecast_date": "2025-01-20T06:00:00Z",
"predicted_quantity": 17.2,
"confidence_percentage": 91.1,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.1% (seed=42)"
},
{
"id": "a32d777c-7052-4ba1-b55b-7cc0dc3cfc3d",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"forecast_date": "2025-01-20T06:00:00Z",
"predicted_quantity": 15.3,
"confidence_percentage": 90.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 90.7% (seed=42)"
},
{
"id": "2db7d1d2-7b38-4ebb-b408-c9e0b6884c22",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"forecast_date": "2025-01-20T06:00:00Z",
"predicted_quantity": 12.89,
"confidence_percentage": 88.1,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 88.1% (seed=42)"
},
{
"id": "b5887602-7f9c-485b-b50d-0e60dd153780",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"forecast_date": "2025-01-21T06:00:00Z",
"predicted_quantity": 35.39,
"confidence_percentage": 90.3,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 90.3% (seed=42)"
},
{
"id": "696498b2-20a7-48cb-a597-d689be7c729f",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"forecast_date": "2025-01-21T06:00:00Z",
"predicted_quantity": 26.46,
"confidence_percentage": 90.4,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 90.4% (seed=42)"
},
{
"id": "b3c83939-52b7-4811-ac91-6fdc24d4ae0f",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"forecast_date": "2025-01-21T06:00:00Z",
"predicted_quantity": 16.23,
"confidence_percentage": 89.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 89.7% (seed=42)"
},
{
"id": "d3ca5707-9eee-4880-ac45-766f0e058492",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"forecast_date": "2025-01-21T06:00:00Z",
"predicted_quantity": 13.47,
"confidence_percentage": 91.6,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.6% (seed=42)"
},
{
"id": "0f67f70f-2d7e-43f2-b5dd-52659b06e578",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000001",
"forecast_date": "2025-01-22T06:00:00Z",
"predicted_quantity": 21.2,
"confidence_percentage": 89.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 89.7% (seed=42)"
},
{
"id": "ba4bc024-6440-4fcf-b6c4-f1773aaa3f24",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000002",
"forecast_date": "2025-01-22T06:00:00Z",
"predicted_quantity": 24.48,
"confidence_percentage": 90.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 90.7% (seed=42)"
},
{
"id": "cb6bfe90-1962-4ca1-b389-9d583780598d",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000003",
"forecast_date": "2025-01-22T06:00:00Z",
"predicted_quantity": 25.48,
"confidence_percentage": 88.8,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 88.8% (seed=42)"
},
{
"id": "76c39f91-82cc-4bce-a91c-1e57e29e3461",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"product_id": "20000000-0000-0000-0000-000000000004",
"forecast_date": "2025-01-22T06:00:00Z",
"predicted_quantity": 10.32,
"confidence_percentage": 91.7,
"forecast_type": "daily",
"created_at": "BASE_TS",
"updated_at": "BASE_TS",
"notes": "Forecast accuracy: 91.7% (seed=42)"
}
],
"prediction_batches": [
{
"id": "80000000-0000-0000-0000-000000001001",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"batch_id": "20250116-001",
"prediction_date": "BASE_TS",
"status": "COMPLETED",
"total_forecasts": 4,
"created_at": "BASE_TS",
"notes": "Daily forecasting batch"
}
]
}

View File

@@ -0,0 +1,291 @@
{
"orchestration_run": {
"id": "90000000-0000-0000-0000-000000000001",
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"run_number": "ORCH-20250114-001",
"status": "completed",
"run_type": "daily",
"started_at": "BASE_TS - 1d 16h",
"completed_at": "BASE_TS - 1d 15h45m",
"duration_seconds": 900,
"trigger_type": "scheduled",
"trigger_source": "system",
"created_at": "BASE_TS - 1d 16h",
"updated_at": "BASE_TS - 1d 15h45m",
"notes": "Nightly orchestration run - Last successful execution before demo session"
},
"orchestration_results": {
"production_batches_created": 18,
"production_batches_completed": 15,
"production_batches_in_progress": 3,
"purchase_orders_created": 6,
"purchase_orders_approved": 4,
"purchase_orders_pending_approval": 2,
"inventory_updates": 25,
"stock_alerts_generated": 3,
"quality_checks_performed": 12,
"delivery_schedules_updated": 4,
"forecasts_generated": 10,
"ai_insights_posted": 5,
"notifications_sent": 8,
"errors_encountered": 0,
"warnings_generated": 2
},
"run_metadata": {
"purchase_orders": [
{
"id": "50000000-0000-0000-0000-000000000001",
"status": "completed",
"delivery_date": "BASE_TS - 2d",
"items": [
{
"ingredient_id": "10000000-0000-0000-0000-000000000001",
"product_name": "Harina de Trigo T55",
"quantity": 500.0,
"unit": "kilograms"
},
{
"ingredient_id": "10000000-0000-0000-0000-000000000002",
"product_name": "Harina de Trigo T65",
"quantity": 200.0,
"unit": "kilograms"
},
{
"ingredient_id": "10000000-0000-0000-0000-000000000005",
"product_name": "Harina de Centeno",
"quantity": 100.0,
"unit": "kilograms"
},
{
"ingredient_id": "10000000-0000-0000-0000-000000000031",
"product_name": "Sal Marina Fina",
"quantity": 50.0,
"unit": "kilograms"
}
]
},
{
"id": "50000000-0000-0000-0000-000000000002",
"status": "completed",
"delivery_date": "BASE_TS - 1d",
"items": [
{
"ingredient_id": "10000000-0000-0000-0000-000000000011",
"product_name": "Mantequilla sin Sal 82% MG",
"quantity": 80.0,
"unit": "kilograms"
}
]
},
{
"id": "50000000-0000-0000-0000-000000000004",
"status": "confirmed",
"delivery_date": "BASE_TS + 1d",
"items": [
{
"ingredient_id": "10000000-0000-0000-0000-000000000001",
"product_name": "Harina de Trigo T55",
"quantity": 1000.0,
"unit": "kilograms"
},
{
"ingredient_id": "10000000-0000-0000-0000-000000000021",
"product_name": "Levadura Fresca de Panadería",
"quantity": 50.0,
"unit": "kilograms"
}
]
}
],
"production_batches": [
{
"id": "40000000-0000-0000-0000-000000000001",
"product_id": "20000000-0000-0000-0000-000000000001",
"product_name": "Baguette Francesa Tradicional",
"status": "COMPLETED",
"scheduled_date": "BASE_TS - 1d 16h",
"quantity": 98.0,
"unit": "units"
},
{
"id": "40000000-0000-0000-0000-000000000002",
"product_id": "20000000-0000-0000-0000-000000000002",
"product_name": "Croissant de Mantequilla Artesanal",
"status": "COMPLETED",
"scheduled_date": "BASE_TS - 1d 15h",
"quantity": 115.0,
"unit": "units"
},
{
"id": "40000000-0000-0000-0000-000000000003",
"product_id": "20000000-0000-0000-0000-000000000003",
"product_name": "Pan de Pueblo con Masa Madre",
"status": "COMPLETED",
"scheduled_date": "BASE_TS - 1d 14h",
"quantity": 80.0,
"unit": "units"
}
]
},
"production_coordination": {
"batches_synchronized": [
{
"batch_id": "40000000-0000-0000-0000-000000000001",
"product_name": "Baguette Francesa Tradicional",
"quantity": 98.0,
"status": "COMPLETED",
"coordinated_with_po": "50000000-0000-0000-0000-000000000001",
"flour_consumed": 50.0,
"yeast_consumed": 2.0,
"butter_consumed": 1.5
},
{
"batch_id": "40000000-0000-0000-0000-000000000002",
"product_name": "Croissant de Mantequilla Artesanal",
"quantity": 115.0,
"status": "COMPLETED",
"coordinated_with_po": "50000000-0000-0000-0000-000000000002",
"flour_consumed": 30.0,
"yeast_consumed": 1.5,
"butter_consumed": 15.0
},
{
"batch_id": "40000000-0000-0000-0000-000000000003",
"product_name": "Pan de Pueblo con Masa Madre",
"quantity": 80.0,
"status": "COMPLETED",
"coordinated_with_po": "50000000-0000-0000-0000-000000000001",
"flour_consumed": 40.0,
"yeast_consumed": 1.0
}
],
"production_alerts": [
{
"alert_type": "LOW_STOCK",
"product_id": "10000000-0000-0000-0000-000000000001",
"product_name": "Harina de Trigo T55",
"current_stock": 150.0,
"threshold": 200.0,
"severity": "WARNING",
"related_po": "50000000-0000-0000-0000-000000000004"
},
{
"alert_type": "DELAYED_DELIVERY",
"product_id": "10000000-0000-0000-0000-000000000001",
"product_name": "Harina de Trigo T55",
"expected_delivery": "BASE_TS - 1d 4h",
"actual_delivery": "BASE_TS - 1d 8h",
"delay_hours": 4,
"severity": "CRITICAL",
"related_po": "50000000-0000-0000-0000-000000000004",
"impacted_batches": [
"40000000-0000-0000-0000-0000000000a3"
]
}
]
},
"procurement_coordination": {
"purchase_orders_processed": [
{
"po_id": "50000000-0000-0000-0000-000000000001",
"supplier_id": "40000000-0000-0000-0000-000000000001",
"supplier_name": "Harinas del Norte",
"status": "completed",
"total_amount": 1053.5,
"items_received": 3,
"items_pending": 0,
"delivery_status": "on_time"
},
{
"po_id": "50000000-0000-0000-0000-000000000002",
"supplier_id": "40000000-0000-0000-0000-000000000002",
"supplier_name": "Lácteos Gipuzkoa",
"status": "completed",
"total_amount": 402.2,
"items_received": 1,
"items_pending": 0,
"delivery_status": "on_time"
},
{
"po_id": "50000000-0000-0000-0000-000000000004",
"supplier_id": "40000000-0000-0000-0000-000000000001",
"supplier_name": "Harinas del Norte",
"status": "confirmed",
"total_amount": 1427.0,
"items_received": 0,
"items_pending": 2,
"delivery_status": "delayed",
"delay_hours": 4,
"urgency": "high"
}
],
"procurement_alerts": [
{
"alert_type": "PO_APPROVAL_ESCALATION",
"po_id": "50000000-0000-0000-0000-000000000003",
"supplier_name": "Eco-Proveedores",
"status": "pending_approval",
"age_hours": 72,
"severity": "WARNING",
"reason": "Auto-approval threshold not met"
}
]
},
"inventory_synchronization": {
"stock_updates": 25,
"low_stock_alerts": 3,
"expiration_alerts": 1,
"stock_movements": 15,
"inventory_accuracy": 98.5
},
"ai_insights": {
"yield_improvement_suggestions": 2,
"waste_reduction_opportunities": 1,
"demand_forecasting_updates": 3,
"procurement_optimization": 2,
"production_scheduling": 1
},
"system_state": {
"last_successful_run": "BASE_TS - 1d 16h",
"next_scheduled_run": "BASE_TS + 16h",
"system_health": "healthy",
"api_availability": 100.0,
"database_performance": "optimal",
"integration_status": "all_connected"
},
"results": {
"ingredients_created": 25,
"stock_entries_created": 25,
"batches_created": 0,
"sales_created": 44,
"forecasts_created": 28,
"consumptions_calculated": 81,
"critical_stock_items": 8,
"active_alerts": 8,
"forecasting_accuracy": 90.5,
"cross_reference_errors": 0,
"cross_reference_warnings": 0
},
"alerts": [
{
"alert_type": "OVERDUE_BATCH",
"severity": "high",
"message": "Production should have started 2 hours ago - BATCH-LATE-0001",
"created_at": "BASE_TS"
},
{
"alert_type": "DELAYED_DELIVERY",
"severity": "high",
"message": "Supplier delivery 4 hours late - PO-LATE-0001",
"created_at": "BASE_TS"
},
{
"alert_type": "CRITICAL_STOCK",
"severity": "critical",
"message": "Harina T55 below reorder point with NO pending PO",
"created_at": "BASE_TS"
}
],
"completed_at": "BASE_TS",
"status": "completed"
}

View File

@@ -0,0 +1,18 @@
{
"delivery_routes": [],
"vehicles": [],
"drivers": [],
"delivery_schedules": [],
"route_optimization_config": {
"enabled": false,
"algorithm": "basic",
"constraints": {
"max_distance_km": 50,
"max_duration_minutes": 180,
"vehicle_capacity_kg": 500
}
},
"tenant_id": "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6",
"is_active": false,
"description": "Professional tier demo - basic distribution setup for single location bakery"
}

View File

@@ -0,0 +1,209 @@
#!/usr/bin/env python3
"""
Enhance Procurement Data for AI Insights
Adds purchase order items with price trends to enable procurement insights
"""
import json
import random
from pathlib import Path
# Set seed for reproducibility
random.seed(42)
# Price trend data (realistic price movements over 90 days)
INGREDIENTS_WITH_TRENDS = [
{
"id": "10000000-0000-0000-0000-000000000001",
"name": "Harina de Trigo T55",
"base_price": 0.85,
"trend": 0.08, # 8% increase over 90 days
"variability": 0.02,
"unit": "kg"
},
{
"id": "10000000-0000-0000-0000-000000000002",
"name": "Harina de Trigo T65",
"base_price": 0.95,
"trend": 0.06, # 6% increase
"variability": 0.02,
"unit": "kg"
},
{
"id": "10000000-0000-0000-0000-000000000011",
"name": "Mantequilla sin Sal",
"base_price": 6.50,
"trend": 0.12, # 12% increase (highest)
"variability": 0.05,
"unit": "kg"
},
{
"id": "10000000-0000-0000-0000-000000000012",
"name": "Leche Entera Fresca",
"base_price": 0.95,
"trend": -0.03, # 3% decrease (seasonal surplus)
"variability": 0.02,
"unit": "L"
},
{
"id": "10000000-0000-0000-0000-000000000021",
"name": "Levadura Fresca",
"base_price": 4.20,
"trend": 0.04, # 4% increase
"variability": 0.03,
"unit": "kg"
},
{
"id": "10000000-0000-0000-0000-000000000032",
"name": "Azúcar Blanco",
"base_price": 1.10,
"trend": 0.02, # 2% increase (stable)
"variability": 0.01,
"unit": "kg"
},
]
def calculate_price(ingredient, days_ago):
"""
Calculate price based on linear trend + random variability
Args:
ingredient: Dict with base_price, trend, variability
days_ago: Number of days in the past
Returns:
Price at that point in time
"""
# Apply trend proportionally based on how far back in time
# If trend is 8% over 90 days, price 45 days ago had 4% increase from base
trend_factor = 1 + (ingredient["trend"] * (90 - days_ago) / 90)
# Add random variability
variability = random.uniform(-ingredient["variability"], ingredient["variability"])
price = ingredient["base_price"] * trend_factor * (1 + variability)
return round(price, 2)
def parse_days_ago(order_date_str):
"""Parse order_date to extract days ago"""
if 'BASE_TS' in order_date_str:
if '- ' in order_date_str:
# Extract number from "BASE_TS - 1d" or "BASE_TS - 1h"
parts = order_date_str.split('- ')[1]
if 'd' in parts:
try:
return int(parts.split('d')[0])
except:
pass
elif 'h' in parts:
# Hours - treat as 0 days
return 0
elif '+ ' in order_date_str:
# Future date - treat as 0 days ago (current price)
return 0
return 30 # Default fallback
def add_items_to_pos():
"""Add items arrays to purchase orders with realistic price trends"""
fixture_path = Path(__file__).parent / "07-procurement.json"
print("🔧 Enhancing Procurement Data for AI Insights...")
print()
# Load existing data
with open(fixture_path, 'r', encoding='utf-8') as f:
data = json.load(f)
pos = data.get('purchase_orders', [])
print(f"📦 Found {len(pos)} purchase orders")
print()
items_added = 0
for i, po in enumerate(pos):
# Parse order date to get days ago
order_date_str = po.get('order_date', 'BASE_TS - 1d')
days_ago = parse_days_ago(order_date_str)
# Select 2-4 random ingredients for this PO
num_items = random.randint(2, 4)
selected_ingredients = random.sample(INGREDIENTS_WITH_TRENDS, k=num_items)
items = []
po_subtotal = 0.0
for ingredient in selected_ingredients:
# Calculate price at this point in time
unit_price = calculate_price(ingredient, days_ago)
# Order quantity (realistic for ingredient type)
if ingredient["unit"] == "kg":
quantity = random.randint(100, 500)
else: # Liters
quantity = random.randint(50, 200)
total_price = round(quantity * unit_price, 2)
po_subtotal += total_price
items.append({
"ingredient_id": ingredient["id"],
"ingredient_name": ingredient["name"],
"ordered_quantity": float(quantity),
"unit": ingredient["unit"],
"unit_price": unit_price,
"total_price": total_price,
"received_quantity": None,
"status": "pending" if po.get('status') != 'delivered' else "received"
})
# Add items to PO
po['items'] = items
# Update PO totals to match items
po['subtotal'] = round(po_subtotal, 2)
tax_rate = 0.21 # 21% IVA in Spain
po['tax_amount'] = round(po_subtotal * tax_rate, 2)
po['shipping_cost'] = 15.0 if po_subtotal < 500 else 20.0
po['total_amount'] = round(po['subtotal'] + po['tax_amount'] + po['shipping_cost'], 2)
items_added += len(items)
print(f" ✓ PO-{i+1} ({order_date_str}): {len(items)} items, €{po['total_amount']:.2f} total")
# Save back
with open(fixture_path, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
print()
print("=" * 60)
print("✅ PROCUREMENT DATA ENHANCEMENT COMPLETE")
print("=" * 60)
print()
print(f"📊 SUMMARY:")
print(f" • Purchase orders enhanced: {len(pos)}")
print(f" • Total items added: {items_added}")
print(f" • Average items per PO: {items_added / len(pos):.1f}")
print()
print("🎯 PRICE TRENDS ADDED:")
for ing in INGREDIENTS_WITH_TRENDS:
direction = "" if ing["trend"] > 0 else ""
print(f" {direction} {ing['name']}: {ing['trend']*100:+.1f}% over 90 days")
print()
print("🚀 PROCUREMENT INSIGHTS READY:")
print(" ✓ Price Forecaster: Can detect trends & recommend actions")
print(" ✓ Supplier Performance: Can analyze delivery reliability")
print(" ✓ Cost Optimizer: Can identify bulk buying opportunities")
print()
print("Next steps:")
print(" 1. Create new demo session")
print(" 2. Wait 60 seconds for AI models")
print(" 3. Check for procurement insights (expect 1-2)")
print()
if __name__ == "__main__":
add_items_to_pos()

View File

@@ -0,0 +1,208 @@
#!/usr/bin/env python3
"""
Fix Procurement Data Structure and Add Realistic Price Trends
Issues to fix:
1. Remove nested 'items' arrays from purchase_orders (wrong structure)
2. Use existing purchase_order_items table structure at root level
3. Add price trends to existing PO items
4. Align PO items with actual inventory stock conditions
"""
import json
from pathlib import Path
import random
# Set seed for reproducibility
random.seed(42)
# Price trend data (realistic price movements over time)
# These match the 6 ingredients we track in inventory
PRICE_TRENDS = {
"10000000-0000-0000-0000-000000000001": { # Harina T55
"name": "Harina de Trigo T55",
"base_price": 0.85,
"current_price": 0.92, # +8% over 90 days
"trend": 0.08
},
"10000000-0000-0000-0000-000000000002": { # Harina T65
"name": "Harina de Trigo T65",
"base_price": 0.95,
"current_price": 1.01, # +6%
"trend": 0.06
},
"10000000-0000-0000-0000-000000000011": { # Mantequilla
"name": "Mantequilla sin Sal",
"base_price": 6.50,
"current_price": 7.28, # +12% (highest increase)
"trend": 0.12
},
"10000000-0000-0000-0000-000000000012": { # Leche
"name": "Leche Entera Fresca",
"base_price": 0.95,
"current_price": 0.92, # -3% (seasonal surplus)
"trend": -0.03
},
"10000000-0000-0000-0000-000000000021": { # Levadura
"name": "Levadura Fresca",
"base_price": 4.20,
"current_price": 4.37, # +4%
"trend": 0.04
},
"10000000-0000-0000-0000-000000000032": { # Azúcar
"name": "Azúcar Blanco",
"base_price": 1.10,
"current_price": 1.12, # +2% (stable)
"trend": 0.02
}
}
def calculate_price_for_date(ingredient_id: str, days_ago: int) -> float:
"""Calculate historical price based on trend"""
if ingredient_id not in PRICE_TRENDS:
return None
trend_data = PRICE_TRENDS[ingredient_id]
base = trend_data["base_price"]
total_trend = trend_data["trend"]
# Apply trend proportionally
# If 90 days trend is +8%, then 45 days ago had +4% from base
trend_factor = 1 + (total_trend * (90 - days_ago) / 90)
# Add small variability (±2%)
variability = random.uniform(-0.02, 0.02)
price = base * trend_factor * (1 + variability)
return round(price, 2)
def parse_days_ago(date_str: str) -> int:
"""Parse BASE_TS marker to extract days ago"""
if not date_str or 'BASE_TS' not in date_str:
return 30
if '- ' in date_str:
parts = date_str.split('- ')[1].strip()
if 'd' in parts:
try:
return int(parts.split('d')[0])
except:
pass
elif 'h' in parts:
return 0 # Same day
elif '+ ' in date_str:
return 0 # Future order, use current price
return 0 # BASE_TS alone = today
def main():
fixture_path = Path(__file__).parent / "07-procurement.json"
print("🔧 Fixing Procurement Data Structure...")
print()
# Load existing data
with open(fixture_path, 'r', encoding='utf-8') as f:
data = json.load(f)
purchase_orders = data.get('purchase_orders', [])
po_items = data.get('purchase_order_items', [])
print(f"📦 Found {len(purchase_orders)} purchase orders")
print(f"📋 Found {len(po_items)} PO items")
print()
# Step 1: Remove nested 'items' arrays from POs (wrong structure)
items_removed = 0
for po in purchase_orders:
if 'items' in po:
items_removed += len(po['items'])
del po['items']
if items_removed > 0:
print(f"✓ Removed {items_removed} nested items arrays (wrong structure)")
print()
# Step 2: Update existing PO items with realistic price trends
items_updated = 0
for item in po_items:
ingredient_id = item.get('inventory_product_id')
if ingredient_id in PRICE_TRENDS:
# Find the PO to get order date
po_id = item.get('purchase_order_id')
po = next((p for p in purchase_orders if p['id'] == po_id), None)
if po:
order_date = po.get('order_date', 'BASE_TS')
days_ago = parse_days_ago(order_date)
# Calculate price for that date
historical_price = calculate_price_for_date(ingredient_id, days_ago)
if historical_price:
# Update item with historical price
ordered_qty = float(item.get('ordered_quantity', 0))
item['unit_price'] = historical_price
item['line_total'] = round(ordered_qty * historical_price, 2)
items_updated += 1
print(f"✓ Updated {items_updated} PO items with price trends")
print()
# Step 3: Recalculate PO totals based on updated items
for po in purchase_orders:
po_id = po['id']
po_items_for_this_po = [item for item in po_items if item.get('purchase_order_id') == po_id]
if po_items_for_this_po:
# Calculate subtotal from items
subtotal = sum(float(item.get('line_total', 0)) for item in po_items_for_this_po)
tax_rate = 0.21 # 21% IVA in Spain
tax = subtotal * tax_rate
# Keep existing shipping cost or default
shipping = float(po.get('shipping_cost', 15.0 if subtotal < 500 else 20.0))
discount = float(po.get('discount_amount', 0.0))
total = subtotal + tax + shipping - discount
po['subtotal'] = round(subtotal, 2)
po['tax_amount'] = round(tax, 2)
po['shipping_cost'] = round(shipping, 2)
po['discount_amount'] = round(discount, 2)
po['total_amount'] = round(total, 2)
print(f"✓ Recalculated totals for {len(purchase_orders)} purchase orders")
print()
# Save fixed data
with open(fixture_path, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
print("=" * 60)
print("✅ PROCUREMENT STRUCTURE FIXED")
print("=" * 60)
print()
print("🎯 Changes Applied:")
print(f" • Removed {items_removed} incorrectly nested items")
print(f" • Updated {items_updated} PO items with price trends")
print(f" • Recalculated {len(purchase_orders)} PO totals")
print()
print("📊 Price Trends Applied:")
for ing_id, data in PRICE_TRENDS.items():
direction = "" if data["trend"] > 0 else ""
print(f" {direction} {data['name']}: {data['trend']*100:+.1f}%")
print()
print("✅ Data structure now matches PurchaseOrderItem model")
print("✅ Price trends enable procurement AI insights")
print()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,296 @@
#!/usr/bin/env python3
"""
Generate AI Insights Data for Professional Demo
Adds realistic stock movements and production worker data to enable AI insight generation
"""
import json
import random
from datetime import datetime, timedelta
from uuid import uuid4, UUID
from typing import List, Dict, Any
# Set random seed for reproducibility
random.seed(42)
# Key ingredients that need demand history (matching actual IDs in 03-inventory.json)
KEY_INGREDIENTS = [
{"id": "10000000-0000-0000-0000-000000000001", "name": "Harina de Trigo T55", "avg_daily": 45.0, "variability": 0.3, "unit_cost": 0.85},
{"id": "10000000-0000-0000-0000-000000000002", "name": "Harina de Trigo T65", "avg_daily": 35.0, "variability": 0.25, "unit_cost": 0.95},
{"id": "10000000-0000-0000-0000-000000000003", "name": "Harina de Fuerza W300", "avg_daily": 25.0, "variability": 0.35, "unit_cost": 1.15},
{"id": "10000000-0000-0000-0000-000000000011", "name": "Mantequilla sin Sal", "avg_daily": 8.5, "variability": 0.35, "unit_cost": 6.50},
{"id": "10000000-0000-0000-0000-000000000012", "name": "Leche Entera Fresca", "avg_daily": 18.0, "variability": 0.3, "unit_cost": 0.95},
{"id": "10000000-0000-0000-0000-000000000014", "name": "Huevos Frescos", "avg_daily": 5.5, "variability": 0.4, "unit_cost": 3.80},
{"id": "10000000-0000-0000-0000-000000000021", "name": "Levadura Fresca", "avg_daily": 3.5, "variability": 0.4, "unit_cost": 4.20},
{"id": "10000000-0000-0000-0000-000000000031", "name": "Sal Marina Fina", "avg_daily": 2.8, "variability": 0.2, "unit_cost": 1.50},
{"id": "10000000-0000-0000-0000-000000000032", "name": "Azúcar Blanco", "avg_daily": 12.0, "variability": 0.3, "unit_cost": 1.10},
{"id": "10000000-0000-0000-0000-000000000013", "name": "Nata para Montar", "avg_daily": 4.2, "variability": 0.35, "unit_cost": 2.80},
]
# Workers with different skill levels (matching users in 02-auth.json)
WORKERS = [
{"id": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6", "name": "María García (Owner - Master Baker)", "skill_level": 0.98, "shift": "morning"}, # Expert
{"id": "50000000-0000-0000-0000-000000000001", "name": "Juan Panadero (Baker)", "skill_level": 0.95, "shift": "morning"}, # Very skilled
{"id": "50000000-0000-0000-0000-000000000006", "name": "Isabel Producción (Production Manager)", "skill_level": 0.90, "shift": "afternoon"}, # Experienced
{"id": "50000000-0000-0000-0000-000000000005", "name": "Carlos Almacén (Warehouse - Occasional Baker)", "skill_level": 0.78, "shift": "afternoon"}, # Learning
]
TENANT_ID = "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6"
def generate_stock_movements(days: int = 90) -> List[Dict[str, Any]]:
"""Generate realistic stock movements for AI insights"""
movements = []
# Generate PRODUCTION_USE movements (daily consumption)
for day in range(days, 0, -1):
for ingredient in KEY_INGREDIENTS:
# Skip some days randomly (not every ingredient used every day)
if random.random() < 0.15: # 15% chance to skip
continue
# Calculate quantity with variability
base_qty = ingredient["avg_daily"]
variability = ingredient["variability"]
quantity = base_qty * random.uniform(1 - variability, 1 + variability)
# Reduce usage on weekends (lower production)
date_offset = f"BASE_TS - {day}d"
day_of_week = (90 - day) % 7 # Approximate day of week
if day_of_week in [5, 6]: # Weekend
quantity *= 0.6
# Round to 2 decimals
quantity = round(quantity, 2)
movement = {
"id": str(uuid4()),
"tenant_id": TENANT_ID,
"ingredient_id": ingredient["id"],
"stock_id": None,
"movement_type": "PRODUCTION_USE",
"quantity": quantity,
"unit_cost": ingredient["unit_cost"],
"total_cost": round(quantity * ingredient["unit_cost"], 2),
"quantity_before": None,
"quantity_after": None,
"movement_date": date_offset,
"reason_code": "production_consumption",
"notes": f"Daily production usage - {ingredient['name']}",
"created_at": date_offset,
"created_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6"
}
movements.append(movement)
# Generate PURCHASE movements (supplier deliveries - weekly/bi-weekly)
for ingredient in KEY_INGREDIENTS:
# Calculate delivery frequency based on usage
weekly_usage = ingredient["avg_daily"] * 7
delivery_qty = weekly_usage * 2 # 2 weeks of stock
# Bi-weekly deliveries over 90 days = ~6-7 deliveries
num_deliveries = 6
delivery_interval = days // num_deliveries
for delivery_num in range(num_deliveries):
day_offset = days - (delivery_num * delivery_interval) - random.randint(0, 3)
if day_offset < 1:
continue
# Add some variability to delivery quantity
qty = delivery_qty * random.uniform(0.9, 1.1)
qty = round(qty, 2)
movement = {
"id": str(uuid4()),
"tenant_id": TENANT_ID,
"ingredient_id": ingredient["id"],
"stock_id": None,
"movement_type": "PURCHASE",
"quantity": qty,
"unit_cost": ingredient["unit_cost"],
"total_cost": round(qty * ingredient["unit_cost"], 2),
"quantity_before": None,
"quantity_after": None,
"movement_date": f"BASE_TS - {day_offset}d",
"reason_code": "supplier_delivery",
"notes": f"Weekly delivery from supplier - {ingredient['name']}",
"created_at": f"BASE_TS - {day_offset}d",
"created_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6"
}
movements.append(movement)
# Add occasional stockout events (0 inventory remaining)
# Add 5-8 stockout PRODUCTION_USE movements
for _ in range(random.randint(5, 8)):
ingredient = random.choice(KEY_INGREDIENTS)
day_offset = random.randint(1, days)
movement = {
"id": str(uuid4()),
"tenant_id": TENANT_ID,
"ingredient_id": ingredient["id"],
"stock_id": None,
"movement_type": "PRODUCTION_USE",
"quantity": round(ingredient["avg_daily"] * 1.3, 2), # Higher than usual
"unit_cost": ingredient["unit_cost"],
"total_cost": round(ingredient["avg_daily"] * 1.3 * ingredient["unit_cost"], 2),
"quantity_before": round(ingredient["avg_daily"] * 0.8, 2),
"quantity_after": 0.0, # Stockout!
"movement_date": f"BASE_TS - {day_offset}d",
"reason_code": "production_consumption_stockout",
"notes": f"STOCKOUT - Ran out of {ingredient['name']} during production",
"created_at": f"BASE_TS - {day_offset}d",
"created_by": "c1a2b3c4-d5e6-47a8-b9c0-d1e2f3a4b5c6"
}
movements.append(movement)
return movements
def add_worker_data_to_batches(batches: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
"""Add staff_assigned and completed_at to production batches"""
updated_batches = []
for batch in batches:
# Skip if no yield data (can't assign skill-based worker)
if batch.get("yield_percentage") is None:
updated_batches.append(batch)
continue
# Assign worker based on yield (better yields = better workers)
yield_pct = batch["yield_percentage"]
if yield_pct >= 95:
# Expert workers for high yields
worker = random.choice(WORKERS[:2])
elif yield_pct >= 90:
# Experienced workers
worker = random.choice(WORKERS[1:3])
elif yield_pct >= 85:
# Competent workers
worker = random.choice(WORKERS[2:4])
else:
# Junior workers for lower yields
worker = random.choice(WORKERS[3:])
# Add staff_assigned
if "staff_assigned" not in batch or not isinstance(batch["staff_assigned"], list):
batch["staff_assigned"] = []
batch["staff_assigned"].append(worker["id"])
# Calculate completed_at from actual_start_time + planned_duration_minutes
if batch.get("actual_start_time") and batch.get("planned_duration_minutes"):
# Parse the BASE_TS offset
start_time_str = batch["actual_start_time"]
duration_mins = batch["planned_duration_minutes"]
# Add duration to start time with some variability
actual_duration = duration_mins * random.uniform(0.95, 1.15) # +/- 15% variability
# Parse the start time offset to calculate completion time
# Format: "BASE_TS - 6d 7h 30m" or "BASE_TS - 6d 7h"
if "BASE_TS" in start_time_str:
# Extract the offset parts
# Convert duration to hours for easier calculation
duration_hours = actual_duration / 60.0
# Parse existing offset
parts = start_time_str.replace("BASE_TS", "").strip()
# Simple approach: just add the duration to the hours component
# Example: "- 6d 7h 30m" -> add 3.5h -> "- 6d 10h 30m" (approximately)
# For simplicity, create a new timestamp offset
# Don't try to parse complex string, just create a note field
batch["actual_duration_minutes"] = round(actual_duration, 1)
# Don't set completed_at - let the system calculate it if needed
updated_batches.append(batch)
return updated_batches
def main():
"""Generate and update JSON files with AI insights data"""
print("🔧 Generating AI Insights Data for Professional Demo...")
print()
# 1. Generate stock movements
print("📊 Generating stock movements...")
stock_movements = generate_stock_movements(days=90)
usage_count = len([m for m in stock_movements if m["movement_type"] == "PRODUCTION_USE"])
in_count = len([m for m in stock_movements if m["movement_type"] == "PURCHASE"])
stockout_count = len([m for m in stock_movements if m.get("quantity_after") == 0.0])
print(f" ✓ Generated {len(stock_movements)} stock movements")
print(f" - PRODUCTION_USE movements: {usage_count}")
print(f" - PURCHASE movements (deliveries): {in_count}")
print(f" - Stockout events: {stockout_count}")
print()
# 2. Load and update inventory JSON
print("📦 Updating 03-inventory.json...")
with open("/Users/urtzialfaro/Documents/bakery-ia/shared/demo/fixtures/professional/03-inventory.json", "r") as f:
inventory_data = json.load(f)
# Append new movements to existing ones
existing_movements = inventory_data.get("stock_movements", [])
print(f" - Existing movements: {len(existing_movements)}")
inventory_data["stock_movements"] = existing_movements + stock_movements
print(f" - Total movements: {len(inventory_data['stock_movements'])}")
# Save updated inventory
with open("/Users/urtzialfaro/Documents/bakery-ia/shared/demo/fixtures/professional/03-inventory.json", "w") as f:
json.dump(inventory_data, f, indent=2, ensure_ascii=False)
print(" ✓ Updated inventory file")
print()
# 3. Load and update production JSON
print("🏭 Updating 06-production.json...")
with open("/Users/urtzialfaro/Documents/bakery-ia/shared/demo/fixtures/professional/06-production.json", "r") as f:
production_data = json.load(f)
# Update production batches with worker data
original_batches = production_data.get("batches", [])
print(f" - Total batches: {len(original_batches)}")
updated_batches = add_worker_data_to_batches(original_batches)
batches_with_workers = len([b for b in updated_batches if b.get("staff_assigned") and len(b.get("staff_assigned", [])) > 0])
batches_with_completion = len([b for b in updated_batches if b.get("completed_at")])
production_data["batches"] = updated_batches
print(f" - Batches with worker_id: {batches_with_workers}")
print(f" - Batches with completed_at: {batches_with_completion}")
# Save updated production
with open("/Users/urtzialfaro/Documents/bakery-ia/shared/demo/fixtures/professional/06-production.json", "w") as f:
json.dump(production_data, f, indent=2, ensure_ascii=False)
print(" ✓ Updated production file")
print()
# 4. Summary
print("=" * 60)
print("✅ AI INSIGHTS DATA GENERATION COMPLETE")
print("=" * 60)
print()
print("📊 DATA ADDED:")
print(f" • Stock movements (PRODUCTION_USE): {usage_count} records (90 days)")
print(f" • Stock movements (PURCHASE): {in_count} deliveries")
print(f" • Stockout events: {stockout_count}")
print(f" • Worker assignments: {batches_with_workers} batches")
print(f" • Completion timestamps: {batches_with_completion} batches")
print()
print("🎯 AI INSIGHTS READINESS:")
print(" ✓ Safety Stock Optimizer: READY (90 days demand data)")
print(" ✓ Yield Predictor: READY (worker data added)")
print(" ✓ Sustainability Metrics: READY (existing waste data)")
print()
print("🚀 Next steps:")
print(" 1. Test demo session creation")
print(" 2. Verify AI insights generation")
print(" 3. Check insight quality in frontend")
print()
if __name__ == "__main__":
main()