{
 "openapi": "3.1.0",
 "info": {
  "title": "Kanban Loops (Manufacturing)",
  "version": "20261030b",
  "description": "The control cycle: what circulates between where and where, in containers of what size, and how many of them exist. The card count is the cap on the stock in the system."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "kanban-loops": {
    "type": "object",
    "required": [
     "name",
     "item_id"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "loop_no": {
      "type": "string",
      "description": "Loop no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item"
     },
     "supply_strategy": {
      "type": "string",
      "description": "How an empty container is refilled"
     },
     "supply_bin_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supply bin"
     },
     "demand_bin_id": {
      "type": "string",
      "format": "uuid",
      "description": "Demand bin (at the line)"
     },
     "supply_work_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplying work center"
     },
     "demand_work_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Consuming work center"
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier"
     },
     "source_warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Source warehouse id"
     },
     "container_qty": {
      "type": "string",
      "format": "decimal",
      "description": "Quantity per container"
     },
     "card_count": {
      "type": "integer",
      "description": "Number of cards"
     },
     "container_type": {
      "type": "string",
      "description": "Container type"
     },
     "avg_daily_demand": {
      "type": "string",
      "format": "decimal",
      "description": "Average daily demand"
     },
     "replenishment_lead_days": {
      "type": "string",
      "format": "decimal",
      "description": "Replenishment lead (days)"
     },
     "safety_factor": {
      "type": "string",
      "format": "decimal",
      "description": "Safety factor"
     },
     "signal_mode": {
      "type": "string",
      "description": "Signal",
      "enum": [
       "manual",
       "barcode",
       "rfid",
       "plc",
       "iot",
       "api"
      ]
     },
     "auto_trigger": {
      "type": "boolean",
      "description": "An emptied card raises supply on its own"
     },
     "target_cycle_hours": {
      "type": "string",
      "format": "decimal",
      "description": "Target cycle (hours)"
     },
     "alert_after_hours": {
      "type": "string",
      "format": "decimal",
      "description": "Alert after (hours)"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "active",
       "draft",
       "on_hold",
       "retired"
      ]
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/mfg/kanban-loops": {
   "get": {
    "summary": "list kanban-loops",
    "operationId": "list_kanban_loops_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create kanban-loops",
    "operationId": "create_kanban_loops_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/kanban-loops/{id}": {
   "get": {
    "summary": "get kanban-loops",
    "operationId": "get_kanban_loops_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change kanban-loops",
    "operationId": "change_kanban_loops_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete kanban-loops",
    "operationId": "delete_kanban_loops_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/kanban-loops/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_kanban_loops_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/kanban-loops/{id}/issue-cards": {
   "post": {
    "summary": "Issue cards",
    "operationId": "action_kanban_loops_0_6",
    "description": "Body keys: count, startFull",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/kanban-loops/{id}/size": {
   "post": {
    "summary": "Size",
    "operationId": "action_kanban_loops_0_6",
    "description": "Body keys: days",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}