New alert system and panel de control page
This commit is contained in:
@@ -692,6 +692,105 @@
|
||||
"production_notes": "Masa madre preparada ayer - Listo para horneado",
|
||||
"quality_notes": null,
|
||||
"equipment_used": ["50000000-0000-0000-0000-000000000001"]
|
||||
},
|
||||
{
|
||||
"id": "40000000-0000-0000-0000-0000000000a1",
|
||||
"batch_number": "BATCH-CHOCOLATE-CAKE-EVENING",
|
||||
"product_id": "20000000-0000-0000-0000-000000000004",
|
||||
"product_name": "Tarta de Chocolate Premium",
|
||||
"recipe_id": "30000000-0000-0000-0000-000000000004",
|
||||
"planned_start_offset_days": 0,
|
||||
"planned_start_hour": 17,
|
||||
"planned_start_minute": 0,
|
||||
"planned_duration_minutes": 180,
|
||||
"planned_quantity": 5.0,
|
||||
"actual_quantity": null,
|
||||
"status": "PENDING",
|
||||
"priority": "HIGH",
|
||||
"current_process_stage": null,
|
||||
"yield_percentage": null,
|
||||
"quality_score": null,
|
||||
"waste_quantity": null,
|
||||
"defect_quantity": null,
|
||||
"waste_defect_type": null,
|
||||
"estimated_cost": 380.00,
|
||||
"actual_cost": null,
|
||||
"labor_cost": null,
|
||||
"material_cost": null,
|
||||
"overhead_cost": null,
|
||||
"station_id": "STATION-03",
|
||||
"is_rush_order": false,
|
||||
"is_special_recipe": true,
|
||||
"is_ai_assisted": true,
|
||||
"production_notes": "⚠️ DASHBOARD: Scheduled in 5 hours but missing 3kg dark chocolate (CHO-NEG-001) - Will trigger BATCH_AT_RISK alert",
|
||||
"quality_notes": null,
|
||||
"equipment_used": ["50000000-0000-0000-0000-000000000001"]
|
||||
},
|
||||
{
|
||||
"id": "40000000-0000-0000-0000-0000000000a2",
|
||||
"batch_number": "BATCH-CROISSANTS-TOMORROW",
|
||||
"product_id": "20000000-0000-0000-0000-000000000002",
|
||||
"product_name": "Croissant de Mantequilla Artesanal",
|
||||
"recipe_id": "30000000-0000-0000-0000-000000000002",
|
||||
"planned_start_offset_days": 1,
|
||||
"planned_start_hour": 5,
|
||||
"planned_start_minute": 0,
|
||||
"planned_duration_minutes": 240,
|
||||
"planned_quantity": 150.0,
|
||||
"actual_quantity": null,
|
||||
"status": "PENDING",
|
||||
"priority": "HIGH",
|
||||
"current_process_stage": null,
|
||||
"yield_percentage": null,
|
||||
"quality_score": null,
|
||||
"waste_quantity": null,
|
||||
"defect_quantity": null,
|
||||
"waste_defect_type": null,
|
||||
"estimated_cost": 420.00,
|
||||
"actual_cost": null,
|
||||
"labor_cost": null,
|
||||
"material_cost": null,
|
||||
"overhead_cost": null,
|
||||
"station_id": "STATION-02",
|
||||
"is_rush_order": false,
|
||||
"is_special_recipe": false,
|
||||
"is_ai_assisted": true,
|
||||
"production_notes": "⚠️ DASHBOARD: Tomorrow morning batch - Depends on yeast (LEV-SEC-001) and butter (MAN-SAL-001) - Coordinates with PO approval escalation scenario",
|
||||
"quality_notes": null,
|
||||
"equipment_used": ["50000000-0000-0000-0000-000000000002", "50000000-0000-0000-0000-000000000001"]
|
||||
},
|
||||
{
|
||||
"id": "40000000-0000-0000-0000-0000000000a3",
|
||||
"batch_number": "BATCH-BAGUETTES-001",
|
||||
"product_id": "20000000-0000-0000-0000-000000000001",
|
||||
"product_name": "Baguette Francesa Tradicional",
|
||||
"recipe_id": "30000000-0000-0000-0000-000000000001",
|
||||
"planned_start_offset_days": 0,
|
||||
"planned_start_hour": 14,
|
||||
"planned_start_minute": 0,
|
||||
"planned_duration_minutes": 165,
|
||||
"planned_quantity": 80.0,
|
||||
"actual_quantity": null,
|
||||
"status": "PENDING",
|
||||
"priority": "MEDIUM",
|
||||
"current_process_stage": null,
|
||||
"yield_percentage": null,
|
||||
"quality_score": null,
|
||||
"waste_quantity": null,
|
||||
"defect_quantity": null,
|
||||
"waste_defect_type": null,
|
||||
"estimated_cost": 120.00,
|
||||
"actual_cost": null,
|
||||
"labor_cost": null,
|
||||
"material_cost": null,
|
||||
"overhead_cost": null,
|
||||
"station_id": "STATION-01",
|
||||
"is_rush_order": false,
|
||||
"is_special_recipe": false,
|
||||
"is_ai_assisted": true,
|
||||
"production_notes": "⚠️ DASHBOARD: At risk due to flour (HAR-T55-001) running low - Will be affected if delivery is late",
|
||||
"quality_notes": null,
|
||||
"equipment_used": ["50000000-0000-0000-0000-000000000001"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -39,7 +39,8 @@ DEMO_TENANT_LA_ESPIGA = uuid.UUID("b2c3d4e5-f6a7-48b9-c0d1-e2f3a4b5c6d7") # Cen
|
||||
# Base reference date for date calculations
|
||||
# MUST match shared/utils/demo_dates.py for proper demo session cloning
|
||||
# This fixed date allows demo sessions to adjust all dates relative to session creation time
|
||||
BASE_REFERENCE_DATE = datetime(2025, 1, 15, 12, 0, 0, tzinfo=timezone.utc)
|
||||
# IMPORTANT: Must match the actual dates in seed data (production batches start Jan 8, 2025)
|
||||
BASE_REFERENCE_DATE = datetime(2025, 1, 8, 6, 0, 0, tzinfo=timezone.utc)
|
||||
|
||||
|
||||
def load_batches_data():
|
||||
|
||||
@@ -25,6 +25,10 @@ import structlog
|
||||
|
||||
from app.models.production import Equipment, EquipmentType, EquipmentStatus
|
||||
|
||||
# Add shared path for demo utilities
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent))
|
||||
from shared.utils.demo_dates import BASE_REFERENCE_DATE
|
||||
|
||||
# Configure logging
|
||||
logger = structlog.get_logger()
|
||||
|
||||
@@ -32,9 +36,6 @@ logger = structlog.get_logger()
|
||||
DEMO_TENANT_SAN_PABLO = uuid.UUID("a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6") # Individual bakery
|
||||
DEMO_TENANT_LA_ESPIGA = uuid.UUID("b2c3d4e5-f6a7-48b9-c0d1-e2f3a4b5c6d7") # Central bakery
|
||||
|
||||
# Base reference date for date calculations
|
||||
BASE_REFERENCE_DATE = datetime(2025, 1, 15, 12, 0, 0, tzinfo=timezone.utc)
|
||||
|
||||
|
||||
def load_equipment_data():
|
||||
"""Load equipment data from JSON file"""
|
||||
|
||||
@@ -25,6 +25,10 @@ import structlog
|
||||
|
||||
from app.models.production import QualityCheckTemplate
|
||||
|
||||
# Add shared path for demo utilities
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent))
|
||||
from shared.utils.demo_dates import BASE_REFERENCE_DATE
|
||||
|
||||
# Configure logging
|
||||
logger = structlog.get_logger()
|
||||
|
||||
@@ -35,9 +39,6 @@ DEMO_TENANT_LA_ESPIGA = uuid.UUID("b2c3d4e5-f6a7-48b9-c0d1-e2f3a4b5c6d7") # Cen
|
||||
# System user ID (first admin user from auth service)
|
||||
SYSTEM_USER_ID = uuid.UUID("50000000-0000-0000-0000-000000000004")
|
||||
|
||||
# Base reference date for date calculations
|
||||
BASE_REFERENCE_DATE = datetime(2025, 1, 15, 12, 0, 0, tzinfo=timezone.utc)
|
||||
|
||||
|
||||
def load_quality_templates_data():
|
||||
"""Load quality templates data from JSON file"""
|
||||
|
||||
Reference in New Issue
Block a user