{
 "openapi": "3.1.0",
 "info": {
  "title": "Control Charts (Manufacturing)",
  "version": "20261030b",
  "description": "Limits computed FROM THE PROCESS, never from the specification — a process comfortably inside a wide tolerance can be wildly out of control and nobody would see it."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "control-charts": {
    "type": "object",
    "required": [
     "name",
     "characteristic"
    ],
    "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
     },
     "chart_no": {
      "type": "string",
      "description": "Chart no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item"
     },
     "characteristic_id": {
      "type": "string",
      "format": "uuid",
      "description": "From an inspection plan"
     },
     "characteristic": {
      "type": "string",
      "description": "Characteristic"
     },
     "work_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Work center"
     },
     "equipment_id": {
      "type": "string",
      "format": "uuid",
      "description": "Machine"
     },
     "chart_type": {
      "type": "string",
      "description": "Chart type",
      "enum": [
       "xbar_r",
       "xbar_s",
       "individuals",
       "moving_range",
       "p",
       "np",
       "c",
       "u",
       "ewma",
       "cusum"
      ]
     },
     "uom": {
      "type": "string",
      "description": "Unit"
     },
     "subgroup_size": {
      "type": "integer",
      "description": "Subgroup size"
     },
     "spec_min": {
      "type": "string",
      "format": "decimal",
      "description": "Specification minimum"
     },
     "spec_max": {
      "type": "string",
      "format": "decimal",
      "description": "Specification maximum"
     },
     "target_value": {
      "type": "string",
      "format": "decimal",
      "description": "Target"
     },
     "center_line": {
      "type": "string",
      "format": "decimal",
      "description": "Center line",
      "readOnly": true
     },
     "ucl": {
      "type": "string",
      "format": "decimal",
      "description": "Ucl",
      "readOnly": true
     },
     "lcl": {
      "type": "string",
      "format": "decimal",
      "description": "Lcl",
      "readOnly": true
     },
     "range_center": {
      "type": "string",
      "format": "decimal",
      "description": "Range center",
      "readOnly": true
     },
     "range_ucl": {
      "type": "string",
      "format": "decimal",
      "description": "Range ucl",
      "readOnly": true
     },
     "baseline_from": {
      "type": "string",
      "format": "date",
      "description": "Baseline from"
     },
     "baseline_to": {
      "type": "string",
      "format": "date",
      "description": "Baseline to"
     },
     "baseline_subgroups": {
      "type": "integer",
      "description": "Baseline subgroups",
      "readOnly": true
     },
     "cp": {
      "type": "string",
      "format": "decimal",
      "description": "Cp",
      "readOnly": true
     },
     "cpk": {
      "type": "string",
      "format": "decimal",
      "description": "Cpk",
      "readOnly": true
     },
     "pp": {
      "type": "string",
      "format": "decimal",
      "description": "Pp",
      "readOnly": true
     },
     "ppk": {
      "type": "string",
      "format": "decimal",
      "description": "Ppk",
      "readOnly": true
     },
     "sigma_estimate": {
      "type": "string",
      "format": "decimal",
      "description": "Sigma estimate",
      "readOnly": true
     },
     "last_computed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last computed at",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "active",
       "draft",
       "baseline",
       "out_of_control",
       "suspended",
       "retired"
      ]
     },
     "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/control-charts": {
   "get": {
    "summary": "list control-charts",
    "operationId": "list_control_charts_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create control-charts",
    "operationId": "create_control_charts_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/control-charts/{id}": {
   "get": {
    "summary": "get control-charts",
    "operationId": "get_control_charts_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change control-charts",
    "operationId": "change_control_charts_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete control-charts",
    "operationId": "delete_control_charts_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/control-charts/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_control_charts_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/control-charts/{id}/baseline": {
   "post": {
    "summary": "Baseline",
    "operationId": "action_control_charts_0_6",
    "description": "Body keys: from, to",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}