{
 "openapi": "3.1.0",
 "info": {
  "title": "Failure Modes (Manufacturing)",
  "version": "20261030b",
  "description": "How this KIND of equipment fails, with the effect and the detection method. Kept at the class rather than the machine, or the same bearing failure is entered forty times and never groups."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "failure-modes": {
    "type": "object",
    "required": [
     "name",
     "failure_mode"
    ],
    "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
     },
     "code": {
      "type": "string",
      "description": "Code",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "equipment_class": {
      "type": "string",
      "description": "Equipment class"
     },
     "equipment_id": {
      "type": "string",
      "format": "uuid",
      "description": "Machine"
     },
     "component": {
      "type": "string",
      "description": "Component"
     },
     "failure_mode": {
      "type": "string",
      "description": "How it fails"
     },
     "effect": {
      "type": "string",
      "description": "Effect"
     },
     "cause": {
      "type": "string",
      "description": "Cause"
     },
     "detection_method": {
      "type": "string",
      "description": "How it is detected"
     },
     "severity": {
      "type": "integer",
      "description": "Severity (1-10)"
     },
     "occurrence": {
      "type": "integer",
      "description": "Occurrence (1-10)"
     },
     "detection": {
      "type": "integer",
      "description": "Detection (1-10)"
     },
     "rpn": {
      "type": "integer",
      "description": "Risk priority number"
     },
     "recommended_action": {
      "type": "string",
      "description": "Recommended action"
     },
     "typical_downtime_hours": {
      "type": "string",
      "format": "decimal",
      "description": "Typical downtime (hours)"
     },
     "typical_cost": {
      "type": "string",
      "format": "decimal",
      "description": "Typical cost"
     },
     "is_active": {
      "type": "boolean",
      "description": "Active"
     },
     "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/failure-modes": {
   "get": {
    "summary": "list failure-modes",
    "operationId": "list_failure_modes_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create failure-modes",
    "operationId": "create_failure_modes_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/failure-modes/{id}": {
   "get": {
    "summary": "get failure-modes",
    "operationId": "get_failure_modes_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change failure-modes",
    "operationId": "change_failure_modes_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete failure-modes",
    "operationId": "delete_failure_modes_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/failure-modes/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_failure_modes_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"
     }
    }
   }
  }
 }
}