From 0fb519f0c4a03fdba24816849e13d7d0daf986cf Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Nov 2025 19:35:51 +0000 Subject: [PATCH] fix: Add missing create_batch_reasoning_regular_schedule helper function Demo seed script was failing with ImportError because the create_batch_reasoning_regular_schedule function was referenced but not implemented in reasoning_types.py. Added the missing helper function to support REGULAR_SCHEDULE batch reasoning type for regular scheduled production batches. Fixes container restart loop in demo-seed-production-batches pod. --- shared/schemas/reasoning_types.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/shared/schemas/reasoning_types.py b/shared/schemas/reasoning_types.py index fe2f7236..55233a6d 100644 --- a/shared/schemas/reasoning_types.py +++ b/shared/schemas/reasoning_types.py @@ -265,3 +265,29 @@ def create_batch_reasoning_customer_order( "ai_assisted": False } } + + +def create_batch_reasoning_regular_schedule( + product_name: str, + scheduled_quantity: float, + production_schedule: str = "daily" +) -> Dict[str, Any]: + """Create reasoning data for regular scheduled production""" + return { + "type": ProductionBatchReasoningType.REGULAR_SCHEDULE.value, + "parameters": { + "product_name": product_name, + "scheduled_quantity": round(scheduled_quantity, 1), + "production_schedule": production_schedule + }, + "urgency": { + "level": "normal", + "ready_by_time": "08:00", + "customer_commitment": False + }, + "metadata": { + "trigger_source": "orchestrator_auto", + "ai_assisted": False + } + } +