{
 "openapi": "3.1.0",
 "info": {
  "title": "Quality Inspections (Manufacturing)",
  "version": "20261030b",
  "description": "Every inspection lot, from what was inspected — a production order, an operation or a goods receipt — through the plan’s characteristics to the result and the usage decision."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "quality-inspections": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "inspection_no": {
      "type": "string",
      "description": "Inspection no",
      "readOnly": true
     },
     "ref_type": {
      "type": "string",
      "description": "Ref type",
      "readOnly": true
     },
     "ref_id": {
      "type": "string",
      "format": "uuid",
      "description": "Ref id",
      "readOnly": true
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item id",
      "readOnly": true
     },
     "lot_no": {
      "type": "string",
      "description": "Lot no",
      "readOnly": true
     },
     "sample_size": {
      "type": "string",
      "format": "decimal",
      "description": "Sample size"
     },
     "result": {
      "type": "string",
      "description": "Result"
     },
     "disposition": {
      "type": "string",
      "description": "Disposition"
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "inspected_by": {
      "type": "string",
      "format": "uuid",
      "description": "Inspected by",
      "readOnly": true
     },
     "inspected_at": {
      "type": "string",
      "format": "date-time",
      "description": "Inspected at",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "inspection_plan_id": {
      "type": "string",
      "format": "uuid",
      "description": "Inspection plan id",
      "readOnly": true
     },
     "inspection_stage": {
      "type": "string",
      "description": "Inspection stage",
      "readOnly": true
     },
     "quantity_inspected": {
      "type": "string",
      "format": "decimal",
      "description": "Quantity inspected",
      "readOnly": true
     },
     "quantity_accepted": {
      "type": "string",
      "format": "decimal",
      "description": "Quantity accepted",
      "readOnly": true
     },
     "quantity_rejected": {
      "type": "string",
      "format": "decimal",
      "description": "Quantity rejected",
      "readOnly": true
     },
     "work_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Work center id",
      "readOnly": true
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier id",
      "readOnly": true
     },
     "nonconformance_id": {
      "type": "string",
      "format": "uuid",
      "description": "Nonconformance id",
      "readOnly": true
     },
     "batch_record_id": {
      "type": "string",
      "format": "uuid",
      "description": "Batch record id",
      "readOnly": true
     },
     "stage": {
      "type": "string",
      "description": "Stage",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "quantity": {
      "type": "string",
      "format": "decimal",
      "description": "Quantity",
      "readOnly": true
     },
     "qty_accepted": {
      "type": "string",
      "format": "decimal",
      "description": "Qty accepted",
      "readOnly": true
     },
     "qty_rejected": {
      "type": "string",
      "format": "decimal",
      "description": "Qty rejected",
      "readOnly": true
     },
     "receipt_id": {
      "type": "string",
      "format": "uuid",
      "description": "Receipt id",
      "readOnly": true
     },
     "receipt_line_id": {
      "type": "string",
      "format": "uuid",
      "description": "Receipt line id",
      "readOnly": true
     },
     "po_id": {
      "type": "string",
      "format": "uuid",
      "description": "Po id",
      "readOnly": true
     },
     "production_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Production order id",
      "readOnly": true
     },
     "production_operation_id": {
      "type": "string",
      "format": "uuid",
      "description": "Production operation id",
      "readOnly": true
     },
     "config_id": {
      "type": "string",
      "format": "uuid",
      "description": "Config id",
      "readOnly": true
     },
     "sales_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Sales order id",
      "readOnly": true
     },
     "parent_inspection_id": {
      "type": "string",
      "format": "uuid",
      "description": "Parent inspection id",
      "readOnly": true
     },
     "attempt_no": {
      "type": "integer",
      "description": "Attempt no",
      "readOnly": true
     },
     "blocks_release": {
      "type": "boolean",
      "description": "Blocks release",
      "readOnly": true
     },
     "required_by": {
      "type": "string",
      "format": "date",
      "description": "Required by",
      "readOnly": true
     },
     "responsible_role": {
      "type": "string",
      "description": "Responsible role",
      "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_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "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/quality-inspections": {
   "get": {
    "summary": "list quality-inspections",
    "operationId": "list_quality_inspections_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create quality-inspections",
    "operationId": "create_quality_inspections_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/quality-inspections/{id}": {
   "get": {
    "summary": "get quality-inspections",
    "operationId": "get_quality_inspections_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change quality-inspections",
    "operationId": "change_quality_inspections_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete quality-inspections",
    "operationId": "delete_quality_inspections_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/quality-inspections/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_quality_inspections_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/quality-inspections/{parentId}/lines": {
   "get": {
    "summary": "Lines",
    "operationId": "action_quality_inspections_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Lines",
    "operationId": "action_quality_inspections_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/quality-inspections/{parentId}/lines/{lineId}": {
   "put": {
    "summary": "Lines",
    "operationId": "action_quality_inspections_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Lines",
    "operationId": "action_quality_inspections_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}