{
 "openapi": "3.1.0",
 "info": {
  "title": "Equipment (Manufacturing)",
  "version": "20261030b",
  "description": "The physical machine, which is neither the work center (a scheduling object) nor the fixed asset (a ledger one). It names both."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "equipment": {
    "type": "object",
    "required": [
     "name"
    ],
    "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
     },
     "equipment_no": {
      "type": "string",
      "description": "Equipment no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "description": {
      "type": "string",
      "description": "Description"
     },
     "parent_id": {
      "type": "string",
      "format": "uuid",
      "description": "Part of"
     },
     "equipment_type": {
      "type": "string",
      "description": "Type",
      "enum": [
       "machine",
       "site",
       "area",
       "line",
       "cell",
       "component",
       "tool",
       "utility",
       "vehicle",
       "instrument"
      ]
     },
     "work_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Work center"
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Location"
     },
     "asset_id": {
      "type": "string",
      "format": "uuid",
      "description": "Fixed asset"
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center"
     },
     "manufacturer": {
      "type": "string",
      "description": "Manufacturer"
     },
     "model": {
      "type": "string",
      "description": "Model"
     },
     "serial_no": {
      "type": "string",
      "description": "Serial number"
     },
     "year_installed": {
      "type": "integer",
      "description": "Year installed"
     },
     "commissioned_at": {
      "type": "string",
      "format": "date",
      "description": "Commissioned"
     },
     "ideal_cycle_seconds": {
      "type": "string",
      "format": "decimal",
      "description": "Ideal cycle (seconds)"
     },
     "nameplate_rate_per_hour": {
      "type": "string",
      "format": "decimal",
      "description": "Nameplate rate per hour"
     },
     "rate_uom": {
      "type": "string",
      "description": "Rate unit"
     },
     "criticality": {
      "type": "string",
      "description": "Criticality",
      "enum": [
       "critical",
       "high",
       "medium",
       "low"
      ]
     },
     "is_constraint": {
      "type": "boolean",
      "description": "Is the constraint"
     },
     "oee_target_pct": {
      "type": "string",
      "format": "decimal",
      "description": "OEE target %"
     },
     "running_hours": {
      "type": "string",
      "format": "decimal",
      "description": "Running hours",
      "readOnly": true
     },
     "cycle_count": {
      "type": "string",
      "format": "decimal",
      "description": "Cycle count",
      "readOnly": true
     },
     "current_state": {
      "type": "string",
      "description": "Current state",
      "readOnly": true
     },
     "state_since": {
      "type": "string",
      "format": "date-time",
      "description": "State since",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "active",
       "standby",
       "maintenance",
       "breakdown",
       "decommissioned",
       "disposed"
      ]
     },
     "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/equipment": {
   "get": {
    "summary": "list equipment",
    "operationId": "list_equipment_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create equipment",
    "operationId": "create_equipment_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/equipment/{id}": {
   "get": {
    "summary": "get equipment",
    "operationId": "get_equipment_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change equipment",
    "operationId": "change_equipment_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete equipment",
    "operationId": "delete_equipment_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/equipment/{parentId}/spares": {
   "get": {
    "summary": "Spares",
    "operationId": "action_equipment_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Spares",
    "operationId": "action_equipment_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/equipment/{parentId}/spares/{lineId}": {
   "put": {
    "summary": "Spares",
    "operationId": "action_equipment_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Spares",
    "operationId": "action_equipment_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/equipment/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_equipment_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/equipment/{id}/state": {
   "post": {
    "summary": "State",
    "operationId": "action_equipment_0_6",
    "description": "Body keys: state, reasonId, productionOrderId, shiftId, source, comment; state one of running|idle|setup|down|planned_stop|starved|blocked|off; source one of plc|iot|operator|supervisor|system|import",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}