{
 "openapi": "3.1.0",
 "info": {
  "title": "Inspection Plans (Manufacturing)",
  "version": "20261030b",
  "description": "An inspection with no plan is one person’s opinion of what mattered that day. A plan fixes the characteristics, the method, the gauge and the sampling before the goods arrive."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "inspection-plans": {
    "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
     },
     "plan_no": {
      "type": "string",
      "description": "Plan no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "version": {
      "type": "string",
      "description": "Version"
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item"
     },
     "item_category": {
      "type": "string",
      "description": "Item category"
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier"
     },
     "routing_id": {
      "type": "string",
      "format": "uuid",
      "description": "Routing"
     },
     "operation_no": {
      "type": "integer",
      "description": "Operation"
     },
     "work_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Work center"
     },
     "inspection_stage": {
      "type": "string",
      "description": "Stage",
      "enum": [
       "incoming",
       "in_process",
       "final",
       "first_article",
       "pre_ship",
       "periodic",
       "audit",
       "returned"
      ]
     },
     "sampling_plan": {
      "type": "string",
      "description": "Sampling",
      "enum": [
       "aql",
       "none",
       "100_percent",
       "fixed",
       "percentage",
       "skip_lot",
       "first_article",
       "periodic"
      ]
     },
     "aql_level": {
      "type": "string",
      "description": "AQL level"
     },
     "inspection_level": {
      "type": "string",
      "description": "Inspection level"
     },
     "sample_size": {
      "type": "string",
      "format": "decimal",
      "description": "Sample size"
     },
     "sample_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Sample %"
     },
     "skip_frequency": {
      "type": "integer",
      "description": "Skip frequency"
     },
     "consecutive_passes_to_skip": {
      "type": "integer",
      "description": "Passes before skipping"
     },
     "requires_coa": {
      "type": "boolean",
      "description": "Requires a certificate of analysis"
     },
     "document_id": {
      "type": "string",
      "format": "uuid",
      "description": "Inspection drawing"
     },
     "change_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Authorized by change order"
     },
     "effective_from": {
      "type": "string",
      "format": "date",
      "description": "Effective from"
     },
     "effective_to": {
      "type": "string",
      "format": "date",
      "description": "Effective to"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "approved_by": {
      "type": "string",
      "format": "uuid",
      "description": "Approved by",
      "readOnly": true
     },
     "approved_at": {
      "type": "string",
      "format": "date-time",
      "description": "Approved at",
      "readOnly": true
     },
     "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/inspection-plans": {
   "get": {
    "summary": "list inspection-plans",
    "operationId": "list_inspection_plans_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create inspection-plans",
    "operationId": "create_inspection_plans_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/inspection-plans/{id}": {
   "get": {
    "summary": "get inspection-plans",
    "operationId": "get_inspection_plans_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change inspection-plans",
    "operationId": "change_inspection_plans_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete inspection-plans",
    "operationId": "delete_inspection_plans_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/inspection-plans/{parentId}/characteristics": {
   "get": {
    "summary": "Characteristics",
    "operationId": "action_inspection_plans_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Characteristics",
    "operationId": "action_inspection_plans_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/inspection-plans/{parentId}/characteristics/{lineId}": {
   "put": {
    "summary": "Characteristics",
    "operationId": "action_inspection_plans_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Characteristics",
    "operationId": "action_inspection_plans_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/inspection-plans/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_inspection_plans_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/inspection-plans/{id}/release": {
   "post": {
    "summary": "Release",
    "operationId": "action_inspection_plans_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/inspection-plans/{id}/revise": {
   "post": {
    "summary": "Revise",
    "operationId": "action_inspection_plans_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}