{
 "openapi": "3.1.0",
 "info": {
  "title": "Change Requests (Manufacturing)",
  "version": "20261030b",
  "description": "Requests to change a product or document, reviewed and approved before a change order is made."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "change-requests": {
    "type": "object",
    "required": [
     "title"
    ],
    "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
     },
     "request_no": {
      "type": "string",
      "description": "Request no",
      "readOnly": true
     },
     "title": {
      "type": "string",
      "description": "What is the problem"
     },
     "description": {
      "type": "string",
      "description": "Description"
     },
     "origin": {
      "type": "string",
      "description": "Where it came from",
      "enum": [
       "internal",
       "customer",
       "supplier",
       "quality",
       "production",
       "regulatory",
       "cost_reduction",
       "obsolescence",
       "safety",
       "field_failure"
      ]
     },
     "reason": {
      "type": "string",
      "description": "Reason"
     },
     "priority": {
      "type": "string",
      "description": "Priority",
      "enum": [
       "low",
       "medium",
       "high",
       "urgent"
      ]
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item"
     },
     "document_id": {
      "type": "string",
      "format": "uuid",
      "description": "Document"
     },
     "nonconformance_no": {
      "type": "string",
      "description": "Nonconformance it came from"
     },
     "case_id": {
      "type": "string",
      "format": "uuid",
      "description": "Case id"
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier"
     },
     "customer_id": {
      "type": "string",
      "format": "uuid",
      "description": "Customer"
     },
     "estimated_cost": {
      "type": "string",
      "format": "decimal",
      "description": "Estimated cost"
     },
     "estimated_saving_per_year": {
      "type": "string",
      "format": "decimal",
      "description": "Estimated saving per year"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "affects_form_fit_function": {
      "type": "boolean",
      "description": "Affects form, fit or function"
     },
     "affects_safety": {
      "type": "boolean",
      "description": "Affects safety"
     },
     "affects_regulatory": {
      "type": "boolean",
      "description": "Affects a regulatory claim"
     },
     "requested_by": {
      "type": "string",
      "format": "uuid",
      "description": "Requested by"
     },
     "requested_at": {
      "type": "string",
      "format": "date-time",
      "description": "Requested at",
      "readOnly": true
     },
     "needed_by": {
      "type": "string",
      "format": "date",
      "description": "Needed by"
     },
     "reviewed_by": {
      "type": "string",
      "format": "uuid",
      "description": "Reviewed by",
      "readOnly": true
     },
     "reviewed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Reviewed at",
      "readOnly": true
     },
     "decision_notes": {
      "type": "string",
      "description": "Decision notes",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "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
     },
     "submitted_by": {
      "type": "string",
      "format": "uuid",
      "description": "Submitted by",
      "readOnly": true
     },
     "submitted_at": {
      "type": "string",
      "format": "date-time",
      "description": "Submitted at",
      "readOnly": true
     },
     "withdrawn_by": {
      "type": "string",
      "format": "uuid",
      "description": "Withdrawn by",
      "readOnly": true
     },
     "withdrawn_at": {
      "type": "string",
      "format": "date-time",
      "description": "Withdrawn at",
      "readOnly": true
     },
     "board_outcome": {
      "type": "string",
      "description": "Board outcome",
      "readOnly": true
     },
     "decision_override": {
      "type": "boolean",
      "description": "Decision override",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/mfg/change-requests": {
   "get": {
    "summary": "list change-requests",
    "operationId": "list_change_requests_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create change-requests",
    "operationId": "create_change_requests_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/change-requests/{id}": {
   "get": {
    "summary": "get change-requests",
    "operationId": "get_change_requests_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change change-requests",
    "operationId": "change_change_requests_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete change-requests",
    "operationId": "delete_change_requests_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/change-requests/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_change_requests_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/change-requests/{id}/submit": {
   "post": {
    "summary": "Submit",
    "operationId": "action_change_requests_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/change-requests/{id}/assign-approvers": {
   "post": {
    "summary": "Assign approvers",
    "operationId": "action_change_requests_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/change-requests/{id}/sign": {
   "post": {
    "summary": "Sign",
    "operationId": "action_change_requests_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/change-requests/{id}/decide": {
   "post": {
    "summary": "Decide",
    "operationId": "action_change_requests_0_6",
    "description": "Body keys: decision, notes; decision one of approved|rejected|deferred",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/change-requests/{id}/withdraw": {
   "post": {
    "summary": "Withdraw",
    "operationId": "action_change_requests_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/change-requests/{id}/reopen": {
   "post": {
    "summary": "Reopen",
    "operationId": "action_change_requests_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}