{
    "schemes": [],
    "swagger": "2.0",
    "info": {
        "description": "Backend API for KavaLife ERP",
        "title": "KavaLife ERP API",
        "contact": {},
        "version": "1.0"
    },
    "host": "localhost:8080",
    "basePath": "/",
    "paths": {
        "/api/health": {
            "get": {
                "description": "Returns service health status",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Health"
                ],
                "summary": "Health check",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/internal_routes.HealthResponse"
                        }
                    }
                }
            }
        },
        "/documents": {
            "get": {
                "description": "Lists uploaded document metadata for a module and optional entity id. The response stores storage_path only; use the signed URL endpoint to view files.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Documents"
                ],
                "summary": "List documents",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Module name, for example sales_po or vendor",
                        "name": "module",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Entity id",
                        "name": "entityId",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.ListDocumentsAPIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/documents/upload": {
            "post": {
                "description": "Uploads one or more documents to the private Supabase documents bucket and stores metadata in document_uploads. Allowed files: PDF, PNG, JPG/JPEG, WEBP, HEIC, HEIF. Max size is 25MB per file.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Documents"
                ],
                "summary": "Upload documents",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Module name, for example sales_po or vendor",
                        "name": "module",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Entity id to attach documents to",
                        "name": "entityId",
                        "in": "formData"
                    },
                    {
                        "type": "string",
                        "description": "Document type, for example customer_coa",
                        "name": "documentType",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "file",
                        "description": "Document file; repeat the files field for multiple files",
                        "name": "files",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.UploadDocumentsAPIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/documents/{id}/url": {
            "get": {
                "description": "Creates a temporary signed Supabase Storage URL for a private document object. Bucket defaults to documents through SUPABASE_STORAGE_BUCKET.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Documents"
                ],
                "summary": "Get document signed URL",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Document upload id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.DocumentSignedURLAPIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/grn/create": {
            "post": {
                "description": "Creates a goods receipt note from a verified VIR.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Manufacturing Runtime"
                ],
                "summary": "Create GRN",
                "parameters": [
                    {
                        "description": "GRN creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CreateGRNRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CreateGRNResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/grn/view": {
            "get": {
                "description": "Lists GRNs, optionally filtered by GRN number for the current runtime flow.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Manufacturing Runtime"
                ],
                "summary": "List GRNs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "GRN number filter",
                        "name": "grnNo",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.GRNResponse"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/grn/{grnNumber}": {
            "get": {
                "description": "Fetches one GRN with linked VIR, product, and vendor details.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Manufacturing Runtime"
                ],
                "summary": "Get GRN",
                "parameters": [
                    {
                        "type": "string",
                        "description": "GRN number",
                        "name": "grnNumber",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.GRNDetailResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/qaqc/create": {
            "post": {
                "description": "Creates a QA/QC record for a manufacturing process reference.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "QAQC"
                ],
                "summary": "Create QA/QC entry",
                "parameters": [
                    {
                        "description": "QA/QC creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CreateQAQCRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CreateQAQCResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/qaqc/verify/{id}": {
            "patch": {
                "description": "Updates QA/QC approval status and approver details.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "QAQC"
                ],
                "summary": "Verify QA/QC entry",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "QA/QC entry ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "QA/QC verification payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.VerifyQAQCRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.VerifyQAQCResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/qaqc/view": {
            "get": {
                "description": "Fetches the QA/QC entry for a GRN or lot process step reference.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "QAQC"
                ],
                "summary": "View QA/QC entry",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Process type, for example grn or lot_process_step",
                        "name": "processType",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Process reference, such as GRN number or lot process step ID",
                        "name": "processRef",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.QAQCEntry"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/sales-po/create": {
            "post": {
                "description": "Creates a Sales inquiry, generates inquiry_number, keeps po_number null, and routes the ticket to Admin with status quote_requested.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Sales PO"
                ],
                "summary": "Create Sales inquiry",
                "parameters": [
                    {
                        "description": "Sales inquiry creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CreateSalesPORequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOAPIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/sales-po/view": {
            "get": {
                "description": "Lists Sales PO records. Admin can list all queues. Sales is restricted to own inquiries. Purchase and Production are restricted to their own queues.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Sales PO"
                ],
                "summary": "List Sales POs",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Status filter",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Sales representative id filter; non-admin Sales users are forced to their own id",
                        "name": "salesRepId",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Queue owner filter: admin, sales, purchase, production",
                        "name": "sendTo",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOListAPIResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/sales-po/{id}": {
            "get": {
                "description": "Fetches a single Sales inquiry / PO by id, including inquiryNumber, poNumber, purchasePrice, status, and sendTo.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Sales PO"
                ],
                "summary": "Get Sales PO",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Sales PO id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOAPIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/sales-po/{id}/status": {
            "patch": {
                "description": "Applies a validated Sales PO v1 status transition. Backend derives send_to from toStatus and ignores frontend sendTo as source of truth. purchase_priced requires purchasePrice \u003e 0. admin_rejected requires rejectionReason.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Sales PO"
                ],
                "summary": "Update Sales PO status",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Sales PO id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Status transition payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.UpdateSalesPOStatusRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOAPIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/sales-po/{id}/status-log": {
            "get": {
                "description": "Fetches the full status history for a Sales PO. History includes fromStatus, toStatus, changedBy, note, and changedAt.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Sales PO"
                ],
                "summary": "Get Sales PO status log",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Sales PO id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatusLogAPIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/batches": {
            "get": {
                "description": "Lists manufacturing batches created from approved GRNs.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Batch Runtime"
                ],
                "summary": "List batches",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchListResponse"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/batches/create": {
            "post": {
                "description": "Creates a manufacturing batch from a GRN and input quantity.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Batch Runtime"
                ],
                "summary": "Create batch",
                "parameters": [
                    {
                        "description": "Batch creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateBatchRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateBatchResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/batches/{id}": {
            "get": {
                "description": "Fetches one manufacturing batch by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Batch Runtime"
                ],
                "summary": "Get batch",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Batch ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchDetailResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/batches/{id}/history": {
            "get": {
                "description": "Fetches batch lots and process step history for runtime traceability.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Batch Runtime"
                ],
                "summary": "Get batch history",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Batch ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchHistoryResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/customers": {
            "get": {
                "description": "Lists active and inactive customer masters.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Management"
                ],
                "summary": "List customers",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Customer"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates a customer master for downstream sales and fulfillment.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Management"
                ],
                "summary": "Create customer",
                "parameters": [
                    {
                        "description": "Customer creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateCustomerRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Customer"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/customers/{id}": {
            "get": {
                "description": "Fetches one customer master by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Management"
                ],
                "summary": "Get customer",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Customer ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Customer"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            },
            "patch": {
                "description": "Updates a customer master.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Management"
                ],
                "summary": "Update customer",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Customer ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Customer update payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateCustomerRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Customer"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/customers/{id}/status": {
            "patch": {
                "description": "Activates or deactivates a customer master.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Customer Management"
                ],
                "summary": "Update customer status",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Customer ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Customer status payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateCustomerStatusRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Customer"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/inventory-lots": {
            "get": {
                "description": "Lists inventory-driven material lots with safe filtering and pagination.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Inventory Runtime"
                ],
                "summary": "List inventory lots",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryLotResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/inventory-lots/{id}": {
            "get": {
                "description": "Fetches one inventory-driven material lot by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Inventory Runtime"
                ],
                "summary": "Get inventory lot",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Inventory lot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryLotResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/inventory-lots/{id}/lineage": {
            "get": {
                "description": "Fetches selected lot, direct parent lots, and direct child lots.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Inventory Runtime"
                ],
                "summary": "Get inventory lot lineage",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Inventory lot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryLotLineageResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/inventory-lots/{id}/transactions": {
            "get": {
                "description": "Lists inventory movement ledger rows for one inventory lot.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Inventory Runtime"
                ],
                "summary": "List inventory lot transactions",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Inventory lot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryTransactionResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/inventory-transactions": {
            "get": {
                "description": "Lists inventory movement ledger rows with safe filtering and pagination.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Inventory Runtime"
                ],
                "summary": "List inventory transactions",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryTransactionResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-definitions": {
            "get": {
                "description": "Lists process master definitions available to workflows and runtime forms.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Workflow Management"
                ],
                "summary": "List process definitions",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessDefinitionResponse"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processDefinitionAPIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-definitions/{id}": {
            "get": {
                "description": "Fetches one process master definition by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Get process definition",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Process definition ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessDefinitionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processDefinitionAPIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processDefinitionAPIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processDefinitionAPIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-definitions/{id}/form-schema": {
            "patch": {
                "description": "Updates the default dynamic form schema for a process definition.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Workflow Management"
                ],
                "summary": "Update process form schema",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Process definition ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Process definition form schema payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateProcessDefinitionFormSchemaRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessDefinitionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processDefinitionAPIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processDefinitionAPIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processDefinitionAPIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-executions": {
            "post": {
                "description": "Starts execution for an active lot process step and records input data.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Create process execution",
                "parameters": [
                    {
                        "description": "Process execution creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateProcessExecutionRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-executions/step/{stepId}": {
            "get": {
                "description": "Lists process executions recorded for a lot process step.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Get executions by step",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Lot process step ID",
                        "name": "stepId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-executions/{id}": {
            "get": {
                "description": "Fetches one process execution record by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Get process execution",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Process execution ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-executions/{id}/complete": {
            "patch": {
                "description": "Completes a process execution with output quantity, loss, form data, and notes.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Complete process execution",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Process execution ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Process execution completion payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.CompleteProcessExecutionRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-executions/{id}/inputs": {
            "get": {
                "description": "Lists inventory lots consumed by a process execution.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Inventory Runtime"
                ],
                "summary": "List process execution inputs",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Process execution ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionInputResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-executions/{id}/outputs": {
            "get": {
                "description": "Lists inventory lots produced by a process execution.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Inventory Runtime"
                ],
                "summary": "List process execution outputs",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Process execution ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionOutputResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-executions/{id}/progress": {
            "patch": {
                "description": "Updates in-progress execution form data, equipment, quantity input, and operator notes without completing the step.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Save process execution progress",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Process execution ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Process execution progress payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateProcessExecutionProgressRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/internal_services_v2.processExecutionAPIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-steps/active": {
            "get": {
                "description": "Lists active lot process steps ready for runtime execution.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Get active process steps",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ActiveLotProcessStepResponse"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-steps/board": {
            "get": {
                "description": "Lists runtime manufacturing process cards for active, in-progress, awaiting QA/QC, and rework steps.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Get process board cards",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Process code",
                        "name": "processCode",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Status",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Batch number",
                        "name": "batchNumber",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Lot number",
                        "name": "lotNumber",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Product ID",
                        "name": "productId",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Search text",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "From date RFC3339 or YYYY-MM-DD",
                        "name": "fromDate",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "To date RFC3339 or YYYY-MM-DD",
                        "name": "toDate",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Sort by",
                        "name": "sortBy",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "asc or desc",
                        "name": "sortOrder",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessStepBoardCardResponse"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-steps/{id}": {
            "get": {
                "description": "Fetches one runtime lot process step by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Get process step",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Lot process step ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.LotProcessStepDetailResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-steps/{id}/complete": {
            "patch": {
                "description": "Completes a runtime lot process step with quantity and note details.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Complete process step",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Lot process step ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Process step completion payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.CompleteLotProcessStepRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.LotProcessStepActionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/process-steps/{id}/start": {
            "patch": {
                "description": "Starts an active runtime lot process step.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Process Runtime"
                ],
                "summary": "Start process step",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Lot process step ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.LotProcessStepActionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/products": {
            "get": {
                "description": "Lists product and material masters available to manufacturing workflows.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Product Management"
                ],
                "summary": "List products",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Product"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Creates a product or material master used by workflows and batches.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Product Management"
                ],
                "summary": "Create product",
                "parameters": [
                    {
                        "description": "Product creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateProductRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Product"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/products/{id}": {
            "get": {
                "description": "Fetches one product or material master by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Product Management"
                ],
                "summary": "Get product",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Product ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Product"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            },
            "patch": {
                "description": "Updates a product or material master.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Product Management"
                ],
                "summary": "Update product",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Product ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Product update payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateProductRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Product"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/products/{id}/status": {
            "patch": {
                "description": "Activates or deactivates a product master.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Product Management"
                ],
                "summary": "Update product status",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Product ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Product status payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateProductStatusRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.Product"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/workflows": {
            "post": {
                "description": "Creates a product workflow definition for manufacturing.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Workflow Management"
                ],
                "summary": "Create workflow",
                "parameters": [
                    {
                        "description": "Workflow creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateWorkflowRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProductWorkflow"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/workflows/active/product/{productId}": {
            "get": {
                "description": "Fetches the active workflow and steps for a product.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Workflow Management"
                ],
                "summary": "Get active workflow",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Product ID",
                        "name": "productId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/workflows/{id}": {
            "get": {
                "description": "Fetches a workflow and its ordered process steps.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Workflow Management"
                ],
                "summary": "Get workflow",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Workflow ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/workflows/{id}/activate": {
            "patch": {
                "description": "Activates a workflow for product batch creation.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Workflow Management"
                ],
                "summary": "Activate workflow",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Workflow ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/v2/workflows/{id}/steps": {
            "post": {
                "description": "Adds ordered process definitions to a product workflow.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Workflow Management"
                ],
                "summary": "Add workflow steps",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Workflow ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Workflow steps payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.AddWorkflowStepsRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/vir/all": {
            "get": {
                "description": "Lists vehicle inspection reports used in the inward material flow.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Manufacturing Runtime"
                ],
                "summary": "List VIRs",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.VIR"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/vir/create": {
            "post": {
                "description": "Creates a vehicle inspection report for received material.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Manufacturing Runtime"
                ],
                "summary": "Create VIR",
                "parameters": [
                    {
                        "description": "VIR creation payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CreateVIRRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CreateVIRResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/vir/verify/{vir_number}": {
            "patch": {
                "description": "Marks a VIR as checked and completed.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Manufacturing Runtime"
                ],
                "summary": "Verify VIR",
                "parameters": [
                    {
                        "type": "string",
                        "description": "VIR number",
                        "name": "vir_number",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "VIR verification payload",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.VerifyVIRRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.VerifyVIRResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        },
        "/vir/{vir_number}": {
            "get": {
                "description": "Fetches one vehicle inspection report by VIR number.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Manufacturing Runtime"
                ],
                "summary": "Get VIR",
                "parameters": [
                    {
                        "type": "string",
                        "description": "VIR number",
                        "name": "vir_number",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.VIR"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "github_com_paaart_kavalife-erp-backend_internal_models.CheckedByData": {
            "type": "object",
            "required": [
                "data"
            ],
            "properties": {
                "data": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.UserData"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.CreateGRNRequest": {
            "type": "object",
            "required": [
                "containerQuantity",
                "quantity",
                "virNumber"
            ],
            "properties": {
                "containerQuantity": {
                    "type": "integer"
                },
                "createdBy": {
                    "description": "Deprecated: ignored by backend; created_by comes from authenticated context.",
                    "type": "integer"
                },
                "invoice": {
                    "type": "string"
                },
                "invoiceDate": {
                    "type": "string"
                },
                "invoiceImg": {
                    "type": "string"
                },
                "packagingStatus": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "virNumber": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.CreateGRNResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "grn_number": {
                    "type": "string"
                },
                "qaqc_status": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.CreateQAQCRequest": {
            "type": "object",
            "required": [
                "processRef",
                "processType"
            ],
            "properties": {
                "analysedBy": {
                    "type": "string"
                },
                "analystRemark": {
                    "type": "string"
                },
                "arNumber": {
                    "type": "string"
                },
                "containersSampled": {
                    "type": "integer"
                },
                "moistureContent": {
                    "type": "string"
                },
                "potency": {
                    "type": "string"
                },
                "processRef": {
                    "type": "string"
                },
                "processType": {
                    "type": "string"
                },
                "releaseDate": {
                    "type": "string"
                },
                "sampledBy": {
                    "type": "string"
                },
                "sampledOn": {
                    "type": "string"
                },
                "sampledQuantity": {
                    "type": "integer"
                },
                "yieldPercent": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.CreateQAQCResponse": {
            "type": "object",
            "properties": {
                "entry": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.QAQCEntry"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.CreateSalesPORequest": {
            "type": "object",
            "properties": {
                "askingPrice": {
                    "type": "number"
                },
                "coaUrl": {
                    "type": "string"
                },
                "comments": {
                    "type": "string"
                },
                "companyAddress": {
                    "type": "string"
                },
                "companyContactEmail": {
                    "type": "string"
                },
                "companyContactName": {
                    "type": "string"
                },
                "companyContactNumber": {
                    "type": "string"
                },
                "companyName": {
                    "type": "string"
                },
                "expectedDeliveryDate": {
                    "type": "string"
                },
                "grade": {
                    "type": "string"
                },
                "productName": {
                    "type": "string"
                },
                "purity": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "quantityUnit": {
                    "type": "string"
                },
                "requestDate": {
                    "description": "optional override",
                    "type": "string"
                },
                "requestType": {
                    "description": "\"sample\" | \"purchase\"",
                    "allOf": [
                        {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPORequestType"
                        }
                    ]
                },
                "salesRepId": {
                    "description": "SalesRepID will usually come from auth context, not from the body,\nbut we keep it here if you ever want to override in services.",
                    "type": "integer"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.CreateVIRRequest": {
            "type": "object",
            "required": [
                "checklist",
                "product",
                "vendor"
            ],
            "properties": {
                "checklist": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "createdAt": {
                    "description": "Deprecated: ignored by backend; created_at comes from backend time.",
                    "type": "string"
                },
                "createdBy": {
                    "description": "Deprecated: ignored by backend; created_by comes from authenticated context.",
                    "allOf": [
                        {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CreatedByData"
                        }
                    ]
                },
                "product": {
                    "type": "string"
                },
                "remarks": {
                    "type": "string"
                },
                "vendor": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.CreateVIRResponse": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "createdBy": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "vir_number": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.CreatedByData": {
            "type": "object",
            "required": [
                "data"
            ],
            "properties": {
                "data": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.UserData"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.DocumentSignedURLAPIResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.DocumentSignedURLResponse"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.DocumentSignedURLResponse": {
            "type": "object",
            "properties": {
                "url": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.DocumentUpload": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "documentType": {
                    "type": "string"
                },
                "entityId": {
                    "type": "integer"
                },
                "fileSize": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "mimeType": {
                    "type": "string"
                },
                "module": {
                    "type": "string"
                },
                "originalFileName": {
                    "type": "string"
                },
                "storagePath": {
                    "type": "string"
                },
                "storedFileName": {
                    "type": "string"
                },
                "uploadedBy": {
                    "type": "integer"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.GRNDetailResponse": {
            "type": "object",
            "properties": {
                "containerQuantity": {
                    "type": "integer"
                },
                "createdAt": {
                    "type": "string"
                },
                "grnNumber": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "invoice": {
                    "type": "string"
                },
                "invoiceDate": {
                    "type": "string"
                },
                "invoiceImg": {
                    "type": "string"
                },
                "packagingStatus": {
                    "type": "string"
                },
                "productName": {
                    "type": "string"
                },
                "qaqcStatus": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "updatedAt": {
                    "type": "string"
                },
                "vendorName": {
                    "type": "string"
                },
                "virNumber": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.GRNResponse": {
            "type": "object",
            "properties": {
                "container_qty": {
                    "type": "integer"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "string"
                },
                "grn_number": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "invoice": {
                    "type": "string"
                },
                "invoice_date": {
                    "type": "string"
                },
                "invoice_img": {
                    "type": "string"
                },
                "packaging_status": {
                    "type": "string"
                },
                "product_name": {
                    "type": "string"
                },
                "qaqc_status": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "vendor_name": {
                    "type": "string"
                },
                "vir_number": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.ListDocumentsAPIResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.ListDocumentsResponse"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.ListDocumentsResponse": {
            "type": "object",
            "properties": {
                "documents": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.DocumentUpload"
                    }
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.QAQCEntry": {
            "type": "object",
            "properties": {
                "analysedBy": {
                    "type": "string"
                },
                "analystRemark": {
                    "type": "string"
                },
                "approvedBy": {
                    "type": "string"
                },
                "arNumber": {
                    "type": "string"
                },
                "containersSampled": {
                    "type": "integer"
                },
                "createdAt": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "moistureContent": {
                    "type": "string"
                },
                "potency": {
                    "type": "string"
                },
                "processRef": {
                    "type": "string"
                },
                "processType": {
                    "type": "string"
                },
                "releaseDate": {
                    "type": "string"
                },
                "sampledBy": {
                    "type": "string"
                },
                "sampledOn": {
                    "type": "string"
                },
                "sampledQuantity": {
                    "type": "integer"
                },
                "status": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                },
                "yieldPercent": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.SalesPO": {
            "type": "object",
            "properties": {
                "approvedAt": {
                    "type": "string"
                },
                "approvedById": {
                    "type": "integer"
                },
                "askingPrice": {
                    "type": "number"
                },
                "coaUrl": {
                    "type": "string"
                },
                "comments": {
                    "type": "string"
                },
                "companyAddress": {
                    "type": "string"
                },
                "companyContactEmail": {
                    "type": "string"
                },
                "companyContactName": {
                    "type": "string"
                },
                "companyContactNumber": {
                    "type": "string"
                },
                "companyName": {
                    "type": "string"
                },
                "createdAt": {
                    "type": "string"
                },
                "deliveryCode": {
                    "type": "string"
                },
                "expectedDeliveryDate": {
                    "type": "string"
                },
                "fulfillmentType": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOFulfillmentType"
                },
                "grade": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "inquiryNumber": {
                    "type": "string"
                },
                "packedAt": {
                    "type": "string"
                },
                "packedById": {
                    "type": "integer"
                },
                "poNumber": {
                    "type": "string"
                },
                "productName": {
                    "type": "string"
                },
                "productionBatchId": {
                    "type": "integer"
                },
                "purchaseOrderId": {
                    "type": "integer"
                },
                "purchasePrice": {
                    "type": "number"
                },
                "purity": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "quantityUnit": {
                    "type": "string"
                },
                "rejectedById": {
                    "type": "integer"
                },
                "rejectionReason": {
                    "type": "string"
                },
                "requestDate": {
                    "type": "string"
                },
                "requestType": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPORequestType"
                },
                "salesRepId": {
                    "type": "integer"
                },
                "sendTo": {
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatus"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.SalesPOAPIResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPO"
                },
                "success": {
                    "type": "boolean"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.SalesPOFulfillmentType": {
            "type": "string",
            "enum": [
                "purchase",
                "production"
            ],
            "x-enum-varnames": [
                "FulfillmentPurchase",
                "FulfillmentProduction"
            ]
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.SalesPOListAPIResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPO"
                    }
                },
                "success": {
                    "type": "boolean"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.SalesPORequestType": {
            "type": "string",
            "enum": [
                "sample",
                "purchase"
            ],
            "x-enum-varnames": [
                "RequestTypeSample",
                "RequestTypePurchase"
            ]
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatus": {
            "type": "string",
            "enum": [
                "quote_requested",
                "quote_admin_approved",
                "quote_sent_to_client",
                "client_negotiation",
                "client_approved",
                "final_admin_approved",
                "routed_to_purchase",
                "routed_to_production",
                "admin_rejected",
                "client_rejected",
                "cancelled",
                "purchase_completed",
                "production_completed",
                "production_approved",
                "closed",
                "purchase_priced",
                "purchase_approved"
            ],
            "x-enum-varnames": [
                "StatusQuoteRequested",
                "StatusQuoteAdminApproved",
                "StatusQuoteSentToClient",
                "StatusClientNegotiation",
                "StatusClientApproved",
                "StatusFinalAdminApproved",
                "StatusRoutedToPurchase",
                "StatusRoutedToProduction",
                "StatusAdminRejected",
                "StatusClientRejected",
                "StatusCancelled",
                "StatusPurchaseCompleted",
                "StatusProductionCompleted",
                "StatusProductionApproved",
                "StatusClosed",
                "StatusPurchasePriced",
                "StatusPurchaseApproved"
            ]
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatusLog": {
            "type": "object",
            "properties": {
                "changedAt": {
                    "type": "string"
                },
                "changedBy": {
                    "type": "integer"
                },
                "fromStatus": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatus"
                },
                "id": {
                    "type": "integer"
                },
                "note": {
                    "type": "string"
                },
                "poId": {
                    "type": "integer"
                },
                "toStatus": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatus"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatusLogAPIResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatusLog"
                    }
                },
                "success": {
                    "type": "boolean"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.UpdateSalesPOStatusRequest": {
            "type": "object",
            "properties": {
                "deliveryCode": {
                    "type": "string"
                },
                "fulfillmentType": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOFulfillmentType"
                },
                "newAskingPrice": {
                    "type": "number"
                },
                "newComments": {
                    "type": "string"
                },
                "newQuantity": {
                    "type": "number"
                },
                "poId": {
                    "type": "integer"
                },
                "purchasePrice": {
                    "type": "number"
                },
                "rejectionReason": {
                    "type": "string"
                },
                "sendTo": {
                    "description": "✅ NEW",
                    "type": "string"
                },
                "toStatus": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.SalesPOStatus"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.UploadDocumentsAPIResponse": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.UploadDocumentsResponse"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.UploadDocumentsResponse": {
            "type": "object",
            "properties": {
                "documents": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.DocumentUpload"
                    }
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.UserData": {
            "type": "object",
            "required": [
                "id"
            ],
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "phone_num": {
                    "type": "integer"
                },
                "role": {
                    "type": "string"
                },
                "username": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.VIR": {
            "type": "object",
            "properties": {
                "checked_at": {
                    "type": "string"
                },
                "checked_by": {
                    "type": "integer"
                },
                "checklist": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "product_id": {
                    "type": "integer"
                },
                "product_name": {
                    "type": "string"
                },
                "remarks": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "vendor_id": {
                    "type": "integer"
                },
                "vendor_name": {
                    "type": "string"
                },
                "vir_number": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.VerifyQAQCRequest": {
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "analystRemark": {
                    "type": "string"
                },
                "approvedBy": {
                    "description": "Deprecated: ignored by backend; approved_by comes from authenticated context.",
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.VerifyQAQCResponse": {
            "type": "object",
            "properties": {
                "entry": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.QAQCEntry"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.VerifyVIRRequest": {
            "type": "object",
            "properties": {
                "checkedAt": {
                    "description": "Deprecated: ignored by backend; checked_at comes from backend time.",
                    "type": "string"
                },
                "checkedBy": {
                    "description": "Deprecated: ignored by backend; checked_by comes from authenticated context.",
                    "allOf": [
                        {
                            "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models.CheckedByData"
                        }
                    ]
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models.VerifyVIRResponse": {
            "type": "object",
            "properties": {
                "checkedAt": {
                    "type": "string"
                },
                "checkedBy": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "vir_number": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ActiveLotProcessStepResponse": {
            "type": "object",
            "properties": {
                "batch_id": {
                    "type": "integer"
                },
                "batch_number": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "lot_id": {
                    "type": "integer"
                },
                "lot_number": {
                    "type": "string"
                },
                "process_code": {
                    "type": "string"
                },
                "process_definition_id": {
                    "type": "integer"
                },
                "process_name": {
                    "type": "string"
                },
                "product_id": {
                    "type": "integer"
                },
                "product_name": {
                    "type": "string"
                },
                "started_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "step_order": {
                    "type": "integer"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.AddWorkflowStepsRequest": {
            "type": "object",
            "required": [
                "steps"
            ],
            "properties": {
                "steps": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.WorkflowStepInput"
                    }
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchDetailResponse": {
            "type": "object",
            "properties": {
                "batch_number": {
                    "type": "string"
                },
                "completed_at": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "current_quantity": {
                    "type": "number"
                },
                "final_quantity": {
                    "type": "number"
                },
                "grn_number": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "input_quantity": {
                    "type": "number"
                },
                "product_id": {
                    "type": "integer"
                },
                "product_name": {
                    "type": "string"
                },
                "source_grn_id": {
                    "type": "integer"
                },
                "started_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "workflow_id": {
                    "type": "integer"
                },
                "yield_percent": {
                    "type": "number"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchHistoryLot": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "lot_number": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "status": {
                    "type": "string"
                },
                "steps": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchHistoryStep"
                    }
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchHistoryResponse": {
            "type": "object",
            "properties": {
                "batch_number": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "lots": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchHistoryLot"
                    }
                },
                "product_name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchHistoryStep": {
            "type": "object",
            "properties": {
                "completed_at": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "process_name": {
                    "type": "string"
                },
                "started_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "step_order": {
                    "type": "integer"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.BatchListResponse": {
            "type": "object",
            "properties": {
                "batch_number": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "grn_number": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "product_name": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.CompleteLotProcessStepRequest": {
            "type": "object",
            "required": [
                "quantity_out"
            ],
            "properties": {
                "loss_reason": {
                    "type": "string"
                },
                "operator_notes": {
                    "type": "string"
                },
                "quantity_loss": {
                    "type": "number"
                },
                "quantity_out": {
                    "type": "number"
                },
                "supervisor_notes": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.CompleteProcessExecutionRequest": {
            "type": "object",
            "properties": {
                "equipmentUsed": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "formData": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "lossReason": {
                    "type": "string"
                },
                "operatorNotes": {
                    "type": "string"
                },
                "outputs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionOutputEntry"
                    }
                },
                "quantityLoss": {
                    "type": "number"
                },
                "quantityOut": {
                    "type": "number"
                },
                "supervisorNotes": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateBatchRequest": {
            "type": "object",
            "required": [
                "grnNumber",
                "quantity"
            ],
            "properties": {
                "grnNumber": {
                    "type": "string"
                },
                "quantity": {
                    "type": "number"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateBatchResponse": {
            "type": "object",
            "properties": {
                "batch_number": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateCustomerRequest": {
            "type": "object",
            "required": [
                "customer_name"
            ],
            "properties": {
                "address_line_1": {
                    "type": "string"
                },
                "address_line_2": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "contact_person": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "customer_code": {
                    "type": "string"
                },
                "customer_name": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "gst_number": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "pincode": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateProcessExecutionRequest": {
            "type": "object",
            "properties": {
                "batchId": {
                    "type": "integer"
                },
                "equipmentUsed": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "formData": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "inputs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionInputEntry"
                    }
                },
                "lotProcessStepId": {
                    "type": "integer"
                },
                "operatorNotes": {
                    "type": "string"
                },
                "processCode": {
                    "type": "string"
                },
                "processDefinitionId": {
                    "type": "integer"
                },
                "quantityIn": {
                    "type": "number"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateProductRequest": {
            "type": "object",
            "required": [
                "material_type",
                "name",
                "unit_of_measure"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "material_type": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "unit_of_measure": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.CreateWorkflowRequest": {
            "type": "object",
            "required": [
                "name",
                "product_id"
            ],
            "properties": {
                "description": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "product_id": {
                    "type": "integer"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.Customer": {
            "type": "object",
            "properties": {
                "address_line_1": {
                    "type": "string"
                },
                "address_line_2": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "contact_person": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "customer_code": {
                    "type": "string"
                },
                "customer_name": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "gst_number": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "is_active": {
                    "type": "boolean"
                },
                "phone": {
                    "type": "string"
                },
                "pincode": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryLotLineageResponse": {
            "type": "object",
            "properties": {
                "child_lots": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.LotLineageResponse"
                    }
                },
                "parent_lots": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.LotLineageResponse"
                    }
                },
                "selected_lot": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryLotResponse"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryLotResponse": {
            "type": "object",
            "properties": {
                "available_quantity": {
                    "type": "number"
                },
                "batch_id": {
                    "type": "integer"
                },
                "batch_number": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "created_by_name": {
                    "type": "string"
                },
                "current_location": {
                    "type": "string"
                },
                "grn_number": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "inventory_type": {
                    "type": "string"
                },
                "lot_number": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "original_quantity": {
                    "type": "number"
                },
                "process_code": {
                    "type": "string"
                },
                "process_name": {
                    "type": "string"
                },
                "product_id": {
                    "type": "integer"
                },
                "product_name": {
                    "type": "string"
                },
                "source_grn_id": {
                    "type": "integer"
                },
                "source_process_execution_id": {
                    "type": "integer"
                },
                "source_type": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "unit_of_measure": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.InventoryTransactionResponse": {
            "type": "object",
            "properties": {
                "balance_after": {
                    "type": "number"
                },
                "batch_id": {
                    "type": "integer"
                },
                "batch_number": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "created_by_name": {
                    "type": "string"
                },
                "grn_id": {
                    "type": "integer"
                },
                "grn_number": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "inventory_lot_id": {
                    "type": "integer"
                },
                "lot_number": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "process_code": {
                    "type": "string"
                },
                "process_execution_id": {
                    "type": "integer"
                },
                "process_name": {
                    "type": "string"
                },
                "product_id": {
                    "type": "integer"
                },
                "product_name": {
                    "type": "string"
                },
                "quantity_change": {
                    "type": "number"
                },
                "reason": {
                    "type": "string"
                },
                "reference_id": {
                    "type": "integer"
                },
                "reference_type": {
                    "type": "string"
                },
                "transaction_type": {
                    "type": "string"
                },
                "unit_of_measure": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.LotLineageResponse": {
            "type": "object",
            "properties": {
                "batch_id": {
                    "type": "integer"
                },
                "batch_number": {
                    "type": "string"
                },
                "child_inventory_lot_id": {
                    "type": "integer"
                },
                "child_lot_number": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "created_by_name": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "notes": {
                    "type": "string"
                },
                "operation_type": {
                    "type": "string"
                },
                "parent_inventory_lot_id": {
                    "type": "integer"
                },
                "parent_lot_number": {
                    "type": "string"
                },
                "process_code": {
                    "type": "string"
                },
                "process_execution_id": {
                    "type": "integer"
                },
                "process_name": {
                    "type": "string"
                },
                "quantity_contributed": {
                    "type": "number"
                },
                "unit_of_measure": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.LotProcessStepActionResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string"
                },
                "step": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_models_v2.LotProcessStepDetailResponse"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.LotProcessStepDetailResponse": {
            "type": "object",
            "properties": {
                "batch_id": {
                    "type": "integer"
                },
                "batch_number": {
                    "type": "string"
                },
                "completed_at": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "is_skipped": {
                    "type": "boolean"
                },
                "lot_id": {
                    "type": "integer"
                },
                "lot_number": {
                    "type": "string"
                },
                "process_code": {
                    "type": "string"
                },
                "process_definition_id": {
                    "type": "integer"
                },
                "process_name": {
                    "type": "string"
                },
                "retry_count": {
                    "type": "integer"
                },
                "skip_reason": {
                    "type": "string"
                },
                "started_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "step_order": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                },
                "workflow_step_id": {
                    "type": "integer"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessDefinitionResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "createdAt": {
                    "type": "string"
                },
                "defaultDepartment": {
                    "type": "string"
                },
                "defaultFormSchema": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "isActive": {
                    "type": "boolean"
                },
                "isManufacturingProcess": {
                    "type": "boolean"
                },
                "moduleKey": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionInputEntry": {
            "type": "object",
            "required": [
                "inventoryLotId",
                "quantity"
            ],
            "properties": {
                "inventoryLotId": {
                    "type": "integer"
                },
                "quantity": {
                    "type": "number"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionInputResponse": {
            "type": "object",
            "properties": {
                "batch_id": {
                    "type": "integer"
                },
                "batch_number": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "created_by_name": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "inventory_lot_id": {
                    "type": "integer"
                },
                "inventory_transaction_id": {
                    "type": "integer"
                },
                "lot_number": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "process_code": {
                    "type": "string"
                },
                "process_execution_id": {
                    "type": "integer"
                },
                "process_name": {
                    "type": "string"
                },
                "product_id": {
                    "type": "integer"
                },
                "product_name": {
                    "type": "string"
                },
                "quantity_consumed": {
                    "type": "number"
                },
                "unit_of_measure": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionOutputEntry": {
            "type": "object",
            "required": [
                "inventoryType",
                "productId",
                "quantity",
                "unitOfMeasure"
            ],
            "properties": {
                "currentLocation": {
                    "type": "string"
                },
                "inventoryType": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "productId": {
                    "type": "integer"
                },
                "quantity": {
                    "type": "number"
                },
                "unitOfMeasure": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionOutputResponse": {
            "type": "object",
            "properties": {
                "batch_id": {
                    "type": "integer"
                },
                "batch_number": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "created_by_name": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "inventory_lot_id": {
                    "type": "integer"
                },
                "inventory_transaction_id": {
                    "type": "integer"
                },
                "lot_number": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "output_type": {
                    "type": "string"
                },
                "process_code": {
                    "type": "string"
                },
                "process_execution_id": {
                    "type": "integer"
                },
                "process_name": {
                    "type": "string"
                },
                "product_id": {
                    "type": "integer"
                },
                "product_name": {
                    "type": "string"
                },
                "quantity_produced": {
                    "type": "number"
                },
                "unit_of_measure": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessExecutionResponse": {
            "type": "object",
            "properties": {
                "completedAt": {
                    "type": "string"
                },
                "completedBy": {
                    "type": "integer"
                },
                "createdAt": {
                    "type": "string"
                },
                "durationMinutes": {
                    "type": "integer"
                },
                "equipmentUsed": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "formData": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "formDataVersion": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "lossReason": {
                    "type": "string"
                },
                "lotProcessStepId": {
                    "type": "integer"
                },
                "operatorNotes": {
                    "type": "string"
                },
                "quantityIn": {
                    "type": "number"
                },
                "quantityLoss": {
                    "type": "number"
                },
                "quantityOut": {
                    "type": "number"
                },
                "startedAt": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "supervisorNotes": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                },
                "verifiedAt": {
                    "type": "string"
                },
                "verifiedBy": {
                    "type": "integer"
                },
                "yieldPercent": {
                    "type": "number"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ProcessStepBoardCardResponse": {
            "type": "object",
            "properties": {
                "batchId": {
                    "type": "integer"
                },
                "batchNumber": {
                    "type": "string"
                },
                "completedAt": {
                    "type": "string"
                },
                "currentStage": {
                    "type": "string"
                },
                "lastUpdatedAt": {
                    "type": "string"
                },
                "lastUpdatedBy": {
                    "type": "string"
                },
                "lotId": {
                    "type": "integer"
                },
                "lotNumber": {
                    "type": "string"
                },
                "processCode": {
                    "type": "string"
                },
                "processDefinitionId": {
                    "type": "integer"
                },
                "processName": {
                    "type": "string"
                },
                "productId": {
                    "type": "integer"
                },
                "productName": {
                    "type": "string"
                },
                "qaqcRequired": {
                    "type": "boolean"
                },
                "quantity": {
                    "type": "number"
                },
                "startedAt": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "stepId": {
                    "type": "integer"
                },
                "unit": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.Product": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "is_active": {
                    "type": "boolean"
                },
                "material_type": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "unit_of_measure": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.ProductWorkflow": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "created_by": {
                    "type": "integer"
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "is_active": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                },
                "product_id": {
                    "type": "integer"
                },
                "version": {
                    "type": "integer"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateCustomerRequest": {
            "type": "object",
            "required": [
                "customer_name"
            ],
            "properties": {
                "address_line_1": {
                    "type": "string"
                },
                "address_line_2": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "contact_person": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "customer_code": {
                    "type": "string"
                },
                "customer_name": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "gst_number": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "pincode": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateCustomerStatusRequest": {
            "type": "object",
            "properties": {
                "is_active": {
                    "type": "boolean"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateProcessDefinitionFormSchemaRequest": {
            "type": "object",
            "required": [
                "defaultFormSchema"
            ],
            "properties": {
                "defaultFormSchema": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateProcessExecutionProgressRequest": {
            "type": "object",
            "properties": {
                "equipmentUsed": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "formData": {
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                },
                "operatorNotes": {
                    "type": "string"
                },
                "quantityIn": {
                    "type": "number"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateProductRequest": {
            "type": "object",
            "required": [
                "material_type",
                "name",
                "unit_of_measure"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "material_type": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "unit_of_measure": {
                    "type": "string"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.UpdateProductStatusRequest": {
            "type": "object",
            "properties": {
                "is_active": {
                    "type": "boolean"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_models_v2.WorkflowStepInput": {
            "type": "object",
            "properties": {
                "is_required": {
                    "type": "boolean"
                },
                "process_definition_id": {
                    "type": "integer"
                },
                "qaqc_required": {
                    "type": "boolean"
                },
                "step_order": {
                    "type": "integer"
                }
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_utils.APIError": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "details": {}
            }
        },
        "github_com_paaart_kavalife-erp-backend_internal_utils.APIResponse": {
            "type": "object",
            "properties": {
                "data": {},
                "error": {
                    "$ref": "#/definitions/github_com_paaart_kavalife-erp-backend_internal_utils.APIError"
                },
                "message": {
                    "type": "string"
                },
                "meta": {},
                "success": {
                    "type": "boolean"
                }
            }
        },
        "internal_routes.HealthResponse": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string",
                    "example": "ok"
                }
            }
        },
        "internal_services_v2.processDefinitionAPIResponse": {
            "type": "object",
            "properties": {
                "data": {},
                "error": {
                    "$ref": "#/definitions/internal_services_v2.processDefinitionErrorResponse"
                },
                "message": {
                    "type": "string"
                },
                "meta": {},
                "success": {
                    "type": "boolean"
                }
            }
        },
        "internal_services_v2.processDefinitionErrorResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "details": {
                    "type": "string"
                }
            }
        },
        "internal_services_v2.processExecutionAPIResponse": {
            "type": "object",
            "properties": {
                "data": {},
                "error": {
                    "$ref": "#/definitions/internal_services_v2.processExecutionErrorResponse"
                },
                "message": {
                    "type": "string"
                },
                "meta": {},
                "success": {
                    "type": "boolean"
                }
            }
        },
        "internal_services_v2.processExecutionErrorResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "details": {
                    "type": "string"
                }
            }
        }
    }
}