feat: Add remaining production batch reasoning helper functions
Added missing helper functions for all production batch reasoning types: - create_batch_reasoning_stock_replenishment: Inventory replenishment - create_batch_reasoning_seasonal_preparation: Seasonal demand prep - create_batch_reasoning_promotion_event: Promotional events - create_batch_reasoning_urgent_order: Urgent customer orders This completes the full set of reasoning helper functions for both purchase orders and production batches, preventing future import errors in demo seed scripts and other services. All helpers now provide structured reasoning_data for i18n translation.
This commit is contained in:
@@ -430,3 +430,113 @@ def create_batch_reasoning_regular_schedule(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def create_batch_reasoning_stock_replenishment(
|
||||||
|
product_name: str,
|
||||||
|
current_stock: float,
|
||||||
|
minimum_stock: float,
|
||||||
|
replenishment_quantity: float
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
"""Create reasoning data for stock replenishment production"""
|
||||||
|
return {
|
||||||
|
"type": ProductionBatchReasoningType.STOCK_REPLENISHMENT.value,
|
||||||
|
"parameters": {
|
||||||
|
"product_name": product_name,
|
||||||
|
"current_stock": round(current_stock, 1),
|
||||||
|
"minimum_stock": round(minimum_stock, 1),
|
||||||
|
"replenishment_quantity": round(replenishment_quantity, 1)
|
||||||
|
},
|
||||||
|
"urgency": {
|
||||||
|
"level": "medium",
|
||||||
|
"ready_by_time": "07:30",
|
||||||
|
"customer_commitment": False
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"trigger_source": "inventory_alert",
|
||||||
|
"ai_assisted": True
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def create_batch_reasoning_seasonal_preparation(
|
||||||
|
product_name: str,
|
||||||
|
season: str,
|
||||||
|
expected_demand: float,
|
||||||
|
preparation_quantity: float
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
"""Create reasoning data for seasonal preparation production"""
|
||||||
|
return {
|
||||||
|
"type": ProductionBatchReasoningType.SEASONAL_PREPARATION.value,
|
||||||
|
"parameters": {
|
||||||
|
"product_name": product_name,
|
||||||
|
"season": season,
|
||||||
|
"expected_demand": round(expected_demand, 1),
|
||||||
|
"preparation_quantity": round(preparation_quantity, 1)
|
||||||
|
},
|
||||||
|
"urgency": {
|
||||||
|
"level": "normal",
|
||||||
|
"ready_by_time": "08:00",
|
||||||
|
"customer_commitment": False
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"trigger_source": "orchestrator_auto",
|
||||||
|
"ai_assisted": True
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def create_batch_reasoning_promotion_event(
|
||||||
|
product_name: str,
|
||||||
|
event_name: str,
|
||||||
|
event_date: str,
|
||||||
|
promotional_quantity: float
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
"""Create reasoning data for promotional event production"""
|
||||||
|
return {
|
||||||
|
"type": ProductionBatchReasoningType.PROMOTION_EVENT.value,
|
||||||
|
"parameters": {
|
||||||
|
"product_name": product_name,
|
||||||
|
"event_name": event_name,
|
||||||
|
"event_date": event_date,
|
||||||
|
"promotional_quantity": round(promotional_quantity, 1)
|
||||||
|
},
|
||||||
|
"urgency": {
|
||||||
|
"level": "high",
|
||||||
|
"ready_by_time": "06:00",
|
||||||
|
"customer_commitment": True
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"trigger_source": "manual",
|
||||||
|
"ai_assisted": False
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def create_batch_reasoning_urgent_order(
|
||||||
|
product_name: str,
|
||||||
|
customer_name: str,
|
||||||
|
urgent_quantity: float,
|
||||||
|
required_by_time: str,
|
||||||
|
reason: str = "urgent_request"
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
"""Create reasoning data for urgent order production"""
|
||||||
|
return {
|
||||||
|
"type": ProductionBatchReasoningType.URGENT_ORDER.value,
|
||||||
|
"parameters": {
|
||||||
|
"product_name": product_name,
|
||||||
|
"customer_name": customer_name,
|
||||||
|
"urgent_quantity": round(urgent_quantity, 1),
|
||||||
|
"required_by_time": required_by_time,
|
||||||
|
"reason": reason
|
||||||
|
},
|
||||||
|
"urgency": {
|
||||||
|
"level": "urgent",
|
||||||
|
"ready_by_time": required_by_time,
|
||||||
|
"customer_commitment": True
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"trigger_source": "urgent_order",
|
||||||
|
"ai_assisted": False
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user