Improve te panel de control logic
This commit is contained in:
@@ -325,6 +325,9 @@ async def get_orchestration_summary(
|
||||
try:
|
||||
po_data = await procurement_client.get_pending_purchase_orders(tenant_id, limit=10)
|
||||
if po_data and isinstance(po_data, list):
|
||||
# Override stale orchestration count with actual real-time PO count
|
||||
summary["purchaseOrdersCreated"] = len(po_data)
|
||||
summary["userActionsRequired"] = len(po_data) # Update actions required to match actual pending POs
|
||||
summary["purchaseOrdersSummary"] = [
|
||||
PurchaseOrderSummary(
|
||||
supplierName=po.get("supplier_name", "Unknown"),
|
||||
@@ -341,6 +344,8 @@ async def get_orchestration_summary(
|
||||
batch_data = await production_client.get_todays_batches(tenant_id)
|
||||
if batch_data:
|
||||
batches = batch_data.get("batches", [])
|
||||
# Override stale orchestration count with actual real-time batch count
|
||||
summary["productionBatchesCreated"] = len(batches)
|
||||
summary["productionBatchesSummary"] = [
|
||||
ProductionBatchSummary(
|
||||
productName=batch.get("product_name", "Unknown"),
|
||||
|
||||
Reference in New Issue
Block a user