{
  "openapi": "3.0.1",
  "info": {
    "title": "Rosistem API",
    "description": "\r\nREST API v1 - [www.rosistem.com](https://www.rosistem.com)\r\n\r\nEndpoints for ERP integrations, e-commerce platforms and internal components.\r\n\r\n### Authentication & tenant routing\r\n- **`X-API-KEY`** (required header).\r\n- Each API key is bound to **exactly one tenant** (via `TenantShortName` on the key record). The middleware resolves the key → tenant → SQL database; all subsequent reads/writes happen on that tenant's DB.\r\n- Keys without a bound tenant (`TenantShortName` NULL) operate on the master DB (`rosistem`) — backward compat for keys generated before multi-tenant.\r\n- If the key is bound to a tenant that is not configured (`Tenants.json` missing it), the API returns **503** with a clear error.\r\n\r\n### Versioning & naming\r\n- All endpoints live under `/api/v1/...`. Old unversioned routes `/api/...` return **404**.\r\n- Routes use **PascalCase** (e.g. `PrintServer`, `ReceiptFlow`, `PurchaseOrders`). Kebab-case routes (`receipt-flow`, etc.) used in older releases were dropped — clients must update to the PascalCase form.\r\n\r\n### General conventions\r\n- **Pagination**: `?page=1&pageSize=50` (default 50, max 100). Response includes `Items`, `Total`, `Page`, `PageSize`.\r\n- **Filtering**: optional query string parameters (`partnerId`, `dateFrom`, `dateTo`, `isValidated`, etc.). Combined with AND.\r\n- **Date format**: ISO 8601 (`2026-05-10` or `2026-05-10T14:30:00Z`).\r\n- **Errors**: 400 with `{ errors: [...] }` for validation; 401 missing key; 404 not found; 500 internal errors (logged).\r\n\r\n### Documents workflow (header + lines)\r\nFor ERP integrations — a single request creates header + N lines in one transaction:\r\n```\r\nPOST /api/v1/Documents{Type}/with-lines\r\n{ \"header\": { ... }, \"lines\": [ ... ] }\r\n```\r\nSupported types: `DocumentsIn`, `DocumentsOut`, `DocumentsTransfer`, `DocumentsInventory`, `DocumentsReturn`, `DocumentsAssembly`, `DocumentsDisassembly`, `DocumentsConsumption`.\r\n\r\nThe created document is marked **`IsNew=true`, `IsValidated=false`, `IsImportedFromErp=true`** (stock commit happens separately via `PATCH /{id}/validate`).\r\n\r\n**MINIMUM example** (shown in Swagger UI when you open any `/with-lines` -> Example Value tab):\r\n```json\r\n{\r\n  \"header\": {\r\n    \"warehouseId\": 1,\r\n    \"partnerId\": 5,\r\n    \"documentDate\": \"2026-05-24T10:00:00\"\r\n  },\r\n  \"lines\": [ { \"productId\": 42, \"quantity\": 10 } ]\r\n}\r\n```\r\n\r\n### Entity lookup — 4 strategies in priority order (Id wins if multiple are supplied)\r\nFor each FK (Warehouse, Partner, Product, Status, Employee, User, Uom, Location):\r\n1. `*Id` - WMS primary key (int)\r\n2. `*Code` - WMS Code field (case-insensitive)\r\n3. `*InternalKey` - ERP id stored in WMS (when imported from ERP)\r\n4. `*ExternalKey` - ERP code stored in WMS\r\n\r\n**Same 4 strategies apply to both HEADER and LINES** in the `/with-lines` endpoints. Header FKs supported: Warehouse, Partner, Status, Employee, User. Line FKs supported: Product, Partner, Employee, User, Uom, LocationSource, LocationDestination, Location.\r\n\r\nIf the supplied key does not resolve, or matches more than one record (duplicate), the endpoint returns **400** with a clear message:\r\n- `\"WarehouseId 999 not found.\"`\r\n- `\"PartnerExternalKey 'FURN-X' not found.\"`\r\n- `\"Multiple matches for ProductCode 'ABC'. Field must be unique - clean duplicates or use Id.\"`\r\n\r\n### Support\r\nEmail: [support@rosistem.com](mailto:support@rosistem.com) - Web: [www.rosistem.com](https://www.rosistem.com)\r\n",
    "version": "v1"
  },
  "paths": {
    "/api/v1/AssemblyLines": {
      "get": {
        "tags": [
          "AssemblyLines"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of records",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AssemblyLineDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssemblyLineDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssemblyLineDtoPagedResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/AssemblyLines/{id}": {
      "get": {
        "tags": [
          "AssemblyLines"
        ],
        "summary": "Get record by ID",
        "description": "Returns single record matching the specified ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AssemblyLineDtoWithoutId"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssemblyLineDtoWithoutId"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssemblyLineDtoWithoutId"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/BarcodeLabels": {
      "get": {
        "tags": [
          "BarcodeLabels"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of records",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeLabelDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeLabelDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeLabelDtoPagedResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/BarcodeLabels/{id}": {
      "get": {
        "tags": [
          "BarcodeLabels"
        ],
        "summary": "Get record by ID",
        "description": "Returns single record matching the specified ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeLabelDtoWithoutId"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeLabelDtoWithoutId"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeLabelDtoWithoutId"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/BarcodeScanners": {
      "get": {
        "tags": [
          "BarcodeScanners"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of barcode scanners",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "BarcodeScanners"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodeScannerDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodeScannerDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodeScannerDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodeScannerDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/BarcodeScanners/{id}": {
      "delete": {
        "tags": [
          "BarcodeScanners"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "BarcodeScanners"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "BarcodeScanners"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodeScannerDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodeScannerDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodeScannerDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BarcodeScannerDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeScannerDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/CrossDocking": {
      "get": {
        "tags": [
          "CrossDocking"
        ],
        "summary": "Get a paged list of all cross-dock allocations.\r\nReturns all allocations sorted by CreatedAt descending.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status: 0=Pending, 1=Confirmed, 2=Completed, 3=Cancelled.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/CrossDocking/allocations": {
      "get": {
        "tags": [
          "CrossDocking"
        ],
        "summary": "Get all cross-dock allocations (optionally filtered by status).\r\nStatus: 0=Pending, 1=Confirmed, 2=Completed, 3=Cancelled",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "post": {
        "tags": [
          "CrossDocking"
        ],
        "summary": "Create a new cross-dock allocation: links an inbound line to an outbound line.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCrossDockAllocationRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCrossDockAllocationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCrossDockAllocationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCrossDockAllocationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/CrossDocking/allocations/{id}/complete": {
      "post": {
        "tags": [
          "CrossDocking"
        ],
        "summary": "Complete cross-dock allocation: goods have been physically delivered to outbound dock.\r\nCalled from the mobile terminal after the operator confirms delivery.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/CrossDocking/allocations/confirm": {
      "post": {
        "tags": [
          "CrossDocking"
        ],
        "summary": "Confirm cross-dock allocations (move from Pending to Confirmed).\r\nConfirmed allocations direct the receiving operator to staging area.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/CrossDocking/instructions/line/{lineInId}": {
      "get": {
        "tags": [
          "CrossDocking"
        ],
        "summary": "Get cross-dock instructions for a specific inbound document line.\r\nUsed by the mobile terminal during receiving: if the line has confirmed cross-dock\r\nallocations, the operator is instructed to take goods to the dock area.",
        "parameters": [
          {
            "name": "lineInId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/CrossDocking/matches": {
      "get": {
        "tags": [
          "CrossDocking"
        ],
        "summary": "Get cross-docking matches: products that appear in both open inbound and outbound documents.\r\nReturns potential cross-dock quantities per product.",
        "parameters": [
          {
            "name": "onlyWithMatch",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/DocumentsAssembly": {
      "get": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "List assembly / production documents (paged)",
        "description": "Returns paged assembly and production documents (BOM processing), sorted newest first.\r\n\r\n**Filters (all optional):**\r\n- `partnerId` — filter by partner ID (if assembly is partner-linked)\r\n- `dateFrom` — DocumentDate >= this date (ISO 8601, e.g. `2026-01-01`)\r\n- `dateTo` — DocumentDate <= this date (end of day inclusive)\r\n- `statusId` — filter by workflow status ID (use `GET /api/DocumentStatuses?documentType=5`)\r\n- `isValidated` — `true` = production committed (materials consumed, finished product added to stock); `false` = work order pending\r\n- `isNulled` — `true` = cancelled only; `false` = active only\r\n\r\n**Key fields:** `ProductId` (finished product), `Quantity` (output quantity), `FinalProductLocationId` (destination storage location for the assembled product).\r\n\r\n**Example:** `GET /api/DocumentsAssembly?isValidated=false&dateFrom=2026-01-01`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter: DocumentDate >= dateFrom (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter: DocumentDate <= dateTo (end of day inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "description": "Filter by workflow status ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isValidated",
            "in": "query",
            "description": "true = validated (materials consumed, finished product in stock); false = work order not yet executed.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isNulled",
            "in": "query",
            "description": "true = cancelled documents; false = active documents.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of assembly documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Create a new assembly / production document",
        "description": "Creates the assembly document header. Set `ProductId` (finished product), `Quantity` (output qty), and `FinalProductLocationId`. Then add raw material component lines via `POST /api/DocumentsLines`. Validate to execute production via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsAssembly/{id}": {
      "delete": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Delete assembly document",
        "description": "Hard-delete of the document header and its BOM lines. For validated documents use `PATCH /{id}/null` instead to preserve audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Get assembly document by ID",
        "description": "Returns the full assembly document header. Use `GET /api/DocumentsLines?documentId={id}` for BOM component lines (raw materials being consumed and quantities).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Assembly document record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Update assembly document",
        "description": "Full update of assembly document header fields. Cannot update validated or cancelled documents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsAssembly/{id}/confirm": {
      "patch": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Confirm assembly document (second approval)",
        "description": "Sets IsConfirmed=true and stamps ConfirmationDate. Represents a second-level approval (e.g. quality control sign-off on produced goods). Idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsAssembly/{id}/null": {
      "patch": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Cancel (null) assembly document",
        "description": "Sets IsNulled=true. If the document was already validated, stock movements are reversed (finished product removed, raw materials returned). Cannot be undone.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsAssembly/{id}/status": {
      "patch": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Change assembly document workflow status",
        "description": "Body: `{ \"StatusId\": N }`. Get available statuses from `GET /api/DocumentStatuses?documentType=5`. Common statuses: Draft, Scheduled, In Production, Quality Check, Completed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status changed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsAssembly/{id}/validate": {
      "patch": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Validate assembly document (execute production)",
        "description": "Sets IsValidated=true and stamps CompletionDate. Raw material components (lines) are consumed from stock and the finished product (ProductId, Quantity) is added to stock at FinalProductLocationId. Idempotent — safe to call multiple times.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsAssembly/with-lines": {
      "post": {
        "tags": [
          "DocumentsAssembly"
        ],
        "summary": "Create a new assembly document WITH its lines in a single call.\r\nDocument is created as IsNew=true, IsValidated=false (unvalidated).\r\nUse this when integrating from ERP — single JSON containing header + lines.",
        "description": "Creates a new DocumentsAssembly header AND its lines in a single transaction.\r\n\r\nThe created document is marked **IsNew = true** and **IsValidated = false** (unvalidated).\r\nUse this when integrating from ERP — caller sends a single JSON containing:\r\n- `Header` — same fields as for `POST /api/DocumentsAssembly`\r\n- `Lines` — array of line items (DocumentId on each line is auto-filled)\r\n\r\nAfter creation, you can validate stock movements via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document + lines created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsConsumption": {
      "get": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "List internal consumption documents (paged)",
        "description": "Returns paged internal consumption documents, sorted newest first.\r\n\r\n**Filters (all optional):**\r\n- `partnerId` — filter by internal department/cost centre partner ID\r\n- `dateFrom` — DocumentDate >= this date (ISO 8601, e.g. `2026-01-01`)\r\n- `dateTo` — DocumentDate <= this date (end of day inclusive)\r\n- `statusId` — filter by workflow status ID (use `GET /api/DocumentStatuses?documentType=8`)\r\n- `isValidated` — `true` = stock decrease committed; `false` = consumption request pending approval\r\n- `isNulled` — `true` = cancelled only; `false` = active only\r\n\r\n**Example:** `GET /api/DocumentsConsumption?isValidated=false&dateFrom=2026-01-01`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner/department ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter: DocumentDate >= dateFrom (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter: DocumentDate <= dateTo (end of day inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "description": "Filter by workflow status ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isValidated",
            "in": "query",
            "description": "true = validated (stock decrease committed); false = consumption not yet approved/executed.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isNulled",
            "in": "query",
            "description": "true = cancelled documents; false = active documents.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of internal consumption documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Create a new internal consumption document",
        "description": "Creates the consumption document header. Then add consumed product lines via `POST /api/DocumentsLines`. Validate to commit the stock decrease via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsConsumption/{id}": {
      "delete": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Delete internal consumption document",
        "description": "Hard-delete of the document header and its lines. For validated documents use `PATCH /{id}/null` instead to preserve audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Get internal consumption document by ID",
        "description": "Returns the full consumption document header. Use `GET /api/DocumentsLines?documentId={id}` for line items (products consumed and quantities).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consumption document record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Update internal consumption document",
        "description": "Full update of consumption document header fields. Cannot update validated or cancelled documents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsConsumption/{id}/confirm": {
      "patch": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Confirm consumption document (second approval)",
        "description": "Sets IsConfirmed=true and stamps ConfirmationDate. Represents a second-level approval (e.g. department manager authorizing the consumption). Idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsConsumption/{id}/null": {
      "patch": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Cancel (null) consumption document",
        "description": "Sets IsNulled=true. If the document was already validated, stock movements are reversed (consumed goods returned to stock). Cannot be undone.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsConsumption/{id}/status": {
      "patch": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Change consumption document workflow status",
        "description": "Body: `{ \"StatusId\": N }`. Get available statuses from `GET /api/DocumentStatuses?documentType=8`. Common statuses: Draft, Requested, Approved, Issued.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status changed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsConsumption/{id}/validate": {
      "patch": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Validate consumption document (commit stock decrease)",
        "description": "Sets IsValidated=true and stamps CompletionDate. Stock is decreased for the consumed goods without generating a sales transaction. Idempotent — safe to call multiple times.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsConsumption/with-lines": {
      "post": {
        "tags": [
          "DocumentsConsumption"
        ],
        "summary": "Create a new consumption document WITH its lines in a single call.\r\nDocument is created as IsNew=true, IsValidated=false (unvalidated).\r\nUse this when integrating from ERP — single JSON containing header + lines.",
        "description": "Creates a new DocumentsConsumption header AND its lines in a single transaction.\r\n\r\nThe created document is marked **IsNew = true** and **IsValidated = false** (unvalidated).\r\nUse this when integrating from ERP — caller sends a single JSON containing:\r\n- `Header` — same fields as for `POST /api/DocumentsConsumption`\r\n- `Lines` — array of line items (DocumentId on each line is auto-filled)\r\n\r\nAfter creation, you can validate stock movements via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document + lines created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsDisassembly": {
      "get": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "List disassembly documents (paged)",
        "description": "Returns paged disassembly documents (reverse production / kit break-down), sorted newest first.\r\n\r\n**Filters (all optional):**\r\n- `partnerId` — filter by partner ID (if disassembly is partner-linked)\r\n- `dateFrom` — DocumentDate >= this date (ISO 8601, e.g. `2026-01-01`)\r\n- `dateTo` — DocumentDate <= this date (end of day inclusive)\r\n- `statusId` — filter by workflow status ID (use `GET /api/DocumentStatuses?documentType=6`)\r\n- `isValidated` — `true` = stock movements committed (product disassembled); `false` = pending disassembly\r\n- `isNulled` — `true` = cancelled only; `false` = active only\r\n\r\n**Example:** `GET /api/DocumentsDisassembly?isValidated=false&dateFrom=2026-01-01`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter: DocumentDate >= dateFrom (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter: DocumentDate <= dateTo (end of day inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "description": "Filter by workflow status ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isValidated",
            "in": "query",
            "description": "true = validated (finished product consumed, components returned to stock); false = not yet executed.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isNulled",
            "in": "query",
            "description": "true = cancelled documents; false = active documents.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of disassembly documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Create a new disassembly document",
        "description": "Creates the disassembly document header. Specify the finished product to be broken down on the header. Then add component lines via `POST /api/DocumentsLines`. Validate to execute disassembly via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsDisassembly/{id}": {
      "delete": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Delete disassembly document",
        "description": "Hard-delete of the document header and its component lines. For validated documents use `PATCH /{id}/null` instead to preserve audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Get disassembly document by ID",
        "description": "Returns the full disassembly document header. Use `GET /api/DocumentsLines?documentId={id}` for component lines (the parts that will be returned to stock after disassembly).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disassembly document record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Update disassembly document",
        "description": "Full update of disassembly document header fields. Cannot update validated or cancelled documents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsDisassembly/{id}/confirm": {
      "patch": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Confirm disassembly document (second approval)",
        "description": "Sets IsConfirmed=true and stamps ConfirmationDate. Represents a second-level approval on the disassembly operation. Idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsDisassembly/{id}/null": {
      "patch": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Cancel (null) disassembly document",
        "description": "Sets IsNulled=true. If the document was already validated, stock movements are reversed (components removed, finished product restored). Cannot be undone.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsDisassembly/{id}/status": {
      "patch": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Change disassembly document workflow status",
        "description": "Body: `{ \"StatusId\": N }`. Get available statuses from `GET /api/DocumentStatuses?documentType=6`. Common statuses: Draft, Scheduled, In Progress, Completed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status changed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsDisassembly/{id}/validate": {
      "patch": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Validate disassembly document (execute disassembly)",
        "description": "Sets IsValidated=true and stamps CompletionDate. The finished product is removed from stock and its components (lines) are added back to stock. Idempotent — safe to call multiple times.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsDisassembly/with-lines": {
      "post": {
        "tags": [
          "DocumentsDisassembly"
        ],
        "summary": "Create a new disassembly document WITH its lines in a single call.\r\nDocument is created as IsNew=true, IsValidated=false (unvalidated).\r\nUse this when integrating from ERP — single JSON containing header + lines.",
        "description": "Creates a new DocumentsDisassembly header AND its lines in a single transaction.\r\n\r\nThe created document is marked **IsNew = true** and **IsValidated = false** (unvalidated).\r\nUse this when integrating from ERP — caller sends a single JSON containing:\r\n- `Header` — same fields as for `POST /api/DocumentsDisassembly`\r\n- `Lines` — array of line items (DocumentId on each line is auto-filled)\r\n\r\nAfter creation, you can validate stock movements via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document + lines created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsIn": {
      "get": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Get a paged list of inbound documents with optional filters.\r\nResults are sorted by DocumentDate descending (newest first).",
        "description": "Returns a paged list of DocumentsIn (goods receipts), sorted newest first.\r\n\r\n**Filters (all optional, combinable):**\r\n- `partnerId` — filter by supplier/partner. Get IDs from `GET /api/Partners`\r\n- `dateFrom` — include only documents with DocumentDate ≥ this date (ISO 8601, e.g. `2026-01-01`)\r\n- `dateTo` — include only documents with DocumentDate ≤ this date (end of day is inclusive)\r\n- `statusId` — filter by workflow status. Get IDs from `GET /api/DocumentStatuses?documentType=1`\r\n- `isValidated` — `true` = only validated (stock committed); `false` = only open/pending\r\n- `isNulled` — `true` = only cancelled documents; `false` = only active documents\r\n\r\n**Key response fields:**\r\n- `IsValidated` — whether stock has been committed to the WMS\r\n- `IsNulled` — whether the document has been cancelled\r\n- `DocumentSN` / `DocumentNo` — document series and number (e.g. NIR / 001234)\r\n- `PartnerId` / `PartnerName` — the supplier\r\n- `TotalValue` / `TotalValueVat` / `Total` — financial totals\r\n\r\n**Examples:**\r\n- Active open receipts: `GET /api/DocumentsIn?isValidated=false&isNulled=false`\r\n- Receipts from partner 5 in January 2026: `GET /api/DocumentsIn?partnerId=5&dateFrom=2026-01-01&dateTo=2026-01-31`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner/supplier ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter: DocumentDate ≥ dateFrom (ISO 8601, e.g. 2026-01-01).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter: DocumentDate ≤ dateTo (end of day inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "description": "Filter by workflow status ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isValidated",
            "in": "query",
            "description": "true = only validated documents (stock committed); false = only unvalidated.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isNulled",
            "in": "query",
            "description": "true = only cancelled documents; false = only active.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of inbound documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Create a new inbound document (goods receipt header).\r\nAfter creating the document, add line items via POST /api/DocumentsLines.\r\nTo commit stock, call PATCH /{id}/validate.",
        "description": "Creates a new DocumentIn header (goods receipt).\r\n\r\n**Typical workflow:**\r\n1. `POST /api/DocumentsIn` — create document header\r\n2. `POST /api/DocumentsLines` (multiple) — add product lines\r\n3. `PATCH /api/DocumentsIn/{id}/validate` — validate to commit stock\r\n\r\n**Key fields to supply:**\r\n- `WarehouseId` — destination warehouse\r\n- `PartnerId` — supplier partner\r\n- `DocumentDate` — receipt date\r\n- `DocumentSN` / `DocumentNo` — document series/number (or leave blank for auto-numbering)\r\n\r\nReturns the created document including server-assigned `ID`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsIn/{id}": {
      "delete": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Delete an inbound document.\r\nOnly allowed for documents that have not been validated.\r\nValidated documents should be cancelled via PATCH /{id}/null instead.",
        "description": "Hard-deletes the document header and all its lines. For validated documents, use `PATCH /{id}/null` (cancel) instead to preserve audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Document not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Get a single inbound document by ID.",
        "description": "Returns the full DocumentIn record. Use `GET /api/DocumentsLines?documentId={id}` to get the line items.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DocumentIn record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Document not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Update an inbound document header.\r\nOnly allowed for documents that have not been validated (IsValidated = false).",
        "description": "Full update of the document header fields. Supply the complete object. Note: updating a validated document may cause stock inconsistencies — use with caution.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated document",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Document not found"
          }
        }
      }
    },
    "/api/v1/DocumentsIn/{id}/confirm": {
      "patch": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Confirm a document (two-step approval workflow).\r\nSets IsConfirmed = true and records the confirmation timestamp.",
        "description": "Marks the document as confirmed (`IsConfirmed = true`) and sets `ConfirmationDate` to now.\r\n\r\nUsed in two-step approval workflows where a supervisor must confirm after the warehouse operator validates.\r\n\r\n**Idempotent:** calling confirm on an already-confirmed document has no effect.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Document not found"
          }
        }
      }
    },
    "/api/v1/DocumentsIn/{id}/null": {
      "patch": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Cancel (null) a document.\r\nSets IsNulled = true. Stock movements are reversed if the document was previously validated.\r\nA nulled document cannot be un-nulled.",
        "description": "Sets `IsNulled = true`. The document is treated as cancelled.\r\n\r\n**Caution:** if the document was already validated, cancelling it reverses the stock movements.\r\nA nulled document cannot be un-nulled via the API.\r\n\r\nReturns the updated document.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Document not found"
          }
        }
      }
    },
    "/api/v1/DocumentsIn/{id}/status": {
      "patch": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Change the workflow status of a document.\r\nStatuses are configured per installation — get available statuses from GET /api/DocumentStatuses.",
        "description": "Assigns a new workflow status to the document.\r\n\r\n**Body:** `{ \"StatusId\": 5 }`\r\n\r\nUse `GET /api/DocumentStatuses?documentType=1` to list statuses available for DocumentsIn.\r\nStatus changes are logged in the audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status changed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Document or status not found"
          }
        }
      }
    },
    "/api/v1/DocumentsIn/{id}/validate": {
      "patch": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Validate a document — commits stock movements to the WMS.\r\nSets IsValidated = true and records the completion timestamp.\r\nAfter validation, stock levels in ProductsStock are increased for all document lines.",
        "description": "Marks the document as validated (`IsValidated = true`) and sets `CompletionDate` to now.\r\n\r\n**Effect:** stock levels are committed — `ProductsStock.Quantity` increases for each document line.\r\n\r\n**Idempotent:** calling validate on an already-validated document has no effect.\r\n\r\nReturns the updated document.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document validated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Document not found"
          }
        }
      }
    },
    "/api/v1/DocumentsIn/with-lines": {
      "post": {
        "tags": [
          "DocumentsIn"
        ],
        "summary": "Create a new in document WITH its lines in a single call.\r\nDocument is created as IsNew=true, IsValidated=false (unvalidated).\r\nUse this when integrating from ERP — single JSON containing header + lines.",
        "description": "Creates a new DocumentsIn header AND its lines in a single transaction.\r\n\r\nThe created document is marked **IsNew = true**, **IsValidated = false** and **IsImportedFromErp = true** (auto).\r\nAfter creation, you can validate stock movements via `PATCH /{id}/validate`.\r\n\r\n### Required (minimum)\r\n- Header: **Warehouse** + **Partner** + **DocumentDate**\r\n- Lines: minim 1, fiecare cu **Product** + **Quantity > 0**\r\n\r\n### Entity lookup — 4 strategii in ordine (Id castiga daca trimitesi mai multe)\r\n1. **`*Id`** — WMS primary key (int)\r\n2. **`*Code`** — WMS Code field (case-insensitive)\r\n3. **`*InternalKey`** — ERP id pastrat in WMS\r\n4. **`*ExternalKey`** — ERP code pastrat in WMS\r\n\r\nDaca o cheie e furnizata dar nu rezolva (sau >1 match), endpoint returneaza 400 cu mesaj clar.\r\n\r\n### Exemplu MINIM (doar campurile required)\r\n```json\r\n{\r\n  \"header\": {\r\n    \"warehouseId\": 1,\r\n    \"partnerId\": 5,\r\n    \"documentDate\": \"2026-05-24T10:00:00\"\r\n  },\r\n  \"lines\": [\r\n    { \"productId\": 42, \"quantity\": 10 }\r\n  ]\r\n}\r\n```\r\n\r\n### Exemplu cu lookup ERP (cand integrarea nu cunoaste Id-urile WMS)\r\n```json\r\n{\r\n  \"header\": {\r\n    \"warehouseInternalKey\": \"1\",\r\n    \"partnerExternalKey\": \"FURN-001\",\r\n    \"documentDate\": \"2026-05-24T10:00:00\",\r\n    \"documentNo\": \"IN-2026-1234\"\r\n  },\r\n  \"lines\": [\r\n    { \"productInternalKey\": \"100\", \"quantity\": 10 },\r\n    { \"productExternalKey\": \"PROD-X\", \"quantity\": 5 },\r\n    { \"productCode\": \"ABC123\", \"quantity\": 2 }\r\n  ]\r\n}\r\n```\r\n\r\n### Eroare clara (HTTP 400) cand lookup esueaza\r\n```json\r\n{\r\n  \"errors\": [\r\n    \"PartnerExternalKey 'FURN-999' not found.\",\r\n    \"Lines[2].ProductCode 'XYZ' not found.\"\r\n  ]\r\n}\r\n```",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document + lines created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error - missing required fields, unknown entity reference, or duplicate match"
          }
        }
      }
    },
    "/api/v1/DocumentsInventory": {
      "get": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "List inventory count documents (paged)",
        "description": "Returns paged inventory count / stock adjustment documents, sorted newest first.\r\n\r\n**Filters (all optional):**\r\n- `partnerId` — filter by partner ID (if counts are partner-linked)\r\n- `dateFrom` — DocumentDate >= this date (ISO 8601, e.g. `2026-01-01`)\r\n- `dateTo` — DocumentDate <= this date (end of day inclusive)\r\n- `statusId` — filter by workflow status ID (use `GET /api/DocumentStatuses?documentType=4`)\r\n- `isValidated` — `true` = stock adjustments committed; `false` = count in progress\r\n- `isNulled` — `true` = cancelled only; `false` = active only\r\n\r\n**Key fields:** `InventoryLocationId` (location being counted), `InventoryEmployeeId` (employee performing the count).\r\n\r\n**Example:** `GET /api/DocumentsInventory?isValidated=false&dateFrom=2026-01-01`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter: DocumentDate >= dateFrom (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter: DocumentDate <= dateTo (end of day inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "description": "Filter by workflow status ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isValidated",
            "in": "query",
            "description": "true = validated (stock adjustments committed); false = count not yet finalized.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isNulled",
            "in": "query",
            "description": "true = cancelled documents; false = active documents.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of inventory count documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Create a new inventory count document",
        "description": "Creates the inventory document header. Set `InventoryLocationId` to specify which location is being counted and `InventoryEmployeeId` for the counter. Then add lines via `POST /api/DocumentsLines`. Validate to commit stock adjustments via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsInventory/{id}": {
      "delete": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Delete inventory count document",
        "description": "Hard-delete of the document header and its lines. For validated documents use `PATCH /{id}/null` instead to preserve audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Get inventory count document by ID",
        "description": "Returns the full inventory document header. Use `GET /api/DocumentsLines?documentId={id}` for line items (products, system quantities, counted quantities, and adjustments).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inventory document record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Update inventory count document",
        "description": "Full update of inventory document header fields. Cannot update validated or cancelled documents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsInventory/{id}/confirm": {
      "patch": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Confirm inventory document (second approval)",
        "description": "Sets IsConfirmed=true and stamps ConfirmationDate. Represents a second-level approval (e.g. manager sign-off on the count results). Idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsInventory/{id}/null": {
      "patch": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Cancel (null) inventory document",
        "description": "Sets IsNulled=true. If the document was already validated, stock adjustments are reversed. Cannot be undone — use with caution.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsInventory/{id}/status": {
      "patch": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Change inventory document workflow status",
        "description": "Body: `{ \"StatusId\": N }`. Get available statuses from `GET /api/DocumentStatuses?documentType=4`. Common statuses: Draft, Counting, Reviewed, Approved.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status changed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsInventory/{id}/validate": {
      "patch": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Validate inventory document (commit stock adjustments)",
        "description": "Sets IsValidated=true and stamps CompletionDate. Stock levels are adjusted to match the physical count recorded in the document lines. Idempotent — safe to call multiple times.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsInventory/with-lines": {
      "post": {
        "tags": [
          "DocumentsInventory"
        ],
        "summary": "Create a new inventory document WITH its lines in a single call.\r\nDocument is created as IsNew=true, IsValidated=false (unvalidated).\r\nUse this when integrating from ERP — single JSON containing header + lines.",
        "description": "Creates a new DocumentsInventory header AND its lines in a single transaction.\r\n\r\nThe created document is marked **IsNew = true** and **IsValidated = false** (unvalidated).\r\nUse this when integrating from ERP — caller sends a single JSON containing:\r\n- `Header` — same fields as for `POST /api/DocumentsInventory`\r\n- `Lines` — array of line items (DocumentId on each line is auto-filled)\r\n\r\nAfter creation, you can validate stock movements via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document + lines created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsLines": {
      "get": {
        "tags": [
          "DocumentsLines"
        ],
        "summary": "Get all lines for a document",
        "description": "Returns paged list of document lines. Filter by documentId to get lines for a specific document.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "documentId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsLines"
        ],
        "summary": "Create new line",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/DocumentsLines/{id}": {
      "delete": {
        "tags": [
          "DocumentsLines"
        ],
        "summary": "Delete line",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsLines"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsLines"
        ],
        "summary": "Update existing line",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/DocumentsLinesLots": {
      "get": {
        "tags": [
          "DocumentsLinesLots"
        ],
        "summary": "Get lots for a document line",
        "description": "Returns paged list of lots. Filter by documentId or documentLineId.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "documentId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "documentLineId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsLinesLots"
        ],
        "summary": "Create new lot",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineLotDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineLotDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineLotDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineLotDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/DocumentsLinesLots/{id}": {
      "delete": {
        "tags": [
          "DocumentsLinesLots"
        ],
        "summary": "Delete lot",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsLinesLots"
        ],
        "summary": "Get lot by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsLinesLots"
        ],
        "summary": "Update existing lot",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineLotDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineLotDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineLotDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineLotDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineLotDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/DocumentsLinesSerialNumbers": {
      "get": {
        "tags": [
          "DocumentsLinesSerialNumbers"
        ],
        "summary": "Get serial numbers for a document line",
        "description": "Returns paged list of serial numbers. Filter by documentId or documentLineId.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "documentId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "documentLineId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsLinesSerialNumbers"
        ],
        "summary": "Create new serial number",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineSerialNumberDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineSerialNumberDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineSerialNumberDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineSerialNumberDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/DocumentsLinesSerialNumbers/{id}": {
      "delete": {
        "tags": [
          "DocumentsLinesSerialNumbers"
        ],
        "summary": "Delete serial number",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsLinesSerialNumbers"
        ],
        "summary": "Get serial number by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsLinesSerialNumbers"
        ],
        "summary": "Update serial number",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineSerialNumberDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineSerialNumberDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineSerialNumberDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLineSerialNumberDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/DocumentsOut": {
      "get": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "List outbound documents (paged)",
        "description": "Returns paged outbound documents (sales orders, picking lists, shipments), sorted newest first.\r\n\r\n**Filters (all optional):**\r\n- `partnerId` — filter by partner/customer ID\r\n- `dateFrom` — DocumentDate >= this date (ISO 8601, e.g. `2026-01-01`)\r\n- `dateTo` — DocumentDate <= this date (end of day inclusive)\r\n- `statusId` — filter by workflow status ID (use `GET /api/DocumentStatuses?documentType=2`)\r\n- `isValidated` — `true` = stock committed (shipment confirmed); `false` = pending picking\r\n- `isNulled` — `true` = cancelled only; `false` = active only\r\n\r\n**Key fields:** `LocationSourceId` (picking location), `PickingLocationId`.\r\n\r\n**Example:** `GET /api/DocumentsOut?isValidated=false&dateFrom=2026-01-01`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner/customer ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter: DocumentDate >= dateFrom (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter: DocumentDate <= dateTo (end of day inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "description": "Filter by workflow status ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isValidated",
            "in": "query",
            "description": "true = validated (stock committed/shipped); false = not yet validated.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isNulled",
            "in": "query",
            "description": "true = cancelled documents; false = active documents.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of outbound documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Create a new outbound document",
        "description": "Creates the outbound document header. Then add line items via `POST /api/DocumentsLines`. Validate (commit stock decrease) via `PATCH /{id}/validate`. Set `LocationSourceId` for the picking location.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsOut/{id}": {
      "delete": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Delete outbound document",
        "description": "Hard-delete of the document header and its lines. For validated documents use `PATCH /{id}/null` instead to preserve audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Get outbound document by ID",
        "description": "Returns the full outbound document header. Use `GET /api/DocumentsLines?documentId={id}` for line items (products, quantities, picking locations).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Outbound document record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Update outbound document",
        "description": "Full update of outbound document header fields. Cannot update validated or cancelled documents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsOut/{id}/confirm": {
      "patch": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Confirm outbound document (second approval)",
        "description": "Sets IsConfirmed=true and stamps ConfirmationDate. Represents a second-level approval (e.g. warehouse manager sign-off on the shipment). Idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsOut/{id}/null": {
      "patch": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Cancel (null) outbound document",
        "description": "Sets IsNulled=true. If the document was already validated, stock movements are reversed. Cannot be undone — use with caution.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsOut/{id}/status": {
      "patch": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Change outbound document workflow status",
        "description": "Body: `{ \"StatusId\": N }`. Get available statuses from `GET /api/DocumentStatuses?documentType=2`. Common statuses: Draft, Picking, Packed, Shipped.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status changed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsOut/{id}/validate": {
      "patch": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Validate outbound document (commit stock decrease)",
        "description": "Sets IsValidated=true and stamps CompletionDate. Stock is decreased at the source picking location (LocationSourceId). Idempotent — safe to call multiple times.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsOut/with-lines": {
      "post": {
        "tags": [
          "DocumentsOut"
        ],
        "summary": "Create a new out document WITH its lines in a single call.\r\nDocument is created as IsNew=true, IsValidated=false (unvalidated).\r\nUse this when integrating from ERP — single JSON containing header + lines.",
        "description": "Creates a new DocumentsOut header AND its lines in a single transaction.\r\n\r\nThe created document is marked **IsNew = true** and **IsValidated = false** (unvalidated).\r\nUse this when integrating from ERP — caller sends a single JSON containing:\r\n- `Header` — same fields as for `POST /api/DocumentsOut`\r\n- `Lines` — array of line items (DocumentId on each line is auto-filled)\r\n\r\nAfter creation, you can validate stock movements via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document + lines created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsReturn": {
      "get": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "List return documents (paged)",
        "description": "Returns paged return documents (customer returns and returns to supplier), sorted newest first.\r\n\r\n**Filters (all optional):**\r\n- `partnerId` — filter by partner/customer ID\r\n- `dateFrom` — DocumentDate >= this date (ISO 8601, e.g. `2026-01-01`)\r\n- `dateTo` — DocumentDate <= this date (end of day inclusive)\r\n- `statusId` — filter by workflow status ID (use `GET /api/DocumentStatuses?documentType=7`)\r\n- `isValidated` — `true` = stock adjusted (return processed); `false` = return pending inspection/approval\r\n- `isNulled` — `true` = cancelled only; `false` = active only\r\n\r\n**Note:** All lines have `IsReturn = true`. Direction (customer return vs. supplier return) is determined by context/partner type.\r\n\r\n**Example:** `GET /api/DocumentsReturn?isValidated=false&dateFrom=2026-01-01`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner/customer ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter: DocumentDate >= dateFrom (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter: DocumentDate <= dateTo (end of day inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "description": "Filter by workflow status ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isValidated",
            "in": "query",
            "description": "true = validated (stock adjusted for the return); false = return not yet processed.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isNulled",
            "in": "query",
            "description": "true = cancelled documents; false = active documents.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of return documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Create a new return document",
        "description": "Creates the return document header. Then add returned product lines via `POST /api/DocumentsLines` (all lines will have `IsReturn=true`). Validate to commit stock adjustment via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsReturn/{id}": {
      "delete": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Delete return document",
        "description": "Hard-delete of the document header and its lines. For validated documents use `PATCH /{id}/null` instead to preserve audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Get return document by ID",
        "description": "Returns the full return document header. Use `GET /api/DocumentsLines?documentId={id}` for line items (returned products, quantities, condition, and original document references).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return document record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Update return document",
        "description": "Full update of return document header fields. Cannot update validated or cancelled documents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsReturn/{id}/confirm": {
      "patch": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Confirm return document (second approval)",
        "description": "Sets IsConfirmed=true and stamps ConfirmationDate. Represents a second-level approval (e.g. quality inspection sign-off before restocking returned goods). Idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsReturn/{id}/null": {
      "patch": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Cancel (null) return document",
        "description": "Sets IsNulled=true. If the document was already validated, stock adjustments are reversed. Cannot be undone — use with caution.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsReturn/{id}/status": {
      "patch": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Change return document workflow status",
        "description": "Body: `{ \"StatusId\": N }`. Get available statuses from `GET /api/DocumentStatuses?documentType=7`. Common statuses: Draft, Received, Inspected, Restocked, Rejected.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status changed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsReturn/{id}/validate": {
      "patch": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Validate return document (commit stock adjustment)",
        "description": "Sets IsValidated=true and stamps CompletionDate. For customer returns: stock is increased at the receiving location. For supplier returns: stock is decreased. Idempotent — safe to call multiple times.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsReturn/with-lines": {
      "post": {
        "tags": [
          "DocumentsReturn"
        ],
        "summary": "Create a new return document WITH its lines in a single call.\r\nDocument is created as IsNew=true, IsValidated=false (unvalidated).\r\nUse this when integrating from ERP — single JSON containing header + lines.",
        "description": "Creates a new DocumentsReturn header AND its lines in a single transaction.\r\n\r\nThe created document is marked **IsNew = true** and **IsValidated = false** (unvalidated).\r\nUse this when integrating from ERP — caller sends a single JSON containing:\r\n- `Header` — same fields as for `POST /api/DocumentsReturn`\r\n- `Lines` — array of line items (DocumentId on each line is auto-filled)\r\n\r\nAfter creation, you can validate stock movements via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document + lines created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentStatuses": {
      "get": {
        "tags": [
          "DocumentStatuses"
        ],
        "summary": "List all document statuses with optional filter by document type.\r\nUse the documentType parameter to get only statuses relevant to a specific document type.",
        "description": "Returns document workflow statuses sorted by Name.\r\n\r\n**Filter:**\r\n- `documentType` — numeric code for the document type:\r\n  - `1` = DocumentsIn (goods receipts)\r\n  - `2` = DocumentsOut (shipments)\r\n  - `3` = DocumentsTransfer (internal transfers)\r\n  - `4` = DocumentsInventory (stock count)\r\n  - `5` = DocumentsAssembly (production)\r\n  - `6` = DocumentsDisassembly\r\n  - `7` = DocumentsReturn\r\n  - `8` = DocumentsConsumption\r\n  - `9` = DocumentsLoan\r\n  - `0` = shared across all types\r\n  - Omit to get all statuses.\r\n\r\n**Key response flags (semantic meaning of each status):**\r\n- `IsWaiting` — waiting for action\r\n- `IsApproved` — approved by authorised user\r\n- `IsInProgress` — currently being processed\r\n- `IsFinished` — processing complete\r\n- `IsNulled` — cancelled\r\n- `IsVerified` — quantities verified\r\n- `IsShipped` — goods dispatched\r\n\r\n**Example:** `GET /api/DocumentStatuses?documentType=1` — statuses for goods receipts.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 200. Default: 100.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "documentType",
            "in": "query",
            "description": "Optional: filter by document type (1=In,2=Out,3=Transfer,4=Inventory,5=Assembly,6=Disassembly,7=Return,8=Consumption,9=Loan,0=shared).",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of document statuses",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentStatuses"
        ],
        "summary": "Create a new document status",
        "description": "Creates a custom workflow status. Set the semantic flags (IsApproved, IsFinished, etc.) to define this status's meaning in the WMS workflow engine.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentStatusDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentStatusDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentStatusDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentStatusDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Status created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentStatuses/{id}": {
      "delete": {
        "tags": [
          "DocumentStatuses"
        ],
        "summary": "Delete a document status",
        "description": "Hard-delete. Do not delete system statuses or statuses currently assigned to documents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric status ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Status not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentStatuses"
        ],
        "summary": "Get document status by ID",
        "description": "Returns a single status record.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric status ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document status record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              }
            }
          },
          "404": {
            "description": "Status not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentStatuses"
        ],
        "summary": "Update a document status",
        "description": "Full update. System statuses (IsSystem=true) should not be modified.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric status ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentStatusDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentStatusDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentStatusDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentStatusDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated status",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatusDto"
                }
              }
            }
          },
          "404": {
            "description": "Status not found"
          }
        }
      }
    },
    "/api/v1/DocumentsTransfer": {
      "get": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "List transfer documents (paged)",
        "description": "Returns paged internal transfer documents (location-to-location or warehouse-to-warehouse moves), sorted newest first.\r\n\r\n**Filters (all optional):**\r\n- `partnerId` — filter by partner ID (if transfers are partner-linked)\r\n- `dateFrom` — DocumentDate >= this date (ISO 8601, e.g. `2026-01-01`)\r\n- `dateTo` — DocumentDate <= this date (end of day inclusive)\r\n- `statusId` — filter by workflow status ID (use `GET /api/DocumentStatuses?documentType=3`)\r\n- `isValidated` — `true` = stock moved (committed); `false` = pending transfer\r\n- `isNulled` — `true` = cancelled only; `false` = active only\r\n\r\n**Key fields:** `LocationSourceId` (goods leave from here), `LocationDestinationId` (goods arrive here).\r\n\r\n**Example:** `GET /api/DocumentsTransfer?isValidated=false&dateFrom=2026-01-01`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "partnerId",
            "in": "query",
            "description": "Filter by partner ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter: DocumentDate >= dateFrom (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter: DocumentDate <= dateTo (end of day inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "description": "Filter by workflow status ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isValidated",
            "in": "query",
            "description": "true = validated (stock transferred); false = not yet validated.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isNulled",
            "in": "query",
            "description": "true = cancelled documents; false = active documents.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of transfer documents",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Create a new transfer document",
        "description": "Creates the transfer document header. Then add line items via `POST /api/DocumentsLines`. Validate (commit stock move) via `PATCH /{id}/validate`. Set `LocationSourceId` and `LocationDestinationId` on the header or per line.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/DocumentsTransfer/{id}": {
      "delete": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Delete transfer document",
        "description": "Hard-delete of the document header and its lines. For validated documents use `PATCH /{id}/null` instead to preserve audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Get transfer document by ID",
        "description": "Returns the full transfer document header. Use `GET /api/DocumentsLines?documentId={id}` for line items (products, quantities, source/destination locations).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transfer document record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Update transfer document",
        "description": "Full update of transfer document header fields. Cannot update validated or cancelled documents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsTransfer/{id}/confirm": {
      "patch": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Confirm transfer document (second approval)",
        "description": "Sets IsConfirmed=true and stamps ConfirmationDate. Represents a second-level approval (e.g. destination location confirms receipt). Idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsTransfer/{id}/null": {
      "patch": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Cancel (null) transfer document",
        "description": "Sets IsNulled=true. If the document was already validated, stock movements are reversed (destination decreases, source increases). Cannot be undone.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsTransfer/{id}/status": {
      "patch": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Change transfer document workflow status",
        "description": "Body: `{ \"StatusId\": N }`. Get available statuses from `GET /api/DocumentStatuses?documentType=3`. Common statuses: Draft, In Transit, Received.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status changed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsTransfer/{id}/validate": {
      "patch": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Validate transfer document (commit stock move)",
        "description": "Sets IsValidated=true and stamps CompletionDate. Stock is decreased at LocationSourceId and increased at LocationDestinationId. Idempotent — safe to call multiple times.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric document ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/DocumentsTransfer/with-lines": {
      "post": {
        "tags": [
          "DocumentsTransfer"
        ],
        "summary": "Create a new transfer document WITH its lines in a single call.\r\nDocument is created as IsNew=true, IsValidated=false (unvalidated).\r\nUse this when integrating from ERP — single JSON containing header + lines.",
        "description": "Creates a new DocumentsTransfer header AND its lines in a single transaction.\r\n\r\nThe created document is marked **IsNew = true** and **IsValidated = false** (unvalidated).\r\nUse this when integrating from ERP — caller sends a single JSON containing:\r\n- `Header` — same fields as for `POST /api/DocumentsTransfer`\r\n- `Lines` — array of line items (DocumentId on each line is auto-filled)\r\n\r\nAfter creation, you can validate stock movements via `PATCH /{id}/validate`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentWithLinesRequest"
              },
              "example": {
                "header": {
                  "warehouseId": 1,
                  "partnerId": 5,
                  "documentDate": "2026-05-24T10:00:00",
                  "documentNo": "IN-2026-0001"
                },
                "lines": [
                  {
                    "productId": 42,
                    "quantity": 10
                  }
                ]
              },
              "examples": {
                "Minimum": {
                  "summary": "MINIMUM payload (required fields only)",
                  "description": "Simplest variant — uses native WMS Ids. Required: Warehouse + Partner + DocumentDate + at least one line with Product + Quantity > 0.",
                  "value": {
                    "header": {
                      "warehouseId": 1,
                      "partnerId": 5,
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-0001"
                    },
                    "lines": [
                      {
                        "productId": 42,
                        "quantity": 10
                      }
                    ]
                  }
                },
                "ErpIntegration": {
                  "summary": "ERP-style call (mixed Code / InternalKey / ExternalKey lookup)",
                  "description": "When the integration does not know native WMS Ids. For each FK you may use any of the 4 keys (Id > Code > InternalKey > ExternalKey — Id wins if multiple are provided). The HEADER FKs (Warehouse, Partner, Status, Employee, User) all support the same 4 strategies — exactly like lines.",
                  "value": {
                    "header": {
                      "warehouseInternalKey": "1",
                      "partnerExternalKey": "FURN-001",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-1234"
                    },
                    "lines": [
                      {
                        "productInternalKey": "100",
                        "quantity": 10
                      },
                      {
                        "productExternalKey": "PROD-X",
                        "quantity": 5
                      },
                      {
                        "productCode": "ABC123",
                        "quantity": 2
                      }
                    ]
                  }
                },
                "FullHeaderLookup": {
                  "summary": "Full header lookup (all 5 header FKs via Code/InternalKey/ExternalKey)",
                  "description": "Demonstrates that ALL header FKs accept the same 4 lookup strategies as lines: Warehouse, Partner, Status, Employee, User. Pick whichever key the ERP knows; the API resolves to native WMS Ids automatically.",
                  "value": {
                    "header": {
                      "warehouseCode": "CENTRAL",
                      "partnerInternalKey": "ERP-PARTNER-42",
                      "statusExternalKey": "NEW",
                      "employeeCode": "OP_001",
                      "userInternalKey": "ERP-USER-7",
                      "documentDate": "2026-05-24T10:00:00",
                      "documentNo": "IN-2026-FULL"
                    },
                    "lines": [
                      {
                        "productCode": "SKU-001",
                        "locationDestinationCode": "A-01-1-A-01",
                        "uomInternalKey": "BUC",
                        "quantity": 3
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document + lines created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentWithLinesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/KpiSnapshots": {
      "get": {
        "tags": [
          "KpiSnapshots"
        ],
        "summary": "Get latest snapshots",
        "description": "Returns latest snapshot per KpiCode. Optionally filter by kpiCode for a single metric.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "kpiCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged result",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/KpiSnapshotDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KpiSnapshotDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/KpiSnapshotDtoPagedResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/KpiSnapshots/latest/{kpiCode}": {
      "get": {
        "tags": [
          "KpiSnapshots"
        ],
        "summary": "Get latest value for a KPI",
        "description": "Returns just the most recent snapshot's value for the given KpiCode.",
        "parameters": [
          {
            "name": "kpiCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/KpiSnapshots/sparkline/{kpiCode}": {
      "get": {
        "tags": [
          "KpiSnapshots"
        ],
        "summary": "Get sparkline data — last N snapshots ordered oldest-first",
        "parameters": [
          {
            "name": "kpiCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "points",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 96
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/KpiSnapshots/write-now": {
      "post": {
        "tags": [
          "KpiSnapshots"
        ],
        "summary": "Trigger an immediate snapshot write — used by manual refresh / cron.",
        "description": "Manual trigger for KPI computation. Returns count of snapshots written.",
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/MerchantPro/orders/incoming": {
      "post": {
        "tags": [
          "MerchantPro"
        ],
        "summary": "Webhook MerchantPro - new order",
        "description": "Receives raw JSON payload with an order from MerchantPro. Body is stored as-is, with timestamp + tenant, in the `orders/` folder for later processing. Tenant comes from the `X-Tenant` header.",
        "responses": {
          "200": {
            "description": "Order queued for processing"
          }
        }
      }
    },
    "/api/v1/MerchantPro/stock-delta": {
      "get": {
        "tags": [
          "MerchantPro"
        ],
        "summary": "Stock delta MerchantPro (stub)",
        "description": "Returns stock changes after the `since` timestamp. STUB - real implementation TBD: must aggregate from WMS `Movements` / `ProductsStock` filtered per tenant.",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stock delta list"
          }
        }
      }
    },
    "/api/v1/MerchantPro/tenants": {
      "get": {
        "tags": [
          "MerchantPro"
        ],
        "summary": "List MerchantPro tenants",
        "description": "Returns the contents of `tenants.json` — the list of MerchantPro tenants provisioned so far.",
        "responses": {
          "200": {
            "description": "JSON dictionary keyed by tenant_id"
          }
        }
      }
    },
    "/api/v1/MerchantPro/tenants/provision": {
      "post": {
        "tags": [
          "MerchantPro"
        ],
        "summary": "Provision a new MerchantPro tenant",
        "description": "Creates a new tenant entry in `tenants.json` (file-based store). Used during onboarding of new shops. Returns tenant_id + SSO login URL.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tenant provisioned",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "external_id or shop_domain missing"
          }
        }
      }
    },
    "/api/v1/MES/assembly-lines/{lineId}/template": {
      "get": {
        "tags": [
          "MES"
        ],
        "summary": "Get label template for assembly line",
        "description": "Returns label template(s) for printing by line ID. The template is a Base64 string in PDF format or ZPL.",
        "parameters": [
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "ExportZPL",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Label template for printing",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletLabelTemplateDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletLabelTemplateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletLabelTemplateDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/MES/assembly-lines/{lineId}/validate-sscc": {
      "post": {
        "tags": [
          "MES"
        ],
        "summary": "Validate SSCC code",
        "description": "Validate SSCC code for assembly line — checks barcode exists in Pallets and belongs to the line",
        "parameters": [
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "string"
              }
            },
            "application/json": {
              "schema": {
                "type": "string"
              }
            },
            "text/json": {
              "schema": {
                "type": "string"
              }
            },
            "application/*+json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSCC validation result"
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Movements": {
      "get": {
        "tags": [
          "Movements"
        ],
        "summary": "Get all movements",
        "description": "Returns paged list of stock movements. Filter by productId or locationId.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MovementDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MovementDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MovementDtoPagedResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Movements/{id}": {
      "get": {
        "tags": [
          "Movements"
        ],
        "summary": "Get movement by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MovementDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MovementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MovementDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/Pallets": {
      "get": {
        "tags": [
          "Pallets"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of pallets",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Pallets"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PalletDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PalletDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PalletDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PalletDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Pallets/{id}": {
      "delete": {
        "tags": [
          "Pallets"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "Pallets"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "Pallets"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PalletDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PalletDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PalletDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PalletDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/PalletsTypes": {
      "get": {
        "tags": [
          "PalletsTypes"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of pallet types",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PalletsTypes"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PalletTypeDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PalletTypeDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PalletTypeDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PalletTypeDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/PalletsTypes/{id}": {
      "delete": {
        "tags": [
          "PalletsTypes"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "PalletsTypes"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "PalletsTypes"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PalletTypeDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PalletTypeDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PalletTypeDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PalletTypeDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PalletTypeDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/Partners": {
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of partners",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "showAddresses",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "showWorksites",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Partners"
        ],
        "summary": "Create new record",
        "description": "Creates new partner",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Partners/{id}": {
      "delete": {
        "tags": [
          "Partners"
        ],
        "summary": "Delete record",
        "description": "Deletes a partner by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "Partners"
        ],
        "summary": "Get record by ID",
        "description": "Returns single record matching the specified ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "showAddresses",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "showWorksites",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "Partners"
        ],
        "summary": "Update existing record",
        "description": "Updates a partner by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/PickingSections": {
      "get": {
        "tags": [
          "PickingSections"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged result",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PickingSectionDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickingSectionDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickingSectionDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PickingSections"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PickingSectionDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PickingSectionDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PickingSectionDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PickingSectionDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/PickingSections/{id}": {
      "delete": {
        "tags": [
          "PickingSections"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "get": {
        "tags": [
          "PickingSections"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "put": {
        "tags": [
          "PickingSections"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PickingSectionDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PickingSectionDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PickingSectionDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PickingSectionDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Printers": {
      "get": {
        "tags": [
          "Printers"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of printers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Printers"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Printers/{id}": {
      "delete": {
        "tags": [
          "Printers"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "Printers"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "Printers"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PrinterDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrinterDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/PrintServer/ack": {
      "post": {
        "tags": [
          "PrintServer"
        ],
        "summary": "Confirma ca job-ul a fost tiparit. WMS marks IsPrinted=true.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PrintJobAckDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintJobAckDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintJobAckDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PrintJobAckDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/PrintServer/enqueue": {
      "post": {
        "tags": [
          "PrintServer"
        ],
        "summary": "Adds un job in coada (push from MAUI / WMS UI / sync apps).\r\n            \r\nWMS server-side face toata munca:\r\n  1. Resolves template-ul FastReport pe baza JobType / EntityKind\r\n  2. Builds DataSet-ul (for ProductLabel — date produs; for PalletLabel — date palet)\r\n  3. Resolves printer via PrinterResolver (cascada User -> Zone -> Warehouse)\r\n  4. Scrie un rand in PrintQueue cu Status=Pending\r\n            \r\nPrint Server ridica job-ul la urmatorul GET /api/printserver/jobs si il tipareste.",
        "description": "Adds un job in coada de tiparire. WMS resolves template + DataSet + printer si scrie un rand in PrintQueue. Print Server ridica job-ul la urmatorul GET /jobs.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PrintEnqueueDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintEnqueueDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintEnqueueDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PrintEnqueueDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job adaugat in coada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrintEnqueueResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintEnqueueResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintEnqueueResultDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/PrintServer/jobs": {
      "get": {
        "tags": [
          "PrintServer"
        ],
        "summary": "Returns the pending print jobs. Each job carries the FastReport template,\r\nthe dataset (XML) and the printer name — the Print Server only loads and prints.",
        "description": "Returns jobs for documents (In/Out/Transfer, initial + validated variants) and pallet labels.",
        "parameters": [
          {
            "name": "max",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Jobs list",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrintJobDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrintJobDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PrintJobDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ProductionSteps": {
      "get": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Get production steps",
        "description": "Returns paged list of production operation steps, optionally filtered by production order",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "productionHeaderId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged steps",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Create production step",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionStepDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionStepDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionStepDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionStepDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/ProductionSteps/{id}": {
      "delete": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Delete production step",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Get production step by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Production step",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Update production step",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionStepDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionStepDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionStepDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionStepDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/ProductionSteps/{id}/complete": {
      "patch": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Complete a production step",
        "description": "Sets status to Completed, records CompletedAt, calculates actual minutes from start",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Step completed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              }
            }
          },
          "400": {
            "description": "Step not in InProgress status"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/ProductionSteps/{id}/start": {
      "patch": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Start a production step",
        "description": "Sets status to InProgress and records StartedAt timestamp",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Step started",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionStepDto"
                }
              }
            }
          },
          "400": {
            "description": "Step not in Pending status"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/Products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get a paged list of all products.\r\nResults are sorted alphabetically by Name.\r\nUse the `page` and `pageSize` parameters to navigate large datasets.\r\nThe response includes `TotalCount` and `TotalPages` for pagination UI.",
        "description": "Returns a paged list of all products sorted by Name.\r\n\r\n**Pagination:**\r\n- `page` — 1-based page number (default: 1)\r\n- `pageSize` — records per page, max 100 (default: 50)\r\n\r\n**Response fields of note:**\r\n- `Barcode` — primary scanner identifier (EAN-13, Code128, etc.)\r\n- `Code` — internal product code / article number\r\n- `WithStock` — if false, this product is not stock-tracked\r\n- `WithLot` / `WithSerialNumber` — whether lot/serial tracking is enabled\r\n- `IsBlocked` — if true, this product cannot be used in new documents\r\n- `StockTotal` — aggregate stock across all warehouses (updated by WMS engine)\r\n\r\n**Example:** `GET /api/Products?page=1&pageSize=20`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Optional search filter — matches Barcode/SKU/Code (exact) or Name (contains). Same logic as GET /api/Products/search.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of products",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Create a new product.\r\nRequired fields: Barcode, Code, Name.",
        "description": "Creates a new product record. The server assigns the ID.\r\n\r\n**Required fields:** `Barcode`, `Code`, `Name`\r\n\r\n**Relations (pass the *Id field):**\r\n- `CategoryId` → see `GET /api/ProductsCategories`\r\n- `UomId` → see `GET /api/ProductsUoms`\r\n- `VatPercentId` → see `GET /api/ProductsVats`\r\n- `TypeId` → see `GET /api/ProductsTypes`\r\n\r\n**Returned:** the full created product including the server-assigned `ID`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Product created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error — check required fields"
          }
        }
      }
    },
    "/api/v1/Products/{id}": {
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Delete a product by ID.\r\nThis performs a hard delete. Ensure no stock records or document lines reference this product before deleting.",
        "description": "Hard-deletes the product. Returns 404 if not found. Ensure no active stock or document lines reference this product before deleting.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric product ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Product not found"
          }
        }
      },
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get a single product by its numeric ID.",
        "description": "Returns the full product record for the given ID. Returns 404 if no product with that ID exists.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric product ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              }
            }
          },
          "404": {
            "description": "Product not found"
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Update an existing product.\r\nAll fields in the request body replace the current values.",
        "description": "Full update (PUT semantics): all writable fields in the request body replace the stored values.\r\nSupply the complete product object; omitted optional fields are set to their zero/empty defaults.\r\n\r\nReturns the updated product record.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric product ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated product",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "404": {
            "description": "Product not found"
          }
        }
      }
    },
    "/api/v1/Products/search": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Search products by barcode, SKU, code, or name.\r\nBarcode/SKU/Code use exact match; Name uses contains (case-insensitive).\r\nReturns up to 50 matches.",
        "description": "Full-text search across the most common product identifiers. Returns up to 50 matches.\r\n\r\n**Match rules:**\r\n- `Barcode`, `SKU`, `Code` — exact match (case-insensitive)\r\n- `Name` — contains match (e.g. `q=bolt` matches \"M8 Bolt HEX\")\r\n\r\n**Example:** `GET /api/Products/search?q=EAN0012345`\r\n\r\n**Tip:** To look up a product by barcode scan, pass the raw barcode value as `q`. An exact barcode match is always returned first in the result list.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search query — barcode (exact), SKU (exact), code (exact), or name (contains). Min 1 character.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of matching products (up to 50)",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Parameter 'q' is required"
          }
        }
      }
    },
    "/api/v1/ProductsCategories": {
      "get": {
        "tags": [
          "ProductsCategories"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of product categories",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ProductsCategories"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/ProductsCategories/{id}": {
      "delete": {
        "tags": [
          "ProductsCategories"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "ProductsCategories"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "ProductsCategories"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/ProductsLocations": {
      "get": {
        "tags": [
          "ProductsLocations"
        ],
        "summary": "Get all product-location assignments",
        "description": "Filter by productId or locationId.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records"
          }
        }
      },
      "post": {
        "tags": [
          "ProductsLocations"
        ],
        "summary": "Create product-location assignment",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLocationDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLocationDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLocationDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLocationDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully"
          }
        }
      }
    },
    "/api/v1/ProductsLocations/{id}": {
      "delete": {
        "tags": [
          "ProductsLocations"
        ],
        "summary": "Delete product-location assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "ProductsLocations"
        ],
        "summary": "Get by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "ProductsLocations"
        ],
        "summary": "Update product-location assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLocationDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLocationDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLocationDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLocationDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/ProductsStock": {
      "get": {
        "tags": [
          "ProductsStock"
        ],
        "summary": "Get detailed stock records with optional filters.\r\nEach record represents the quantity of one product at one location, optionally scoped to a lot or serial number.\r\nFor aggregate totals per product, use `GET /api/ProductsStock/summary`.",
        "description": "Returns paged, detailed stock records. Each record = one (Product, Location, Lot, SerialNumber) combination.\r\n\r\n**Filters (all optional, combinable):**\r\n- `productId` — filter to a single product. Get the product ID from `GET /api/Products`\r\n- `locationId` — filter to a single warehouse location (bin/shelf). Get IDs from `GET /api/WarehousesLocations`\r\n- `warehouseId` — filter to an entire warehouse. Get IDs from `GET /api/Warehouses`\r\n- `lot` — exact lot/batch number match (e.g. `LOT-2026-001`)\r\n- `serialNumber` — exact serial number match (returns 0 or 1 records)\r\n\r\n**Sorting:** newest entry date first (EntryDate DESC).\r\n\r\n**Key response fields:**\r\n- `Quantity` — total physical quantity on hand\r\n- `ReservedQuantity` — reserved for pending outbound operations\r\n- `AvailableQuantity` = `Quantity - ReservedQuantity`\r\n- `StockAgeDays` — days since receiving date (for FIFO/FEFO analysis)\r\n\r\n**Examples:**\r\n- All stock for product 42: `GET /api/ProductsStock?productId=42`\r\n- Stock in warehouse 1: `GET /api/ProductsStock?warehouseId=1&page=1&pageSize=100`\r\n- Find a specific serial: `GET /api/ProductsStock?serialNumber=SN123456`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 500. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "productId",
            "in": "query",
            "description": "Filter by product ID (exact match).",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Filter by warehouse location ID (exact match).",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "description": "Filter by warehouse ID — returns stock across all locations in that warehouse.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "lot",
            "in": "query",
            "description": "Filter by lot/batch number (exact, case-sensitive).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serialNumber",
            "in": "query",
            "description": "Filter by serial number (exact, case-sensitive). Returns at most 1 record for serial-tracked products.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of stock records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductStockDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductStockDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductStockDtoPagedResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ProductsStock/{id}": {
      "get": {
        "tags": [
          "ProductsStock"
        ],
        "summary": "Get a single stock record by its internal ID.",
        "description": "Returns a single stock record by its internal database ID. Useful after receiving an ID from a list response.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric stock record ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single stock record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductStockDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductStockDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductStockDto"
                }
              }
            }
          },
          "404": {
            "description": "Stock record not found"
          }
        }
      }
    },
    "/api/v1/ProductsStock/summary": {
      "get": {
        "tags": [
          "ProductsStock"
        ],
        "summary": "Get aggregated stock totals per product.\r\nReturns one row per product with summed Quantity, ReservedQuantity, and AvailableQuantity.\r\nOptionally filtered by productId, locationId, or warehouseId.",
        "description": "Aggregates stock records and returns one summary row per product.\r\n\r\n**Filters (all optional):**\r\n- `productId` — limit to one specific product\r\n- `locationId` — only count stock at one location\r\n- `warehouseId` — only count stock within one warehouse\r\n\r\n**Response fields per row:**\r\n- `ProductId`, `ProductCode`, `ProductName` — product identification\r\n- `UomName` — unit of measure\r\n- `TotalQuantity` — total physical stock across all matching locations/lots\r\n- `ReservedQuantity` — total reserved for outbound documents\r\n- `AvailableQuantity` = `TotalQuantity - ReservedQuantity`\r\n\r\n**Sorted by:** ProductName ascending.\r\n\r\n**Example:** `GET /api/ProductsStock/summary?warehouseId=1`",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "description": "Optional: filter to one product.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "description": "Optional: filter to one location.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "description": "Optional: filter to one warehouse.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of stock summaries per product"
          }
        }
      }
    },
    "/api/v1/ProductsTypes": {
      "get": {
        "tags": [
          "ProductsTypes"
        ],
        "summary": "List all product types, sorted by Name.",
        "description": "Returns all product type classification labels sorted alphabetically by Name.\r\n\r\nProduct types are used to classify products in the WMS (e.g. Raw material, Finished good, Semi-finished, Service).\r\nReference a type in a product via the `TypeId` field when creating or updating a product.\r\n\r\n**Example:** `GET /api/ProductsTypes?page=1&pageSize=50`",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (1-based). Default: 1.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Records per page, max 100. Default: 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged list of product types",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ProductsTypes"
        ],
        "summary": "Create a new product type",
        "description": "Creates a classification label. After creation, assign it to products via `TypeId`.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTypeDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTypeDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTypeDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTypeDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Product type created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/ProductsTypes/{id}": {
      "delete": {
        "tags": [
          "ProductsTypes"
        ],
        "summary": "Delete a product type",
        "description": "Hard-delete. Ensure no products reference this type before deleting.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric product type ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "ProductsTypes"
        ],
        "summary": "Get product type by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric product type ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product type record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "ProductsTypes"
        ],
        "summary": "Update a product type",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Numeric product type ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTypeDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTypeDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTypeDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTypeDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated product type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductTypeDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/ProductsUoms": {
      "get": {
        "tags": [
          "ProductsUoms"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of units of measure",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ProductsUoms"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUomDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUomDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUomDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUomDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/ProductsUoms/{id}": {
      "delete": {
        "tags": [
          "ProductsUoms"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "ProductsUoms"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "ProductsUoms"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUomDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUomDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUomDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUomDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductUomDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/ProductsVats": {
      "get": {
        "tags": [
          "ProductsVats"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of VAT rates",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ProductsVats"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVatDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVatDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVatDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVatDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/ProductsVats/{id}": {
      "delete": {
        "tags": [
          "ProductsVats"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "ProductsVats"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "ProductsVats"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVatDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVatDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVatDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVatDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVatDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders": {
      "get": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Get all purchase orders",
        "description": "Returns paged list of purchase orders, optionally filtered by status",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeLines",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged purchase orders",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Create purchase order",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders/{id}": {
      "delete": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Delete purchase order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Get purchase order by ID",
        "description": "Returns full order with lines",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Purchase order with lines",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Update purchase order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders/{id}/acknowledge": {
      "patch": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Acknowledge PO by supplier",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Acknowledged"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders/{id}/cancel": {
      "patch": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Cancel purchase order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders/{id}/invoice": {
      "patch": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Mark as invoiced",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoiced"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders/{id}/lines": {
      "get": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Get order lines",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lines",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PurchaseOrderLineDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PurchaseOrderLineDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PurchaseOrderLineDto"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Add line to purchase order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderLineDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderLineDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderLineDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderLineDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders/{id}/lines/{lineId}": {
      "delete": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Delete order line",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders/{id}/receive": {
      "patch": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Mark as received (GRN)",
        "description": "Marks order as Received. Use the WMS backoffice to validate the DocumentsIn NIR.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "/api/v1/PurchaseOrders/{id}/send": {
      "patch": {
        "tags": [
          "PurchaseOrders"
        ],
        "summary": "Send PO to supplier",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/PutawayRules": {
      "get": {
        "tags": [
          "PutawayRules"
        ],
        "summary": "Get paged list of putaway rules",
        "description": "Sorted by priority ascending (lower = evaluated first).",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged result",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PutawayRules"
        ],
        "summary": "Create new putaway rule",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PutawayRuleDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutawayRuleDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PutawayRuleDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PutawayRuleDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/PutawayRules/{id}": {
      "delete": {
        "tags": [
          "PutawayRules"
        ],
        "summary": "Delete a putaway rule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "PutawayRules"
        ],
        "summary": "Get putaway rule by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "PutawayRules"
        ],
        "summary": "Update existing putaway rule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PutawayRuleDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutawayRuleDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PutawayRuleDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PutawayRuleDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutawayRuleDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/PutawayRules/evaluate": {
      "get": {
        "tags": [
          "PutawayRules"
        ],
        "summary": "Evaluate rules + return candidate locations for a (product, warehouse, quantity) input.\r\nSanity-check helper for testing rule configurations.",
        "description": "Returns candidate locations the engine suggests for the given product/warehouse/quantity. Does NOT commit any data.",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "max",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of suggested locations with match reason + score"
          },
          "400": {
            "description": "Missing parameters"
          }
        }
      }
    },
    "/api/v1/ReceiptFlow/documents/{id}/close-from-terminal": {
      "post": {
        "tags": [
          "ReceiptFlow"
        ],
        "summary": "MAUI/Terminal: marks a document as partially closed (status IsPartial).\r\nThe document stays in the Unvalidated list (IsNew=true). The backoffice\r\nlater decides whether to Mark complete or Split.\r\n            \r\nQuantity is not changed. ScanQuantity stays at what was scanned.\r\nStock is not affected (it was already updated during scanning).",
        "description": "Sets document Status to IsPartial. Quantity preserved, ScanQuantity preserved.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document marked as Partial"
          },
          "404": {
            "description": "Document not found"
          },
          "409": {
            "description": "Invalid transition (doc not in editable state)"
          }
        }
      }
    },
    "/api/v1/ReceiptFlow/documents/{id}/mark-complete": {
      "post": {
        "tags": [
          "ReceiptFlow"
        ],
        "summary": "Backoffice: marks un doc Partial ca finalizat. Status devine IsFinished,\r\nIsNew=false. Quantity ramane intact (audit trail).",
        "description": "Sets IsNew=false, Status=IsFinished. Quantity preserved as audit trail.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document marked complete"
          },
          "404": {
            "description": "Document not found"
          },
          "409": {
            "description": "Document not in Partial status"
          }
        }
      }
    },
    "/api/v1/ReceiptFlow/documents/{id}/split-remaining": {
      "post": {
        "tags": [
          "ReceiptFlow"
        ],
        "summary": "Backoffice: divide pozitiile ramase intr-o order noua.\r\nBody: { lines: [ { lineId, quantity } ] }\r\nDoc original ramane Status=IsFinished + IsNew=false (Quantity intact).\r\nDoc nou: IsNew=true, Status=IsWaiting, FromDocument FK.",
        "description": "Creates new IsWaiting doc with FromDocument FK. Original becomes IsFinished.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SplitRemainingRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitRemainingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitRemainingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SplitRemainingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Split successful, returns new document ID"
          },
          "404": {
            "description": "Document not found"
          },
          "400": {
            "description": "Invalid request body"
          }
        }
      }
    },
    "/api/v1/SalesOrders": {
      "get": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Get all sales orders",
        "description": "Returns paged list of OMS sales orders, optionally filtered by status",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeLines",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged sales orders",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Create sales order",
        "description": "Creates a new sales order in Draft status",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/SalesOrders/{id}": {
      "delete": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Delete sales order",
        "description": "Deletes a Draft or Cancelled sales order and its lines",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Cannot delete active orders"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Get sales order by ID",
        "description": "Returns full order with lines",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sales order with lines",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Update sales order",
        "description": "Updates a Draft sales order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Cannot update non-Draft order"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/SalesOrders/{id}/cancel": {
      "patch": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Cancel sales order",
        "description": "Cancels a Draft or Confirmed order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Cannot cancel this order"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/SalesOrders/{id}/confirm": {
      "patch": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Confirm sales order",
        "description": "Moves order from Draft to Confirmed status and recalculates totals",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid state"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/SalesOrders/{id}/invoice": {
      "patch": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Mark as invoiced",
        "description": "Moves order from Shipped to Invoiced",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoiced",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid state"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/SalesOrders/{id}/lines": {
      "get": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Get order lines",
        "description": "Returns all lines for a sales order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lines",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SalesOrderLineDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SalesOrderLineDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SalesOrderLineDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found"
          }
        }
      },
      "post": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Add a line to order",
        "description": "Adds a product line to a Draft sales order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderLineDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderLineDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderLineDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderLineDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Line created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderLineDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderLineDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderLineDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Order not found"
          }
        }
      }
    },
    "/api/v1/SalesOrders/{id}/lines/{lineId}": {
      "delete": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Delete order line",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Update order line",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderLineDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderLineDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderLineDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SalesOrderLineDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderLineDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderLineDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderLineDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/SalesOrders/{id}/ship": {
      "patch": {
        "tags": [
          "SalesOrders"
        ],
        "summary": "Mark as shipped",
        "description": "Moves order from Picking to Shipped",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shipped",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesOrderDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid state"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/ShelfReturnQueue/{id}": {
      "get": {
        "tags": [
          "ShelfReturnQueue"
        ],
        "summary": "Detalii for o sarcina specifica.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task details",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              }
            }
          },
          "404": {
            "description": "Task not found"
          }
        }
      }
    },
    "/api/v1/ShelfReturnQueue/{id}/confirm": {
      "post": {
        "tags": [
          "ShelfReturnQueue"
        ],
        "summary": "Confirma executia fizica a sarcinii — aplica reversal stoc si marks Completed.\r\nFor MoveBack, primul confirm avanseaza la SubStep=PutBackOnSource; al doilea finalizeaza.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ShelfReturnConfirmDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShelfReturnConfirmDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ShelfReturnConfirmDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ShelfReturnConfirmDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (location code not found, qty <= 0)"
          },
          "404": {
            "description": "Task not found"
          }
        }
      }
    },
    "/api/v1/ShelfReturnQueue/{id}/release": {
      "post": {
        "tags": [
          "ShelfReturnQueue"
        ],
        "summary": "Elibereaza lock-ul (InProgress → Pending) — operatorul renunta fara confirm.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Released",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              }
            }
          },
          "404": {
            "description": "Task not found"
          }
        }
      }
    },
    "/api/v1/ShelfReturnQueue/{id}/skip": {
      "post": {
        "tags": [
          "ShelfReturnQueue"
        ],
        "summary": "Marks sarcina ca Skipped (cu motiv). Stock NU se modifica — necesita interventie manuala admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ShelfReturnSkipDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShelfReturnSkipDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ShelfReturnSkipDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ShelfReturnSkipDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Skipped",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              }
            }
          },
          "400": {
            "description": "Reason is required"
          },
          "404": {
            "description": "Task not found"
          }
        }
      }
    },
    "/api/v1/ShelfReturnQueue/{id}/start": {
      "post": {
        "tags": [
          "ShelfReturnQueue"
        ],
        "summary": "Marks sarcina ca InProgress (lock for alt operator).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Started",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShelfReturnQueueDto"
                }
              }
            }
          },
          "404": {
            "description": "Task not found"
          },
          "409": {
            "description": "Task is already InProgress by another user or Completed"
          }
        }
      }
    },
    "/api/v1/ShelfReturnQueue/pending": {
      "get": {
        "tags": [
          "ShelfReturnQueue"
        ],
        "summary": "List sarcinilor pending for operatorul MAUI.",
        "description": "Returns tasks with Status=Pending or InProgress, optionally filtered by warehouse and actionType.",
        "parameters": [
          {
            "name": "warehouseId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "actionType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of pending tasks",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ShelfReturnQueueDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ShelfReturnQueueDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ShelfReturnQueueDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Tms/drivers": {
      "get": {
        "tags": [
          "Tms"
        ],
        "summary": "Get all drivers",
        "description": "Returns paged list of TMS drivers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged drivers",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Tms"
        ],
        "summary": "Create driver",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsDriverDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsDriverDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsDriverDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsDriverDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Tms/drivers/{id}": {
      "delete": {
        "tags": [
          "Tms"
        ],
        "summary": "Delete driver",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "Tms"
        ],
        "summary": "Get driver by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Driver",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "Tms"
        ],
        "summary": "Update driver",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsDriverDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsDriverDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsDriverDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsDriverDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsDriverDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/Tms/routes": {
      "get": {
        "tags": [
          "Tms"
        ],
        "summary": "Get all routes",
        "description": "Returns paged list of TMS routes",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged routes",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Tms"
        ],
        "summary": "Create route",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsRouteDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsRouteDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsRouteDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsRouteDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Tms/routes/{id}": {
      "delete": {
        "tags": [
          "Tms"
        ],
        "summary": "Delete route",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "Tms"
        ],
        "summary": "Get route by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Route",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "Tms"
        ],
        "summary": "Update route",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsRouteDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsRouteDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsRouteDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsRouteDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsRouteDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/Tms/vehicles": {
      "get": {
        "tags": [
          "Tms"
        ],
        "summary": "Get all vehicles",
        "description": "Returns paged list of TMS vehicles",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged vehicles",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Tms"
        ],
        "summary": "Create vehicle",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsVehicleDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsVehicleDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsVehicleDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsVehicleDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Tms/vehicles/{id}": {
      "delete": {
        "tags": [
          "Tms"
        ],
        "summary": "Delete vehicle",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "Tms"
        ],
        "summary": "Get vehicle by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vehicle",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "Tms"
        ],
        "summary": "Update vehicle",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsVehicleDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsVehicleDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TmsVehicleDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TmsVehicleDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmsVehicleDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/Users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of users",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/UserDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Users/{id}": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/UserDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/UsersGroups": {
      "get": {
        "tags": [
          "UsersGroups"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of user groups",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "UsersGroups"
        ],
        "summary": "Create new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/UsersGroupDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsersGroupDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UsersGroupDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UsersGroupDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/UsersGroups/{id}": {
      "delete": {
        "tags": [
          "UsersGroups"
        ],
        "summary": "Delete record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "UsersGroups"
        ],
        "summary": "Get record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "UsersGroups"
        ],
        "summary": "Update existing record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/UsersGroupDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsersGroupDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UsersGroupDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UsersGroupDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsersGroupDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/Warehouses": {
      "get": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of records. If userId is provided, filters by that user's warehouse permissions (UsersWarehouses). IsAdmin/IsSystem users bypass the filter.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "userId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Create new record",
        "description": "Creates new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Warehouses/{id}": {
      "delete": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Delete record",
        "description": "Deletes (or deactivates) a record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Get record by ID",
        "description": "Returns single record matching the specified ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Update existing record",
        "description": "Updates a record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDtoWithoutId"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/Warehouses/{id}/buffer-locations": {
      "get": {
        "tags": [
          "Warehouses"
        ],
        "summary": "2026-05-22 (flux_receptie #185): returns list locatiilor de tip buffer for\r\nwarehouse-ul specificat. Folosita de MAUI for a decide flux 0/1/N la setarea\r\n\"Uses locatii buffer la intrare\".",
        "description": "Returns active locations with IsBuffer=true in the specified warehouse",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of buffer locations",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": { }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": { }
                }
              }
            }
          },
          "404": {
            "description": "Warehouse not found"
          }
        }
      }
    },
    "/api/v1/WarehousesLocations": {
      "get": {
        "tags": [
          "WarehousesLocations"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of warehouse locations",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "WarehousesLocations"
        ],
        "summary": "Create new record",
        "description": "Creates new warehouse location",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseLocationDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseLocationDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseLocationDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseLocationDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/WarehousesLocations/{id}": {
      "delete": {
        "tags": [
          "WarehousesLocations"
        ],
        "summary": "Delete record",
        "description": "Deletes a warehouse location by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "WarehousesLocations"
        ],
        "summary": "Get record by ID",
        "description": "Returns single record matching the specified ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "WarehousesLocations"
        ],
        "summary": "Update existing record",
        "description": "Updates a warehouse location by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseLocationDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseLocationDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseLocationDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseLocationDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseLocationDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/WarehousesZones": {
      "get": {
        "tags": [
          "WarehousesZones"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of warehouse zones",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "WarehousesZones"
        ],
        "summary": "Create new record",
        "description": "Creates new warehouse zone",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseZoneDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseZoneDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseZoneDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseZoneDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/WarehousesZones/{id}": {
      "delete": {
        "tags": [
          "WarehousesZones"
        ],
        "summary": "Delete record",
        "description": "Deletes (or deactivates) a warehouse zone by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "WarehousesZones"
        ],
        "summary": "Get record by ID",
        "description": "Returns single record matching the specified ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "WarehousesZones"
        ],
        "summary": "Update existing record",
        "description": "Updates a warehouse zone by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseZoneDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseZoneDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseZoneDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseZoneDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseZoneDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/Waves": {
      "get": {
        "tags": [
          "Waves"
        ],
        "summary": "Get paged list of waves",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged result",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WaveDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaveDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaveDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Waves"
        ],
        "summary": "Create new wave (status=Draft)",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WaveCreateDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WaveCreateDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WaveCreateDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WaveCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Waves/{id}": {
      "get": {
        "tags": [
          "Waves"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single wave with stats",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WaveWithStatsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaveWithStatsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaveWithStatsDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Waves/{id}/assign-documents": {
      "post": {
        "tags": [
          "Waves"
        ],
        "summary": "Assign multiple outbound documents to this wave",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/AssignDocsDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignDocsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignDocsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AssignDocsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Waves/{id}/cancel": {
      "patch": {
        "tags": [
          "Waves"
        ],
        "summary": "Cancel wave (unbinds documents)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "unbindDocs",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Waves/{id}/complete": {
      "patch": {
        "tags": [
          "Waves"
        ],
        "summary": "Complete wave (Active → Completed)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Waves/{id}/release": {
      "patch": {
        "tags": [
          "Waves"
        ],
        "summary": "Release wave (Draft → Active)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/generic": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Receives a platform-agnostic JSON order and creates a Draft Sales Order.\r\nUse this for Shopify, Magento, custom storefronts, or any other platform\r\nthat can send a webhook.",
        "description": "Platform-agnostic order receiver. Maps order_number → CustomerRef, customer.email → Partner lookup/create, line_items[].sku → Product.Code / Barcode. If warehouse_id is not supplied, the first active warehouse is used.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/GenericOrderWebhookDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenericOrderWebhookDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/GenericOrderWebhookDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GenericOrderWebhookDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Processed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid payload"
          }
        }
      }
    },
    "/api/v1/Webhooks/Magento/event": {
      "post": {
        "tags": [
          "WebhooksMagento"
        ],
        "summary": "Catch-all for orice tip de webhook Magento.",
        "description": "Catch-all for orice tip de webhook Magento. Body JSON arbitrar.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/Magento/order/created": {
      "post": {
        "tags": [
          "WebhooksMagento"
        ],
        "summary": "Receives a new order din Magento.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed"
          }
        }
      }
    },
    "/api/v1/Webhooks/Magento/order/updated": {
      "post": {
        "tags": [
          "WebhooksMagento"
        ],
        "summary": "Update status order Magento.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/Magento/stock/updated": {
      "post": {
        "tags": [
          "WebhooksMagento"
        ],
        "summary": "Stock update notification din Magento.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/NopCommerce/event": {
      "post": {
        "tags": [
          "WebhooksNopCommerce"
        ],
        "summary": "Catch-all for orice tip de webhook nopCommerce.",
        "description": "Catch-all for orice tip de webhook nopCommerce. Body JSON arbitrar.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/NopCommerce/order/created": {
      "post": {
        "tags": [
          "WebhooksNopCommerce"
        ],
        "summary": "Receives a new order din nopCommerce.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed"
          }
        }
      }
    },
    "/api/v1/Webhooks/NopCommerce/order/updated": {
      "post": {
        "tags": [
          "WebhooksNopCommerce"
        ],
        "summary": "Update status order nopCommerce.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/NopCommerce/stock/updated": {
      "post": {
        "tags": [
          "WebhooksNopCommerce"
        ],
        "summary": "Stock update notification din nopCommerce.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/OpenCart/event": {
      "post": {
        "tags": [
          "WebhooksOpenCart"
        ],
        "summary": "Catch-all for orice tip de webhook OpenCart.",
        "description": "Catch-all for orice tip de webhook OpenCart. Body JSON arbitrar.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/OpenCart/order/created": {
      "post": {
        "tags": [
          "WebhooksOpenCart"
        ],
        "summary": "Receives a new order din OpenCart.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed"
          }
        }
      }
    },
    "/api/v1/Webhooks/OpenCart/order/updated": {
      "post": {
        "tags": [
          "WebhooksOpenCart"
        ],
        "summary": "Update status order OpenCart.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/OpenCart/stock/updated": {
      "post": {
        "tags": [
          "WebhooksOpenCart"
        ],
        "summary": "Stock update notification din OpenCart.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/PrestaShop/event": {
      "post": {
        "tags": [
          "WebhooksPrestaShop"
        ],
        "summary": "Catch-all for orice tip de webhook PrestaShop.",
        "description": "Catch-all for orice tip de webhook PrestaShop. Body JSON arbitrar.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/PrestaShop/order/created": {
      "post": {
        "tags": [
          "WebhooksPrestaShop"
        ],
        "summary": "Receives a new order din PrestaShop.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed"
          }
        }
      }
    },
    "/api/v1/Webhooks/PrestaShop/order/updated": {
      "post": {
        "tags": [
          "WebhooksPrestaShop"
        ],
        "summary": "Update status order PrestaShop.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/PrestaShop/stock/updated": {
      "post": {
        "tags": [
          "WebhooksPrestaShop"
        ],
        "summary": "Stock update notification din PrestaShop.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/woocommerce": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Receives a WooCommerce order.created / order.updated webhook.\r\nFinds or creates the customer as a WMS Partner, then creates a Draft Sales Order\r\nwith all matched line items.",
        "description": "Receives WooCommerce order.created / order.updated events and auto-creates a Sales Order. Products are matched by SKU (Products.Code) then by barcode. Unmatched lines are skipped. Customer is matched by email; if not found, a new Partner is created.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WooCommerceOrderDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WooCommerceOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WooCommerceOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WooCommerceOrderDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Processed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid payload"
          }
        }
      }
    },
    "/api/v1/Webhooks/WooCommerce/event": {
      "post": {
        "tags": [
          "WebhooksWooCommerce"
        ],
        "summary": "Catch-all for orice tip de webhook WooCommerce.",
        "description": "Catch-all for orice tip de webhook WooCommerce. Body JSON arbitrar.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/WooCommerce/order/created": {
      "post": {
        "tags": [
          "WebhooksWooCommerce"
        ],
        "summary": "Receives a new order din WooCommerce.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed"
          }
        }
      }
    },
    "/api/v1/Webhooks/WooCommerce/order/updated": {
      "post": {
        "tags": [
          "WebhooksWooCommerce"
        ],
        "summary": "Update status order WooCommerce.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/Webhooks/WooCommerce/stock/updated": {
      "post": {
        "tags": [
          "WebhooksWooCommerce"
        ],
        "summary": "Stock update notification din WooCommerce.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/JToken"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/WorkCentres": {
      "get": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Get all work centres",
        "description": "Returns paged list of MES work centres",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "activeOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged work centres",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Create work centre",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCentreDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCentreDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCentreDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCentreDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/WorkCentres/{id}": {
      "delete": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Delete work centre",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "get": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Get work centre by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Work centre",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "WorkCentres"
        ],
        "summary": "Update work centre",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCentreDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCentreDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCentreDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCentreDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkCentreDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/Worksites": {
      "get": {
        "tags": [
          "Worksites"
        ],
        "summary": "Get all records",
        "description": "Returns paged list of records",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns paged records",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Worksites"
        ],
        "summary": "Create new record",
        "description": "Creates new record",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WorksiteDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorksiteDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WorksiteDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WorksiteDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/v1/Worksites/{id}": {
      "delete": {
        "tags": [
          "Worksites"
        ],
        "summary": "Delete record",
        "description": "Deletes (or deactivates) a record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted successfully"
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "get": {
        "tags": [
          "Worksites"
        ],
        "summary": "Get record by ID",
        "description": "Returns single record matching the specified ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      },
      "put": {
        "tags": [
          "Worksites"
        ],
        "summary": "Update existing record",
        "description": "Updates a record by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WorksiteDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorksiteDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WorksiteDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WorksiteDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorksiteDtoWithoutId"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/v1/WorkTasks": {
      "get": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Get paged list of work tasks",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "taskType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "assignedToUserId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paged result",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDtoPagedResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDtoPagedResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDtoPagedResult"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Create new work task",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkTaskDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkTaskDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkTaskDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkTaskDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/WorkTasks/{id}": {
      "delete": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Delete work task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        }
      },
      "get": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Get work task by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Single record",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkTaskDto"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Update work task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkTaskDtoWithoutId"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkTaskDtoWithoutId"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkTaskDtoWithoutId"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkTaskDtoWithoutId"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/WorkTasks/{id}/complete": {
      "patch": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Status transitions: Complete (InProgress → 3 + CompletedAt)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/WorkTasks/{id}/start": {
      "patch": {
        "tags": [
          "WorkTasks"
        ],
        "summary": "Status transitions: Start (1 or 0 → 2 InProgress + StartedAt)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AssemblyLineDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "AssemblyLineDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssemblyLineDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "AssemblyLineDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AssignDocsDto": {
        "type": "object",
        "properties": {
          "documentIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BarcodeLabelDto": {
        "required": [
          "filename",
          "name",
          "template"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "template": {
            "minLength": 1,
            "type": "string"
          },
          "filename": {
            "minLength": 1,
            "type": "string"
          },
          "reportType": {
            "type": "integer",
            "format": "int32"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "BarcodeLabelDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BarcodeLabelDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "BarcodeLabelDtoWithoutId": {
        "required": [
          "filename",
          "name",
          "template"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "template": {
            "minLength": 1,
            "type": "string"
          },
          "filename": {
            "minLength": 1,
            "type": "string"
          },
          "reportType": {
            "type": "integer",
            "format": "int32"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BarcodeScannerDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "ip": {
            "type": "string",
            "nullable": true
          },
          "port": {
            "type": "integer",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "BarcodeScannerDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BarcodeScannerDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "BarcodeScannerDtoWithoutId": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "ip": {
            "type": "string",
            "nullable": true
          },
          "port": {
            "type": "integer",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateCrossDockAllocationRequest": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "integer",
            "format": "int32"
          },
          "lineInId": {
            "type": "integer",
            "format": "int32"
          },
          "lineOutId": {
            "type": "integer",
            "format": "int32"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateDocumentWithLinesRequest": {
        "type": "object",
        "properties": {
          "header": {
            "$ref": "#/components/schemas/DocumentDtoWithoutId"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentLineDtoWithoutId"
            },
            "description": "Document lines. Minim 1 element. Fiecare line:\r\n<list type=\"bullet\"><item>Product = mandatory (ProductId or ProductCode or ProductInternalKey or ProductExternalKey)</item><item>Quantity > 0 = mandatory</item><item>DocumentId = ignorat (auto-completat din header creat)</item></list>",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request body for creating a document (header + lines) in a single call.\r\nSupports both DocumentsIn and DocumentsOut (controller-specific minimum validation applies).\r\n<br><strong>MINIMUM required for DocumentsIn:</strong> Header (Warehouse + Partner + DocumentDate) + cel putin 1 Line (Product + Quantity > 0).\r\n<br><strong>Entity lookup — 4 strategii in order (Id castiga):</strong>\r\n1) `*Id` (WMS primary key, int) — 2) `*Code` (WMS Code, case-insensitive) —\r\n3) `*InternalKey` (ERP id pastrat in WMS) — 4) `*ExternalKey` (ERP code pastrat in WMS).\r\n<br><strong>Exemplu MINIM:</strong>```\r\n{\r\n  \"header\": {\r\n    \"warehouseId\": 1,\r\n    \"partnerId\": 5,\r\n    \"documentDate\": \"2026-05-24T10:00:00\"\r\n  },\r\n  \"lines\": [\r\n    { \"productId\": 42, \"quantity\": 10 }\r\n  ]\r\n}\r\n```",
        "example": {
          "header": {
            "warehouseCode": "CENTRAL",
            "partnerInternalKey": "ERP-PARTNER-42",
            "documentDate": "2026-05-24T10:00:00",
            "documentNo": "IN-2026-FULL"
          },
          "lines": [
            {
              "productCode": "SKU-001",
              "quantity": 10
            },
            {
              "productExternalKey": "PROD-X",
              "quantity": 5
            }
          ]
        }
      },
      "CreateDocumentWithLinesResponse": {
        "type": "object",
        "properties": {
          "document": {
            "$ref": "#/components/schemas/DocumentDto"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentLineDto"
            },
            "description": "All created document lines with their server-assigned IDs.",
            "nullable": true
          },
          "lineCount": {
            "type": "integer",
            "description": "Number of lines created.",
            "format": "int32"
          },
          "totalValue": {
            "type": "number",
            "description": "Sum of all line net values (excl. VAT).",
            "format": "double"
          },
          "totalValueVat": {
            "type": "number",
            "description": "Sum of all line VAT amounts.",
            "format": "double"
          },
          "total": {
            "type": "number",
            "description": "Grand total (TotalValue + TotalValueVat).",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Response returned after a successful create-with-lines call.\r\nContains the created document header and all created lines, plus computed totals."
      },
      "DocumentDto": {
        "type": "object",
        "properties": {
          "warehouseCode": {
            "type": "string",
            "description": "Depozit Code (WMS-intern, case-insensitive).",
            "nullable": true
          },
          "warehouseInternalKey": {
            "type": "string",
            "description": "Depozit InternalKey (ERP id pastrat in WMS).",
            "nullable": true
          },
          "warehouseExternalKey": {
            "type": "string",
            "description": "Depozit ExternalKey (ERP code pastrat in WMS).",
            "nullable": true
          },
          "partnerCode": {
            "type": "string",
            "description": "Partener Code (WMS-intern, case-insensitive).",
            "nullable": true
          },
          "partnerInternalKey": {
            "type": "string",
            "description": "Partener InternalKey (ERP id).",
            "nullable": true
          },
          "partnerExternalKey": {
            "type": "string",
            "description": "Partener ExternalKey (ERP code).",
            "nullable": true
          },
          "statusCode": {
            "type": "string",
            "description": "Status Code (WMS-intern, case-insensitive). NOTA: DocumentsStatuses NU are field Code — folositi Id / InternalKey / ExternalKey.",
            "nullable": true
          },
          "statusInternalKey": {
            "type": "string",
            "description": "Status InternalKey (ERP id).",
            "nullable": true
          },
          "statusExternalKey": {
            "type": "string",
            "description": "Status ExternalKey (ERP code).",
            "nullable": true
          },
          "employeeCode": {
            "type": "string",
            "description": "Employee Code.",
            "nullable": true
          },
          "employeeInternalKey": {
            "type": "string",
            "description": "Employee InternalKey (ERP id).",
            "nullable": true
          },
          "employeeExternalKey": {
            "type": "string",
            "description": "Employee ExternalKey (ERP code).",
            "nullable": true
          },
          "userCode": {
            "type": "string",
            "description": "User Code.",
            "nullable": true
          },
          "userInternalKey": {
            "type": "string",
            "description": "User InternalKey (ERP id).",
            "nullable": true
          },
          "userExternalKey": {
            "type": "string",
            "description": "User ExternalKey (ERP code).",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "description": "ID of the warehouse this document is processed in. Use `GET /api/Warehouses` to list warehouses.",
            "format": "int32",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "description": "Warehouse display name (read-only in responses).",
            "nullable": true
          },
          "partnerId": {
            "type": "integer",
            "description": "ID of the partner (supplier for inbound, customer for outbound).\r\nUse `GET /api/Partners` to list partners.",
            "format": "int32",
            "nullable": true
          },
          "partnerName": {
            "type": "string",
            "description": "Partner display name (read-only in responses).",
            "nullable": true
          },
          "partnerAddressId": {
            "type": "integer",
            "description": "ID of the partner delivery address. Use `GET /api/Partners/{id}/Addresses`.",
            "format": "int32",
            "nullable": true
          },
          "partnerAddressName": {
            "type": "string",
            "description": "Partner address display name (read-only in responses).",
            "nullable": true
          },
          "partnersWorksiteId": {
            "type": "integer",
            "description": "ID of the partner worksite / delivery point.",
            "format": "int32",
            "nullable": true
          },
          "partnersWorksiteName": {
            "type": "string",
            "description": "Partner worksite name (read-only in responses).",
            "nullable": true
          },
          "employeeId": {
            "type": "integer",
            "description": "ID of the warehouse employee responsible for executing this document.",
            "format": "int32",
            "nullable": true
          },
          "employeeName": {
            "type": "string",
            "description": "Employee name (read-only in responses).",
            "nullable": true
          },
          "userId": {
            "type": "integer",
            "description": "ID of the system user who owns / created this document.",
            "format": "int32",
            "nullable": true
          },
          "userName": {
            "type": "string",
            "description": "System user name (read-only in responses).",
            "nullable": true
          },
          "delegateUserId": {
            "type": "integer",
            "description": "ID of the delegate user (e.g. the person physically delivering goods).",
            "format": "int32",
            "nullable": true
          },
          "delegateUserName": {
            "type": "string",
            "description": "Delegate user name (read-only in responses).",
            "nullable": true
          },
          "statusId": {
            "type": "integer",
            "description": "ID of the current workflow status. Use `GET /api/DocumentStatuses` to list statuses.\r\nChange the status via `PATCH /api/Documents{Type}/{id}/status`.",
            "format": "int32",
            "nullable": true
          },
          "statusName": {
            "type": "string",
            "description": "Status display name (read-only in responses).",
            "nullable": true
          },
          "inventoryLocationId": {
            "type": "integer",
            "description": "Inventory count location (used in DocumentsInventory).",
            "format": "int32",
            "nullable": true
          },
          "inventoryLocationName": {
            "type": "string",
            "description": "Inventory location name (read-only).",
            "nullable": true
          },
          "pickingLocationId": {
            "type": "integer",
            "description": "Picking location — where goods are picked from (used in DocumentsOut/Transfer).",
            "format": "int32",
            "nullable": true
          },
          "pickingLocationName": {
            "type": "string",
            "description": "Picking location name (read-only).",
            "nullable": true
          },
          "locationSourceId": {
            "type": "integer",
            "description": "Source location for transfer documents.",
            "format": "int32",
            "nullable": true
          },
          "locationSourceName": {
            "type": "string",
            "description": "Source location name (read-only).",
            "nullable": true
          },
          "locationDestinationId": {
            "type": "integer",
            "description": "Destination location for transfer / inbound documents.",
            "format": "int32",
            "nullable": true
          },
          "locationDestinationName": {
            "type": "string",
            "description": "Destination location name (read-only).",
            "nullable": true
          },
          "finalProductLocationId": {
            "type": "integer",
            "description": "Location where the finished product is stored (used in DocumentsAssembly).",
            "format": "int32",
            "nullable": true
          },
          "finalProductLocationName": {
            "type": "string",
            "description": "Final product location name (read-only).",
            "nullable": true
          },
          "locationId": {
            "type": "integer",
            "description": "General location associated with this document.",
            "format": "int32",
            "nullable": true
          },
          "locationName": {
            "type": "string",
            "description": "General location name (read-only).",
            "nullable": true
          },
          "inventoryEmployeeId": {
            "type": "integer",
            "description": "Employee responsible for the inventory count (DocumentsInventory).",
            "format": "int32",
            "nullable": true
          },
          "inventoryEmployeeName": {
            "type": "string",
            "description": "Inventory employee name (read-only).",
            "nullable": true
          },
          "inventoryPartnerId": {
            "type": "integer",
            "description": "Partner associated with the inventory count (e.g. consignment stock owner).",
            "format": "int32",
            "nullable": true
          },
          "inventoryPartnerName": {
            "type": "string",
            "description": "Inventory partner name (read-only).",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "description": "Finished/assembled product ID (used in DocumentsAssembly / DocumentsDisassembly).",
            "format": "int32",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "description": "Product name (read-only).",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "description": "Unit of measure for the produced/consumed quantity.",
            "format": "int32",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "description": "UOM name (read-only).",
            "nullable": true
          },
          "documentSN": {
            "type": "string",
            "description": "Document serial/series (e.g. `NIR`, `AVZ`, `BON`).",
            "nullable": true
          },
          "documentNo": {
            "type": "string",
            "description": "Document sequential number within the series (e.g. `001234`).",
            "nullable": true
          },
          "documentSnNo": {
            "type": "string",
            "description": "Concatenated series + number for display (e.g. `NIR 001234`).",
            "nullable": true
          },
          "documentPartnerSnNo": {
            "type": "string",
            "description": "Partner's own reference number for this document (e.g. supplier's delivery note number).",
            "nullable": true
          },
          "documentDeliveryNo": {
            "type": "string",
            "description": "Shipping / delivery note number.",
            "nullable": true
          },
          "documentDate": {
            "type": "string",
            "description": "Main document date (when the operation is scheduled or took place).",
            "format": "date-time"
          },
          "documentDueDate": {
            "type": "string",
            "description": "Due date for payment or completion.",
            "format": "date-time"
          },
          "documentInvoiceSN": {
            "type": "string",
            "description": "Invoice series (e.g. `FACT`). Populated when the document generates an invoice.",
            "nullable": true
          },
          "documentInvoiceNo": {
            "type": "string",
            "description": "Invoice sequential number.",
            "nullable": true
          },
          "documentInvoiceDate": {
            "type": "string",
            "description": "Invoice date.",
            "format": "date-time"
          },
          "totalValue": {
            "type": "number",
            "description": "Total net value (excluding VAT) of all document lines.",
            "format": "double"
          },
          "totalValueVat": {
            "type": "number",
            "description": "Total VAT amount for all document lines.",
            "format": "double"
          },
          "total": {
            "type": "number",
            "description": "Grand total (net + VAT).",
            "format": "double"
          },
          "totalUnpayed": {
            "type": "number",
            "description": "Remaining unpaid amount.",
            "format": "double"
          },
          "totalCard": {
            "type": "number",
            "description": "Amount paid by card.",
            "format": "double"
          },
          "totalCash": {
            "type": "number",
            "description": "Amount paid by cash.",
            "format": "double"
          },
          "totalTickets": {
            "type": "number",
            "description": "Amount paid by meal / gift tickets.",
            "format": "double"
          },
          "totalBalanceFunds": {
            "type": "number",
            "description": "Amount paid from balance funds / credit.",
            "format": "double"
          },
          "priceUnit": {
            "type": "number",
            "description": "Unit price for the assembled/produced product (DocumentsAssembly).",
            "format": "double"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the assembled/consumed product.",
            "format": "double"
          },
          "details": {
            "type": "string",
            "description": "Internal notes / technical details visible only in the WMS back-office.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Description printed on the document (visible to partners).",
            "nullable": true
          },
          "delegateName": {
            "type": "string",
            "description": "Name of the person physically delivering/picking up the goods.",
            "nullable": true
          },
          "delegateIDSN": {
            "type": "string",
            "description": "Delegate ID card series (e.g. `MS`).",
            "nullable": true
          },
          "delegateIDNo": {
            "type": "string",
            "description": "Delegate ID card number.",
            "nullable": true
          },
          "delegateIDRegister": {
            "type": "string",
            "description": "Delegate ID issuing registry / authority.",
            "nullable": true
          },
          "delegateCar": {
            "type": "string",
            "description": "Vehicle registration number used for delivery.",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "description": "If `false`, the document is archived/deleted. Default: `true`."
          },
          "isNew": {
            "type": "boolean",
            "description": "Newly created document not yet saved to the main database."
          },
          "isForValidating": {
            "type": "boolean",
            "description": "Document is pending validation by an authorised user."
          },
          "isVerified": {
            "type": "boolean",
            "description": "Document quantities have been verified against physical count."
          },
          "isValidated": {
            "type": "boolean",
            "description": "Document has been validated (stock movements committed to the WMS).\r\nUse `PATCH /{id}/validate` to set this flag."
          },
          "isConfirmed": {
            "type": "boolean",
            "description": "Document has been confirmed (second-level approval in two-step workflows).\r\nUse `PATCH /{id}/confirm` to set this flag."
          },
          "isNulled": {
            "type": "boolean",
            "description": "Document has been cancelled / nulled (stock movements reversed).\r\nUse `PATCH /{id}/null` to set this flag. Once nulled, a document cannot be un-nulled via API."
          },
          "isInvoice": {
            "type": "boolean",
            "description": "Document has an associated invoice generated."
          },
          "isReturnInvoice": {
            "type": "boolean",
            "description": "Document is a credit note / return invoice."
          },
          "isReturn": {
            "type": "boolean",
            "description": "Document is a return/RMA operation."
          },
          "isReturnGenerated": {
            "type": "boolean",
            "description": "A return document has been automatically generated from this document."
          },
          "isOfflineValidate": {
            "type": "boolean",
            "description": "Document was validated offline (on a mobile device without connectivity) and later synced."
          },
          "isHidden": {
            "type": "boolean",
            "description": "Document is hidden from standard lists (internal use only)."
          },
          "isPrinted": {
            "type": "boolean",
            "description": "Document has been printed at least once."
          },
          "isPalletLabelPrinted": {
            "type": "boolean",
            "description": "Pallet labels have been printed for this document."
          },
          "isNotCash": {
            "type": "boolean",
            "description": "Payment was not made in cash (e.g. invoice payment terms)."
          },
          "isFromCashRegister": {
            "type": "boolean",
            "description": "Document originated from a cash register / POS."
          },
          "isServiceInvoice": {
            "type": "boolean",
            "description": "Document is a service invoice (no physical goods movement)."
          },
          "isServicePayed": {
            "type": "boolean",
            "description": "Service invoice has been paid."
          },
          "isProductionTransferRawMaterials": {
            "type": "boolean",
            "description": "Raw materials have been transferred for this production order."
          },
          "isProductionTransferFinalProduct": {
            "type": "boolean",
            "description": "Finished product has been transferred after assembly."
          },
          "isTemporary": {
            "type": "boolean",
            "description": "Document is a temporary draft not yet committed to the main workflow."
          },
          "isExcelGenerated": {
            "type": "boolean",
            "description": "Document data has been exported to Excel."
          },
          "isMultipleDocumentsCombined": {
            "type": "boolean",
            "description": "This document is a combined version of multiple source documents."
          },
          "isCombined": {
            "type": "boolean",
            "description": "This document has been merged/combined into another document."
          },
          "isChildLotsGenerated": {
            "type": "boolean",
            "description": "Child lot records have been generated for lot-split operations."
          },
          "isErpSync": {
            "type": "boolean",
            "description": "Document has been synchronised to the ERP system."
          },
          "isImportedFromErp": {
            "type": "boolean",
            "description": "Document was imported from ERP (originated in ERP, not in WMS)."
          },
          "isErpSyncStatus": {
            "type": "boolean",
            "description": "ERP sync status has been confirmed."
          },
          "isErpSyncProduction": {
            "type": "boolean",
            "description": "Production order sync to ERP is complete."
          },
          "isErpSyncTransferRawMaterials": {
            "type": "boolean",
            "description": "Raw material transfer sync to ERP is complete."
          },
          "isOlafSync": {
            "type": "boolean",
            "description": "Document has been synced to OLAF (customs reporting system)."
          },
          "erpStatus": {
            "type": "string",
            "description": "ERP sync status text/code returned by ERP.",
            "nullable": true
          },
          "erpDetails": {
            "type": "string",
            "description": "ERP sync error details or additional information.",
            "nullable": true
          },
          "erpId": {
            "type": "string",
            "description": "ERP document ID (primary identifier in the ERP system).",
            "nullable": true
          },
          "erpIdInternal": {
            "type": "string",
            "description": "ERP internal document ID (secondary identifier).",
            "nullable": true
          },
          "erpIdExternal": {
            "type": "string",
            "description": "ERP external document ID (e.g. customer-facing ID in ERP).",
            "nullable": true
          },
          "erpTotalLineCount": {
            "type": "integer",
            "description": "Total number of document lines as reported by ERP (for validation against WMS line count).",
            "format": "int32"
          },
          "sscC_Barcode": {
            "type": "string",
            "description": "SSCC (Serial Shipping Container Code) barcode in machine-readable format.",
            "nullable": true
          },
          "sscC_Barcode_Human": {
            "type": "string",
            "description": "SSCC barcode in human-readable format (with spaces / dashes).",
            "nullable": true
          },
          "entityType": {
            "type": "string",
            "description": "Entity type discriminator (used internally by the WMS to distinguish object classes).",
            "nullable": true
          },
          "source": {
            "type": "string",
            "description": "Source system or channel that created this document (e.g. `ERP`, `WEB`, `MOBILE`).",
            "nullable": true
          },
          "sourceType": {
            "type": "string",
            "description": "Source type (sub-category of Rosistem.API.DTO.Documents.DocumentDtoWithoutId.Source).",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "description": "Currency code for financial amounts (e.g. `RON`, `EUR`, `USD`).",
            "nullable": true
          },
          "parentDocument": {
            "type": "integer",
            "description": "ID of the parent document (e.g. the purchase order that generated this receipt).",
            "format": "int32"
          },
          "multipleDocumentsCombined": {
            "type": "string",
            "description": "Comma-separated list of document IDs that were merged into this combined document.",
            "nullable": true
          },
          "serviceDocumentID": {
            "type": "integer",
            "description": "ID of the associated service document.",
            "format": "int32"
          },
          "associatedDocument": {
            "type": "integer",
            "description": "ID of an associated linked document (e.g. the outbound shipment linked to a return).",
            "format": "int32"
          },
          "shipping_Code": {
            "type": "string",
            "description": "Shipping carrier tracking code / AWB number.",
            "nullable": true
          },
          "shipping_Date": {
            "type": "string",
            "description": "Scheduled shipping date.",
            "format": "date-time"
          },
          "shipping_Time": {
            "type": "string",
            "description": "Scheduled shipping time (stored as DateTime; only the time component is meaningful).",
            "format": "date-time"
          },
          "shipping_Details": {
            "type": "string",
            "description": "Shipping instructions or additional shipping notes.",
            "nullable": true
          },
          "custom1": {
            "type": "string",
            "description": "Free-text custom field 1 — meaning defined per WMS installation.",
            "nullable": true
          },
          "custom2": {
            "type": "string",
            "description": "Free-text custom field 2.",
            "nullable": true
          },
          "custom3": {
            "type": "string",
            "description": "Free-text custom field 3.",
            "nullable": true
          },
          "custom4": {
            "type": "string",
            "description": "Free-text custom field 4.",
            "nullable": true
          },
          "custom5": {
            "type": "string",
            "description": "Free-text custom field 5.",
            "nullable": true
          },
          "custom6": {
            "type": "string",
            "description": "Free-text custom field 6.",
            "nullable": true
          },
          "custom7": {
            "type": "string",
            "description": "Free-text custom field 7.",
            "nullable": true
          },
          "custom8": {
            "type": "string",
            "description": "Free-text custom field 8.",
            "nullable": true
          },
          "custom9": {
            "type": "string",
            "description": "Free-text custom field 9.",
            "nullable": true
          },
          "custom10": {
            "type": "string",
            "description": "Free-text custom field 10.",
            "nullable": true
          },
          "internalKey": {
            "type": "string",
            "description": "Internal cross-reference key for ERP / third-party integrations.",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "description": "External cross-reference key.",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this document.",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this document was created.",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this document.",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "description": "Unique identifier of this document (auto-assigned by the database).",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Full document record including server-assigned ID.\r\nA \"document\" in the WMS represents a warehouse operation (receipt, shipment, transfer, inventory count, etc.).\r\nThe same DTO structure is used for all document types; irrelevant fields are empty/null.",
        "example": {
          "id": 1234,
          "warehouseId": 1,
          "warehouseName": "Depozit Central",
          "partnerId": 42,
          "partnerName": "Furnizor SRL",
          "statusId": 1,
          "documentDate": "2026-05-24T10:00:00",
          "documentNo": "IN-2026-1234",
          "totalValue": 1500.5,
          "totalValueVat": 285.1,
          "total": 1785.6,
          "isNew": true,
          "isValidated": false,
          "isImportedFromErp": true
        }
      },
      "DocumentDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "DocumentDtoWithoutId": {
        "type": "object",
        "properties": {
          "warehouseCode": {
            "type": "string",
            "description": "Depozit Code (WMS-intern, case-insensitive).",
            "nullable": true
          },
          "warehouseInternalKey": {
            "type": "string",
            "description": "Depozit InternalKey (ERP id pastrat in WMS).",
            "nullable": true
          },
          "warehouseExternalKey": {
            "type": "string",
            "description": "Depozit ExternalKey (ERP code pastrat in WMS).",
            "nullable": true
          },
          "partnerCode": {
            "type": "string",
            "description": "Partener Code (WMS-intern, case-insensitive).",
            "nullable": true
          },
          "partnerInternalKey": {
            "type": "string",
            "description": "Partener InternalKey (ERP id).",
            "nullable": true
          },
          "partnerExternalKey": {
            "type": "string",
            "description": "Partener ExternalKey (ERP code).",
            "nullable": true
          },
          "statusCode": {
            "type": "string",
            "description": "Status Code (WMS-intern, case-insensitive). NOTA: DocumentsStatuses NU are field Code — folositi Id / InternalKey / ExternalKey.",
            "nullable": true
          },
          "statusInternalKey": {
            "type": "string",
            "description": "Status InternalKey (ERP id).",
            "nullable": true
          },
          "statusExternalKey": {
            "type": "string",
            "description": "Status ExternalKey (ERP code).",
            "nullable": true
          },
          "employeeCode": {
            "type": "string",
            "description": "Employee Code.",
            "nullable": true
          },
          "employeeInternalKey": {
            "type": "string",
            "description": "Employee InternalKey (ERP id).",
            "nullable": true
          },
          "employeeExternalKey": {
            "type": "string",
            "description": "Employee ExternalKey (ERP code).",
            "nullable": true
          },
          "userCode": {
            "type": "string",
            "description": "User Code.",
            "nullable": true
          },
          "userInternalKey": {
            "type": "string",
            "description": "User InternalKey (ERP id).",
            "nullable": true
          },
          "userExternalKey": {
            "type": "string",
            "description": "User ExternalKey (ERP code).",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "description": "ID of the warehouse this document is processed in. Use `GET /api/Warehouses` to list warehouses.",
            "format": "int32",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "description": "Warehouse display name (read-only in responses).",
            "nullable": true
          },
          "partnerId": {
            "type": "integer",
            "description": "ID of the partner (supplier for inbound, customer for outbound).\r\nUse `GET /api/Partners` to list partners.",
            "format": "int32",
            "nullable": true
          },
          "partnerName": {
            "type": "string",
            "description": "Partner display name (read-only in responses).",
            "nullable": true
          },
          "partnerAddressId": {
            "type": "integer",
            "description": "ID of the partner delivery address. Use `GET /api/Partners/{id}/Addresses`.",
            "format": "int32",
            "nullable": true
          },
          "partnerAddressName": {
            "type": "string",
            "description": "Partner address display name (read-only in responses).",
            "nullable": true
          },
          "partnersWorksiteId": {
            "type": "integer",
            "description": "ID of the partner worksite / delivery point.",
            "format": "int32",
            "nullable": true
          },
          "partnersWorksiteName": {
            "type": "string",
            "description": "Partner worksite name (read-only in responses).",
            "nullable": true
          },
          "employeeId": {
            "type": "integer",
            "description": "ID of the warehouse employee responsible for executing this document.",
            "format": "int32",
            "nullable": true
          },
          "employeeName": {
            "type": "string",
            "description": "Employee name (read-only in responses).",
            "nullable": true
          },
          "userId": {
            "type": "integer",
            "description": "ID of the system user who owns / created this document.",
            "format": "int32",
            "nullable": true
          },
          "userName": {
            "type": "string",
            "description": "System user name (read-only in responses).",
            "nullable": true
          },
          "delegateUserId": {
            "type": "integer",
            "description": "ID of the delegate user (e.g. the person physically delivering goods).",
            "format": "int32",
            "nullable": true
          },
          "delegateUserName": {
            "type": "string",
            "description": "Delegate user name (read-only in responses).",
            "nullable": true
          },
          "statusId": {
            "type": "integer",
            "description": "ID of the current workflow status. Use `GET /api/DocumentStatuses` to list statuses.\r\nChange the status via `PATCH /api/Documents{Type}/{id}/status`.",
            "format": "int32",
            "nullable": true
          },
          "statusName": {
            "type": "string",
            "description": "Status display name (read-only in responses).",
            "nullable": true
          },
          "inventoryLocationId": {
            "type": "integer",
            "description": "Inventory count location (used in DocumentsInventory).",
            "format": "int32",
            "nullable": true
          },
          "inventoryLocationName": {
            "type": "string",
            "description": "Inventory location name (read-only).",
            "nullable": true
          },
          "pickingLocationId": {
            "type": "integer",
            "description": "Picking location — where goods are picked from (used in DocumentsOut/Transfer).",
            "format": "int32",
            "nullable": true
          },
          "pickingLocationName": {
            "type": "string",
            "description": "Picking location name (read-only).",
            "nullable": true
          },
          "locationSourceId": {
            "type": "integer",
            "description": "Source location for transfer documents.",
            "format": "int32",
            "nullable": true
          },
          "locationSourceName": {
            "type": "string",
            "description": "Source location name (read-only).",
            "nullable": true
          },
          "locationDestinationId": {
            "type": "integer",
            "description": "Destination location for transfer / inbound documents.",
            "format": "int32",
            "nullable": true
          },
          "locationDestinationName": {
            "type": "string",
            "description": "Destination location name (read-only).",
            "nullable": true
          },
          "finalProductLocationId": {
            "type": "integer",
            "description": "Location where the finished product is stored (used in DocumentsAssembly).",
            "format": "int32",
            "nullable": true
          },
          "finalProductLocationName": {
            "type": "string",
            "description": "Final product location name (read-only).",
            "nullable": true
          },
          "locationId": {
            "type": "integer",
            "description": "General location associated with this document.",
            "format": "int32",
            "nullable": true
          },
          "locationName": {
            "type": "string",
            "description": "General location name (read-only).",
            "nullable": true
          },
          "inventoryEmployeeId": {
            "type": "integer",
            "description": "Employee responsible for the inventory count (DocumentsInventory).",
            "format": "int32",
            "nullable": true
          },
          "inventoryEmployeeName": {
            "type": "string",
            "description": "Inventory employee name (read-only).",
            "nullable": true
          },
          "inventoryPartnerId": {
            "type": "integer",
            "description": "Partner associated with the inventory count (e.g. consignment stock owner).",
            "format": "int32",
            "nullable": true
          },
          "inventoryPartnerName": {
            "type": "string",
            "description": "Inventory partner name (read-only).",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "description": "Finished/assembled product ID (used in DocumentsAssembly / DocumentsDisassembly).",
            "format": "int32",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "description": "Product name (read-only).",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "description": "Unit of measure for the produced/consumed quantity.",
            "format": "int32",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "description": "UOM name (read-only).",
            "nullable": true
          },
          "documentSN": {
            "type": "string",
            "description": "Document serial/series (e.g. `NIR`, `AVZ`, `BON`).",
            "nullable": true
          },
          "documentNo": {
            "type": "string",
            "description": "Document sequential number within the series (e.g. `001234`).",
            "nullable": true
          },
          "documentSnNo": {
            "type": "string",
            "description": "Concatenated series + number for display (e.g. `NIR 001234`).",
            "nullable": true
          },
          "documentPartnerSnNo": {
            "type": "string",
            "description": "Partner's own reference number for this document (e.g. supplier's delivery note number).",
            "nullable": true
          },
          "documentDeliveryNo": {
            "type": "string",
            "description": "Shipping / delivery note number.",
            "nullable": true
          },
          "documentDate": {
            "type": "string",
            "description": "Main document date (when the operation is scheduled or took place).",
            "format": "date-time"
          },
          "documentDueDate": {
            "type": "string",
            "description": "Due date for payment or completion.",
            "format": "date-time"
          },
          "documentInvoiceSN": {
            "type": "string",
            "description": "Invoice series (e.g. `FACT`). Populated when the document generates an invoice.",
            "nullable": true
          },
          "documentInvoiceNo": {
            "type": "string",
            "description": "Invoice sequential number.",
            "nullable": true
          },
          "documentInvoiceDate": {
            "type": "string",
            "description": "Invoice date.",
            "format": "date-time"
          },
          "totalValue": {
            "type": "number",
            "description": "Total net value (excluding VAT) of all document lines.",
            "format": "double"
          },
          "totalValueVat": {
            "type": "number",
            "description": "Total VAT amount for all document lines.",
            "format": "double"
          },
          "total": {
            "type": "number",
            "description": "Grand total (net + VAT).",
            "format": "double"
          },
          "totalUnpayed": {
            "type": "number",
            "description": "Remaining unpaid amount.",
            "format": "double"
          },
          "totalCard": {
            "type": "number",
            "description": "Amount paid by card.",
            "format": "double"
          },
          "totalCash": {
            "type": "number",
            "description": "Amount paid by cash.",
            "format": "double"
          },
          "totalTickets": {
            "type": "number",
            "description": "Amount paid by meal / gift tickets.",
            "format": "double"
          },
          "totalBalanceFunds": {
            "type": "number",
            "description": "Amount paid from balance funds / credit.",
            "format": "double"
          },
          "priceUnit": {
            "type": "number",
            "description": "Unit price for the assembled/produced product (DocumentsAssembly).",
            "format": "double"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the assembled/consumed product.",
            "format": "double"
          },
          "details": {
            "type": "string",
            "description": "Internal notes / technical details visible only in the WMS back-office.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Description printed on the document (visible to partners).",
            "nullable": true
          },
          "delegateName": {
            "type": "string",
            "description": "Name of the person physically delivering/picking up the goods.",
            "nullable": true
          },
          "delegateIDSN": {
            "type": "string",
            "description": "Delegate ID card series (e.g. `MS`).",
            "nullable": true
          },
          "delegateIDNo": {
            "type": "string",
            "description": "Delegate ID card number.",
            "nullable": true
          },
          "delegateIDRegister": {
            "type": "string",
            "description": "Delegate ID issuing registry / authority.",
            "nullable": true
          },
          "delegateCar": {
            "type": "string",
            "description": "Vehicle registration number used for delivery.",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "description": "If `false`, the document is archived/deleted. Default: `true`."
          },
          "isNew": {
            "type": "boolean",
            "description": "Newly created document not yet saved to the main database."
          },
          "isForValidating": {
            "type": "boolean",
            "description": "Document is pending validation by an authorised user."
          },
          "isVerified": {
            "type": "boolean",
            "description": "Document quantities have been verified against physical count."
          },
          "isValidated": {
            "type": "boolean",
            "description": "Document has been validated (stock movements committed to the WMS).\r\nUse `PATCH /{id}/validate` to set this flag."
          },
          "isConfirmed": {
            "type": "boolean",
            "description": "Document has been confirmed (second-level approval in two-step workflows).\r\nUse `PATCH /{id}/confirm` to set this flag."
          },
          "isNulled": {
            "type": "boolean",
            "description": "Document has been cancelled / nulled (stock movements reversed).\r\nUse `PATCH /{id}/null` to set this flag. Once nulled, a document cannot be un-nulled via API."
          },
          "isInvoice": {
            "type": "boolean",
            "description": "Document has an associated invoice generated."
          },
          "isReturnInvoice": {
            "type": "boolean",
            "description": "Document is a credit note / return invoice."
          },
          "isReturn": {
            "type": "boolean",
            "description": "Document is a return/RMA operation."
          },
          "isReturnGenerated": {
            "type": "boolean",
            "description": "A return document has been automatically generated from this document."
          },
          "isOfflineValidate": {
            "type": "boolean",
            "description": "Document was validated offline (on a mobile device without connectivity) and later synced."
          },
          "isHidden": {
            "type": "boolean",
            "description": "Document is hidden from standard lists (internal use only)."
          },
          "isPrinted": {
            "type": "boolean",
            "description": "Document has been printed at least once."
          },
          "isPalletLabelPrinted": {
            "type": "boolean",
            "description": "Pallet labels have been printed for this document."
          },
          "isNotCash": {
            "type": "boolean",
            "description": "Payment was not made in cash (e.g. invoice payment terms)."
          },
          "isFromCashRegister": {
            "type": "boolean",
            "description": "Document originated from a cash register / POS."
          },
          "isServiceInvoice": {
            "type": "boolean",
            "description": "Document is a service invoice (no physical goods movement)."
          },
          "isServicePayed": {
            "type": "boolean",
            "description": "Service invoice has been paid."
          },
          "isProductionTransferRawMaterials": {
            "type": "boolean",
            "description": "Raw materials have been transferred for this production order."
          },
          "isProductionTransferFinalProduct": {
            "type": "boolean",
            "description": "Finished product has been transferred after assembly."
          },
          "isTemporary": {
            "type": "boolean",
            "description": "Document is a temporary draft not yet committed to the main workflow."
          },
          "isExcelGenerated": {
            "type": "boolean",
            "description": "Document data has been exported to Excel."
          },
          "isMultipleDocumentsCombined": {
            "type": "boolean",
            "description": "This document is a combined version of multiple source documents."
          },
          "isCombined": {
            "type": "boolean",
            "description": "This document has been merged/combined into another document."
          },
          "isChildLotsGenerated": {
            "type": "boolean",
            "description": "Child lot records have been generated for lot-split operations."
          },
          "isErpSync": {
            "type": "boolean",
            "description": "Document has been synchronised to the ERP system."
          },
          "isImportedFromErp": {
            "type": "boolean",
            "description": "Document was imported from ERP (originated in ERP, not in WMS)."
          },
          "isErpSyncStatus": {
            "type": "boolean",
            "description": "ERP sync status has been confirmed."
          },
          "isErpSyncProduction": {
            "type": "boolean",
            "description": "Production order sync to ERP is complete."
          },
          "isErpSyncTransferRawMaterials": {
            "type": "boolean",
            "description": "Raw material transfer sync to ERP is complete."
          },
          "isOlafSync": {
            "type": "boolean",
            "description": "Document has been synced to OLAF (customs reporting system)."
          },
          "erpStatus": {
            "type": "string",
            "description": "ERP sync status text/code returned by ERP.",
            "nullable": true
          },
          "erpDetails": {
            "type": "string",
            "description": "ERP sync error details or additional information.",
            "nullable": true
          },
          "erpId": {
            "type": "string",
            "description": "ERP document ID (primary identifier in the ERP system).",
            "nullable": true
          },
          "erpIdInternal": {
            "type": "string",
            "description": "ERP internal document ID (secondary identifier).",
            "nullable": true
          },
          "erpIdExternal": {
            "type": "string",
            "description": "ERP external document ID (e.g. customer-facing ID in ERP).",
            "nullable": true
          },
          "erpTotalLineCount": {
            "type": "integer",
            "description": "Total number of document lines as reported by ERP (for validation against WMS line count).",
            "format": "int32"
          },
          "sscC_Barcode": {
            "type": "string",
            "description": "SSCC (Serial Shipping Container Code) barcode in machine-readable format.",
            "nullable": true
          },
          "sscC_Barcode_Human": {
            "type": "string",
            "description": "SSCC barcode in human-readable format (with spaces / dashes).",
            "nullable": true
          },
          "entityType": {
            "type": "string",
            "description": "Entity type discriminator (used internally by the WMS to distinguish object classes).",
            "nullable": true
          },
          "source": {
            "type": "string",
            "description": "Source system or channel that created this document (e.g. `ERP`, `WEB`, `MOBILE`).",
            "nullable": true
          },
          "sourceType": {
            "type": "string",
            "description": "Source type (sub-category of Rosistem.API.DTO.Documents.DocumentDtoWithoutId.Source).",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "description": "Currency code for financial amounts (e.g. `RON`, `EUR`, `USD`).",
            "nullable": true
          },
          "parentDocument": {
            "type": "integer",
            "description": "ID of the parent document (e.g. the purchase order that generated this receipt).",
            "format": "int32"
          },
          "multipleDocumentsCombined": {
            "type": "string",
            "description": "Comma-separated list of document IDs that were merged into this combined document.",
            "nullable": true
          },
          "serviceDocumentID": {
            "type": "integer",
            "description": "ID of the associated service document.",
            "format": "int32"
          },
          "associatedDocument": {
            "type": "integer",
            "description": "ID of an associated linked document (e.g. the outbound shipment linked to a return).",
            "format": "int32"
          },
          "shipping_Code": {
            "type": "string",
            "description": "Shipping carrier tracking code / AWB number.",
            "nullable": true
          },
          "shipping_Date": {
            "type": "string",
            "description": "Scheduled shipping date.",
            "format": "date-time"
          },
          "shipping_Time": {
            "type": "string",
            "description": "Scheduled shipping time (stored as DateTime; only the time component is meaningful).",
            "format": "date-time"
          },
          "shipping_Details": {
            "type": "string",
            "description": "Shipping instructions or additional shipping notes.",
            "nullable": true
          },
          "custom1": {
            "type": "string",
            "description": "Free-text custom field 1 — meaning defined per WMS installation.",
            "nullable": true
          },
          "custom2": {
            "type": "string",
            "description": "Free-text custom field 2.",
            "nullable": true
          },
          "custom3": {
            "type": "string",
            "description": "Free-text custom field 3.",
            "nullable": true
          },
          "custom4": {
            "type": "string",
            "description": "Free-text custom field 4.",
            "nullable": true
          },
          "custom5": {
            "type": "string",
            "description": "Free-text custom field 5.",
            "nullable": true
          },
          "custom6": {
            "type": "string",
            "description": "Free-text custom field 6.",
            "nullable": true
          },
          "custom7": {
            "type": "string",
            "description": "Free-text custom field 7.",
            "nullable": true
          },
          "custom8": {
            "type": "string",
            "description": "Free-text custom field 8.",
            "nullable": true
          },
          "custom9": {
            "type": "string",
            "description": "Free-text custom field 9.",
            "nullable": true
          },
          "custom10": {
            "type": "string",
            "description": "Free-text custom field 10.",
            "nullable": true
          },
          "internalKey": {
            "type": "string",
            "description": "Internal cross-reference key for ERP / third-party integrations.",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "description": "External cross-reference key.",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this document.",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this document was created.",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this document.",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Document data used for create (POST) and update (PUT) requests.\r\nFill in the fields relevant to the specific document type; unused fields can be omitted.",
        "example": {
          "warehouseCode": "CENTRAL",
          "partnerInternalKey": "ERP-PARTNER-42",
          "statusExternalKey": "NEW",
          "employeeCode": "OP_001",
          "userInternalKey": "ERP-USER-7",
          "documentDate": "2026-05-24T10:00:00",
          "documentNo": "IN-2026-FULL",
          "isImportedFromErp": true
        }
      },
      "DocumentLineDto": {
        "type": "object",
        "properties": {
          "productInternalKey": {
            "type": "string",
            "description": "Produs InternalKey (ERP id).",
            "nullable": true
          },
          "productExternalKey": {
            "type": "string",
            "description": "Produs ExternalKey (ERP code).",
            "nullable": true
          },
          "partnerCode": {
            "type": "string",
            "description": "Partener Code.",
            "nullable": true
          },
          "partnerInternalKey": {
            "type": "string",
            "description": "Partener InternalKey (ERP id).",
            "nullable": true
          },
          "partnerExternalKey": {
            "type": "string",
            "description": "Partener ExternalKey (ERP code).",
            "nullable": true
          },
          "employeeCode": {
            "type": "string",
            "description": "Employee Code.",
            "nullable": true
          },
          "employeeInternalKey": {
            "type": "string",
            "description": "Employee InternalKey (ERP id).",
            "nullable": true
          },
          "employeeExternalKey": {
            "type": "string",
            "description": "Employee ExternalKey (ERP code).",
            "nullable": true
          },
          "userCode": {
            "type": "string",
            "description": "User Code.",
            "nullable": true
          },
          "userInternalKey": {
            "type": "string",
            "description": "User InternalKey (ERP id).",
            "nullable": true
          },
          "userExternalKey": {
            "type": "string",
            "description": "User ExternalKey (ERP code).",
            "nullable": true
          },
          "uomCode": {
            "type": "string",
            "description": "UoM Code (WMS-intern, case-insensitive).",
            "nullable": true
          },
          "uomInternalKey": {
            "type": "string",
            "description": "UoM InternalKey (ERP id).",
            "nullable": true
          },
          "uomExternalKey": {
            "type": "string",
            "description": "UoM ExternalKey (ERP code).",
            "nullable": true
          },
          "locationSourceCode": {
            "type": "string",
            "description": "Locatie sursa Code (WMS-intern).",
            "nullable": true
          },
          "locationSourceInternalKey": {
            "type": "string",
            "description": "Locatie sursa InternalKey (ERP id).",
            "nullable": true
          },
          "locationSourceExternalKey": {
            "type": "string",
            "description": "Locatie sursa ExternalKey (ERP code).",
            "nullable": true
          },
          "locationDestinationCode": {
            "type": "string",
            "description": "Locatie destinatie Code.",
            "nullable": true
          },
          "locationDestinationInternalKey": {
            "type": "string",
            "description": "Locatie destinatie InternalKey (ERP id).",
            "nullable": true
          },
          "locationDestinationExternalKey": {
            "type": "string",
            "description": "Locatie destinatie ExternalKey (ERP code).",
            "nullable": true
          },
          "locationCode": {
            "type": "string",
            "description": "Locatie generala Code.",
            "nullable": true
          },
          "locationInternalKey": {
            "type": "string",
            "description": "Locatie generala InternalKey (ERP id).",
            "nullable": true
          },
          "locationExternalKey": {
            "type": "string",
            "description": "Locatie generala ExternalKey (ERP code).",
            "nullable": true
          },
          "documentId": {
            "type": "integer",
            "description": "ID of the parent document this line belongs to (e.g. the DocumentsIn ID).",
            "format": "int32",
            "nullable": true
          },
          "partnerId": {
            "type": "integer",
            "description": "ID of the partner on this line (overrides document-level partner when set).",
            "format": "int32",
            "nullable": true
          },
          "partnerName": {
            "type": "string",
            "description": "Partner name (read-only in responses).",
            "nullable": true
          },
          "employeeId": {
            "type": "integer",
            "description": "ID of the employee responsible for this line.",
            "format": "int32",
            "nullable": true
          },
          "employeeName": {
            "type": "string",
            "description": "Employee name (read-only in responses).",
            "nullable": true
          },
          "userId": {
            "type": "integer",
            "description": "ID of the system user who owns this line.",
            "format": "int32",
            "nullable": true
          },
          "userName": {
            "type": "string",
            "description": "System user name (read-only in responses).",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "description": "ID of the product on this line. Use `GET /api/Products` to find products.",
            "format": "int32",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "description": "Product display name (read-only in responses).",
            "nullable": true
          },
          "productBarcode": {
            "type": "string",
            "description": "Product barcode (read-only in responses).",
            "nullable": true
          },
          "productCode": {
            "type": "string",
            "description": "Product internal Code (WMS Products.Code field). Pe REQUEST: uses for lookup case-insensitive (vezi EntityResolver). Pe RESPONSE: read-only, populat de server.",
            "nullable": true
          },
          "productUom": {
            "type": "string",
            "description": "Product default UOM code (read-only in responses).",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "description": "ID of the unit of measure for the quantity on this line. Defaults to the product's default UOM.",
            "format": "int32",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "description": "UOM display name (read-only in responses).",
            "nullable": true
          },
          "productUomMultipleId": {
            "type": "integer",
            "description": "ID of an alternative UOM-multiple (e.g. carton when product UOM is pieces).",
            "format": "int32",
            "nullable": true
          },
          "locationSourceId": {
            "type": "integer",
            "description": "Source location (bin) for this line (used in transfers and outbound documents).",
            "format": "int32",
            "nullable": true
          },
          "locationSourceName": {
            "type": "string",
            "description": "Source location name (read-only).",
            "nullable": true
          },
          "locationDestinationId": {
            "type": "integer",
            "description": "Destination location (bin) for this line (used in inbound and transfer documents).",
            "format": "int32",
            "nullable": true
          },
          "locationDestinationName": {
            "type": "string",
            "description": "Destination location name (read-only).",
            "nullable": true
          },
          "locationId": {
            "type": "integer",
            "description": "General location associated with this line.",
            "format": "int32",
            "nullable": true
          },
          "locationName": {
            "type": "string",
            "description": "General location name (read-only).",
            "nullable": true
          },
          "barcode": {
            "type": "string",
            "description": "Scanned barcode value. Can be used to identify the product during mobile scanning.",
            "nullable": true
          },
          "lot": {
            "type": "string",
            "description": "Lot/batch number for lot-tracked products. Empty for products with `WithLot = false`.",
            "nullable": true
          },
          "lotDate": {
            "type": "string",
            "description": "Lot production date (for products with `WithLotDate = true`).",
            "format": "date-time"
          },
          "lotBestBeforeDate": {
            "type": "string",
            "description": "Lot best-before / expiration date (for products with `WithExpirationDate = true`). Used for FEFO.",
            "format": "date-time"
          },
          "serialNumber": {
            "type": "string",
            "description": "Serial number for serial-tracked products. One line = one serial number = one unit.",
            "nullable": true
          },
          "vatPercent": {
            "type": "number",
            "description": "VAT percentage applied to this line (e.g. `19` for 19%).",
            "format": "double"
          },
          "priceUnit": {
            "type": "number",
            "description": "Unit price excluding VAT.",
            "format": "double"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity ordered / expected on this line.",
            "format": "double"
          },
          "priceValue": {
            "type": "number",
            "description": "Line net value: `Quantity × PriceUnit`.",
            "format": "double"
          },
          "priceValueVat": {
            "type": "number",
            "description": "VAT amount for this line: `PriceValue × VatPercent / 100`.",
            "format": "double"
          },
          "priceTotal": {
            "type": "number",
            "description": "Line gross total: `PriceValue + PriceValueVat`.",
            "format": "double"
          },
          "priceAdd": {
            "type": "number",
            "description": "Additional price surcharge on top of the base price.",
            "format": "double"
          },
          "priceDiscount": {
            "type": "number",
            "description": "Discount amount per unit.",
            "format": "double"
          },
          "priceSaleUnit": {
            "type": "number",
            "description": "Customer sale price per unit (for outbound documents).",
            "format": "double"
          },
          "priceUnitCurrency": {
            "type": "string",
            "description": "Currency code for the unit price (when different from the document currency).",
            "nullable": true
          },
          "scanQuantity": {
            "type": "number",
            "description": "Quantity actually scanned/picked by the warehouse operator.\r\nUpdated in real-time during mobile scanning operations.",
            "format": "double"
          },
          "scanQuantityConfirmation": {
            "type": "number",
            "description": "Quantity confirmed during a second-pass verification scan.",
            "format": "double"
          },
          "uomMultipleQuantity": {
            "type": "number",
            "description": "Quantity expressed in the UOM-multiple (e.g. number of cartons).",
            "format": "double"
          },
          "scanRemainQuantity": {
            "type": "number",
            "description": "Remaining quantity to scan: `Quantity - ScanQuantity`.",
            "format": "double"
          },
          "stockLocationAfterInventoryValidation": {
            "type": "number",
            "description": "Stock at this location after the inventory count was validated.",
            "format": "double"
          },
          "stockEmployeeAfterInventoryValidation": {
            "type": "number",
            "description": "Stock attributed to the employee after inventory validation.",
            "format": "double"
          },
          "stockPartnerAfterInventoryValidation": {
            "type": "number",
            "description": "Stock attributed to the partner after inventory validation.",
            "format": "double"
          },
          "verificationQuantity": {
            "type": "number",
            "description": "Expected quantity used during physical verification (may differ from Rosistem.API.DTO.Documents.DocumentLineDtoWithoutId.Quantity if ERP quantity differs).",
            "format": "double"
          },
          "quantityERP": {
            "type": "number",
            "description": "Quantity as imported from ERP (for comparison / validation purposes).",
            "format": "double"
          },
          "quantityPacks": {
            "type": "number",
            "description": "Number of packaging units (e.g. cartons) for this line.",
            "format": "double"
          },
          "quantityPallet": {
            "type": "number",
            "description": "Number of pallets for this line.",
            "format": "double"
          },
          "details": {
            "type": "string",
            "description": "Internal technical details / notes for this line.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Public description printed on the document.",
            "nullable": true
          },
          "entityType": {
            "type": "string",
            "description": "Entity type discriminator (internal use).",
            "nullable": true
          },
          "locations": {
            "type": "string",
            "description": "JSON or comma-separated list of location IDs associated with this line (for multi-location picks).",
            "nullable": true
          },
          "slaveDocumentLine": {
            "type": "integer",
            "description": "ID of the slave (child) document line linked to this line (for split operations).",
            "format": "int32"
          },
          "slaveDocumentLines": {
            "type": "string",
            "description": "Comma-separated IDs of all slave document lines.",
            "nullable": true
          },
          "productPartnerCode": {
            "type": "string",
            "description": "Partner's own product code for this item (cross-reference).",
            "nullable": true
          },
          "parentLineId": {
            "type": "integer",
            "description": "ID of the parent line (for child/split lines).",
            "format": "int32"
          },
          "internalNumber": {
            "type": "integer",
            "description": "Internal sequential number within the document.",
            "format": "int32"
          },
          "isErpSync": {
            "type": "boolean",
            "description": "Whether this line has been synchronised to ERP."
          },
          "erpLineId": {
            "type": "string",
            "description": "ERP line identifier.",
            "nullable": true
          },
          "erpLineOrder": {
            "type": "string",
            "description": "ERP line order / sort sequence.",
            "nullable": true
          },
          "erpLineDetails": {
            "type": "string",
            "description": "Additional details from ERP for this line.",
            "nullable": true
          },
          "erpLineValueDecimal": {
            "type": "number",
            "description": "Numeric value from ERP (custom field, meaning depends on ERP integration).",
            "format": "double"
          },
          "erpLineValueNumber": {
            "type": "integer",
            "description": "Integer value from ERP (custom field).",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean",
            "description": "If `false`, this line is archived/deleted."
          },
          "internalKey": {
            "type": "string",
            "description": "Internal cross-reference key.",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "description": "External cross-reference key.",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this line.",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this line was created.",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this line.",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "description": "Unique identifier of this document line (auto-assigned).",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Full document line record including server-assigned ID.\r\nA document line represents one product entry within a warehouse document.",
        "example": {
          "id": 5001,
          "documentId": 1234,
          "productId": 42,
          "productCode": "SKU-001",
          "productName": "Articol demo",
          "quantity": 10,
          "priceUnit": 150.05,
          "priceValue": 1500.5,
          "lot": "LOT-2026-001"
        }
      },
      "DocumentLineDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentLineDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "DocumentLineDtoWithoutId": {
        "type": "object",
        "properties": {
          "productInternalKey": {
            "type": "string",
            "description": "Produs InternalKey (ERP id).",
            "nullable": true
          },
          "productExternalKey": {
            "type": "string",
            "description": "Produs ExternalKey (ERP code).",
            "nullable": true
          },
          "partnerCode": {
            "type": "string",
            "description": "Partener Code.",
            "nullable": true
          },
          "partnerInternalKey": {
            "type": "string",
            "description": "Partener InternalKey (ERP id).",
            "nullable": true
          },
          "partnerExternalKey": {
            "type": "string",
            "description": "Partener ExternalKey (ERP code).",
            "nullable": true
          },
          "employeeCode": {
            "type": "string",
            "description": "Employee Code.",
            "nullable": true
          },
          "employeeInternalKey": {
            "type": "string",
            "description": "Employee InternalKey (ERP id).",
            "nullable": true
          },
          "employeeExternalKey": {
            "type": "string",
            "description": "Employee ExternalKey (ERP code).",
            "nullable": true
          },
          "userCode": {
            "type": "string",
            "description": "User Code.",
            "nullable": true
          },
          "userInternalKey": {
            "type": "string",
            "description": "User InternalKey (ERP id).",
            "nullable": true
          },
          "userExternalKey": {
            "type": "string",
            "description": "User ExternalKey (ERP code).",
            "nullable": true
          },
          "uomCode": {
            "type": "string",
            "description": "UoM Code (WMS-intern, case-insensitive).",
            "nullable": true
          },
          "uomInternalKey": {
            "type": "string",
            "description": "UoM InternalKey (ERP id).",
            "nullable": true
          },
          "uomExternalKey": {
            "type": "string",
            "description": "UoM ExternalKey (ERP code).",
            "nullable": true
          },
          "locationSourceCode": {
            "type": "string",
            "description": "Locatie sursa Code (WMS-intern).",
            "nullable": true
          },
          "locationSourceInternalKey": {
            "type": "string",
            "description": "Locatie sursa InternalKey (ERP id).",
            "nullable": true
          },
          "locationSourceExternalKey": {
            "type": "string",
            "description": "Locatie sursa ExternalKey (ERP code).",
            "nullable": true
          },
          "locationDestinationCode": {
            "type": "string",
            "description": "Locatie destinatie Code.",
            "nullable": true
          },
          "locationDestinationInternalKey": {
            "type": "string",
            "description": "Locatie destinatie InternalKey (ERP id).",
            "nullable": true
          },
          "locationDestinationExternalKey": {
            "type": "string",
            "description": "Locatie destinatie ExternalKey (ERP code).",
            "nullable": true
          },
          "locationCode": {
            "type": "string",
            "description": "Locatie generala Code.",
            "nullable": true
          },
          "locationInternalKey": {
            "type": "string",
            "description": "Locatie generala InternalKey (ERP id).",
            "nullable": true
          },
          "locationExternalKey": {
            "type": "string",
            "description": "Locatie generala ExternalKey (ERP code).",
            "nullable": true
          },
          "documentId": {
            "type": "integer",
            "description": "ID of the parent document this line belongs to (e.g. the DocumentsIn ID).",
            "format": "int32",
            "nullable": true
          },
          "partnerId": {
            "type": "integer",
            "description": "ID of the partner on this line (overrides document-level partner when set).",
            "format": "int32",
            "nullable": true
          },
          "partnerName": {
            "type": "string",
            "description": "Partner name (read-only in responses).",
            "nullable": true
          },
          "employeeId": {
            "type": "integer",
            "description": "ID of the employee responsible for this line.",
            "format": "int32",
            "nullable": true
          },
          "employeeName": {
            "type": "string",
            "description": "Employee name (read-only in responses).",
            "nullable": true
          },
          "userId": {
            "type": "integer",
            "description": "ID of the system user who owns this line.",
            "format": "int32",
            "nullable": true
          },
          "userName": {
            "type": "string",
            "description": "System user name (read-only in responses).",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "description": "ID of the product on this line. Use `GET /api/Products` to find products.",
            "format": "int32",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "description": "Product display name (read-only in responses).",
            "nullable": true
          },
          "productBarcode": {
            "type": "string",
            "description": "Product barcode (read-only in responses).",
            "nullable": true
          },
          "productCode": {
            "type": "string",
            "description": "Product internal Code (WMS Products.Code field). Pe REQUEST: uses for lookup case-insensitive (vezi EntityResolver). Pe RESPONSE: read-only, populat de server.",
            "nullable": true
          },
          "productUom": {
            "type": "string",
            "description": "Product default UOM code (read-only in responses).",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "description": "ID of the unit of measure for the quantity on this line. Defaults to the product's default UOM.",
            "format": "int32",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "description": "UOM display name (read-only in responses).",
            "nullable": true
          },
          "productUomMultipleId": {
            "type": "integer",
            "description": "ID of an alternative UOM-multiple (e.g. carton when product UOM is pieces).",
            "format": "int32",
            "nullable": true
          },
          "locationSourceId": {
            "type": "integer",
            "description": "Source location (bin) for this line (used in transfers and outbound documents).",
            "format": "int32",
            "nullable": true
          },
          "locationSourceName": {
            "type": "string",
            "description": "Source location name (read-only).",
            "nullable": true
          },
          "locationDestinationId": {
            "type": "integer",
            "description": "Destination location (bin) for this line (used in inbound and transfer documents).",
            "format": "int32",
            "nullable": true
          },
          "locationDestinationName": {
            "type": "string",
            "description": "Destination location name (read-only).",
            "nullable": true
          },
          "locationId": {
            "type": "integer",
            "description": "General location associated with this line.",
            "format": "int32",
            "nullable": true
          },
          "locationName": {
            "type": "string",
            "description": "General location name (read-only).",
            "nullable": true
          },
          "barcode": {
            "type": "string",
            "description": "Scanned barcode value. Can be used to identify the product during mobile scanning.",
            "nullable": true
          },
          "lot": {
            "type": "string",
            "description": "Lot/batch number for lot-tracked products. Empty for products with `WithLot = false`.",
            "nullable": true
          },
          "lotDate": {
            "type": "string",
            "description": "Lot production date (for products with `WithLotDate = true`).",
            "format": "date-time"
          },
          "lotBestBeforeDate": {
            "type": "string",
            "description": "Lot best-before / expiration date (for products with `WithExpirationDate = true`). Used for FEFO.",
            "format": "date-time"
          },
          "serialNumber": {
            "type": "string",
            "description": "Serial number for serial-tracked products. One line = one serial number = one unit.",
            "nullable": true
          },
          "vatPercent": {
            "type": "number",
            "description": "VAT percentage applied to this line (e.g. `19` for 19%).",
            "format": "double"
          },
          "priceUnit": {
            "type": "number",
            "description": "Unit price excluding VAT.",
            "format": "double"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity ordered / expected on this line.",
            "format": "double"
          },
          "priceValue": {
            "type": "number",
            "description": "Line net value: `Quantity × PriceUnit`.",
            "format": "double"
          },
          "priceValueVat": {
            "type": "number",
            "description": "VAT amount for this line: `PriceValue × VatPercent / 100`.",
            "format": "double"
          },
          "priceTotal": {
            "type": "number",
            "description": "Line gross total: `PriceValue + PriceValueVat`.",
            "format": "double"
          },
          "priceAdd": {
            "type": "number",
            "description": "Additional price surcharge on top of the base price.",
            "format": "double"
          },
          "priceDiscount": {
            "type": "number",
            "description": "Discount amount per unit.",
            "format": "double"
          },
          "priceSaleUnit": {
            "type": "number",
            "description": "Customer sale price per unit (for outbound documents).",
            "format": "double"
          },
          "priceUnitCurrency": {
            "type": "string",
            "description": "Currency code for the unit price (when different from the document currency).",
            "nullable": true
          },
          "scanQuantity": {
            "type": "number",
            "description": "Quantity actually scanned/picked by the warehouse operator.\r\nUpdated in real-time during mobile scanning operations.",
            "format": "double"
          },
          "scanQuantityConfirmation": {
            "type": "number",
            "description": "Quantity confirmed during a second-pass verification scan.",
            "format": "double"
          },
          "uomMultipleQuantity": {
            "type": "number",
            "description": "Quantity expressed in the UOM-multiple (e.g. number of cartons).",
            "format": "double"
          },
          "scanRemainQuantity": {
            "type": "number",
            "description": "Remaining quantity to scan: `Quantity - ScanQuantity`.",
            "format": "double"
          },
          "stockLocationAfterInventoryValidation": {
            "type": "number",
            "description": "Stock at this location after the inventory count was validated.",
            "format": "double"
          },
          "stockEmployeeAfterInventoryValidation": {
            "type": "number",
            "description": "Stock attributed to the employee after inventory validation.",
            "format": "double"
          },
          "stockPartnerAfterInventoryValidation": {
            "type": "number",
            "description": "Stock attributed to the partner after inventory validation.",
            "format": "double"
          },
          "verificationQuantity": {
            "type": "number",
            "description": "Expected quantity used during physical verification (may differ from Rosistem.API.DTO.Documents.DocumentLineDtoWithoutId.Quantity if ERP quantity differs).",
            "format": "double"
          },
          "quantityERP": {
            "type": "number",
            "description": "Quantity as imported from ERP (for comparison / validation purposes).",
            "format": "double"
          },
          "quantityPacks": {
            "type": "number",
            "description": "Number of packaging units (e.g. cartons) for this line.",
            "format": "double"
          },
          "quantityPallet": {
            "type": "number",
            "description": "Number of pallets for this line.",
            "format": "double"
          },
          "details": {
            "type": "string",
            "description": "Internal technical details / notes for this line.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Public description printed on the document.",
            "nullable": true
          },
          "entityType": {
            "type": "string",
            "description": "Entity type discriminator (internal use).",
            "nullable": true
          },
          "locations": {
            "type": "string",
            "description": "JSON or comma-separated list of location IDs associated with this line (for multi-location picks).",
            "nullable": true
          },
          "slaveDocumentLine": {
            "type": "integer",
            "description": "ID of the slave (child) document line linked to this line (for split operations).",
            "format": "int32"
          },
          "slaveDocumentLines": {
            "type": "string",
            "description": "Comma-separated IDs of all slave document lines.",
            "nullable": true
          },
          "productPartnerCode": {
            "type": "string",
            "description": "Partner's own product code for this item (cross-reference).",
            "nullable": true
          },
          "parentLineId": {
            "type": "integer",
            "description": "ID of the parent line (for child/split lines).",
            "format": "int32"
          },
          "internalNumber": {
            "type": "integer",
            "description": "Internal sequential number within the document.",
            "format": "int32"
          },
          "isErpSync": {
            "type": "boolean",
            "description": "Whether this line has been synchronised to ERP."
          },
          "erpLineId": {
            "type": "string",
            "description": "ERP line identifier.",
            "nullable": true
          },
          "erpLineOrder": {
            "type": "string",
            "description": "ERP line order / sort sequence.",
            "nullable": true
          },
          "erpLineDetails": {
            "type": "string",
            "description": "Additional details from ERP for this line.",
            "nullable": true
          },
          "erpLineValueDecimal": {
            "type": "number",
            "description": "Numeric value from ERP (custom field, meaning depends on ERP integration).",
            "format": "double"
          },
          "erpLineValueNumber": {
            "type": "integer",
            "description": "Integer value from ERP (custom field).",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean",
            "description": "If `false`, this line is archived/deleted."
          },
          "internalKey": {
            "type": "string",
            "description": "Internal cross-reference key.",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "description": "External cross-reference key.",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this line.",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this line was created.",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this line.",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Document line data used for create (POST) and update (PUT) requests.",
        "example": {
          "productCode": "SKU-001",
          "productInternalKey": "100",
          "productExternalKey": "PROD-X",
          "uomInternalKey": "BUC",
          "locationDestinationCode": "A-01-1-A-01",
          "quantity": 10,
          "lot": "LOT-2026-001",
          "serial": "SN-001"
        }
      },
      "DocumentLineLotDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "documentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "documentLineId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "productCode": {
            "type": "string",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "nullable": true
          },
          "productUomMultipleId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "barcode": {
            "type": "string",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "uomMultipleQuantity": {
            "type": "number",
            "format": "double"
          },
          "lot": {
            "type": "string",
            "nullable": true
          },
          "lotDate": {
            "type": "string",
            "nullable": true
          },
          "lotBestBeforeDate": {
            "type": "string",
            "format": "date-time"
          },
          "isErpSync": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "DocumentLineLotDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentLineLotDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "DocumentLineLotDtoWithoutId": {
        "type": "object",
        "properties": {
          "documentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "documentLineId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productUomMultipleId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "barcode": {
            "type": "string",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "uomMultipleQuantity": {
            "type": "number",
            "format": "double"
          },
          "lot": {
            "type": "string",
            "nullable": true
          },
          "lotDate": {
            "type": "string",
            "nullable": true
          },
          "lotBestBeforeDate": {
            "type": "string",
            "format": "date-time"
          },
          "isErpSync": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "DocumentLineSerialNumberDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "documentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "documentLineId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "serialNumber": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DocumentLineSerialNumberDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentLineSerialNumberDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "DocumentLineSerialNumberDtoWithoutId": {
        "type": "object",
        "properties": {
          "documentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "documentLineId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "serialNumber": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DocumentStatusDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the status record.",
            "format": "int32"
          },
          "code": {
            "type": "string",
            "description": "Short code used for quick identification. Example: `WTG`, `APPR`, `DONE`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Human-readable status name shown in the WMS UI and on documents. Example: `Waiting approval`.",
            "nullable": true
          },
          "details": {
            "type": "string",
            "description": "Optional description of what this status means or when it is applied.",
            "nullable": true
          },
          "documentType": {
            "type": "integer",
            "description": "Numeric code identifying which document type this status belongs to.\r\nValues: `1`=DocumentsIn, `2`=DocumentsOut, `3`=DocumentsTransfer,\r\n`4`=DocumentsInventory, `5`=DocumentsAssembly, `6`=DocumentsDisassembly,\r\n`7`=DocumentsReturn, `8`=DocumentsConsumption, `9`=DocumentsLoan.\r\nUse `0` for statuses shared across all document types.",
            "format": "int32"
          },
          "isSystem": {
            "type": "boolean",
            "description": "If `true`, this status is built-in and cannot be deleted. System statuses are created by the WMS installer."
          },
          "isWaiting": {
            "type": "boolean",
            "description": "Semantic flag: document is waiting for an action (e.g. waiting for approval)."
          },
          "isApproved": {
            "type": "boolean",
            "description": "Semantic flag: document has been approved by an authorised user."
          },
          "isInProgress": {
            "type": "boolean",
            "description": "Semantic flag: document is currently being processed (picking in progress, etc.)."
          },
          "isFinished": {
            "type": "boolean",
            "description": "Semantic flag: document processing is complete."
          },
          "isNulled": {
            "type": "boolean",
            "description": "Semantic flag: document has been cancelled / nulled."
          },
          "isVerified": {
            "type": "boolean",
            "description": "Semantic flag: document quantities have been verified against physical count."
          },
          "isShipped": {
            "type": "boolean",
            "description": "Semantic flag: goods have been shipped / dispatched."
          },
          "isActive": {
            "type": "boolean",
            "description": "If `false`, this status is archived and hidden from dropdowns."
          },
          "internalKey": {
            "type": "string",
            "description": "Internal cross-reference key for ERP integrations.",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "description": "External cross-reference key for ERP integrations.",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this status.",
            "format": "int32"
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this status was created.",
            "format": "date-time"
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this status.",
            "format": "int32"
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Document status — a configurable workflow state that can be assigned to any document.\r\nEach document type can have its own set of statuses.\r\nStatus semantics (Waiting, Approved, etc.) are controlled by the boolean flags below."
      },
      "DocumentStatusDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentStatusDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "DocumentStatusDtoWithoutId": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Short code. Example: `APPR`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Display name. Example: `Approved`.",
            "nullable": true
          },
          "details": {
            "type": "string",
            "description": "Optional description.",
            "nullable": true
          },
          "documentType": {
            "type": "integer",
            "description": "Document type numeric code this status belongs to (0 = shared).",
            "format": "int32"
          },
          "isSystem": {
            "type": "boolean",
            "description": "System-managed flag (set to false for custom statuses)."
          },
          "isWaiting": {
            "type": "boolean",
            "description": "Semantic: waiting for action."
          },
          "isApproved": {
            "type": "boolean",
            "description": "Semantic: approved."
          },
          "isInProgress": {
            "type": "boolean",
            "description": "Semantic: in progress."
          },
          "isFinished": {
            "type": "boolean",
            "description": "Semantic: finished / complete."
          },
          "isNulled": {
            "type": "boolean",
            "description": "Semantic: cancelled / nulled."
          },
          "isVerified": {
            "type": "boolean",
            "description": "Semantic: verified against physical count."
          },
          "isShipped": {
            "type": "boolean",
            "description": "Semantic: shipped / dispatched."
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether this status is active and appears in dropdowns."
          },
          "internalKey": {
            "type": "string",
            "description": "Internal cross-reference key.",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "description": "External cross-reference key.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request body for creating or updating a document status (ID is assigned by the server)."
      },
      "GenericCustomerDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Customer full name or company name.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Used to look up existing partner — create if not found.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GenericLineItemDto": {
        "type": "object",
        "properties": {
          "sku": {
            "type": "string",
            "description": "Product SKU / code. Matched against Products.Code then Products.Barcode.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Fallback product name if SKU not found (stored in Notes).",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "format": "double"
          },
          "discountPercent": {
            "type": "number",
            "description": "Discount percent 0-100. Default 0.",
            "format": "double"
          },
          "vatPercent": {
            "type": "number",
            "description": "VAT percent. If 0, product default is used.",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "GenericOrderWebhookDto": {
        "type": "object",
        "properties": {
          "orderNumber": {
            "type": "string",
            "description": "Order number from the source platform (used as CustomerRef).",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "description": "ISO 8601 order date. Defaults to now if omitted.",
            "format": "date-time",
            "nullable": true
          },
          "requiredDate": {
            "type": "string",
            "description": "Requested delivery date.",
            "format": "date-time",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "description": "Target WMS warehouse ID. If 0/null, the first active warehouse is used.",
            "format": "int32",
            "nullable": true
          },
          "customer": {
            "$ref": "#/components/schemas/GenericCustomerDto"
          },
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenericLineItemDto"
            },
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "description": "Source platform identifier, stored in Notes (e.g. \"shopify\", \"magento\").",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "JToken": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/JToken"
        }
      },
      "KpiSnapshotDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "snapshotAt": {
            "type": "string",
            "format": "date-time"
          },
          "kpiCode": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "number",
            "format": "double"
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "contextId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "KpiSnapshotDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KpiSnapshotDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "MovementDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "documentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "documentLineId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "productCode": {
            "type": "string",
            "nullable": true
          },
          "productBarcode": {
            "type": "string",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "nullable": true
          },
          "locationId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "locationName": {
            "type": "string",
            "nullable": true
          },
          "locationSourceId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "locationSourceName": {
            "type": "string",
            "nullable": true
          },
          "locationDestinationId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "locationDestinationName": {
            "type": "string",
            "nullable": true
          },
          "movementDate": {
            "type": "string",
            "format": "date-time"
          },
          "barcode": {
            "type": "string",
            "nullable": true
          },
          "lot": {
            "type": "string",
            "nullable": true
          },
          "serialNumber": {
            "type": "string",
            "nullable": true
          },
          "initialQuantity": {
            "type": "number",
            "format": "double"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "reservedQuantity": {
            "type": "number",
            "format": "double"
          },
          "availableQuantity": {
            "type": "number",
            "format": "double"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "priceIn": {
            "type": "number",
            "format": "double"
          },
          "priceOut": {
            "type": "number",
            "format": "double"
          },
          "priceAdd": {
            "type": "number",
            "format": "double"
          },
          "priceDiscount": {
            "type": "number",
            "format": "double"
          },
          "direction": {
            "type": "integer",
            "format": "int32"
          },
          "isStock": {
            "type": "boolean"
          },
          "isInventoryAdjustment": {
            "type": "boolean"
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MovementDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MovementDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "PalletDto": {
        "type": "object",
        "properties": {
          "assemblyLineId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "assemblyLineName": {
            "type": "string",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "palletTypeId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "palletTypeName": {
            "type": "string",
            "nullable": true
          },
          "sscC_Barcode": {
            "type": "string",
            "nullable": true
          },
          "sscC_Barcode_Human": {
            "type": "string",
            "nullable": true
          },
          "sscC_Serial": {
            "type": "string",
            "nullable": true
          },
          "lot": {
            "type": "string",
            "nullable": true
          },
          "lotDate": {
            "type": "string",
            "format": "date-time"
          },
          "lotBestBeforeDate": {
            "type": "string",
            "format": "date-time"
          },
          "width": {
            "type": "number",
            "format": "double"
          },
          "height": {
            "type": "number",
            "format": "double"
          },
          "length": {
            "type": "number",
            "format": "double"
          },
          "weight": {
            "type": "number",
            "format": "double"
          },
          "thickness": {
            "type": "number",
            "format": "double"
          },
          "volume": {
            "type": "number",
            "format": "double"
          },
          "material": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "copies": {
            "type": "integer",
            "format": "int32"
          },
          "isPrinted": {
            "type": "boolean"
          },
          "isNew": {
            "type": "boolean"
          },
          "isSameProduct": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PalletDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PalletDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "PalletDtoWithoutId": {
        "type": "object",
        "properties": {
          "assemblyLineId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "assemblyLineName": {
            "type": "string",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "palletTypeId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "palletTypeName": {
            "type": "string",
            "nullable": true
          },
          "sscC_Barcode": {
            "type": "string",
            "nullable": true
          },
          "sscC_Barcode_Human": {
            "type": "string",
            "nullable": true
          },
          "sscC_Serial": {
            "type": "string",
            "nullable": true
          },
          "lot": {
            "type": "string",
            "nullable": true
          },
          "lotDate": {
            "type": "string",
            "format": "date-time"
          },
          "lotBestBeforeDate": {
            "type": "string",
            "format": "date-time"
          },
          "width": {
            "type": "number",
            "format": "double"
          },
          "height": {
            "type": "number",
            "format": "double"
          },
          "length": {
            "type": "number",
            "format": "double"
          },
          "weight": {
            "type": "number",
            "format": "double"
          },
          "thickness": {
            "type": "number",
            "format": "double"
          },
          "volume": {
            "type": "number",
            "format": "double"
          },
          "material": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "copies": {
            "type": "integer",
            "format": "int32"
          },
          "isPrinted": {
            "type": "boolean"
          },
          "isNew": {
            "type": "boolean"
          },
          "isSameProduct": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PalletLabelTemplateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "template": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PalletTypeDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "width": {
            "type": "number",
            "format": "double"
          },
          "height": {
            "type": "number",
            "format": "double"
          },
          "length": {
            "type": "number",
            "format": "double"
          },
          "weight": {
            "type": "number",
            "format": "double"
          },
          "thickness": {
            "type": "number",
            "format": "double"
          },
          "material": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "volume": {
            "type": "number",
            "format": "double"
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PalletTypeDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PalletTypeDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "PalletTypeDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "width": {
            "type": "number",
            "format": "double"
          },
          "height": {
            "type": "number",
            "format": "double"
          },
          "length": {
            "type": "number",
            "format": "double"
          },
          "weight": {
            "type": "number",
            "format": "double"
          },
          "thickness": {
            "type": "number",
            "format": "double"
          },
          "material": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "volume": {
            "type": "number",
            "format": "double"
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PartnerAddressDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "partnerId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cityId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countryId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "partnerName": {
            "type": "string",
            "nullable": true
          },
          "cityName": {
            "type": "string",
            "nullable": true
          },
          "countyName": {
            "type": "string",
            "nullable": true
          },
          "countryName": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "contactName": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "gln": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "longitude": {
            "type": "string",
            "nullable": true
          },
          "latitude": {
            "type": "string",
            "nullable": true
          },
          "guid": {
            "type": "string",
            "format": "uuid"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PartnerDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "partnerTypeId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "partnerTypeCode": {
            "type": "string",
            "nullable": true
          },
          "partnerTypeName": {
            "type": "string",
            "nullable": true
          },
          "cityId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cityCode": {
            "type": "string",
            "nullable": true
          },
          "cityName": {
            "type": "string",
            "nullable": true
          },
          "countyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countyCode": {
            "type": "string",
            "nullable": true
          },
          "countyName": {
            "type": "string",
            "nullable": true
          },
          "countryId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          },
          "countryName": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "suppCode": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "registrationID": {
            "type": "string",
            "nullable": true
          },
          "hasVatNumber": {
            "type": "boolean"
          },
          "imageData": {
            "type": "string",
            "nullable": true
          },
          "registrationNumber": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "siteAddress": {
            "type": "string",
            "nullable": true
          },
          "siteCode": {
            "type": "string",
            "nullable": true
          },
          "siteName": {
            "type": "string",
            "nullable": true
          },
          "bankName": {
            "type": "string",
            "nullable": true
          },
          "bankAccount": {
            "type": "string",
            "nullable": true
          },
          "discount": {
            "type": "number",
            "format": "double"
          },
          "paymentDays": {
            "type": "integer",
            "format": "int32"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "delegateName": {
            "type": "string",
            "nullable": true
          },
          "delegateIDSN": {
            "type": "string",
            "nullable": true
          },
          "delegateIDNo": {
            "type": "string",
            "nullable": true
          },
          "delegateIDRegister": {
            "type": "string",
            "nullable": true
          },
          "delegateCar": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "web": {
            "type": "string",
            "nullable": true
          },
          "emailInvoice": {
            "type": "string",
            "nullable": true
          },
          "isNew": {
            "type": "boolean"
          },
          "isModified": {
            "type": "boolean"
          },
          "isIka": {
            "type": "boolean"
          },
          "isProduction": {
            "type": "boolean"
          },
          "isConsumption": {
            "type": "boolean"
          },
          "isExtern": {
            "type": "boolean"
          },
          "externalCode": {
            "type": "string",
            "nullable": true
          },
          "doNotGenerateDocumentsInErp": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "isNotCompany": {
            "type": "boolean"
          },
          "customText1": {
            "type": "string",
            "nullable": true
          },
          "customText2": {
            "type": "string",
            "nullable": true
          },
          "customText3": {
            "type": "string",
            "nullable": true
          },
          "customText4": {
            "type": "string",
            "nullable": true
          },
          "customText5": {
            "type": "string",
            "nullable": true
          },
          "customText6": {
            "type": "string",
            "nullable": true
          },
          "customText7": {
            "type": "string",
            "nullable": true
          },
          "customText8": {
            "type": "string",
            "nullable": true
          },
          "customText9": {
            "type": "string",
            "nullable": true
          },
          "customText10": {
            "type": "string",
            "nullable": true
          },
          "customNumber1": {
            "type": "number",
            "format": "double"
          },
          "customNumber2": {
            "type": "number",
            "format": "double"
          },
          "customNumber3": {
            "type": "number",
            "format": "double"
          },
          "customNumber4": {
            "type": "number",
            "format": "double"
          },
          "customNumber5": {
            "type": "number",
            "format": "double"
          },
          "customDecimal1": {
            "type": "string",
            "nullable": true
          },
          "customDecimal2": {
            "type": "string",
            "nullable": true
          },
          "customDecimal3": {
            "type": "string",
            "nullable": true
          },
          "customDecimal4": {
            "type": "string",
            "nullable": true
          },
          "customDecimal5": {
            "type": "string",
            "nullable": true
          },
          "customDateTime1": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime2": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime3": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime4": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime5": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerAddressDto"
            },
            "nullable": true
          },
          "worksites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerWorksiteDto"
            },
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PartnerDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "PartnerDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "partnerTypeId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "partnerTypeCode": {
            "type": "string",
            "nullable": true
          },
          "partnerTypeName": {
            "type": "string",
            "nullable": true
          },
          "cityId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cityCode": {
            "type": "string",
            "nullable": true
          },
          "cityName": {
            "type": "string",
            "nullable": true
          },
          "countyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countyCode": {
            "type": "string",
            "nullable": true
          },
          "countyName": {
            "type": "string",
            "nullable": true
          },
          "countryId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          },
          "countryName": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "suppCode": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "registrationID": {
            "type": "string",
            "nullable": true
          },
          "hasVatNumber": {
            "type": "boolean"
          },
          "imageData": {
            "type": "string",
            "nullable": true
          },
          "registrationNumber": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "siteAddress": {
            "type": "string",
            "nullable": true
          },
          "siteCode": {
            "type": "string",
            "nullable": true
          },
          "siteName": {
            "type": "string",
            "nullable": true
          },
          "bankName": {
            "type": "string",
            "nullable": true
          },
          "bankAccount": {
            "type": "string",
            "nullable": true
          },
          "discount": {
            "type": "number",
            "format": "double"
          },
          "paymentDays": {
            "type": "integer",
            "format": "int32"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "delegateName": {
            "type": "string",
            "nullable": true
          },
          "delegateIDSN": {
            "type": "string",
            "nullable": true
          },
          "delegateIDNo": {
            "type": "string",
            "nullable": true
          },
          "delegateIDRegister": {
            "type": "string",
            "nullable": true
          },
          "delegateCar": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "web": {
            "type": "string",
            "nullable": true
          },
          "emailInvoice": {
            "type": "string",
            "nullable": true
          },
          "isNew": {
            "type": "boolean"
          },
          "isModified": {
            "type": "boolean"
          },
          "isIka": {
            "type": "boolean"
          },
          "isProduction": {
            "type": "boolean"
          },
          "isConsumption": {
            "type": "boolean"
          },
          "isExtern": {
            "type": "boolean"
          },
          "externalCode": {
            "type": "string",
            "nullable": true
          },
          "doNotGenerateDocumentsInErp": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "isNotCompany": {
            "type": "boolean"
          },
          "customText1": {
            "type": "string",
            "nullable": true
          },
          "customText2": {
            "type": "string",
            "nullable": true
          },
          "customText3": {
            "type": "string",
            "nullable": true
          },
          "customText4": {
            "type": "string",
            "nullable": true
          },
          "customText5": {
            "type": "string",
            "nullable": true
          },
          "customText6": {
            "type": "string",
            "nullable": true
          },
          "customText7": {
            "type": "string",
            "nullable": true
          },
          "customText8": {
            "type": "string",
            "nullable": true
          },
          "customText9": {
            "type": "string",
            "nullable": true
          },
          "customText10": {
            "type": "string",
            "nullable": true
          },
          "customNumber1": {
            "type": "number",
            "format": "double"
          },
          "customNumber2": {
            "type": "number",
            "format": "double"
          },
          "customNumber3": {
            "type": "number",
            "format": "double"
          },
          "customNumber4": {
            "type": "number",
            "format": "double"
          },
          "customNumber5": {
            "type": "number",
            "format": "double"
          },
          "customDecimal1": {
            "type": "string",
            "nullable": true
          },
          "customDecimal2": {
            "type": "string",
            "nullable": true
          },
          "customDecimal3": {
            "type": "string",
            "nullable": true
          },
          "customDecimal4": {
            "type": "string",
            "nullable": true
          },
          "customDecimal5": {
            "type": "string",
            "nullable": true
          },
          "customDateTime1": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime2": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime3": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime4": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime5": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerAddressDto"
            },
            "nullable": true
          },
          "worksites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerWorksiteDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PartnerWorksiteDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "partnerId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cityId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countryId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "partnerName": {
            "type": "string",
            "nullable": true
          },
          "cityName": {
            "type": "string",
            "nullable": true
          },
          "countyName": {
            "type": "string",
            "nullable": true
          },
          "countryName": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "contactName": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "gln": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "longitude": {
            "type": "string",
            "nullable": true
          },
          "latitude": {
            "type": "string",
            "nullable": true
          },
          "guid": {
            "type": "string",
            "format": "uuid"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PickingSectionDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PickingSectionDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PickingSectionDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "PickingSectionDtoWithoutId": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "PrintEnqueueDto": {
        "type": "object",
        "properties": {
          "jobType": {
            "type": "string",
            "description": "\"ProductLabel\" / \"PalletLabel\" / \"LocationLabel\" / \"Document\" / \"Custom\".",
            "nullable": true
          },
          "entityKind": {
            "type": "string",
            "description": "\"Products\" / \"Pallets\" / \"Locations\" / \"DocumentsIn\" / etc. — or null for Custom.",
            "nullable": true
          },
          "entityId": {
            "type": "integer",
            "description": "ID-ul entitatii din EntityKind. 0 / null for Custom.",
            "format": "int32",
            "nullable": true
          },
          "copies": {
            "type": "integer",
            "description": "Numarul de copii. Default 1.",
            "format": "int32"
          },
          "requestingUserId": {
            "type": "integer",
            "description": "User-ul care cere tiparirea — for cascada de printer.\r\n            If null or 0, sare User si merge direct la Zone -> Warehouse.",
            "format": "int32",
            "nullable": true
          },
          "printerNameOverride": {
            "type": "string",
            "description": "Override explicit for numele imprimantei. When e setat, sare cascada.",
            "nullable": true
          },
          "customReportTemplate": {
            "type": "string",
            "description": "For JobType=\"Custom\" — the client trimite direct template + DataSet\r\n            (e.g. tiparire ad-hoc fara entitate din DB). For JobType cunoscut (ProductLabel etc.)\r\n            se construiesc server-side din ReportTypeEnum corespunzator si EntityId.",
            "nullable": true
          },
          "customDataSetXml": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Cerere de adaugare in coada de tiparire (push from MAUI / WMS UI / sync apps).\r\n            \r\nCaz tipic — terminalul scaneaza un palet si vrea sa tipareasca eticheta:\r\n  POST /api/printserver/enqueue\r\n  { \"JobType\":\"PalletLabel\", \"EntityKind\":\"Pallets\", \"EntityId\":1234,\r\n    \"Copies\":1, \"RequestingUserId\":7 }\r\n            \r\nWMS server-side resolves template + DataSet + cascada printer (User->Zone->Warehouse)\r\nsi scrie un rand cu Status=Pending. Print Server ridica job-ul la urmatorul GET /jobs."
      },
      "PrintEnqueueResultDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "queueId": {
            "type": "integer",
            "format": "int32"
          },
          "error": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PrintJobAckDto": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "nullable": true
          },
          "error": {
            "type": "string",
            "description": "Optional — if the client a incercat dar a esuat la tiparire.\r\n            When e setat, randul din PrintQueue va fi marcat Status=Failed cu this mesaj.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PrintJobDto": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "nullable": true
          },
          "jobType": {
            "type": "string",
            "nullable": true
          },
          "entityKind": {
            "type": "string",
            "nullable": true
          },
          "entityId": {
            "type": "integer",
            "format": "int32"
          },
          "reportType": {
            "type": "string",
            "nullable": true
          },
          "reportTemplate": {
            "type": "string",
            "nullable": true
          },
          "dataSetXml": {
            "type": "string",
            "nullable": true
          },
          "printerName": {
            "type": "string",
            "nullable": true
          },
          "copies": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PrinterDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PrinterDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrinterDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "PrinterDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProductCategoryDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ProductCategoryDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductCategoryDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "ProductCategoryDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProductDto": {
        "required": [
          "barcode",
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "integer",
            "description": "ID of the product category. Use `GET /api/ProductsCategories` to list available categories.",
            "format": "int32",
            "nullable": true
          },
          "categoryCode": {
            "type": "string",
            "description": "Category code (read-only in responses; ignored in requests).",
            "nullable": true
          },
          "categoryName": {
            "type": "string",
            "description": "Category display name (read-only in responses; ignored in requests).",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "description": "ID of the default unit of measure. Use `GET /api/ProductsUoms` to list available UOMs.",
            "format": "int32",
            "nullable": true
          },
          "uomCode": {
            "type": "string",
            "description": "UOM short code (read-only in responses).",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "description": "UOM display name (read-only in responses).",
            "nullable": true
          },
          "vatPercentId": {
            "type": "integer",
            "description": "ID of the VAT rate applied to this product. Use `GET /api/ProductsVats` to list rates.",
            "format": "int32",
            "nullable": true
          },
          "vatPercentName": {
            "type": "string",
            "description": "VAT rate name (read-only in responses).",
            "nullable": true
          },
          "vatPercentValue": {
            "type": "number",
            "description": "VAT percentage value, e.g. `19` for 19% (read-only in responses).",
            "format": "double"
          },
          "typeId": {
            "type": "integer",
            "description": "ID of the product type (Raw material, Finished good, etc.). Use `GET /api/ProductsTypes`.",
            "format": "int32",
            "nullable": true
          },
          "typeName": {
            "type": "string",
            "description": "Product type name (read-only in responses).",
            "nullable": true
          },
          "barcodeLabelId": {
            "type": "integer",
            "description": "ID of the barcode label template for product labels. Use `GET /api/BarcodeLabels`.",
            "format": "int32",
            "nullable": true
          },
          "palletBarcodeLabelId": {
            "type": "integer",
            "description": "ID of the barcode label template for pallet labels.",
            "format": "int32",
            "nullable": true
          },
          "barcode": {
            "minLength": 1,
            "type": "string",
            "description": "Primary barcode (EAN-13, EAN-8, Code128, etc.). Used by scanners.\r\nMust be unique across all products. <b>Required.</b>"
          },
          "sku": {
            "type": "string",
            "description": "Stock Keeping Unit identifier. Optional secondary identifier.",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string",
            "description": "Internal product code / article number. Must be unique. <b>Required.</b>"
          },
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Product display name (shown in UI and on documents). <b>Required.</b>"
          },
          "nameExt": {
            "type": "string",
            "description": "Extended / alternative name (e.g. marketing name or name in another language).",
            "nullable": true
          },
          "purchasePriceUnit": {
            "type": "number",
            "description": "Default purchase (cost) price per unit, excluding VAT.",
            "format": "double"
          },
          "salePriceUnit": {
            "type": "number",
            "description": "Default sale price per unit, excluding VAT.",
            "format": "double"
          },
          "salePriceUnitWithVat": {
            "type": "number",
            "description": "Default sale price per unit, including VAT (computed field; set manually if needed).",
            "format": "double"
          },
          "lastPurchasePriceUnit": {
            "type": "number",
            "description": "Most recent purchase price (updated automatically when a receipt is validated).",
            "format": "double"
          },
          "lastSalePriceUnit": {
            "type": "number",
            "description": "Most recent sale price (updated automatically when a sale is validated).",
            "format": "double"
          },
          "salePriceAdd": {
            "type": "number",
            "description": "Additional markup amount added to the sale price.",
            "format": "double"
          },
          "supplierProductCode": {
            "type": "string",
            "description": "Supplier's own code for this product (useful for cross-referencing on purchase orders).",
            "nullable": true
          },
          "supplierName": {
            "type": "string",
            "description": "Default supplier name (informational; for official supplier links use Partner relations).",
            "nullable": true
          },
          "details": {
            "type": "string",
            "description": "Short internal details / technical notes.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Full public-facing product description.",
            "nullable": true
          },
          "stockMin": {
            "type": "number",
            "description": "Minimum stock threshold — triggers replenishment alerts when stock falls below this.",
            "format": "double"
          },
          "stockMax": {
            "type": "number",
            "description": "Maximum stock level — system will not recommend ordering above this.",
            "format": "double"
          },
          "stockOptimal": {
            "type": "number",
            "description": "Optimal (target) stock level.",
            "format": "double"
          },
          "stockTotal": {
            "type": "number",
            "description": "Computed total stock across all warehouses (read-only; updated by WMS engine).",
            "format": "double"
          },
          "withWeight": {
            "type": "boolean",
            "description": "If `true`, this product is sold/purchased by weight; quantity is measured in kg/g."
          },
          "withStock": {
            "type": "boolean",
            "description": "If `true`, stock movements for this product are tracked in the WMS."
          },
          "withSerialNumber": {
            "type": "boolean",
            "description": "If `true`, each unit must carry a unique serial number tracked through all movements."
          },
          "withLot": {
            "type": "boolean",
            "description": "If `true`, this product is tracked by lot/batch number."
          },
          "withLotDate": {
            "type": "boolean",
            "description": "If `true`, the lot production date must be recorded on receipt."
          },
          "withExpirationDate": {
            "type": "boolean",
            "description": "If `true`, the lot expiration date must be recorded on receipt (FEFO applies)."
          },
          "withProductionDate": {
            "type": "boolean",
            "description": "If `true`, the production/manufacturing date must be recorded on receipt."
          },
          "withFreezeAttribute": {
            "type": "boolean",
            "description": "If `true`, a freeze attribute is tracked for this product (cold-chain)."
          },
          "withReturnablePack": {
            "type": "boolean",
            "description": "If `true`, this product comes with a returnable packaging (e.g. pallets, kegs)."
          },
          "offlineSync": {
            "type": "boolean",
            "description": "If `true`, this product is synchronised to offline (mobile) devices."
          },
          "isBlocked": {
            "type": "boolean",
            "description": "If `true`, the product is blocked — cannot be used in new documents."
          },
          "isNew": {
            "type": "boolean",
            "description": "Marks the product as newly added (informational flag)."
          },
          "isModified": {
            "type": "boolean",
            "description": "Marks the product as recently modified (informational flag)."
          },
          "isActive": {
            "type": "boolean",
            "description": "If `false`, the product is archived and hidden from most lists. Default: `true`."
          },
          "warrantyDays": {
            "type": "integer",
            "description": "Warranty duration in days for this product.",
            "format": "int32"
          },
          "daysRefillStock": {
            "type": "integer",
            "description": "Estimated lead time in days to replenish stock (used for reorder planning).",
            "format": "int32"
          },
          "maxQuantityOnPallet": {
            "type": "integer",
            "description": "Maximum number of units that fit on one pallet (used for pallet label calculations).",
            "format": "int64"
          },
          "internalKey": {
            "type": "string",
            "description": "Internal cross-reference key used for ERP / third-party integrations.",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "description": "External cross-reference key (e.g. ERP article number).",
            "nullable": true
          },
          "internalParentKey": {
            "type": "string",
            "description": "Internal parent key (for hierarchical product structures in ERP).",
            "nullable": true
          },
          "erpStock": {
            "type": "string",
            "description": "Stock value/quantity as received from ERP (informational, not used by WMS logic).",
            "nullable": true
          },
          "accountingType": {
            "type": "string",
            "description": "Accounting type code (for ERP accounting integration).",
            "nullable": true
          },
          "accountingAccount": {
            "type": "string",
            "description": "Accounting ledger account code (for ERP accounting integration).",
            "nullable": true
          },
          "packagingCount": {
            "type": "number",
            "description": "Number of units per packaging unit (e.g. 12 cans per carton).",
            "format": "double"
          },
          "packagingTransport": {
            "type": "string",
            "description": "Packaging type description for transport (e.g. \"Carton box\", \"Pallet\").",
            "nullable": true
          },
          "width": {
            "type": "number",
            "description": "Product width in mm (or other configured unit).",
            "format": "double"
          },
          "height": {
            "type": "number",
            "description": "Product height in mm.",
            "format": "double"
          },
          "length": {
            "type": "number",
            "description": "Product length/depth in mm.",
            "format": "double"
          },
          "weight": {
            "type": "number",
            "description": "Product weight in kg.",
            "format": "double"
          },
          "diameter": {
            "type": "number",
            "description": "Product diameter in mm (for cylindrical items).",
            "format": "double"
          },
          "thickness": {
            "type": "number",
            "description": "Material thickness in mm.",
            "format": "double"
          },
          "pressure": {
            "type": "number",
            "description": "Operating pressure in bar (for pressure vessels / industrial goods).",
            "format": "double"
          },
          "material": {
            "type": "string",
            "description": "Material composition (e.g. \"Stainless steel 304\", \"ABS plastic\").",
            "nullable": true
          },
          "norm": {
            "type": "string",
            "description": "Industry / quality norm reference (e.g. \"ISO 9001\", \"EN 1092-1\").",
            "nullable": true
          },
          "color": {
            "type": "string",
            "description": "Product colour description.",
            "nullable": true
          },
          "area": {
            "type": "number",
            "description": "Surface area in m².",
            "format": "double"
          },
          "volume": {
            "type": "number",
            "description": "Volume in liters or m³.",
            "format": "double"
          },
          "temperature": {
            "type": "number",
            "description": "Storage or operating temperature in °C.",
            "format": "double"
          },
          "customText1": {
            "type": "string",
            "description": "Free-text custom field 1 — meaning defined per WMS installation.",
            "nullable": true
          },
          "customText2": {
            "type": "string",
            "description": "Free-text custom field 2.",
            "nullable": true
          },
          "customText3": {
            "type": "string",
            "description": "Free-text custom field 3.",
            "nullable": true
          },
          "customText4": {
            "type": "string",
            "description": "Free-text custom field 4.",
            "nullable": true
          },
          "customText5": {
            "type": "string",
            "description": "Free-text custom field 5.",
            "nullable": true
          },
          "customText6": {
            "type": "string",
            "description": "Free-text custom field 6.",
            "nullable": true
          },
          "customText7": {
            "type": "string",
            "description": "Free-text custom field 7.",
            "nullable": true
          },
          "customText8": {
            "type": "string",
            "description": "Free-text custom field 8.",
            "nullable": true
          },
          "customText9": {
            "type": "string",
            "description": "Free-text custom field 9.",
            "nullable": true
          },
          "customText10": {
            "type": "string",
            "description": "Free-text custom field 10.",
            "nullable": true
          },
          "customNumber1": {
            "type": "number",
            "description": "Custom numeric field 1 — meaning defined per WMS installation.",
            "format": "double"
          },
          "customNumber2": {
            "type": "number",
            "description": "Custom numeric field 2.",
            "format": "double"
          },
          "customNumber3": {
            "type": "number",
            "description": "Custom numeric field 3.",
            "format": "double"
          },
          "customNumber4": {
            "type": "number",
            "description": "Custom numeric field 4.",
            "format": "double"
          },
          "customNumber5": {
            "type": "number",
            "description": "Custom numeric field 5.",
            "format": "double"
          },
          "customDecimal1": {
            "type": "string",
            "description": "Custom decimal text field 1 (stored as string to preserve formatting).",
            "nullable": true
          },
          "customDecimal2": {
            "type": "string",
            "description": "Custom decimal text field 2.",
            "nullable": true
          },
          "customDecimal3": {
            "type": "string",
            "description": "Custom decimal text field 3.",
            "nullable": true
          },
          "customDecimal4": {
            "type": "string",
            "description": "Custom decimal text field 4.",
            "nullable": true
          },
          "customDecimal5": {
            "type": "string",
            "description": "Custom decimal text field 5.",
            "nullable": true
          },
          "customDateTime1": {
            "type": "string",
            "description": "Custom date/time field 1 — meaning defined per WMS installation.",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime2": {
            "type": "string",
            "description": "Custom date/time field 2.",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime3": {
            "type": "string",
            "description": "Custom date/time field 3.",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime4": {
            "type": "string",
            "description": "Custom date/time field 4.",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime5": {
            "type": "string",
            "description": "Custom date/time field 5.",
            "format": "date-time",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this product record.",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this product was created.",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this product.",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "description": "Unique identifier (auto-assigned by the database).",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Full product record including server-assigned ID.\r\nReturned by GET endpoints."
      },
      "ProductDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "ProductDtoWithoutId": {
        "required": [
          "barcode",
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "integer",
            "description": "ID of the product category. Use `GET /api/ProductsCategories` to list available categories.",
            "format": "int32",
            "nullable": true
          },
          "categoryCode": {
            "type": "string",
            "description": "Category code (read-only in responses; ignored in requests).",
            "nullable": true
          },
          "categoryName": {
            "type": "string",
            "description": "Category display name (read-only in responses; ignored in requests).",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "description": "ID of the default unit of measure. Use `GET /api/ProductsUoms` to list available UOMs.",
            "format": "int32",
            "nullable": true
          },
          "uomCode": {
            "type": "string",
            "description": "UOM short code (read-only in responses).",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "description": "UOM display name (read-only in responses).",
            "nullable": true
          },
          "vatPercentId": {
            "type": "integer",
            "description": "ID of the VAT rate applied to this product. Use `GET /api/ProductsVats` to list rates.",
            "format": "int32",
            "nullable": true
          },
          "vatPercentName": {
            "type": "string",
            "description": "VAT rate name (read-only in responses).",
            "nullable": true
          },
          "vatPercentValue": {
            "type": "number",
            "description": "VAT percentage value, e.g. `19` for 19% (read-only in responses).",
            "format": "double"
          },
          "typeId": {
            "type": "integer",
            "description": "ID of the product type (Raw material, Finished good, etc.). Use `GET /api/ProductsTypes`.",
            "format": "int32",
            "nullable": true
          },
          "typeName": {
            "type": "string",
            "description": "Product type name (read-only in responses).",
            "nullable": true
          },
          "barcodeLabelId": {
            "type": "integer",
            "description": "ID of the barcode label template for product labels. Use `GET /api/BarcodeLabels`.",
            "format": "int32",
            "nullable": true
          },
          "palletBarcodeLabelId": {
            "type": "integer",
            "description": "ID of the barcode label template for pallet labels.",
            "format": "int32",
            "nullable": true
          },
          "barcode": {
            "minLength": 1,
            "type": "string",
            "description": "Primary barcode (EAN-13, EAN-8, Code128, etc.). Used by scanners.\r\nMust be unique across all products. <b>Required.</b>"
          },
          "sku": {
            "type": "string",
            "description": "Stock Keeping Unit identifier. Optional secondary identifier.",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string",
            "description": "Internal product code / article number. Must be unique. <b>Required.</b>"
          },
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Product display name (shown in UI and on documents). <b>Required.</b>"
          },
          "nameExt": {
            "type": "string",
            "description": "Extended / alternative name (e.g. marketing name or name in another language).",
            "nullable": true
          },
          "purchasePriceUnit": {
            "type": "number",
            "description": "Default purchase (cost) price per unit, excluding VAT.",
            "format": "double"
          },
          "salePriceUnit": {
            "type": "number",
            "description": "Default sale price per unit, excluding VAT.",
            "format": "double"
          },
          "salePriceUnitWithVat": {
            "type": "number",
            "description": "Default sale price per unit, including VAT (computed field; set manually if needed).",
            "format": "double"
          },
          "lastPurchasePriceUnit": {
            "type": "number",
            "description": "Most recent purchase price (updated automatically when a receipt is validated).",
            "format": "double"
          },
          "lastSalePriceUnit": {
            "type": "number",
            "description": "Most recent sale price (updated automatically when a sale is validated).",
            "format": "double"
          },
          "salePriceAdd": {
            "type": "number",
            "description": "Additional markup amount added to the sale price.",
            "format": "double"
          },
          "supplierProductCode": {
            "type": "string",
            "description": "Supplier's own code for this product (useful for cross-referencing on purchase orders).",
            "nullable": true
          },
          "supplierName": {
            "type": "string",
            "description": "Default supplier name (informational; for official supplier links use Partner relations).",
            "nullable": true
          },
          "details": {
            "type": "string",
            "description": "Short internal details / technical notes.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Full public-facing product description.",
            "nullable": true
          },
          "stockMin": {
            "type": "number",
            "description": "Minimum stock threshold — triggers replenishment alerts when stock falls below this.",
            "format": "double"
          },
          "stockMax": {
            "type": "number",
            "description": "Maximum stock level — system will not recommend ordering above this.",
            "format": "double"
          },
          "stockOptimal": {
            "type": "number",
            "description": "Optimal (target) stock level.",
            "format": "double"
          },
          "stockTotal": {
            "type": "number",
            "description": "Computed total stock across all warehouses (read-only; updated by WMS engine).",
            "format": "double"
          },
          "withWeight": {
            "type": "boolean",
            "description": "If `true`, this product is sold/purchased by weight; quantity is measured in kg/g."
          },
          "withStock": {
            "type": "boolean",
            "description": "If `true`, stock movements for this product are tracked in the WMS."
          },
          "withSerialNumber": {
            "type": "boolean",
            "description": "If `true`, each unit must carry a unique serial number tracked through all movements."
          },
          "withLot": {
            "type": "boolean",
            "description": "If `true`, this product is tracked by lot/batch number."
          },
          "withLotDate": {
            "type": "boolean",
            "description": "If `true`, the lot production date must be recorded on receipt."
          },
          "withExpirationDate": {
            "type": "boolean",
            "description": "If `true`, the lot expiration date must be recorded on receipt (FEFO applies)."
          },
          "withProductionDate": {
            "type": "boolean",
            "description": "If `true`, the production/manufacturing date must be recorded on receipt."
          },
          "withFreezeAttribute": {
            "type": "boolean",
            "description": "If `true`, a freeze attribute is tracked for this product (cold-chain)."
          },
          "withReturnablePack": {
            "type": "boolean",
            "description": "If `true`, this product comes with a returnable packaging (e.g. pallets, kegs)."
          },
          "offlineSync": {
            "type": "boolean",
            "description": "If `true`, this product is synchronised to offline (mobile) devices."
          },
          "isBlocked": {
            "type": "boolean",
            "description": "If `true`, the product is blocked — cannot be used in new documents."
          },
          "isNew": {
            "type": "boolean",
            "description": "Marks the product as newly added (informational flag)."
          },
          "isModified": {
            "type": "boolean",
            "description": "Marks the product as recently modified (informational flag)."
          },
          "isActive": {
            "type": "boolean",
            "description": "If `false`, the product is archived and hidden from most lists. Default: `true`."
          },
          "warrantyDays": {
            "type": "integer",
            "description": "Warranty duration in days for this product.",
            "format": "int32"
          },
          "daysRefillStock": {
            "type": "integer",
            "description": "Estimated lead time in days to replenish stock (used for reorder planning).",
            "format": "int32"
          },
          "maxQuantityOnPallet": {
            "type": "integer",
            "description": "Maximum number of units that fit on one pallet (used for pallet label calculations).",
            "format": "int64"
          },
          "internalKey": {
            "type": "string",
            "description": "Internal cross-reference key used for ERP / third-party integrations.",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "description": "External cross-reference key (e.g. ERP article number).",
            "nullable": true
          },
          "internalParentKey": {
            "type": "string",
            "description": "Internal parent key (for hierarchical product structures in ERP).",
            "nullable": true
          },
          "erpStock": {
            "type": "string",
            "description": "Stock value/quantity as received from ERP (informational, not used by WMS logic).",
            "nullable": true
          },
          "accountingType": {
            "type": "string",
            "description": "Accounting type code (for ERP accounting integration).",
            "nullable": true
          },
          "accountingAccount": {
            "type": "string",
            "description": "Accounting ledger account code (for ERP accounting integration).",
            "nullable": true
          },
          "packagingCount": {
            "type": "number",
            "description": "Number of units per packaging unit (e.g. 12 cans per carton).",
            "format": "double"
          },
          "packagingTransport": {
            "type": "string",
            "description": "Packaging type description for transport (e.g. \"Carton box\", \"Pallet\").",
            "nullable": true
          },
          "width": {
            "type": "number",
            "description": "Product width in mm (or other configured unit).",
            "format": "double"
          },
          "height": {
            "type": "number",
            "description": "Product height in mm.",
            "format": "double"
          },
          "length": {
            "type": "number",
            "description": "Product length/depth in mm.",
            "format": "double"
          },
          "weight": {
            "type": "number",
            "description": "Product weight in kg.",
            "format": "double"
          },
          "diameter": {
            "type": "number",
            "description": "Product diameter in mm (for cylindrical items).",
            "format": "double"
          },
          "thickness": {
            "type": "number",
            "description": "Material thickness in mm.",
            "format": "double"
          },
          "pressure": {
            "type": "number",
            "description": "Operating pressure in bar (for pressure vessels / industrial goods).",
            "format": "double"
          },
          "material": {
            "type": "string",
            "description": "Material composition (e.g. \"Stainless steel 304\", \"ABS plastic\").",
            "nullable": true
          },
          "norm": {
            "type": "string",
            "description": "Industry / quality norm reference (e.g. \"ISO 9001\", \"EN 1092-1\").",
            "nullable": true
          },
          "color": {
            "type": "string",
            "description": "Product colour description.",
            "nullable": true
          },
          "area": {
            "type": "number",
            "description": "Surface area in m².",
            "format": "double"
          },
          "volume": {
            "type": "number",
            "description": "Volume in liters or m³.",
            "format": "double"
          },
          "temperature": {
            "type": "number",
            "description": "Storage or operating temperature in °C.",
            "format": "double"
          },
          "customText1": {
            "type": "string",
            "description": "Free-text custom field 1 — meaning defined per WMS installation.",
            "nullable": true
          },
          "customText2": {
            "type": "string",
            "description": "Free-text custom field 2.",
            "nullable": true
          },
          "customText3": {
            "type": "string",
            "description": "Free-text custom field 3.",
            "nullable": true
          },
          "customText4": {
            "type": "string",
            "description": "Free-text custom field 4.",
            "nullable": true
          },
          "customText5": {
            "type": "string",
            "description": "Free-text custom field 5.",
            "nullable": true
          },
          "customText6": {
            "type": "string",
            "description": "Free-text custom field 6.",
            "nullable": true
          },
          "customText7": {
            "type": "string",
            "description": "Free-text custom field 7.",
            "nullable": true
          },
          "customText8": {
            "type": "string",
            "description": "Free-text custom field 8.",
            "nullable": true
          },
          "customText9": {
            "type": "string",
            "description": "Free-text custom field 9.",
            "nullable": true
          },
          "customText10": {
            "type": "string",
            "description": "Free-text custom field 10.",
            "nullable": true
          },
          "customNumber1": {
            "type": "number",
            "description": "Custom numeric field 1 — meaning defined per WMS installation.",
            "format": "double"
          },
          "customNumber2": {
            "type": "number",
            "description": "Custom numeric field 2.",
            "format": "double"
          },
          "customNumber3": {
            "type": "number",
            "description": "Custom numeric field 3.",
            "format": "double"
          },
          "customNumber4": {
            "type": "number",
            "description": "Custom numeric field 4.",
            "format": "double"
          },
          "customNumber5": {
            "type": "number",
            "description": "Custom numeric field 5.",
            "format": "double"
          },
          "customDecimal1": {
            "type": "string",
            "description": "Custom decimal text field 1 (stored as string to preserve formatting).",
            "nullable": true
          },
          "customDecimal2": {
            "type": "string",
            "description": "Custom decimal text field 2.",
            "nullable": true
          },
          "customDecimal3": {
            "type": "string",
            "description": "Custom decimal text field 3.",
            "nullable": true
          },
          "customDecimal4": {
            "type": "string",
            "description": "Custom decimal text field 4.",
            "nullable": true
          },
          "customDecimal5": {
            "type": "string",
            "description": "Custom decimal text field 5.",
            "nullable": true
          },
          "customDateTime1": {
            "type": "string",
            "description": "Custom date/time field 1 — meaning defined per WMS installation.",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime2": {
            "type": "string",
            "description": "Custom date/time field 2.",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime3": {
            "type": "string",
            "description": "Custom date/time field 3.",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime4": {
            "type": "string",
            "description": "Custom date/time field 4.",
            "format": "date-time",
            "nullable": true
          },
          "customDateTime5": {
            "type": "string",
            "description": "Custom date/time field 5.",
            "format": "date-time",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this product record.",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this product was created.",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this product.",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Product data used for create (POST) and update (PUT) requests.\r\nRequired fields: Rosistem.API.DTO.Products.ProductDtoWithoutId.Barcode, Rosistem.API.DTO.Products.ProductDtoWithoutId.Code, Rosistem.API.DTO.Products.ProductDtoWithoutId.Name."
      },
      "ProductLocationDtoWithoutId": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "locationId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "isPicking": {
            "type": "boolean"
          },
          "isStockable": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ProductStockDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of this stock record.",
            "format": "int32"
          },
          "productId": {
            "type": "integer",
            "description": "ID of the product. Use `productId` filter to get all stock for one product.",
            "format": "int32",
            "nullable": true
          },
          "productCode": {
            "type": "string",
            "description": "Product internal code (e.g. `P001`).",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "description": "Product display name.",
            "nullable": true
          },
          "productBarcode": {
            "type": "string",
            "description": "Product barcode (EAN-13 or similar).",
            "nullable": true
          },
          "productSKU": {
            "type": "string",
            "description": "Product SKU (Stock Keeping Unit identifier).",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "description": "ID of the unit of measure (e.g. pcs, kg, m²).",
            "format": "int32",
            "nullable": true
          },
          "uomCode": {
            "type": "string",
            "description": "Unit of measure short code (e.g. `PCS`, `KG`).",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "description": "Unit of measure display name (e.g. `Pieces`).",
            "nullable": true
          },
          "locationId": {
            "type": "integer",
            "description": "ID of the warehouse location (bin/shelf). Use `locationId` filter to scope stock to one bin.",
            "format": "int32",
            "nullable": true
          },
          "locationCode": {
            "type": "string",
            "description": "Location code (e.g. `A-01-03` for aisle A, row 1, shelf 3).",
            "nullable": true
          },
          "locationName": {
            "type": "string",
            "description": "Location display name.",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "description": "ID of the parent warehouse. Use `warehouseId` filter to scope stock to one warehouse.",
            "format": "int32",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "description": "Warehouse display name.",
            "nullable": true
          },
          "lot": {
            "type": "string",
            "description": "Lot/batch number. Empty string if the product is not lot-tracked (`WithLot = false`).",
            "nullable": true
          },
          "serialNumber": {
            "type": "string",
            "description": "Serial number. Empty string if the product is not serial-tracked (`WithSerialNumber = false`). For serial-tracked items each record has exactly 1 unit.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Total physical quantity on hand at this location.",
            "format": "double"
          },
          "reservedQuantity": {
            "type": "number",
            "description": "Quantity reserved for pending outbound documents (sales orders, transfers, etc.).",
            "format": "double"
          },
          "availableQuantity": {
            "type": "number",
            "description": "Quantity available for new orders: `Quantity - ReservedQuantity`.",
            "format": "double"
          },
          "receivingDate": {
            "type": "string",
            "description": "Date the goods were physically received (from the inbound document).",
            "format": "date-time"
          },
          "entryDate": {
            "type": "string",
            "description": "Date this stock record was created in the system.",
            "format": "date-time"
          },
          "stockAgeDays": {
            "type": "integer",
            "description": "Number of days since `ReceivingDate` — useful for FIFO/FEFO aging analysis.",
            "format": "int32"
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this record.",
            "format": "int32"
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this record was created.",
            "format": "date-time"
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this record.",
            "format": "int32"
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Represents a single stock record: the quantity of a specific product at a specific warehouse location,\r\noptionally tracked by lot/batch and serial number.\r\nOne product can have multiple stock records — one per unique (Product, Location, Lot, SerialNumber) combination.\r\nUse `GET /api/ProductsStock/summary` for aggregated totals per product."
      },
      "ProductStockDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductStockDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "ProductTypeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier (auto-assigned by the database).",
            "format": "int32"
          },
          "code": {
            "type": "string",
            "description": "Short alphanumeric code, unique per type. Example: `RM`, `FG`, `SVC`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Human-readable display name. Example: `Raw Material`.",
            "nullable": true
          },
          "details": {
            "type": "string",
            "description": "Optional extended description / notes about this type.",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "description": "ID of the user who created this record.",
            "format": "int32"
          },
          "creationDate": {
            "type": "string",
            "description": "UTC timestamp when this record was created.",
            "format": "date-time"
          },
          "modifiedByUser": {
            "type": "integer",
            "description": "ID of the user who last modified this record.",
            "format": "int32"
          },
          "lastModified": {
            "type": "string",
            "description": "UTC timestamp of the last modification.",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Product type — classification label used to group products (e.g. \"Raw material\", \"Finished good\", \"Service\").\r\nReferenced from products via the TypeId / TypeName fields."
      },
      "ProductTypeDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductTypeDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "ProductTypeDtoWithoutId": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Short alphanumeric code, unique per type. Example: `RM`.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Human-readable display name. Example: `Raw Material`.",
            "nullable": true
          },
          "details": {
            "type": "string",
            "description": "Optional description / notes.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request body for creating or updating a product type (ID is assigned by the server)."
      },
      "ProductUomDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ProductUomDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductUomDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "ProductUomDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProductVatDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "percent": {
            "type": "number",
            "format": "double"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ProductVatDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductVatDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "ProductVatDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "percent": {
            "type": "number",
            "format": "double"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProductionStepDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "productionHeaderId": {
            "type": "integer",
            "format": "int32"
          },
          "stepOrder": {
            "type": "integer",
            "format": "int32"
          },
          "stepName": {
            "type": "string",
            "nullable": true
          },
          "workCentreId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "workCentreName": {
            "type": "string",
            "nullable": true
          },
          "plannedMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "actualMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "description": "Pending | InProgress | Completed | Cancelled",
            "nullable": true
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "deviationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ProductionStepDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductionStepDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "ProductionStepDtoWithoutId": {
        "type": "object",
        "properties": {
          "productionHeaderId": {
            "type": "integer",
            "format": "int32"
          },
          "stepOrder": {
            "type": "integer",
            "format": "int32"
          },
          "stepName": {
            "type": "string",
            "nullable": true
          },
          "workCentreId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "plannedMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "actualMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProvisionRequest": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "nullable": true
          },
          "external_id": {
            "type": "string",
            "nullable": true
          },
          "shop_domain": {
            "type": "string",
            "nullable": true
          },
          "owner_email": {
            "type": "string",
            "nullable": true
          },
          "owner_name": {
            "type": "string",
            "nullable": true
          },
          "display_name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProvisionResponse": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string",
            "nullable": true
          },
          "login_url": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PurchaseOrderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "purchaseOrderNo": {
            "type": "string",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "format": "date-time"
          },
          "expectedDeliveryDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "supplierId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "supplierName": {
            "type": "string",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "Draft | Sent | Acknowledged | PartialReceipt | Received | Invoiced | Cancelled",
            "nullable": true
          },
          "totalValue": {
            "type": "number",
            "format": "double"
          },
          "totalValueVat": {
            "type": "number",
            "format": "double"
          },
          "supplierRef": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "receiptDocumentId": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastModified": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseOrderLineDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PurchaseOrderDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseOrderDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "PurchaseOrderDtoWithoutId": {
        "type": "object",
        "properties": {
          "purchaseOrderNo": {
            "type": "string",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "format": "date-time"
          },
          "expectedDeliveryDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "supplierId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "supplierRef": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PurchaseOrderLineDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "purchaseOrderId": {
            "type": "integer",
            "format": "int32"
          },
          "lineNo": {
            "type": "integer",
            "format": "int32"
          },
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productCode": {
            "type": "string",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "format": "double"
          },
          "vatPercent": {
            "type": "number",
            "format": "double"
          },
          "lineTotal": {
            "type": "number",
            "format": "double"
          },
          "lineTotalVat": {
            "type": "number",
            "format": "double"
          },
          "receivedQuantity": {
            "type": "number",
            "format": "double"
          },
          "remainingQuantity": {
            "type": "number",
            "format": "double"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PurchaseOrderLineDtoWithoutId": {
        "type": "object",
        "properties": {
          "purchaseOrderId": {
            "type": "integer",
            "format": "int32"
          },
          "lineNo": {
            "type": "integer",
            "format": "int32"
          },
          "productId": {
            "type": "integer",
            "format": "int32"
          },
          "uomId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "format": "double"
          },
          "vatPercent": {
            "type": "number",
            "format": "double"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PutawayRuleDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "conditionsJson": {
            "type": "string",
            "description": "JSON shape e.g. {\"productCategory\":\"FROZEN\",\"warehouseId\":5}",
            "nullable": true
          },
          "actionsJson": {
            "type": "string",
            "description": "JSON shape e.g. {\"preferZone\":\"COLD\",\"respectCapacity\":true}",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PutawayRuleDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PutawayRuleDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "PutawayRuleDtoWithoutId": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "conditionsJson": {
            "type": "string",
            "description": "JSON shape e.g. {\"productCategory\":\"FROZEN\",\"warehouseId\":5}",
            "nullable": true
          },
          "actionsJson": {
            "type": "string",
            "description": "JSON shape e.g. {\"preferZone\":\"COLD\",\"respectCapacity\":true}",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "SalesOrderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "salesOrderNo": {
            "type": "string",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "format": "date-time"
          },
          "requiredDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "partnerId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "partnerName": {
            "type": "string",
            "nullable": true
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "Draft | Confirmed | Picking | Shipped | Invoiced | Cancelled",
            "nullable": true
          },
          "totalValue": {
            "type": "number",
            "format": "double"
          },
          "totalValueVat": {
            "type": "number",
            "format": "double"
          },
          "customerRef": {
            "type": "string",
            "nullable": true
          },
          "deliveryAddress": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "fulfilmentDocumentId": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastModified": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesOrderLineDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SalesOrderDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesOrderDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "SalesOrderDtoWithoutId": {
        "type": "object",
        "properties": {
          "salesOrderNo": {
            "type": "string",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "format": "date-time"
          },
          "requiredDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "partnerId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "customerRef": {
            "type": "string",
            "nullable": true
          },
          "deliveryAddress": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SalesOrderLineDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "salesOrderId": {
            "type": "integer",
            "format": "int32"
          },
          "lineNo": {
            "type": "integer",
            "format": "int32"
          },
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productCode": {
            "type": "string",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "uomId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "uomName": {
            "type": "string",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "format": "double"
          },
          "discountPercent": {
            "type": "number",
            "format": "double"
          },
          "vatPercent": {
            "type": "number",
            "format": "double"
          },
          "lineTotal": {
            "type": "number",
            "format": "double"
          },
          "lineTotalVat": {
            "type": "number",
            "format": "double"
          },
          "fulfilledQuantity": {
            "type": "number",
            "format": "double"
          },
          "remainingQuantity": {
            "type": "number",
            "format": "double"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SalesOrderLineDtoWithoutId": {
        "type": "object",
        "properties": {
          "salesOrderId": {
            "type": "integer",
            "format": "int32"
          },
          "lineNo": {
            "type": "integer",
            "format": "int32"
          },
          "productId": {
            "type": "integer",
            "format": "int32"
          },
          "uomId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "format": "double"
          },
          "discountPercent": {
            "type": "number",
            "format": "double"
          },
          "vatPercent": {
            "type": "number",
            "format": "double"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SetStatusRequest": {
        "type": "object",
        "properties": {
          "statusId": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Used for PATCH /documents/{id}/status"
      },
      "ShelfReturnConfirmDto": {
        "type": "object",
        "properties": {
          "confirmedLocationCode": {
            "type": "string",
            "description": "Codul locatiei confirmate (operator a scanat-o cu lectorul).",
            "nullable": true
          },
          "confirmedQuantity": {
            "type": "number",
            "description": "Cantitatea confirmata (de obicei = Quantity, dar poate diferi).",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "2026-05-21: Body for POST /confirm — operatorul MAUI a executat fizic actiunea\r\nsi confirma locatia + cantitatea reala."
      },
      "ShelfReturnQueueDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "sourceDocumentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "sourceDocumentNumber": {
            "type": "string",
            "nullable": true
          },
          "documentType": {
            "type": "integer",
            "format": "int32"
          },
          "documentTypeLabel": {
            "type": "string",
            "nullable": true
          },
          "partnerId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "partnerName": {
            "type": "string",
            "nullable": true
          },
          "productId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "productCode": {
            "type": "string",
            "nullable": true
          },
          "productName": {
            "type": "string",
            "nullable": true
          },
          "productBarcode": {
            "type": "string",
            "nullable": true
          },
          "lot": {
            "type": "string",
            "nullable": true
          },
          "lotDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "actionType": {
            "type": "string",
            "nullable": true
          },
          "actionTypeLabel": {
            "type": "string",
            "nullable": true
          },
          "taskSubStep": {
            "type": "string",
            "nullable": true
          },
          "taskSubStepLabel": {
            "type": "string",
            "nullable": true
          },
          "sourceLocationId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "sourceLocationCode": {
            "type": "string",
            "nullable": true
          },
          "sourceLocationName": {
            "type": "string",
            "nullable": true
          },
          "destinationLocationId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "destinationLocationCode": {
            "type": "string",
            "nullable": true
          },
          "destinationLocationName": {
            "type": "string",
            "nullable": true
          },
          "confirmedLocationId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "confirmedLocationCode": {
            "type": "string",
            "nullable": true
          },
          "originalOperatorId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "originalOperatorName": {
            "type": "string",
            "nullable": true
          },
          "cancelledByUserId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cancelledByUserName": {
            "type": "string",
            "nullable": true
          },
          "cancelledAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedByUserId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "completedByUserName": {
            "type": "string",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "stockReversalDone": {
            "type": "boolean"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "2026-05-21: DTO for sarcina de retur raft (vizibila in MAUI + backoffice).\r\nContine info display + meta for actiunea fizica de executat de operator."
      },
      "ShelfReturnSkipDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Motivul for skip (mandatory pt audit).",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "2026-05-21: Body for POST /skip — admin or operator marks ca nerezolvabil."
      },
      "SplitLineDto": {
        "type": "object",
        "properties": {
          "lineId": {
            "type": "integer",
            "format": "int32"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "SplitRemainingRequest": {
        "type": "object",
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SplitLineDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TmsDriverDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "driverCode": {
            "type": "string",
            "nullable": true
          },
          "driverName": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "licenseNo": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "TmsDriverDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TmsDriverDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "TmsDriverDtoWithoutId": {
        "type": "object",
        "properties": {
          "driverCode": {
            "type": "string",
            "nullable": true
          },
          "driverName": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "licenseNo": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TmsRouteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "routeCode": {
            "type": "string",
            "nullable": true
          },
          "routeName": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "TmsRouteDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TmsRouteDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "TmsRouteDtoWithoutId": {
        "type": "object",
        "properties": {
          "routeCode": {
            "type": "string",
            "nullable": true
          },
          "routeName": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TmsVehicleDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "vehicleCode": {
            "type": "string",
            "nullable": true
          },
          "licensePlate": {
            "type": "string",
            "nullable": true
          },
          "vehicleType": {
            "type": "string",
            "nullable": true
          },
          "maxPayloadKg": {
            "type": "number",
            "format": "double"
          },
          "defaultDriverId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "defaultDriverName": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "TmsVehicleDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TmsVehicleDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "TmsVehicleDtoWithoutId": {
        "type": "object",
        "properties": {
          "vehicleCode": {
            "type": "string",
            "nullable": true
          },
          "licensePlate": {
            "type": "string",
            "nullable": true
          },
          "vehicleType": {
            "type": "string",
            "nullable": true
          },
          "maxPayloadKg": {
            "type": "number",
            "format": "double"
          },
          "defaultDriverId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UserDto": {
        "required": [
          "code",
          "username"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "username": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isAdmin": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "isSystem": {
            "type": "boolean"
          },
          "erpCode": {
            "type": "string",
            "nullable": true
          },
          "agentIDSN": {
            "type": "string",
            "nullable": true
          },
          "agentIDNo": {
            "type": "string",
            "nullable": true
          },
          "agentCar": {
            "type": "string",
            "nullable": true
          },
          "externalCode": {
            "type": "string",
            "nullable": true
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "userGroupId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "userGroupName": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "UserDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "UserDtoWithoutId": {
        "required": [
          "code",
          "username"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "username": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isAdmin": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "isSystem": {
            "type": "boolean"
          },
          "erpCode": {
            "type": "string",
            "nullable": true
          },
          "agentIDSN": {
            "type": "string",
            "nullable": true
          },
          "agentIDNo": {
            "type": "string",
            "nullable": true
          },
          "agentCar": {
            "type": "string",
            "nullable": true
          },
          "externalCode": {
            "type": "string",
            "nullable": true
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "userGroupId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "userGroupName": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UsersGroupDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "canEditFieldsNames": {
            "type": "boolean"
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "UsersGroupDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsersGroupDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "UsersGroupDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "canEditFieldsNames": {
            "type": "boolean"
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WarehouseDto": {
        "required": [
          "code",
          "name",
          "worksiteId"
        ],
        "type": "object",
        "properties": {
          "worksiteId": {
            "type": "integer",
            "format": "int32"
          },
          "worksiteName": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "displayName2": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "printDocIn": {
            "type": "boolean"
          },
          "printDocInValidated": {
            "type": "boolean"
          },
          "printDocOut": {
            "type": "boolean"
          },
          "printDocOutValidated": {
            "type": "boolean"
          },
          "printDocTransfer": {
            "type": "boolean"
          },
          "printDocTransferValidated": {
            "type": "boolean"
          },
          "isPrinterDocument": {
            "type": "boolean"
          },
          "printerDocumentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerDocument": {
            "type": "string",
            "nullable": true
          },
          "isPrinterLabelPallet": {
            "type": "boolean"
          },
          "printerLabelPalletId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerLabelPallet": {
            "type": "string",
            "nullable": true
          },
          "isPrinterLabelPicking": {
            "type": "boolean"
          },
          "printerLabelPickingId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerLabelPicking": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "WarehouseDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WarehouseDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "WarehouseDtoWithoutId": {
        "required": [
          "code",
          "name",
          "worksiteId"
        ],
        "type": "object",
        "properties": {
          "worksiteId": {
            "type": "integer",
            "format": "int32"
          },
          "worksiteName": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "displayName2": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "printDocIn": {
            "type": "boolean"
          },
          "printDocInValidated": {
            "type": "boolean"
          },
          "printDocOut": {
            "type": "boolean"
          },
          "printDocOutValidated": {
            "type": "boolean"
          },
          "printDocTransfer": {
            "type": "boolean"
          },
          "printDocTransferValidated": {
            "type": "boolean"
          },
          "isPrinterDocument": {
            "type": "boolean"
          },
          "printerDocumentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerDocument": {
            "type": "string",
            "nullable": true
          },
          "isPrinterLabelPallet": {
            "type": "boolean"
          },
          "printerLabelPalletId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerLabelPallet": {
            "type": "string",
            "nullable": true
          },
          "isPrinterLabelPicking": {
            "type": "boolean"
          },
          "printerLabelPickingId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerLabelPicking": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WarehouseLocationDto": {
        "required": [
          "barcode",
          "code",
          "name",
          "warehouseId",
          "warehouseZoneId"
        ],
        "type": "object",
        "properties": {
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseCode": {
            "type": "string",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "nullable": true
          },
          "warehouseZoneId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseZoneCode": {
            "type": "string",
            "nullable": true
          },
          "warehouseZoneName": {
            "type": "string",
            "nullable": true
          },
          "barcode": {
            "minLength": 1,
            "type": "string"
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "isPicking": {
            "type": "boolean"
          },
          "isStockable": {
            "type": "boolean"
          },
          "isReception": {
            "type": "boolean"
          },
          "isProduction": {
            "type": "boolean"
          },
          "isDamaged": {
            "type": "boolean"
          },
          "isReturns": {
            "type": "boolean"
          },
          "showInStockReports": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "isBuffer": {
            "type": "boolean"
          },
          "hideInCustomersOrders": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean"
          },
          "width": {
            "type": "number",
            "format": "double"
          },
          "height": {
            "type": "number",
            "format": "double"
          },
          "length": {
            "type": "number",
            "format": "double"
          },
          "weight": {
            "type": "number",
            "format": "double"
          },
          "volume": {
            "type": "number",
            "format": "double"
          },
          "stockMinim": {
            "type": "number",
            "format": "double"
          },
          "stockOptimal": {
            "type": "number",
            "format": "double"
          },
          "isFreezen": {
            "type": "boolean"
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "WarehouseLocationDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WarehouseLocationDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "WarehouseLocationDtoWithoutId": {
        "required": [
          "barcode",
          "code",
          "name",
          "warehouseId",
          "warehouseZoneId"
        ],
        "type": "object",
        "properties": {
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseCode": {
            "type": "string",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "nullable": true
          },
          "warehouseZoneId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseZoneCode": {
            "type": "string",
            "nullable": true
          },
          "warehouseZoneName": {
            "type": "string",
            "nullable": true
          },
          "barcode": {
            "minLength": 1,
            "type": "string"
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "isPicking": {
            "type": "boolean"
          },
          "isStockable": {
            "type": "boolean"
          },
          "isReception": {
            "type": "boolean"
          },
          "isProduction": {
            "type": "boolean"
          },
          "isDamaged": {
            "type": "boolean"
          },
          "isReturns": {
            "type": "boolean"
          },
          "showInStockReports": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "isBuffer": {
            "type": "boolean"
          },
          "hideInCustomersOrders": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean"
          },
          "width": {
            "type": "number",
            "format": "double"
          },
          "height": {
            "type": "number",
            "format": "double"
          },
          "length": {
            "type": "number",
            "format": "double"
          },
          "weight": {
            "type": "number",
            "format": "double"
          },
          "volume": {
            "type": "number",
            "format": "double"
          },
          "stockMinim": {
            "type": "number",
            "format": "double"
          },
          "stockOptimal": {
            "type": "number",
            "format": "double"
          },
          "isFreezen": {
            "type": "boolean"
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WarehouseZoneDto": {
        "required": [
          "code",
          "name",
          "warehouseId"
        ],
        "type": "object",
        "properties": {
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseCode": {
            "type": "string",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "printDocIn": {
            "type": "boolean"
          },
          "printDocInValidated": {
            "type": "boolean"
          },
          "printDocOut": {
            "type": "boolean"
          },
          "printDocOutValidated": {
            "type": "boolean"
          },
          "printDocTransfer": {
            "type": "boolean"
          },
          "printDocTransferValidated": {
            "type": "boolean"
          },
          "isPrinterDocument": {
            "type": "boolean"
          },
          "printerDocumentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerDocument": {
            "type": "string",
            "nullable": true
          },
          "isPrinterLabelPallet": {
            "type": "boolean"
          },
          "printerLabelPalletId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerLabelPallet": {
            "type": "string",
            "nullable": true
          },
          "isPrinterLabelPicking": {
            "type": "boolean"
          },
          "printerLabelPickingId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerLabelPicking": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "WarehouseZoneDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WarehouseZoneDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "WarehouseZoneDtoWithoutId": {
        "required": [
          "code",
          "name",
          "warehouseId"
        ],
        "type": "object",
        "properties": {
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseCode": {
            "type": "string",
            "nullable": true
          },
          "warehouseName": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "printDocIn": {
            "type": "boolean"
          },
          "printDocInValidated": {
            "type": "boolean"
          },
          "printDocOut": {
            "type": "boolean"
          },
          "printDocOutValidated": {
            "type": "boolean"
          },
          "printDocTransfer": {
            "type": "boolean"
          },
          "printDocTransferValidated": {
            "type": "boolean"
          },
          "isPrinterDocument": {
            "type": "boolean"
          },
          "printerDocumentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerDocument": {
            "type": "string",
            "nullable": true
          },
          "isPrinterLabelPallet": {
            "type": "boolean"
          },
          "printerLabelPalletId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerLabelPallet": {
            "type": "string",
            "nullable": true
          },
          "isPrinterLabelPicking": {
            "type": "boolean"
          },
          "printerLabelPickingId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "printerLabelPicking": {
            "type": "string",
            "nullable": true
          },
          "creationByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modifiedByUser": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WaveCreateDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "releaseTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "carrierCutoff": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "allocatedUserId": {
            "type": "integer",
            "format": "int32"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WaveDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "waveNo": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "0=Draft, 1=Active, 2=Completed, 3=Cancelled",
            "format": "int32"
          },
          "allocatedUserId": {
            "type": "integer",
            "format": "int32"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WaveDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WaveDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "WaveWithStatsDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "waveNo": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "0=Draft, 1=Active, 2=Completed, 3=Cancelled",
            "format": "int32"
          },
          "allocatedUserId": {
            "type": "integer",
            "format": "int32"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "documentCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalLines": {
            "type": "integer",
            "format": "int32"
          },
          "totalQuantity": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "WebhookResultDto": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "salesOrderId": {
            "type": "integer",
            "format": "int32"
          },
          "salesOrderNo": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "partnerCreated": {
            "type": "boolean"
          },
          "linesMatched": {
            "type": "integer",
            "format": "int32"
          },
          "linesSkipped": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "WooAddressDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "company": {
            "type": "string",
            "nullable": true
          },
          "address1": {
            "type": "string",
            "nullable": true
          },
          "address2": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "fullName": {
            "type": "string",
            "description": "Full name helper.",
            "nullable": true,
            "readOnly": true
          },
          "displayName": {
            "type": "string",
            "description": "Display name: company if set, otherwise full name.",
            "nullable": true,
            "readOnly": true
          },
          "fullAddress": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "WooCommerceOrderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "WooCommerce internal order ID.",
            "format": "int32"
          },
          "number": {
            "type": "string",
            "description": "Human-readable order number (same as id unless customised).",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time"
          },
          "dateCreatedGmt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "total": {
            "type": "string",
            "nullable": true
          },
          "totalTax": {
            "type": "string",
            "nullable": true
          },
          "customerNote": {
            "type": "string",
            "nullable": true
          },
          "billing": {
            "$ref": "#/components/schemas/WooAddressDto"
          },
          "shipping": {
            "$ref": "#/components/schemas/WooAddressDto"
          },
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WooLineItemDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WooLineItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "productId": {
            "type": "integer",
            "format": "int32"
          },
          "variationId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "sku": {
            "type": "string",
            "nullable": true
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "price": {
            "type": "string",
            "description": "Unit price as string (WooCommerce sends decimals as strings).",
            "nullable": true
          },
          "subtotal": {
            "type": "string",
            "nullable": true
          },
          "totalTax": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WorkCentreDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "workCentreType": {
            "type": "string",
            "description": "Machine | Manual | Outsource",
            "nullable": true
          },
          "capacityPerHour": {
            "type": "number",
            "format": "double"
          },
          "setupMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastModified": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "WorkCentreDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCentreDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "WorkCentreDtoWithoutId": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "workCentreType": {
            "type": "string",
            "nullable": true
          },
          "capacityPerHour": {
            "type": "number",
            "format": "double"
          },
          "setupMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "WorkTaskDto": {
        "type": "object",
        "properties": {
          "taskType": {
            "type": "string",
            "description": "One of: Put, Pick, Replen, Move, Cycle, Pack, Loading",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "0=Pending, 1=Assigned, 2=InProgress, 3=Completed, 4=Cancelled",
            "format": "int32"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "assignedToUserId": {
            "type": "integer",
            "format": "int32"
          },
          "assignedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "parentDocumentId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "sourceLocationId": {
            "type": "integer",
            "format": "int32"
          },
          "targetLocationId": {
            "type": "integer",
            "format": "int32"
          },
          "productId": {
            "type": "integer",
            "format": "int32"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "assignedToUserName": {
            "type": "string",
            "nullable": true
          },
          "durationMinutes": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "WorkTaskDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkTaskDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "WorkTaskDtoWithoutId": {
        "type": "object",
        "properties": {
          "taskType": {
            "type": "string",
            "description": "One of: Put, Pick, Replen, Move, Cycle, Pack, Loading",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "0=Pending, 1=Assigned, 2=InProgress, 3=Completed, 4=Cancelled",
            "format": "int32"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "assignedToUserId": {
            "type": "integer",
            "format": "int32"
          },
          "assignedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "parentDocumentId": {
            "type": "integer",
            "format": "int32"
          },
          "warehouseId": {
            "type": "integer",
            "format": "int32"
          },
          "sourceLocationId": {
            "type": "integer",
            "format": "int32"
          },
          "targetLocationId": {
            "type": "integer",
            "format": "int32"
          },
          "productId": {
            "type": "integer",
            "format": "int32"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WorksiteDto": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "cityId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cityCode": {
            "type": "string",
            "nullable": true
          },
          "cityName": {
            "type": "string",
            "nullable": true
          },
          "countyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countyCode": {
            "type": "string",
            "nullable": true
          },
          "countyName": {
            "type": "string",
            "nullable": true
          },
          "countryId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          },
          "countryName": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "gln": {
            "type": "string",
            "nullable": true
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "id": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "WorksiteDtoPagedResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorksiteDto"
            },
            "description": "The records on the current page.",
            "nullable": true
          },
          "page": {
            "type": "integer",
            "description": "Current page number (1-based).",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of records per page (max varies per endpoint).",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "description": "Total number of records matching the applied filters (across all pages).",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages: ceil(TotalCount / PageSize).",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "Generic paged result wrapper returned by all list endpoints."
      },
      "WorksiteDtoWithoutId": {
        "required": [
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "cityId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "cityCode": {
            "type": "string",
            "nullable": true
          },
          "cityName": {
            "type": "string",
            "nullable": true
          },
          "countyId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countyCode": {
            "type": "string",
            "nullable": true
          },
          "countyName": {
            "type": "string",
            "nullable": true
          },
          "countryId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          },
          "countryName": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "gln": {
            "type": "string",
            "nullable": true
          },
          "internalKey": {
            "type": "string",
            "nullable": true
          },
          "externalKey": {
            "type": "string",
            "nullable": true
          },
          "isActive": {
            "type": "boolean"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "X-API-KEY": {
        "type": "apiKey",
        "description": "API Key in header **X-API-KEY**.",
        "name": "X-API-KEY",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "X-API-KEY": [ ]
    }
  ],
  "tags": [
    {
      "name": "AssemblyLines",
      "description": "Assembly lines management"
    },
    {
      "name": "BarcodeLabels",
      "description": "Barcode labels management"
    },
    {
      "name": "BarcodeScanners",
      "description": "Barcode scanners management"
    },
    {
      "name": "CrossDocking",
      "description": "Cross-Docking — direct transfer from receiving to shipping"
    },
    {
      "name": "DocumentsAssembly",
      "description": "Documents Assembly (type 5) — production/assembly documents using bill of materials. Consumes raw materials (lines) and produces finished products. Key fields: ProductId, Quantity, FinalProductLocationId."
    },
    {
      "name": "DocumentsConsumption",
      "description": "Documents Consumption (type 8) — internal consumption of goods (not a sale). Validating decreases stock without a sales transaction. Used for office supplies, maintenance materials, samples, etc."
    },
    {
      "name": "DocumentsDisassembly",
      "description": "Documents Disassembly (type 6) — reverse assembly: breaks a finished product into its components. Validating removes the finished product from stock and increases component quantities."
    },
    {
      "name": "DocumentsIn",
      "description": "Documents In — goods receipts / inbound shipments"
    },
    {
      "name": "DocumentsInventory",
      "description": "Documents Inventory (type 4) — stock count and adjustment documents. Validates stock levels against physical count. Key fields: InventoryLocationId, InventoryEmployeeId."
    },
    {
      "name": "DocumentsLines",
      "description": "Document lines management"
    },
    {
      "name": "DocumentsLinesLots",
      "description": "Document line lots management"
    },
    {
      "name": "DocumentsLinesSerialNumbers",
      "description": "Document line serial numbers management"
    },
    {
      "name": "DocumentsOut",
      "description": "Documents Out (type 2) — outbound shipments: sales orders, picking lists. Validating commits stock decrease at the source location."
    },
    {
      "name": "DocumentsReturn",
      "description": "Documents Return (type 7) — goods returned by customers or to suppliers. IsReturn=true. Validating adjusts stock accordingly (customer return = stock in; supplier return = stock out)."
    },
    {
      "name": "DocumentStatuses",
      "description": "Document statuses — workflow states for all document types"
    },
    {
      "name": "DocumentsTransfer",
      "description": "Documents Transfer (type 3) — internal warehouse transfers between locations or warehouses. Validating moves stock from LocationSourceId to LocationDestinationId."
    },
    {
      "name": "KpiSnapshots",
      "description": "KPI Snapshots — time-series WMS KPIs"
    },
    {
      "name": "MES",
      "description": "Manufacturing Execution System"
    },
    {
      "name": "Movements",
      "description": "Stock movements (read-only)"
    },
    {
      "name": "Pallets",
      "description": "Pallets management"
    },
    {
      "name": "PalletsTypes",
      "description": "Pallet types management"
    },
    {
      "name": "Partners",
      "description": "Partners management"
    },
    {
      "name": "PickingSections",
      "description": "Picking Sections — logical pick-zone groupings"
    },
    {
      "name": "Printers",
      "description": "Printers management"
    },
    {
      "name": "PrintServer",
      "description": "Print Server jobs (thin client)"
    },
    {
      "name": "ProductsCategories",
      "description": "Product categories management"
    },
    {
      "name": "Products",
      "description": "Products (articles / SKUs)"
    },
    {
      "name": "ProductsLocations",
      "description": "Product-location assignments (which products go to which locations)"
    },
    {
      "name": "ProductsStock",
      "description": "Stock levels (inventory on hand per location/lot)"
    },
    {
      "name": "ProductsTypes",
      "description": "Product types — classification labels (Raw material, Finished good, Service, etc.)"
    },
    {
      "name": "ProductsUoms",
      "description": "Product units of measure management"
    },
    {
      "name": "ProductsVats",
      "description": "Product VAT rates management"
    },
    {
      "name": "PurchaseOrders",
      "description": "OMS — Purchase Orders (procurement pipeline: Draft → Sent → Acknowledged → Received → Invoiced)"
    },
    {
      "name": "PutawayRules",
      "description": "Putaway Rules — engine input for receipt put-away decisions"
    },
    {
      "name": "ReceiptFlow",
      "description": "Receipt flow — status transitions for inbound documents"
    },
    {
      "name": "SalesOrders",
      "description": "OMS — Sales Orders pipeline (Draft → Confirmed → Picking → Shipped → Invoiced)"
    },
    {
      "name": "ShelfReturnQueue",
      "description": "Shelf return queue — physical return tasks after line cancellations"
    },
    {
      "name": "Tms",
      "description": "Transport Management System — Routes, Vehicles, Drivers"
    },
    {
      "name": "Users",
      "description": "Users management"
    },
    {
      "name": "UsersGroups",
      "description": "User groups management"
    },
    {
      "name": "Warehouses",
      "description": "Warehouses management"
    },
    {
      "name": "WarehousesLocations",
      "description": "Warehouse locations management"
    },
    {
      "name": "WarehousesZones",
      "description": "Warehouse zones management"
    },
    {
      "name": "Waves",
      "description": "Waves — outbound consolidation for batch picking"
    },
    {
      "name": "Webhooks",
      "description": "Webhooks — inbound e-commerce order events (WooCommerce, generic)"
    },
    {
      "name": "WebhooksMagento",
      "description": "Webhooks - Magento ecommerce"
    },
    {
      "name": "WebhooksNopCommerce",
      "description": "Webhooks - nopCommerce ecommerce"
    },
    {
      "name": "WebhooksOpenCart",
      "description": "Webhooks - OpenCart ecommerce"
    },
    {
      "name": "WebhooksPrestaShop",
      "description": "Webhooks - PrestaShop ecommerce"
    },
    {
      "name": "WebhooksWooCommerce",
      "description": "Webhooks - WooCommerce ecommerce"
    },
    {
      "name": "WorkCentres",
      "description": "MES Work Centres and Production Steps"
    },
    {
      "name": "Worksites",
      "description": "Worksites management"
    },
    {
      "name": "WorkTasks",
      "description": "Work Tasks — operator task assignments + labor metrics"
    },
    {
      "name": "CrossDocking",
      "description": "Cross-Docking API — matches inbound and outbound orders by product\r\nand manages allocations for direct transfer without warehousing."
    },
    {
      "name": "DocumentsAssembly",
      "description": "Assembly / production documents — bill of materials (BOM) processing.\r\nConsumes raw material components and produces finished goods.\r\nKey fields: ProductId (finished product being assembled), Quantity (output qty),\r\nFinalProductLocationId (where the finished product is stored). Document type = 5."
    },
    {
      "name": "DocumentsConsumption",
      "description": "Internal consumption documents — goods consumed internally by the organization, not sold.\r\nValidating decreases stock without creating a sales transaction.\r\nTypical uses: office supplies used internally, materials used for maintenance, samples.\r\nDocument type = 8."
    },
    {
      "name": "DocumentsDisassembly",
      "description": "Disassembly documents — breaking down finished products into their component parts.\r\nReverse of assembly: consumes a finished product and increases stock of its components.\r\nDocument type = 6."
    },
    {
      "name": "DocumentsIn",
      "description": "Manage inbound documents (goods receipts, purchase receipts, NIR).\r\nA DocumentIn represents the physical receipt of goods from a supplier.\r\nValidating a DocumentIn increases stock levels in the WMS."
    },
    {
      "name": "DocumentsInventory",
      "description": "Inventory count / stock adjustment documents.\r\nUsed to reconcile system stock levels against physical counts.\r\nKey fields: InventoryLocationId (location being counted), InventoryEmployeeId (counter).\r\nDocument type = 4."
    },
    {
      "name": "DocumentsOut",
      "description": "Outbound documents — sales orders, picking lists, and shipments.\r\nValidating an outbound document decreases stock at the source picking location.\r\nKey fields: LocationSourceId (where to pick from), PickingLocationId. Document type = 2."
    },
    {
      "name": "DocumentsReturn",
      "description": "Return documents — goods returned by customers or returned to suppliers.\r\nIsReturn = true on all lines. Validating increases stock for customer returns\r\nor decreases stock for returns to supplier. Document type = 7."
    },
    {
      "name": "DocumentStatuses",
      "description": "Document workflow statuses — configure the state machine for each document type.\r\nStatuses are referenced from document headers via StatusId/StatusName."
    },
    {
      "name": "DocumentsTransfer",
      "description": "Internal warehouse transfer documents — moving goods between locations or warehouses.\r\nValidating decreases stock at the source location and increases stock at the destination.\r\nKey fields: LocationSourceId, LocationDestinationId. Document type = 3."
    },
    {
      "name": "KpiSnapshots",
      "description": "2026-05-24 (excel #190 — read-only API): KPI snapshots time series.\r\n            \r\nSnapshots are produced by KpiSnapshotWriter (background timer in WMS). The API exposes\r\nread endpoints for external dashboards / Power BI integration.\r\n            \r\nKnown KpiCode values: PicksPerHour, ActiveOperators, OpenExceptions, OrderFulfillRate\r\n(see KpiSnapshot entity class doc for full taxonomy)."
    },
    {
      "name": "MerchantPro",
      "description": "MerchantPro connector — provisioning, order ingest and stock delta endpoints.\r\nUsed by the Rosistem.MerchantPro connector service (Source/MerchantPro) to bridge\r\nMerchantPro shops with the WMS. All endpoints require X-Api-Key header."
    },
    {
      "name": "PickingSections",
      "description": "2026-05-24 (excel #185 — CRUD): Picking Sections.\r\nSections group locations as logical pick zones (cross-cutting actual Warehouse Zones)."
    },
    {
      "name": "PrintServer",
      "description": "Endpoints for the Rosistem Print Server service (thin client).\r\n            \r\nThe Print Server no longer knows DB credentials. It calls this API:\r\n  - GET  /api/printserver/jobs      -> receives the list of pre-baked jobs\r\n                                       (FastReport template + dataset XML + printer name + copies)\r\n  - POST /api/printserver/ack       -> acknowledges a job was printed, WMS sets IsPrinted=true\r\n            \r\nAuth: standard X-API-KEY (same middleware as the rest of the API)."
    },
    {
      "name": "Products",
      "description": "Manage WMS products (articles / SKUs).\r\nProducts are the central entity of the WMS — all stock movements, document lines, and stock records reference a product."
    },
    {
      "name": "ProductsStock",
      "description": "Read stock levels per product, per location, and per lot/serial.\r\nStock records are managed by the WMS engine — they are not created directly via this API.\r\nUse document operations (DocumentsIn, DocumentsOut, DocumentsTransfer) to change stock."
    },
    {
      "name": "ProductsTypes",
      "description": "Product type lookup — classification labels for products (e.g. Raw material, Finished good, Service).\r\nReferenced from Product via TypeId/TypeName."
    },
    {
      "name": "PutawayRules",
      "description": "2026-05-24 (excel #189 — CRUD): manage Putaway Rules. Each rule is a (priority, conditions, actions)\r\ntuple evaluated by PutawayRulesEngine when receiving a new IN doc line.\r\n            \r\nConditions/Actions JSON shapes — see PutawayRule entity class doc."
    },
    {
      "name": "ReceiptFlow",
      "description": "2026-05-22 (receipt flow #185): endpoints for status transitions on the\r\nreceipt flow. Used by MAUI (close-from-terminal) and by the backoffice\r\n(mark-complete, split-remaining) via direct API calls."
    },
    {
      "name": "ShelfReturnQueue",
      "description": "2026-05-21 (ShelfReturnQueue Faza 4): Endpoint-uri for aplicatia MAUI sa listeze\r\nsi sa confirme sarcinile de retur raft generate de cancel-line pe documents validate.\r\n            \r\nEndpoint-urile sunt protejate via ApiKeyMiddleware (granular permissions implementate\r\nanterior). The user-API must aiba checked: ShelfReturnQueue.GetPending, /Confirm etc."
    },
    {
      "name": "Waves",
      "description": "2026-05-24 (excel #194 — CRUD): Wave Management.\r\n            \r\nA wave groups multiple outbound documents for consolidated picking.\r\nStatus: 0=Draft, 1=Active, 2=Completed, 3=Cancelled."
    },
    {
      "name": "Webhooks",
      "description": "E-commerce webhook receiver.\r\nCreates WMS Sales Orders automatically from incoming platform webhooks.\r\n            \r\nSecurity: protect these endpoints with the standard X-API-Key header.\r\nWooCommerce: configure webhook secret in WC → Settings → Advanced → Webhooks."
    },
    {
      "name": "WebhooksMagento",
      "description": "Webhook receiver for Magento — receives notifications from the Magento shop\r\n(orders, product updates, stock changes, customers)."
    },
    {
      "name": "WebhooksNopCommerce",
      "description": "Webhook receiver for nopCommerce — receives notifications from the nopCommerce shop\r\n(orders, product updates, stock changes, customers)."
    },
    {
      "name": "WebhooksOpenCart",
      "description": "Webhook receiver for OpenCart — receives notifications from the OpenCart shop\r\n(orders, product updates, stock changes, customers)."
    },
    {
      "name": "WebhooksPrestaShop",
      "description": "Webhook receiver for PrestaShop — receives notifications from the PrestaShop shop\r\n(orders, product updates, stock changes, customers).\r\nPrestaShop trimite payload JSON cu signature in header X-PrestaShop-Webhook-Signature."
    },
    {
      "name": "WebhooksWooCommerce",
      "description": "Webhook receiver for WooCommerce — receives notifications from the WooCommerce shop\r\n(orders, product updates, stock changes, customers)."
    },
    {
      "name": "WorkTasks",
      "description": "2026-05-24 (excel #195 — CRUD): Work Tasks for labor metrics.\r\n            \r\nStatus workflow:\r\n  0 Pending → 1 Assigned → 2 InProgress → 3 Completed\r\n                                   \\→ 4 Cancelled"
    }
  ]
}