{
  "openapi": "3.1.0",
  "info": {
    "title": "SimpleBilly API",
    "description": "Simplebilly API - Bookkeeping, CRM, ERP. Multi-tenant API: a tenant is isolated and routed by subdomain (or a configured custom domain) under the base domain.\n\n## Rate limiting\nAll endpoints are rate-limited per client IP: **100 requests per minute** on API routes and **5 requests per minute** on authentication routes. Exceeding a limit returns `429 Too Many Requests`; the window resets after 60 seconds.",
    "termsOfService": "https://simplebilly.com/en/legal/tos",
    "contact": {
      "name": "Endless Deals Germany GmbH",
      "url": "https://simplebilly.com/en/legal/imprint",
      "email": "support@simplebilly.com"
    },
    "license": {
      "name": "Apache-2.0",
      "identifier": "Apache-2.0"
    },
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://{subdomain}.simplebilly.com",
      "description": "Tenant-segmented production API. Each tenant is isolated to its own subdomain under the base domain (configured as `config.base_domain`). Replace the `subdomain` variable with the tenant's subdomain, or its custom domain if configured.",
      "variables": {
        "subdomain": {
          "default": "demo",
          "description": "Tenant subdomain used for tenant isolation and routing"
        }
      }
    }
  ],
  "paths": {
    "/api/pos/billing": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_billing",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/kasse/closing": {
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_kasse_closing",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/kasse/entries": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_kasse_entries",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/kasse/export": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_kasse_export",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/kasse/pay-in-out": {
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_kasse_pay_in_out",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/orders": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_list_orders",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by order status",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_create_order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/orders/{order_number}/pay": {
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_pay_order",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/orders/{order_number}/print": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_order_print",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/orders/{order_number}/receipt": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_order_receipt",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/products": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_list_products",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Product search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/registers": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_list_registers",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PosRegister"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_create_register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PosRegisterCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PosRegister"
                }
              }
            }
          }
        }
      }
    },
    "/api/pos/registers/{id}/disable": {
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_disable_register",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PosRegister"
                }
              }
            }
          }
        }
      }
    },
    "/api/pos/sumup/checkout": {
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_sumup_checkout",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/pos/tables": {
      "get": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_list_tables",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PosTable"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_create_table",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PosTableCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PosTable"
                }
              }
            }
          }
        }
      }
    },
    "/api/pos/tables/{id}/free": {
      "post": {
        "tags": [
          "pos"
        ],
        "operationId": "pos_free_table",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PosTable"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/absences": {
      "post": {
        "tags": [
          "absence"
        ],
        "operationId": "create_absence",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AbsenceCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Absence"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/absences/": {
      "get": {
        "tags": [
          "absence"
        ],
        "operationId": "get_absences",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Absence"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/absences/{id}": {
      "get": {
        "tags": [
          "absence"
        ],
        "operationId": "get_absence",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Absence"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "absence"
        ],
        "operationId": "update_absence",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AbsenceUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Absence"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "absence"
        ],
        "operationId": "delete_absence",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/activities": {
      "post": {
        "tags": [
          "activity"
        ],
        "operationId": "create_activity",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Activity"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/activities/": {
      "get": {
        "tags": [
          "activity"
        ],
        "operationId": "list_activities",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "activityType",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "assignedTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "overdueOnly",
            "in": "query",
            "description": "Only show overdue follow-ups.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Activity"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/activities/{activity_id}": {
      "get": {
        "tags": [
          "activity"
        ],
        "operationId": "get_activity",
        "parameters": [
          {
            "name": "activity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "activity"
        ],
        "operationId": "update_activity",
        "parameters": [
          {
            "name": "activity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "activity"
        ],
        "operationId": "delete_activity",
        "parameters": [
          {
            "name": "activity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/activities/{activity_id}/status": {
      "put": {
        "tags": [
          "activity"
        ],
        "operationId": "update_activity_status",
        "parameters": [
          {
            "name": "activity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivityStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/storage/mirror": {
      "post": {
        "tags": [
          "admin"
        ],
        "operationId": "trigger_mirror",
        "responses": {
          "200": {
            "description": "Mirror job queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MirrorTriggerResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attachments": {
      "post": {
        "tags": [
          "attachment"
        ],
        "operationId": "create_attachment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attachments/": {
      "get": {
        "tags": [
          "attachment"
        ],
        "operationId": "list_attachments",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Attachment"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attachments/{attachment_id}/ocr-text": {
      "put": {
        "tags": [
          "attachment"
        ],
        "summary": "Persist client-side OCR output for an attachment.",
        "operationId": "save_attachment_ocr_text",
        "parameters": [
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OcrTextRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attachments/{attachment_id}/versions": {
      "get": {
        "tags": [
          "attachment_version"
        ],
        "operationId": "list_attachment_versions",
        "parameters": [
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AttachmentVersion"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "attachment_version"
        ],
        "operationId": "create_attachment_version",
        "parameters": [
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "New current version recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentVersion"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attachments/{attachment_id}/versions/{version_id}/restore": {
      "post": {
        "tags": [
          "attachment_version"
        ],
        "operationId": "restore_attachment_version",
        "parameters": [
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attachments/{id}": {
      "get": {
        "tags": [
          "attachment"
        ],
        "operationId": "get_attachment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "attachment"
        ],
        "operationId": "delete_attachment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/attachments/{id}/restore": {
      "post": {
        "tags": [
          "attachment"
        ],
        "operationId": "attachment_restore",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/automations": {
      "get": {
        "tags": [
          "automations"
        ],
        "operationId": "list_automations",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AutomationDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/automations/{key}": {
      "put": {
        "tags": [
          "automations"
        ],
        "operationId": "update_automation",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAutomation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/automations/{key}/trigger": {
      "post": {
        "tags": [
          "automations"
        ],
        "operationId": "trigger_automation",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/boms": {
      "post": {
        "tags": [
          "bom"
        ],
        "operationId": "create_bom",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BomCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bom"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/boms/": {
      "get": {
        "tags": [
          "bom"
        ],
        "operationId": "list_boms",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "query",
            "description": "Filter by finished product id.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Bom"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/boms/{bom_id}": {
      "get": {
        "tags": [
          "bom"
        ],
        "operationId": "get_bom",
        "parameters": [
          {
            "name": "bom_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bom"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "bom"
        ],
        "operationId": "update_bom",
        "parameters": [
          {
            "name": "bom_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BomUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bom"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "bom"
        ],
        "operationId": "delete_bom",
        "parameters": [
          {
            "name": "bom_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/anlage-g": {
      "get": {
        "tags": [
          "anlage_g"
        ],
        "operationId": "anlage_g_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Anlage G Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnlageGErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/anlage-s": {
      "get": {
        "tags": [
          "anlage_s"
        ],
        "operationId": "anlage_s_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Anlage S Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnlageSErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/banking/lookup": {
      "get": {
        "tags": [
          "banking"
        ],
        "operationId": "bank_lookup_api",
        "parameters": [
          {
            "name": "iban",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bank-Lookup Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankLookup"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/banking/transactions": {
      "get": {
        "tags": [
          "banking"
        ],
        "operationId": "bank_transactions_api",
        "responses": {
          "200": {
            "description": "Bank-Transaktionen"
          }
        }
      }
    },
    "/api/v1/bookkeeping/buchhalter-csv": {
      "get": {
        "tags": [
          "gobd_export"
        ],
        "operationId": "buchhalter_csv_api",
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Buchhalter CSV",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoBDExportResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/budgets": {
      "get": {
        "tags": [
          "budgets"
        ],
        "operationId": "budgets_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Monats-Budget + Prognose",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/budgets/goals/{category}": {
      "put": {
        "tags": [
          "budgets"
        ],
        "operationId": "upsert_budget_goal_api",
        "parameters": [
          {
            "name": "category",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetGoalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Budget goal saved (upsert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Budget"
                }
              }
            }
          },
          "400": {
            "description": "Negative goal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/bwa": {
      "get": {
        "tags": [
          "bookkeeping"
        ],
        "summary": "Get BWA (Betriebswirtschaftliche Auswertung) report",
        "operationId": "bwa_report_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BWA Report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BWAReport"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v1/bookkeeping/cashflow": {
      "get": {
        "tags": [
          "bookkeeping"
        ],
        "summary": "GET /api/v1/bookkeeping/cashflow\nReturns operating, investing, and financing cashflow for the given period.",
        "operationId": "get_cashflow",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cashflow report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashflowReport"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/datev/export": {
      "get": {
        "tags": [
          "datev"
        ],
        "summary": "Export bookkeeping data as DATEV CSV",
        "operationId": "datev_export_api",
        "parameters": [
          {
            "name": "account_schema",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DATEV CSV export",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatevExportResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/datev/import": {
      "post": {
        "tags": [
          "datev_import"
        ],
        "operationId": "datev_import_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Parsed DATEV CSV rows",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatevImportResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/datev/preview": {
      "get": {
        "tags": [
          "datev"
        ],
        "summary": "Exported_datev_bookings: returns formed bookings for review",
        "operationId": "datev_preview_api",
        "parameters": [
          {
            "name": "account_schema",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DATEV booking preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DatevBookingPreview"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/dunning": {
      "post": {
        "tags": [
          "bookkeeping"
        ],
        "operationId": "run_dunning_api",
        "responses": {
          "200": {
            "description": "Dunning run completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DunningResult"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/ebilanz": {
      "get": {
        "tags": [
          "ebilanz"
        ],
        "operationId": "ebilanz_report_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "E-Bilanz report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EBilanzReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/ebilanz/xbrl": {
      "get": {
        "tags": [
          "ebilanz"
        ],
        "operationId": "ebilanz_xbrl_export_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "XBRL XML content",
            "content": {
              "application/xml": {}
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/eks": {
      "get": {
        "tags": [
          "anlage_eks"
        ],
        "operationId": "eks_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Anlage EKS Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EksErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/elster/status": {
      "get": {
        "tags": [
          "bookkeeping"
        ],
        "operationId": "elster_status_api",
        "responses": {
          "200": {
            "description": "ELSTER integration status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElsterStatus"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/emissions/entries": {
      "get": {
        "tags": [
          "emissions"
        ],
        "operationId": "emissions_entries_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Emission entries for year",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmissionEntry"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "emissions"
        ],
        "operationId": "create_emission_entry_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmissionEntry"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Emission entry created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmissionEntry"
                }
              }
            }
          },
          "400": {
            "description": "Unknown category/method",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/emissions/entries/{id}": {
      "delete": {
        "tags": [
          "emissions"
        ],
        "operationId": "delete_emission_entry_api",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Emission entry deleted"
          },
          "404": {
            "description": "Entry not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/emissions/export": {
      "get": {
        "tags": [
          "emissions"
        ],
        "operationId": "emissions_export_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Emissions CSV export",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmissionsExportResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/emissions/factors": {
      "get": {
        "tags": [
          "emissions"
        ],
        "operationId": "emissions_factors_api",
        "responses": {
          "200": {
            "description": "Builtin emission factors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmissionFactorResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/emissions/report": {
      "get": {
        "tags": [
          "emissions"
        ],
        "operationId": "emissions_report_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Emissions report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmissionsReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/emissions/targets": {
      "get": {
        "tags": [
          "emissions"
        ],
        "operationId": "emissions_targets_api",
        "responses": {
          "200": {
            "description": "Emission reduction targets (ESRS E1-4)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmissionTarget"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "emissions"
        ],
        "operationId": "create_emission_target_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmissionTarget"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Emission target created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmissionTarget"
                }
              }
            }
          },
          "400": {
            "description": "Invalid scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/emissions/targets/{id}": {
      "delete": {
        "tags": [
          "emissions"
        ],
        "operationId": "delete_emission_target_api",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Emission target deleted"
          },
          "404": {
            "description": "Target not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/euer": {
      "get": {
        "tags": [
          "euer"
        ],
        "operationId": "euer_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "EÜR Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EuerErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/euer/kategorien": {
      "get": {
        "tags": [
          "euer"
        ],
        "operationId": "euer_kategorien_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "EÜR mit Kategorie-Aufschlüsselung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EuerDetailErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/fristen": {
      "get": {
        "tags": [
          "fristen"
        ],
        "operationId": "fristen_api",
        "parameters": [
          {
            "name": "bundesland",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "voranmeldungsrhythmus",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "dauerfristverlaengerung",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          },
          {
            "name": "est_aktiv",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          },
          {
            "name": "gewst_aktiv",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          },
          {
            "name": "monate",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Steuerliche Fristen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FristenErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/gewerbesteuer": {
      "get": {
        "tags": [
          "gewerbesteuer"
        ],
        "operationId": "gewerbesteuer_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "hebesatz",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "gewerbeertrag",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "gemeindeschluessel",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gewerbesteuer / Trade Tax Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GewerbesteuerErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/gewinnverwendung": {
      "get": {
        "tags": [
          "gewinnverwendung"
        ],
        "operationId": "gewinnverwendung_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gewinnverwendungsrechnung (§ 150, § 174 AktG)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GewinnverwendungsReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/gewinnverwendung/export": {
      "get": {
        "tags": [
          "gewinnverwendung"
        ],
        "operationId": "gewinnverwendung_export_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gewinnverwendungsrechnung als CSV (BOM, Semikolon)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GewinnverwendungsExportResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/gez": {
      "get": {
        "tags": [
          "gez"
        ],
        "operationId": "gez_api",
        "parameters": [
          {
            "name": "jahr",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "betriebsstaetten",
            "in": "query",
            "description": "Liste der Betriebsstätten als JSON, z.B. `[{\"name\":\"Filiale 1\",\"beschaefigte\":12}]`.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "kfz",
            "in": "query",
            "description": "Gesamtzahl der betrieblich genutzten Kfz (falls keine Betriebsstätten angegeben sind).",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "hotelzimmer",
            "in": "query",
            "description": "Gesamtzahl der Hotel-/Gästezimmer und Ferienwohnungen.",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "beschaefigte",
            "in": "query",
            "description": "Gesamtzahl der Beschäftigten (verwendet nur, wenn `betriebsstaetten` fehlt;\ndann wird eine einzelne Betriebsstätte angenommen).",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rundfunkbeitrag (GEZ) Berechnung nach § 5 RBStV",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GezReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/gobd": {
      "get": {
        "tags": [
          "gobd_export"
        ],
        "summary": "GoBD/GDPdU export. Default: ZIP archive (`index.xml` + CSV tables, IDEA\nformat). `?format=csv` returns the legacy single-journal CSV as JSON.",
        "operationId": "gobd_export_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Export format: `zip` (default, full GDPdU/IDEA export) or\n`csv` (legacy single-journal CSV as JSON).",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            },
            "example": "zip"
          }
        ],
        "responses": {
          "200": {
            "description": "GoBD/GDPdU export: ZIP (application/zip) with index.xml (IDEA table specification) and one UTF-8 CSV per tax-relevant table; legacy single-journal CSV JSON via ?format=csv",
            "content": {
              "application/zip": {}
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/hebesatz": {
      "get": {
        "tags": [
          "banking"
        ],
        "operationId": "hebesatz_lookup_api",
        "parameters": [
          {
            "name": "gemeindeschluessel",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "plz",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "stichtag",
            "in": "query",
            "description": "Stichtag for validity (YYYY-MM-DD); defaults to today. Picks row where valid_from <= date <= valid_to.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "country_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hebesatz Lookup",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HebesatzLookup"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/institute/status": {
      "get": {
        "tags": [
          "institute"
        ],
        "operationId": "institute_status_api",
        "responses": {
          "200": {
            "description": "Institut-Status: Fristen und Checkliste (KWG § 26, HGB § 340k/§ 341k, HGB § 325, GwG § 8)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstituteStatus"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/inventory-value": {
      "get": {
        "tags": [
          "inventory_value"
        ],
        "operationId": "get_inventory_value_api",
        "responses": {
          "200": {
            "description": "Inventory value history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentInventoryValue"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/inventory-value/record": {
      "post": {
        "tags": [
          "inventory_value"
        ],
        "operationId": "record_inventory_value_api",
        "responses": {
          "200": {
            "description": "Current value snapshot recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryValuePoint"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/jahresust": {
      "get": {
        "tags": [
          "ustva"
        ],
        "operationId": "jahresust_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Jahresumsatzsteuer Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JahresUstErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/konzern/status": {
      "get": {
        "tags": [
          "konzern"
        ],
        "operationId": "konzern_status_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Konzern-Status (§§ 290, 291, 293 HGB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KonzernStatus"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/konzern/status/export": {
      "get": {
        "tags": [
          "konzern"
        ],
        "operationId": "konzern_export_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Konzern-Beteiligungen mit Kontrollstatus als CSV (BOM, Semikolon)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KonzernExportResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/kosten-vorschau": {
      "get": {
        "tags": [
          "kosten_vorschau"
        ],
        "operationId": "kosten_vorschau_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Kosten-Vorschau für den Monat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KostenVorschau"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/kst": {
      "get": {
        "tags": [
          "kst"
        ],
        "operationId": "kst_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "gewinn",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Körperschaftsteuer Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KstErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/liquidity": {
      "get": {
        "tags": [
          "bookkeeping"
        ],
        "summary": "GET /api/v1/bookkeeping/liquidity\nReturns current liquidity position with ratios.",
        "operationId": "get_liquidity",
        "responses": {
          "200": {
            "description": "Liquidity position",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiquidityPosition"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/offenlegung": {
      "get": {
        "tags": [
          "offenlegung"
        ],
        "operationId": "offenlegung_api",
        "responses": {
          "200": {
            "description": "Offenlegungs-Checkliste (§ 325 HGB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OffenlegungReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/open-items": {
      "get": {
        "tags": [
          "list_open_items"
        ],
        "operationId": "list_open_items_api",
        "parameters": [
          {
            "name": "reminder_level1_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "reminder_level2_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "reminder_level3_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of open invoices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OpenItem"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v1/bookkeeping/oss": {
      "get": {
        "tags": [
          "oss_report"
        ],
        "operationId": "oss_report_api",
        "responses": {
          "200": {
            "description": "OSS dependencies",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OssReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/paygap/auskunft/{employee_id}": {
      "get": {
        "tags": [
          "paygap"
        ],
        "operationId": "paygap_auskunft_api",
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Individual pay information (§ 10-14 EntgTranspG)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayGapInfoResponse"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/paygap/export": {
      "get": {
        "tags": [
          "paygap"
        ],
        "operationId": "paygap_export_api",
        "responses": {
          "200": {
            "description": "Gender pay gap CSV export",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayGapExportResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/paygap/report": {
      "get": {
        "tags": [
          "paygap"
        ],
        "operationId": "paygap_report_api",
        "responses": {
          "200": {
            "description": "Gender pay gap report (EntgTranspG, EU 2023/970)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayGapReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/plausibility": {
      "get": {
        "tags": [
          "plausibility"
        ],
        "operationId": "plausibility_check_api",
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plausibility report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlausibilityReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/propose-assignments": {
      "get": {
        "tags": [
          "propose_assignments"
        ],
        "operationId": "propose_assignments_api",
        "parameters": [
          {
            "name": "min_confidence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Proposed payment to invoice assignments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProposedAssignment"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v1/bookkeeping/reports/bilanz": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Bilanz (Balance Sheet)",
        "operationId": "bilanz_report_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Balance sheet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BilanzReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/reports/guv": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Gewinn- und Verlustrechnung (P&L statement)",
        "operationId": "guv_report_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "GuV report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuVReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/reports/kontenansicht": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Kontenansicht (Account Overview)",
        "operationId": "kontenansicht_report_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account overview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KontoReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/reports/umsatzsteuer": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Umsatzsteuer-Voranmeldung (VAT report)",
        "operationId": "umsatzsteuer_report_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "VAT report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UmsatzsteuerReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/sepa-direct-debit": {
      "post": {
        "tags": [
          "create_sepa_direct_debit"
        ],
        "operationId": "create_sepa_direct_debit_api",
        "parameters": [
          {
            "name": "creditor_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditor_iban",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditor_bic",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "creditor_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mandate_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mandate_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "debtor_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "debtor_iban",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "debtor_bic",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "collection_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "description",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SEPA Direct Debit XML",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SepaDirectDebitResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v1/bookkeeping/stille/export": {
      "get": {
        "tags": [
          "stille"
        ],
        "operationId": "stille_export_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stille Beteiligungen als CSV (BOM, Semikolon)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StilleExportResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/stille/report": {
      "get": {
        "tags": [
          "stille"
        ],
        "operationId": "stille_report_api",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gewinn-/Verlustverteilung an stille Gesellschafter (§§ 230–236 HGB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StilleReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/ustva": {
      "get": {
        "tags": [
          "ustva"
        ],
        "operationId": "ustva_api",
        "parameters": [
          {
            "name": "zeitraum",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "UStVA Ergebnis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UstvaErgebnis"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bookkeeping/ustva/elster-validate": {
      "post": {
        "tags": [
          "bookkeeping"
        ],
        "operationId": "elster_validate_api",
        "parameters": [
          {
            "name": "zeitraum",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validate UStVA XML (mock or ERiC)"
          }
        }
      }
    },
    "/api/v1/bookkeeping/ustva/elster-xml": {
      "get": {
        "tags": [
          "bookkeeping"
        ],
        "operationId": "elster_xml_api",
        "parameters": [
          {
            "name": "zeitraum",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ELSTER UStVA XML template (manual upload)"
          }
        }
      }
    },
    "/api/v1/bookkeeping/verfahrensdokumentation": {
      "get": {
        "tags": [
          "bookkeeping"
        ],
        "summary": "GET /api/v1/bookkeeping/verfahrensdokumentation\nReturns the complete compliance catalog of all documented modules.",
        "operationId": "get_verfahrensdokumentation",
        "responses": {
          "200": {
            "description": "Verfahrensdokumentation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verfahrensdokumentation"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communications": {
      "post": {
        "tags": [
          "customer_communication"
        ],
        "operationId": "create_communication",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCommunicationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerCommunication"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communications/": {
      "get": {
        "tags": [
          "customer_communication"
        ],
        "operationId": "list_communications",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "description": "Filter history to a single contact.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/CommunicationChannel"
                }
              ]
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/components/schemas/CommunicationDirection"
                }
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Only include communications after this ISO date (inclusive).",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Only include communications before this ISO date (inclusive).",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CustomerCommunication"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communications/{communication_id}": {
      "get": {
        "tags": [
          "customer_communication"
        ],
        "operationId": "get_communication",
        "parameters": [
          {
            "name": "communication_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerCommunication"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "customer_communication"
        ],
        "operationId": "update_communication",
        "parameters": [
          {
            "name": "communication_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCommunicationUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerCommunication"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "customer_communication"
        ],
        "operationId": "delete_communication",
        "parameters": [
          {
            "name": "communication_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communications/{communication_id}/restore": {
      "post": {
        "tags": [
          "customer_communication"
        ],
        "operationId": "customercommunication_restore",
        "parameters": [
          {
            "name": "communication_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerCommunication"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compliance-trainings": {
      "post": {
        "tags": [
          "compliance_training"
        ],
        "operationId": "create_compliance_training",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplianceTrainingCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceTraining"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compliance-trainings/": {
      "get": {
        "tags": [
          "compliance_training"
        ],
        "operationId": "get_compliance_trainings",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ComplianceTraining"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compliance-trainings/{id}": {
      "get": {
        "tags": [
          "compliance_training"
        ],
        "operationId": "get_compliance_training",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceTraining"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "compliance_training"
        ],
        "operationId": "update_compliance_training",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplianceTrainingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceTraining"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "compliance_training"
        ],
        "operationId": "delete_compliance_training",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contacts": {
      "get": {
        "tags": [
          "contact"
        ],
        "summary": "List contacts with search, type filter, and pagination",
        "operationId": "list_contacts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "contact_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of contacts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Contact"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "contact"
        ],
        "summary": "Create contact",
        "operationId": "create_contact",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contacts/sales-volume": {
      "get": {
        "tags": [
          "contact"
        ],
        "summary": "Sales volume per contact",
        "operationId": "sales_volume",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "contact_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sales volume report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesVolumeReport"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contacts/schema": {
      "get": {
        "tags": [
          "contact"
        ],
        "summary": "Serve JSON Schema for client-side validation",
        "operationId": "contact_schema",
        "responses": {
          "200": {
            "description": "JSON Schema for Contact",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/contacts/{contact_id}": {
      "get": {
        "tags": [
          "contact"
        ],
        "summary": "Get single contact",
        "operationId": "get_contact",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "contact"
        ],
        "summary": "Update contact",
        "operationId": "update_contact",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "contact"
        ],
        "summary": "Soft-delete contact",
        "operationId": "delete_contact",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        }
      }
    },
    "/api/v1/contacts/{contact_id}/communications": {
      "get": {
        "tags": [
          "customer_communication"
        ],
        "operationId": "get_contact_history",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactHistoryResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contacts/{contact_id}/timeline": {
      "get": {
        "tags": [
          "contact"
        ],
        "summary": "Get the full per-contact timeline (Xentral §4.6/4.7).",
        "description": "Aggregates communications, quotations, orders, invoices and uploaded\ndocuments for a contact, merged into a single reverse-chronological feed.",
        "operationId": "contact_timeline",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactTimelineResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/coupons": {
      "post": {
        "tags": [
          "coupon"
        ],
        "operationId": "create_coupon",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CouponCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Coupon"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/coupons/": {
      "get": {
        "tags": [
          "coupon"
        ],
        "operationId": "list_coupons",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "discount_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Coupon"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/coupons/{coupon_id}": {
      "get": {
        "tags": [
          "coupon"
        ],
        "operationId": "get_coupon",
        "parameters": [
          {
            "name": "coupon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Coupon"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "coupon"
        ],
        "operationId": "update_coupon",
        "parameters": [
          {
            "name": "coupon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CouponUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Coupon"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "coupon"
        ],
        "operationId": "delete_coupon",
        "parameters": [
          {
            "name": "coupon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/coupons/{coupon_id}/restore": {
      "post": {
        "tags": [
          "coupon"
        ],
        "operationId": "coupon_restore",
        "parameters": [
          {
            "name": "coupon_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Coupon"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/credit-notes": {
      "post": {
        "tags": [
          "credit_note"
        ],
        "operationId": "create_credit_note",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "404": {
            "description": "Preceding invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/credit-notes/": {
      "get": {
        "tags": [
          "credit_note"
        ],
        "operationId": "list_credit_notes",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/credit-notes/{credit_note_id}": {
      "get": {
        "tags": [
          "credit_note"
        ],
        "operationId": "get_credit_note",
        "parameters": [
          {
            "name": "credit_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/credit-notes/{credit_note_id}/pdf": {
      "get": {
        "tags": [
          "credit_note"
        ],
        "operationId": "download_credit_note_pdf",
        "parameters": [
          {
            "name": "credit_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF file",
            "content": {
              "application/pdf": {}
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customer-groups": {
      "post": {
        "tags": [
          "customer_group"
        ],
        "operationId": "create_customer_group",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerGroupCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroup"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customer-groups/": {
      "get": {
        "tags": [
          "customer_group"
        ],
        "operationId": "list_customer_groups",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CustomerGroup"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customer-groups/{customer_group_id}": {
      "get": {
        "tags": [
          "customer_group"
        ],
        "operationId": "get_customer_group",
        "parameters": [
          {
            "name": "customer_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroup"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "customer_group"
        ],
        "operationId": "update_customer_group",
        "parameters": [
          {
            "name": "customer_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerGroupUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroup"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "customer_group"
        ],
        "operationId": "delete_customer_group",
        "parameters": [
          {
            "name": "customer_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customer-groups/{customer_group_id}/members": {
      "post": {
        "tags": [
          "customer_group"
        ],
        "operationId": "add_group_members",
        "parameters": [
          {
            "name": "customer_group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerGroup"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers": {
      "post": {
        "tags": [
          "customer"
        ],
        "operationId": "create_customer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/": {
      "get": {
        "tags": [
          "customer"
        ],
        "operationId": "get_customers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Customer"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{customer_id}": {
      "get": {
        "tags": [
          "customer"
        ],
        "operationId": "get_customer",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "customer"
        ],
        "operationId": "update_customer",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "customer"
        ],
        "operationId": "delete_customer",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{customer_id}/restore": {
      "post": {
        "tags": [
          "customer"
        ],
        "operationId": "customer_restore",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/declarations": {
      "post": {
        "tags": [
          "declaration"
        ],
        "operationId": "create_declaration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclarationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Declaration"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/declarations/": {
      "get": {
        "tags": [
          "declaration"
        ],
        "operationId": "get_declarations",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Declaration"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/declarations/{id}": {
      "get": {
        "tags": [
          "declaration"
        ],
        "operationId": "get_declaration",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Declaration"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "declaration"
        ],
        "operationId": "update_declaration",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclarationUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Declaration"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "declaration"
        ],
        "operationId": "delete_declaration",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/declarations/{id}/restore": {
      "post": {
        "tags": [
          "declaration"
        ],
        "operationId": "declaration_restore",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Declaration"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-appointments": {
      "get": {
        "tags": [
          "delivery_appointment"
        ],
        "operationId": "list_delivery_appointments",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "warehouse_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeliveryAppointment"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "delivery_appointment"
        ],
        "operationId": "create_delivery_appointment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryAppointmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryAppointment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-appointments/{appointment_id}": {
      "get": {
        "tags": [
          "delivery_appointment"
        ],
        "operationId": "get_delivery_appointment",
        "parameters": [
          {
            "name": "appointment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryAppointment"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "delivery_appointment"
        ],
        "operationId": "update_delivery_appointment",
        "parameters": [
          {
            "name": "appointment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryAppointment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "delivery_appointment"
        ],
        "operationId": "delete_delivery_appointment",
        "parameters": [
          {
            "name": "appointment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-appointments/{appointment_id}/status": {
      "put": {
        "tags": [
          "delivery_appointment"
        ],
        "operationId": "update_delivery_appointment_status",
        "parameters": [
          {
            "name": "appointment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppointmentStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryAppointment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request / invalid transition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-dates": {
      "post": {
        "tags": [
          "delivery_date"
        ],
        "operationId": "create_delivery_date",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryDateCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryDate"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-dates/": {
      "get": {
        "tags": [
          "delivery_date"
        ],
        "operationId": "list_delivery_dates",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "orderNumber",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Only dates on or after this date.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Only dates on or before this date.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeliveryDate"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-dates/performance": {
      "get": {
        "tags": [
          "delivery_date"
        ],
        "summary": "On-time performance summary: how many promised delivery dates were met\nwithin a period.",
        "operationId": "get_delivery_performance",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "orderNumber",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Only dates on or after this date.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Only dates on or before this date.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-dates/{delivery_date_id}": {
      "get": {
        "tags": [
          "delivery_date"
        ],
        "operationId": "get_delivery_date",
        "parameters": [
          {
            "name": "delivery_date_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryDate"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "delivery_date"
        ],
        "operationId": "update_delivery_date",
        "parameters": [
          {
            "name": "delivery_date_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryDate"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "delivery_date"
        ],
        "operationId": "delete_delivery_date",
        "parameters": [
          {
            "name": "delivery_date_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-dates/{delivery_date_id}/status": {
      "put": {
        "tags": [
          "delivery_date"
        ],
        "operationId": "update_delivery_date_status",
        "parameters": [
          {
            "name": "delivery_date_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryDateStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryDate"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes": {
      "post": {
        "tags": [
          "delivery_note"
        ],
        "operationId": "create_delivery_note",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryNoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryNote"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/": {
      "get": {
        "tags": [
          "delivery_note"
        ],
        "operationId": "list_delivery_notes",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeliveryNote"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/{delivery_note_id}": {
      "get": {
        "tags": [
          "delivery_note"
        ],
        "operationId": "get_delivery_note",
        "parameters": [
          {
            "name": "delivery_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryNote"
                }
              }
            },
            "links": {
              "getDeliveryNoteContact": {
                "operation_id": "get_contact",
                "parameters": {
                  "contact_id": "$response.body#/contactId"
                },
                "description": "Contact referenced by `contactId`."
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "delivery_note"
        ],
        "operationId": "delete_delivery_note",
        "parameters": [
          {
            "name": "delivery_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/{delivery_note_id}/pdf": {
      "get": {
        "tags": [
          "delivery_note"
        ],
        "operationId": "download_delivery_note_pdf",
        "parameters": [
          {
            "name": "delivery_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF file",
            "content": {
              "application/pdf": {}
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/{delivery_note_id}/pursue": {
      "post": {
        "tags": [
          "delivery_note"
        ],
        "operationId": "pursue_delivery_note",
        "parameters": [
          {
            "name": "delivery_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created Invoice",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/{delivery_note_id}/restore": {
      "post": {
        "tags": [
          "delivery_note"
        ],
        "operationId": "deliverynote_restore",
        "parameters": [
          {
            "name": "delivery_note_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryNote"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/down-payment-invoices/": {
      "get": {
        "tags": [
          "down_payment_invoice"
        ],
        "operationId": "list_down_payment_invoices",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DownPaymentInvoice"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/down-payment-invoices/{id}": {
      "get": {
        "tags": [
          "down_payment_invoice"
        ],
        "operationId": "get_down_payment_invoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownPaymentInvoice"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/down-payment-invoices/{id}/pdf": {
      "get": {
        "tags": [
          "down_payment_invoice"
        ],
        "operationId": "download_down_payment_invoice_pdf",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF placeholder"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/email-templates": {
      "post": {
        "tags": [
          "email_template"
        ],
        "operationId": "create_email_template",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/email-templates/": {
      "get": {
        "tags": [
          "email_template"
        ],
        "operationId": "list_email_templates",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmailTemplate"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/email-templates/{email_template_id}": {
      "get": {
        "tags": [
          "email_template"
        ],
        "operationId": "get_email_template",
        "parameters": [
          {
            "name": "email_template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "email_template"
        ],
        "operationId": "update_email_template",
        "parameters": [
          {
            "name": "email_template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "email_template"
        ],
        "operationId": "delete_email_template",
        "parameters": [
          {
            "name": "email_template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/email-templates/{email_template_id}/render": {
      "post": {
        "tags": [
          "email_template"
        ],
        "operationId": "render_email_template",
        "parameters": [
          {
            "name": "email_template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees": {
      "post": {
        "tags": [
          "employee"
        ],
        "operationId": "create_employee",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Employee"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/": {
      "get": {
        "tags": [
          "employee"
        ],
        "operationId": "get_employees",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Employee"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}": {
      "get": {
        "tags": [
          "employee"
        ],
        "operationId": "get_employee",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Employee"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "employee"
        ],
        "operationId": "update_employee",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Employee"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "employee"
        ],
        "operationId": "delete_employee",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}/payroll-summary": {
      "get": {
        "tags": [
          "employee"
        ],
        "operationId": "get_employee_payroll_summary",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "year",
            "in": "query",
            "description": "Fiscal year for the breakdown; defaults to the current year.",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payroll summary for the employee",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayrollSummary"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}/restore": {
      "post": {
        "tags": [
          "employee"
        ],
        "operationId": "employee_restore",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Employee"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/event-subscriptions": {
      "post": {
        "tags": [
          "event_subscription"
        ],
        "operationId": "create_event_subscription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscription"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/event-subscriptions/": {
      "get": {
        "tags": [
          "event_subscription"
        ],
        "operationId": "list_event_subscriptions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EventSubscription"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/event-subscriptions/{subscription_id}": {
      "delete": {
        "tags": [
          "event_subscription"
        ],
        "operationId": "delete_event_subscription",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/gdpr/account-erasure": {
      "post": {
        "tags": [
          "gdpr"
        ],
        "summary": "Erase ALL personal data of the tenant (TOS §11: deletion 90 days after\ntermination).",
        "description": "Anonymizes every contact, anonymizes personal fields on bookkeeping\nrecords (orders/invoices/payments keep amounts and dates for GoBD),\nremoves the tenant linkage of the (global, saasy-framework) users and\nmarks the erasure on `tenant_settings.gdpr_erased_at`. No row is\nphysically deleted. The audit triggers on the touched tables record\nwho/when.",
        "operationId": "account_erasure",
        "responses": {
          "200": {
            "description": "Tenant personal data anonymized",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/gdpr/dpa": {
      "get": {
        "tags": [
          "gdpr"
        ],
        "summary": "Current DPA acceptance status (from tenant_settings).",
        "operationId": "get_dpa",
        "responses": {
          "200": {
            "description": "DPA acceptance status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DpaStatus"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "gdpr"
        ],
        "summary": "Record DPA acceptance: sets dpa_accepted_at/by/version on the tenant\nsettings row (created with company-type defaults if missing).",
        "operationId": "accept_dpa",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DpaAcceptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "DPA acceptance recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DpaStatus"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/gdpr/erasure/{contact_id}": {
      "post": {
        "tags": [
          "gdpr"
        ],
        "summary": "Anonymize + soft-delete a contact: personal attributes are cleared, the\nrecord itself is kept for GoBD retention (Art. 17(3)(e) DSGVO). The audit\ntrigger on `contacts` already records who/when.",
        "operationId": "erasure_contact",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact anonymized",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Contact not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/gdpr/export": {
      "get": {
        "tags": [
          "gdpr"
        ],
        "summary": "Export the current user's personal data (GDPR Art. 15/20).",
        "description": "No admin permission required: a user always exports their own data.",
        "operationId": "export_gdpr",
        "responses": {
          "200": {
            "description": "Personal data export",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_GdprExport"
                }
              }
            }
          },
          "404": {
            "description": "User not found"
          }
        }
      }
    },
    "/api/v1/gdpr/export/{contact_id}": {
      "get": {
        "tags": [
          "gdpr"
        ],
        "summary": "Art. 15 data-subject access export for a contact.",
        "description": "Returns the contact itself plus the tenant-scoped rows linked to it.\n\n## Relations\nThe `customers`/`orders`/`invoices`/`payments` tables have no FK to\n`contacts`; they are linked through the `customer_id` column, which per\nthe app's conventions holds one of:\n- the admin customer's `customer_id` (a UUID, often the same value as\n  the contact's `contact_id`/`customer_number`),\n- the buyer's email for shop orders, or\n- the marketplace's external customer id for plugin orders.\n\nThe export therefore matches the contact's identifiers (`contact_id`,\n`customer_number`, `external_id`, `email`) plus any resolved customer ids\nagainst `customer_id`. `delivery_notes` and `customer_communications`\nreference contacts directly via `contact_id`. Soft-deleted rows are\nincluded (their data is still processed and retained for GoBD).\nRelations that genuinely do not exist for a contact stay empty but the\nkey is always present.",
        "operationId": "export_contact_data",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Art. 15 data-subject export",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Contact not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/goods-receipts": {
      "post": {
        "tags": [
          "goods_receipt"
        ],
        "operationId": "create_goods_receipt",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoodsReceipt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoodsReceipt"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/goods-receipts/": {
      "get": {
        "tags": [
          "goods_receipt"
        ],
        "operationId": "list_goods_receipts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "purchase_order_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "warehouse_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GoodsReceipt"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/goods-receipts/{goods_receipt_id}": {
      "get": {
        "tags": [
          "goods_receipt"
        ],
        "operationId": "get_goods_receipt",
        "parameters": [
          {
            "name": "goods_receipt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoodsReceipt"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "goods_receipt"
        ],
        "operationId": "delete_goods_receipt",
        "parameters": [
          {
            "name": "goods_receipt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/group-figures": {
      "post": {
        "tags": [
          "group_figure"
        ],
        "operationId": "create_group_figure",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupFigureCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupFigure"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/group-figures/": {
      "get": {
        "tags": [
          "group_figure"
        ],
        "operationId": "get_group_figures",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupFigure"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/group-figures/{year}": {
      "get": {
        "tags": [
          "group_figure"
        ],
        "operationId": "get_group_figure",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupFigure"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "group_figure"
        ],
        "operationId": "update_group_figure",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupFigureUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupFigure"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "group_figure"
        ],
        "operationId": "delete_group_figure",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/import/start": {
      "post": {
        "tags": [
          "import_runner"
        ],
        "operationId": "start_import",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportStartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Import job queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportStartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/import/test": {
      "post": {
        "tags": [
          "import_runner"
        ],
        "operationId": "test_import_connection",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Connection test result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/import/{job_id}": {
      "get": {
        "tags": [
          "import_runner"
        ],
        "operationId": "get_import_status",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Import job status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJobStatus"
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/institute-profile": {
      "get": {
        "tags": [
          "institute_profile"
        ],
        "summary": "Current institute profile (created with defaults when missing).",
        "operationId": "get_institute_profile",
        "responses": {
          "200": {
            "description": "Institute profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstituteProfile"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "institute_profile"
        ],
        "summary": "Update the institute profile (institute_type and/or kapitalmarktorientiert).",
        "operationId": "update_institute_profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstituteProfileUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated institute profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstituteProfile"
                }
              }
            }
          },
          "400": {
            "description": "Invalid institute_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inventory-counts": {
      "post": {
        "tags": [
          "inventory_count"
        ],
        "operationId": "create_inventory_count",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryCount"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryCount"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inventory-counts/": {
      "get": {
        "tags": [
          "inventory_count"
        ],
        "operationId": "list_inventory_counts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "warehouse_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InventoryCount"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inventory-counts/generate": {
      "post": {
        "tags": [
          "inventory_count"
        ],
        "operationId": "generate_inventory_count",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateCountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryCount"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inventory-counts/{inventory_count_id}": {
      "get": {
        "tags": [
          "inventory_count"
        ],
        "operationId": "get_inventory_count",
        "parameters": [
          {
            "name": "inventory_count_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryCount"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "inventory_count"
        ],
        "operationId": "update_inventory_count",
        "parameters": [
          {
            "name": "inventory_count_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryCount"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "inventory_count"
        ],
        "operationId": "delete_inventory_count",
        "parameters": [
          {
            "name": "inventory_count_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inventory-counts/{inventory_count_id}/status": {
      "put": {
        "tags": [
          "inventory_count"
        ],
        "operationId": "update_inventory_count_status",
        "parameters": [
          {
            "name": "inventory_count_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryCountStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryCount"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices": {
      "post": {
        "tags": [
          "invoice"
        ],
        "operationId": "create_invoice",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "links": {
              "getCreatedInvoice": {
                "operation_id": "get_invoice",
                "parameters": {
                  "id": "$response.body#/id"
                },
                "description": "Fetch the created invoice by the `id` returned in the response body."
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices/": {
      "get": {
        "tags": [
          "invoice"
        ],
        "operationId": "get_invoices",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices/{id}": {
      "get": {
        "tags": [
          "invoice"
        ],
        "operationId": "get_invoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "links": {
              "getInvoiceCustomer": {
                "operation_id": "get_customer",
                "parameters": {
                  "customer_id": "$response.body#/customerId"
                },
                "description": "Customer referenced by `customerId`."
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "invoice"
        ],
        "operationId": "update_invoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "invoice"
        ],
        "operationId": "delete_invoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices/{id}/pdf": {
      "get": {
        "tags": [
          "invoice"
        ],
        "operationId": "download_invoice_pdf",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF file",
            "content": {
              "application/pdf": {}
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices/{id}/pdf-url": {
      "get": {
        "tags": [
          "invoice"
        ],
        "operationId": "get_invoice_pdf_url",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Presigned download URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoicePdfUrlResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Storage not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices/{id}/peppol": {
      "get": {
        "tags": [
          "peppol"
        ],
        "operationId": "peppol_api",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Peppol BIS 3.0 Invoice XML",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PeppolResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/qrcode": {
      "get": {
        "tags": [
          "generate_qrcode"
        ],
        "operationId": "generate_qrcode_api",
        "parameters": [
          {
            "name": "iban",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "holder_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "bic",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "reference",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "purpose",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR Code for invoice payment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QRCodeResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/restore": {
      "post": {
        "tags": [
          "invoice"
        ],
        "operationId": "invoice_restore",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices/{id}/xrechnung": {
      "get": {
        "tags": [
          "generate_xrechnung"
        ],
        "operationId": "generate_xrechnung_api",
        "parameters": [
          {
            "name": "supplier_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_street",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_city",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_zip",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_country",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_vat_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "XRechnung XML",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/XRechnungResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v1/invoices/{id}/zugferd": {
      "get": {
        "tags": [
          "zugferd"
        ],
        "operationId": "generate_zugferd_api",
        "parameters": [
          {
            "name": "supplier_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_street",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_city",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_zip",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_country",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_vat_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ZUGFeRD/Factur-X hybrid PDF (PDF/A-3 with embedded EN 16931 XML)",
            "content": {
              "application/pdf": {}
            }
          },
          "404": {
            "description": "Invoice not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/api/v1/job-applications": {
      "get": {
        "tags": [
          "job_application"
        ],
        "operationId": "list_job_applications",
        "parameters": [
          {
            "name": "postingId",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Applications list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobApplication"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/job-applications/{application_id}": {
      "get": {
        "tags": [
          "job_application"
        ],
        "operationId": "get_job_application",
        "parameters": [
          {
            "name": "application_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Application",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobApplication"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "job_application"
        ],
        "operationId": "delete_job_application",
        "parameters": [
          {
            "name": "application_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Soft-deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobApplication"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/job-applications/{application_id}/cv": {
      "get": {
        "tags": [
          "job_application"
        ],
        "operationId": "download_cv",
        "parameters": [
          {
            "name": "application_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CV file"
          }
        }
      }
    },
    "/api/v1/job-applications/{application_id}/score": {
      "post": {
        "tags": [
          "job_application"
        ],
        "operationId": "score_job_application",
        "parameters": [
          {
            "name": "application_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobApplication"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/job-applications/{application_id}/status": {
      "patch": {
        "tags": [
          "job_application"
        ],
        "operationId": "update_job_application_status",
        "parameters": [
          {
            "name": "application_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobApplication"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/job-postings": {
      "get": {
        "tags": [
          "job_posting"
        ],
        "operationId": "list_job_postings",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job postings list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobPosting"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "job_posting"
        ],
        "operationId": "create_job_posting",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobPostingCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobPosting"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/job-postings/{id}": {
      "get": {
        "tags": [
          "job_posting"
        ],
        "operationId": "get_job_posting",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobPosting"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "job_posting"
        ],
        "operationId": "update_job_posting",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobPostingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobPosting"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "job_posting"
        ],
        "operationId": "delete_job_posting",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/kyc-records": {
      "post": {
        "tags": [
          "kyc_record"
        ],
        "operationId": "create_kyc_record",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KycRecordCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KycRecord"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/kyc-records/": {
      "get": {
        "tags": [
          "kyc_record"
        ],
        "operationId": "get_kyc_records",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KycRecord"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/kyc-records/{id}": {
      "get": {
        "tags": [
          "kyc_record"
        ],
        "operationId": "get_kyc_record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KycRecord"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "kyc_record"
        ],
        "operationId": "update_kyc_record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KycRecordUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KycRecord"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "kyc_record"
        ],
        "operationId": "delete_kyc_record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/labor-costs": {
      "get": {
        "tags": [
          "time_entries"
        ],
        "summary": "Labor-cost report: worked hours aggregated per employee / order / day,\nvalued at the employee's hourly cost rate.",
        "operationId": "get_labor_costs",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "description": "One of \"employee\", \"order\" or \"day\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LaborCostRow"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/legal/documents": {
      "get": {
        "tags": [
          "legal_document"
        ],
        "summary": "List all legal documents of the tenant. Missing documents are seeded from\nthe default texts (with tenant placeholders replaced) on first access.",
        "operationId": "get_legal_documents",
        "responses": {
          "200": {
            "description": "All legal documents of the tenant",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LegalDocument"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "legal_document"
        ],
        "summary": "Upsert legal documents per (doc_type, lang). Returns the full tenant list.",
        "operationId": "upsert_legal_documents",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LegalDocumentUpsert"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved legal documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LegalDocument"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/legal/documents/reset": {
      "post": {
        "tags": [
          "legal_document"
        ],
        "summary": "Restore default texts for all documents (or a single doc_type/lang when\nthe optional filter is given). Returns the full tenant list.",
        "operationId": "reset_legal_documents",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalDocumentReset"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Reset legal documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LegalDocument"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections": {
      "get": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "List connections for the current tenant",
        "operationId": "list_connections_api",
        "responses": {
          "200": {
            "description": "List of connections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceConnection"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Create a new connection (for API-key based platforms)",
        "operationId": "create_connection_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnection"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connection_id}": {
      "get": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Get a single connection",
        "operationId": "get_connection_api",
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnection"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Update a connection",
        "operationId": "update_connection_api",
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnection"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Soft-delete a connection",
        "operationId": "delete_connection_api",
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connection_id}/directions": {
      "get": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Get current sync direction configuration for a connection",
        "operationId": "get_sync_direction_api",
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current sync directions"
          }
        }
      },
      "put": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Update per-entity sync direction configuration for a connection",
        "operationId": "update_sync_direction_api",
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSyncDirectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Sync directions updated"
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connection_id}/logs": {
      "get": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Get sync logs for a connection",
        "operationId": "get_sync_logs_api",
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sync logs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SyncLog"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connection_id}/sync": {
      "post": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Trigger sync for a connection",
        "operationId": "trigger_sync_api",
        "parameters": [
          {
            "name": "sync_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sync triggered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncSummary"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/oauth/authorize": {
      "post": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "OAuth: initiate authorization flow",
        "operationId": "oauth_authorize_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthAuthorizeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Authorization URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAuthorizeResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/oauth/callback": {
      "post": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "OAuth: handle callback after authorization",
        "operationId": "oauth_callback_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthCallbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Connection created/updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnection"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/platforms": {
      "get": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "List all supported platforms",
        "operationId": "list_platforms_api",
        "responses": {
          "200": {
            "description": "Supported platforms",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlatformInfo"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/webhook/{platform}/{connection_id}": {
      "post": {
        "tags": [
          "marketplace_api"
        ],
        "summary": "Webhook receiver",
        "operationId": "webhook_receiver_api",
        "parameters": [
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook received"
          },
          "401": {
            "description": "Invalid signature"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/me/permissions": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "GET /api/v1/me/permissions — resolved permissions from the auth token,\nused by the frontend to show/hide admin navigation.",
        "operationId": "my_permissions",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications": {
      "get": {
        "tags": [
          "notifications"
        ],
        "operationId": "list_notifications",
        "responses": {
          "200": {
            "description": "Own notifications, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NotificationDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/read-all": {
      "put": {
        "tags": [
          "notifications"
        ],
        "operationId": "mark_all_read",
        "responses": {
          "200": {
            "description": "All own notifications marked as read",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/unread-count": {
      "get": {
        "tags": [
          "notifications"
        ],
        "operationId": "unread_count",
        "responses": {
          "200": {
            "description": "Number of unread notifications",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/{id}": {
      "delete": {
        "tags": [
          "notifications"
        ],
        "operationId": "delete_notification",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found or not owned by caller"
          }
        }
      }
    },
    "/api/v1/notifications/{id}/read": {
      "put": {
        "tags": [
          "notifications"
        ],
        "operationId": "mark_as_read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Marked as read"
          },
          "404": {
            "description": "Not found or not owned by caller"
          }
        }
      }
    },
    "/api/v1/order-confirmations": {
      "post": {
        "tags": [
          "order_confirmation"
        ],
        "operationId": "create_confirmation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderConfirmationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderConfirmation"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/order-confirmations/": {
      "get": {
        "tags": [
          "order_confirmation"
        ],
        "operationId": "list_confirmations",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderConfirmation"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/order-confirmations/{confirmation_id}": {
      "get": {
        "tags": [
          "order_confirmation"
        ],
        "operationId": "get_confirmation",
        "parameters": [
          {
            "name": "confirmation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderConfirmation"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "order_confirmation"
        ],
        "operationId": "delete_confirmation",
        "parameters": [
          {
            "name": "confirmation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/order-confirmations/{confirmation_id}/pdf": {
      "get": {
        "tags": [
          "order_confirmation"
        ],
        "operationId": "download_confirmation_pdf",
        "parameters": [
          {
            "name": "confirmation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF file",
            "content": {
              "application/pdf": {}
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/order-confirmations/{confirmation_id}/pursue": {
      "post": {
        "tags": [
          "order_confirmation"
        ],
        "operationId": "pursue_confirmation",
        "parameters": [
          {
            "name": "confirmation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created DeliveryNote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryNote"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/order-confirmations/{confirmation_id}/restore": {
      "post": {
        "tags": [
          "order_confirmation"
        ],
        "operationId": "orderconfirmation_restore",
        "parameters": [
          {
            "name": "confirmation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderConfirmation"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/order/{order_number}": {
      "get": {
        "tags": [
          "order"
        ],
        "operationId": "get_order",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "links": {
              "getOrderCustomer": {
                "operation_id": "get_customer",
                "parameters": {
                  "customer_id": "$response.body#/customerId"
                },
                "description": "Customer referenced by `customerId`."
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders": {
      "get": {
        "tags": [
          "order"
        ],
        "operationId": "get_orders",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orders found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Order"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "No orders found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/by-ext-ref/{ext_ref}": {
      "get": {
        "tags": [
          "order"
        ],
        "operationId": "find_order_by_external_ref",
        "parameters": [
          {
            "name": "ext_ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}": {
      "patch": {
        "tags": [
          "order"
        ],
        "operationId": "patch_order",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Order updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}/state": {
      "put": {
        "tags": [
          "order"
        ],
        "operationId": "update_order_state",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderStateUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Order state updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}/tags": {
      "put": {
        "tags": [
          "order"
        ],
        "operationId": "replace_order_tags",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderTagsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tags replaced",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "order"
        ],
        "operationId": "add_order_tags",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderTagsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tags added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_number}/shipments": {
      "post": {
        "tags": [
          "shipment"
        ],
        "summary": "Create a real shipment for an order: calls the configured carrier's label\nAPI, stores the returned tracking/label on a new shipment row, and marks\nthe order as shipped.",
        "operationId": "create_shipment_from_order",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShipmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Shipment created via carrier API",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packing/queue": {
      "get": {
        "tags": [
          "packing"
        ],
        "summary": "Get the packing queue - orders ready for packing",
        "operationId": "get_packing_queue",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Packing queue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackingQueue"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packing/{order_number}/complete": {
      "post": {
        "tags": [
          "packing"
        ],
        "summary": "Mark packing as complete and transition order to shipped",
        "operationId": "complete_packing",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackingCompleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Packing completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackingCompleteResponse"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packing/{order_number}/print-delivery-note": {
      "post": {
        "tags": [
          "packing"
        ],
        "summary": "Print delivery note (Lieferschein) for an order",
        "operationId": "print_delivery_note",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery note printed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintDeliveryNoteResponse"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packing/{order_number}/print-label": {
      "post": {
        "tags": [
          "packing"
        ],
        "summary": "Print shipping label for an order",
        "operationId": "print_label",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Label printed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintLabelResponse"
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packing/{order_number}/record-video": {
      "post": {
        "tags": [
          "packing"
        ],
        "summary": "Record video of packing process",
        "operationId": "record_packing_video",
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Video recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackingVideoResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/participations": {
      "post": {
        "tags": [
          "participation"
        ],
        "operationId": "create_participation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ParticipationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Participation"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/participations/": {
      "get": {
        "tags": [
          "participation"
        ],
        "operationId": "get_participations",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Participation"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/participations/{id}": {
      "get": {
        "tags": [
          "participation"
        ],
        "operationId": "get_participation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Participation"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "participation"
        ],
        "operationId": "update_participation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ParticipationUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Participation"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "participation"
        ],
        "operationId": "delete_participation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payment-conditions": {
      "get": {
        "tags": [
          "payment_condition"
        ],
        "operationId": "list_payment_conditions_api",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PaymentCondition"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payment-gateways": {
      "post": {
        "tags": [
          "payment_gateway"
        ],
        "operationId": "create_payment_gateway_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentGateway"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payment-gateways/": {
      "get": {
        "tags": [
          "payment_gateway"
        ],
        "operationId": "list_payment_gateways_api",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PaymentGateway"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payment-gateways/oauth/authorize": {
      "post": {
        "tags": [
          "payment_gateway"
        ],
        "operationId": "oauth_authorize_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GatewayOAuthAuthorizeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OAuth authorization URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayOAuthAuthorizeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payment-gateways/oauth/callback": {
      "post": {
        "tags": [
          "payment_gateway"
        ],
        "operationId": "oauth_callback_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GatewayOAuthCallbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Gateway connected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentGateway"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payment-gateways/{gateway_id}": {
      "put": {
        "tags": [
          "payment_gateway"
        ],
        "operationId": "update_payment_gateway_api",
        "parameters": [
          {
            "name": "gateway_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentGateway"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "payment_gateway"
        ],
        "operationId": "delete_payment_gateway_api",
        "parameters": [
          {
            "name": "gateway_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payments": {
      "post": {
        "tags": [
          "payment"
        ],
        "operationId": "create_payment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payments/": {
      "get": {
        "tags": [
          "payment"
        ],
        "operationId": "get_payments",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Payment"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payments/allocate": {
      "post": {
        "tags": [
          "bookkeeping"
        ],
        "summary": "Allocate a payment to an invoice",
        "operationId": "allocate_payment_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllocatePaymentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Payment allocated successfully"
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Payment or invoice not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payments/open-invoices/{customer_id}": {
      "get": {
        "tags": [
          "bookkeeping"
        ],
        "summary": "Get open invoices for a customer",
        "operationId": "get_open_invoices_api",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Open invoices list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Customer not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payments/{id}": {
      "get": {
        "tags": [
          "payment"
        ],
        "operationId": "get_payment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            },
            "links": {
              "getPaymentCustomer": {
                "operation_id": "get_customer",
                "parameters": {
                  "customer_id": "$response.body#/customerId"
                },
                "description": "Customer referenced by `customerId`."
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "payment"
        ],
        "operationId": "update_payment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Payment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "payment"
        ],
        "operationId": "delete_payment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payments/{id}/restore": {
      "post": {
        "tags": [
          "payment"
        ],
        "operationId": "payment_restore",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payroll": {
      "get": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_list",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PayrollRunApi"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayrollCreatePayload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayrollRunApi"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payroll/summary/{year}": {
      "get": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_summary",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YearlyPayrollSummary"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payroll/{id}": {
      "get": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayrollRunApi"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/api/v1/payroll/{id}/approve": {
      "post": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_approve",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayrollRunApi"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payroll/{id}/autopay": {
      "post": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_autopay",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/payroll/{id}/calculate": {
      "post": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_calculate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayrollRunApi"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payroll/{id}/elster-export": {
      "post": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_elster_export",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV export"
          }
        }
      }
    },
    "/api/v1/payroll/{id}/email": {
      "post": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_email",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/payroll/{id}/entries/{entry_id}/pdf": {
      "get": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_entry_pdf",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF slip",
            "content": {
              "application/pdf": {}
            }
          }
        }
      }
    },
    "/api/v1/payroll/{id}/pay": {
      "post": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_pay",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayrollPayPayload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayrollRunApi"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payroll/{id}/pdf": {
      "get": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_pdf",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF summary",
            "content": {
              "application/pdf": {}
            }
          }
        }
      }
    },
    "/api/v1/payroll/{id}/sv-meldungen": {
      "post": {
        "tags": [
          "payroll"
        ],
        "operationId": "payroll_sv_meldungen",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/plans": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "All canonical plans (free/starter/business/enterprise) — the single\nsource of truth lives in `crate::saasy::plans`, matching marketing.",
        "operationId": "get_plans",
        "responses": {
          "200": {
            "description": "All subscription plans",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Vec_Plan"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posting-categories": {
      "get": {
        "tags": [
          "posting_category"
        ],
        "operationId": "list_posting_categories",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PostingCategory"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "posting_category"
        ],
        "operationId": "create_posting_category",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostingCategory"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posting-categories/seed/{skr_version}": {
      "post": {
        "tags": [
          "posting_category"
        ],
        "operationId": "seed_posting_categories",
        "parameters": [
          {
            "name": "skr_version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Seeded"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posting-categories/{category_id}": {
      "put": {
        "tags": [
          "posting_category"
        ],
        "operationId": "update_posting_category",
        "parameters": [
          {
            "name": "category_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostingCategory"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "posting_category"
        ],
        "operationId": "delete_posting_category",
        "parameters": [
          {
            "name": "category_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/price-tiers": {
      "post": {
        "tags": [
          "price_tier"
        ],
        "operationId": "create_price_tier",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceTierCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTier"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/price-tiers/": {
      "get": {
        "tags": [
          "price_tier"
        ],
        "operationId": "list_price_tiers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "customer_group_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceTier"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/price-tiers/resolved": {
      "get": {
        "tags": [
          "price_tier"
        ],
        "operationId": "get_resolved_price",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "contactId",
            "in": "query",
            "description": "Contact used to match customer-group-scoped tiers.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolvedPriceResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/price-tiers/{price_tier_id}": {
      "get": {
        "tags": [
          "price_tier"
        ],
        "operationId": "get_price_tier",
        "parameters": [
          {
            "name": "price_tier_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTier"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "price_tier"
        ],
        "operationId": "update_price_tier",
        "parameters": [
          {
            "name": "price_tier_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceTierUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTier"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "price_tier"
        ],
        "operationId": "delete_price_tier",
        "parameters": [
          {
            "name": "price_tier_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-attributes": {
      "post": {
        "tags": [
          "product_attribute"
        ],
        "operationId": "create_product_attribute",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductAttributeCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductAttribute"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-attributes/": {
      "get": {
        "tags": [
          "product_attribute"
        ],
        "operationId": "list_product_attributes",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "is_filterable",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductAttribute"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-attributes/{attribute_id}": {
      "get": {
        "tags": [
          "product_attribute"
        ],
        "operationId": "get_product_attribute",
        "parameters": [
          {
            "name": "attribute_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductAttribute"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "product_attribute"
        ],
        "operationId": "update_product_attribute",
        "parameters": [
          {
            "name": "attribute_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductAttributeUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductAttribute"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "product_attribute"
        ],
        "operationId": "delete_product_attribute",
        "parameters": [
          {
            "name": "attribute_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories": {
      "get": {
        "tags": [
          "product_category"
        ],
        "operationId": "list_product_categories",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategory"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "product_category"
        ],
        "operationId": "create_product_category",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategory"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories/{category_id}": {
      "get": {
        "tags": [
          "product_category"
        ],
        "operationId": "get_product_category",
        "parameters": [
          {
            "name": "category_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "product_category"
        ],
        "operationId": "update_product_category",
        "parameters": [
          {
            "name": "category_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "product_category"
        ],
        "operationId": "delete_product_category",
        "parameters": [
          {
            "name": "category_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-variants": {
      "post": {
        "tags": [
          "product_variant"
        ],
        "operationId": "create_product_variant",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVariant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariant"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-variants/": {
      "get": {
        "tags": [
          "product_variant"
        ],
        "operationId": "list_product_variants",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductVariant"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-variants/generate": {
      "post": {
        "tags": [
          "product_variant"
        ],
        "operationId": "generate_product_variants",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateVariantsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductVariant"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-variants/{variant_id}": {
      "get": {
        "tags": [
          "product_variant"
        ],
        "operationId": "get_product_variant",
        "parameters": [
          {
            "name": "variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariant"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "product_variant"
        ],
        "operationId": "update_product_variant",
        "parameters": [
          {
            "name": "variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariant"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "product_variant"
        ],
        "operationId": "delete_product_variant",
        "parameters": [
          {
            "name": "variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/production-orders": {
      "post": {
        "tags": [
          "production_order"
        ],
        "operationId": "create_production_order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionOrder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/production-orders/": {
      "get": {
        "tags": [
          "production_order"
        ],
        "operationId": "list_production_orders",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductionOrder"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/production-orders/{production_order_id}": {
      "get": {
        "tags": [
          "production_order"
        ],
        "operationId": "get_production_order",
        "parameters": [
          {
            "name": "production_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionOrder"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "production_order"
        ],
        "operationId": "update_production_order",
        "parameters": [
          {
            "name": "production_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionOrder"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "production_order"
        ],
        "operationId": "delete_production_order",
        "parameters": [
          {
            "name": "production_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/production-orders/{production_order_id}/costing": {
      "get": {
        "tags": [
          "production_order"
        ],
        "summary": "Actual-costing report (Nachkalkulation) — material costs from BOM\ncomponents at their purchase price plus the resulting per-unit cost and\nmargin against the finished product's sale price.",
        "operationId": "production_order_costing",
        "parameters": [
          {
            "name": "production_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionOrderCosting"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/production-orders/{production_order_id}/status": {
      "put": {
        "tags": [
          "production_order"
        ],
        "operationId": "update_production_order_status",
        "parameters": [
          {
            "name": "production_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductionOrderStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductionOrder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products": {
      "post": {
        "tags": [
          "product"
        ],
        "operationId": "create_product_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/": {
      "get": {
        "tags": [
          "product"
        ],
        "operationId": "get_products_api",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/low-stock": {
      "get": {
        "tags": [
          "product"
        ],
        "operationId": "list_low_stock_products_api",
        "parameters": [
          {
            "name": "threshold",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Low stock products",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductStock"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{product_id}": {
      "get": {
        "tags": [
          "product"
        ],
        "operationId": "get_product_api",
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "product"
        ],
        "operationId": "update_product_api",
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "product"
        ],
        "operationId": "delete_product_api",
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{product_id}/restore": {
      "post": {
        "tags": [
          "product"
        ],
        "operationId": "product_restore",
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{product_id}/stock": {
      "get": {
        "tags": [
          "product"
        ],
        "operationId": "get_product_stock_api",
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stock info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductStock"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "product"
        ],
        "operationId": "update_product_stock_api",
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stock updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductStock"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proforma-invoices": {
      "post": {
        "tags": [
          "proforma_invoice"
        ],
        "operationId": "create_proforma_invoice",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProformaInvoice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProformaInvoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proforma-invoices/": {
      "get": {
        "tags": [
          "proforma_invoice"
        ],
        "operationId": "list_proforma_invoices",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "order_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProformaInvoice"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proforma-invoices/{proforma_id}": {
      "get": {
        "tags": [
          "proforma_invoice"
        ],
        "operationId": "get_proforma_invoice",
        "parameters": [
          {
            "name": "proforma_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProformaInvoice"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "proforma_invoice"
        ],
        "operationId": "update_proforma_invoice",
        "parameters": [
          {
            "name": "proforma_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProformaInvoice"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "proforma_invoice"
        ],
        "operationId": "delete_proforma_invoice",
        "parameters": [
          {
            "name": "proforma_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proforma-invoices/{proforma_id}/convert": {
      "post": {
        "tags": [
          "proforma_invoice"
        ],
        "operationId": "convert_proforma_to_invoice",
        "parameters": [
          {
            "name": "proforma_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/delivery-appointments/request": {
      "post": {
        "tags": [
          "delivery_appointment"
        ],
        "summary": "Supplier/carrier requests an inbound delivery slot (public, no auth).\nThe tenant is derived from the warehouse found by `code` — never from\nthe request.",
        "operationId": "request_public_delivery_appointment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicDeliveryAppointmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Appointment requested",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDeliveryAppointmentResponse"
                }
              }
            }
          },
          "404": {
            "description": "Warehouse not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/public/delivery-appointments/status": {
      "get": {
        "tags": [
          "delivery_appointment"
        ],
        "summary": "Supplier/carrier checks appointment status (public, no auth). The\nappointment is only revealed when email AND token match.",
        "operationId": "get_public_delivery_appointment_status",
        "parameters": [
          {
            "name": "appointmentId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDeliveryAppointmentStatusResponse"
                }
              }
            }
          },
          "404": {
            "description": "Appointment not found or credentials mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/public/jobs": {
      "get": {
        "tags": [
          "job_application"
        ],
        "operationId": "list_public_postings",
        "responses": {
          "200": {
            "description": "Published postings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicPosting"
                  }
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/public/jobs/inbound-email": {
      "post": {
        "tags": [
          "job_application"
        ],
        "summary": "Inbound CV email, mailgun/sendgrid inbound-parse style: multipart form\nwith `from`, `subject`, `body-plain` and one or more `attachment-N` file\nfields. The subject may reference a posting as `[JOB-<posting_id>]`;\nwithout one the application lands in the general inbox.",
        "operationId": "inbound_email",
        "responses": {
          "201": {
            "description": "Application received"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/public/jobs/{posting_id}/apply": {
      "post": {
        "tags": [
          "job_application"
        ],
        "operationId": "apply_public",
        "parameters": [
          {
            "name": "posting_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Application received"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/public/returns/list": {
      "get": {
        "tags": [
          "public_returns"
        ],
        "summary": "List all returns for an order (public, no auth).",
        "operationId": "list_public_returns",
        "parameters": [
          {
            "name": "orderNumber",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns for the order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicReturnStatusResponse"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found or email mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/public/returns/request": {
      "post": {
        "tags": [
          "public_returns"
        ],
        "summary": "Customer requests a return for an order (public, no auth).",
        "operationId": "request_public_return",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicReturnRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Return requested",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReturnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request (item not in order / quantity too high)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Order not found or email mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/public/returns/status": {
      "get": {
        "tags": [
          "public_returns"
        ],
        "summary": "Customer checks the status of a return (public, no auth). The return is\nonly revealed when its linked order's email matches.",
        "operationId": "get_public_return_status",
        "parameters": [
          {
            "name": "returnNumber",
            "in": "query",
            "description": "Either return_number or return_order_id must be provided.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "returnOrderId",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderNumber",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Return status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReturnStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request (missing return identifier)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Return not found or email mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/public/track": {
      "post": {
        "tags": [
          "shipment"
        ],
        "summary": "Customer-facing tracking lookup: order number + email → shipment status and\nlive carrier events. No auth (public storefront API).",
        "operationId": "track_order_public",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Order tracking info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackOrderResponse"
                }
              }
            }
          },
          "404": {
            "description": "Order not found or email mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v1/purchase-orders": {
      "post": {
        "tags": [
          "purchase_order"
        ],
        "operationId": "create_purchase_order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/purchase-orders/": {
      "get": {
        "tags": [
          "purchase_order"
        ],
        "operationId": "list_purchase_orders",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PurchaseOrder"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/purchase-orders/{purchase_order_id}": {
      "get": {
        "tags": [
          "purchase_order"
        ],
        "operationId": "get_purchase_order",
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrder"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "purchase_order"
        ],
        "operationId": "update_purchase_order",
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "purchase_order"
        ],
        "operationId": "delete_purchase_order",
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/purchase-orders/{purchase_order_id}/match-invoice": {
      "post": {
        "tags": [
          "purchase_order"
        ],
        "summary": "3-way invoice check (Rechnungsprüfung): compares the purchase order line\nitems, the quantities received via goods receipts, and the supplier\ninvoice line items, reporting quantity and price variances per product.",
        "operationId": "match_invoice",
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceMatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/purchase-orders/{purchase_order_id}/status": {
      "put": {
        "tags": [
          "purchase_order"
        ],
        "operationId": "update_purchase_order_status",
        "parameters": [
          {
            "name": "purchase_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quota": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Effective limits + current usage for the calling tenant.",
        "operationId": "get_quota_api",
        "responses": {
          "200": {
            "description": "Effective limits and current usage"
          },
          "404": {
            "description": "Tenant not found"
          }
        }
      },
      "put": {
        "tags": [
          "billing"
        ],
        "summary": "Write the per-tenant quota override (`admin:settings`). An empty object\nclears the override.",
        "operationId": "put_quota_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotaOverride"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Override saved, effective limits returned"
          },
          "403": {
            "description": "Missing admin:settings permission"
          },
          "404": {
            "description": "Tenant not found"
          }
        }
      }
    },
    "/api/v1/quotations": {
      "post": {
        "tags": [
          "quotation"
        ],
        "operationId": "create_quotation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quotation"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quotations/": {
      "get": {
        "tags": [
          "quotation"
        ],
        "operationId": "list_quotations",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Quotation"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quotations/{quotation_id}": {
      "get": {
        "tags": [
          "quotation"
        ],
        "operationId": "get_quotation",
        "parameters": [
          {
            "name": "quotation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quotation"
                }
              }
            },
            "links": {
              "getQuotationContact": {
                "operation_id": "get_contact",
                "parameters": {
                  "contact_id": "$response.body#/contactId"
                },
                "description": "Contact referenced by `contactId`."
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "quotation"
        ],
        "operationId": "update_quotation",
        "parameters": [
          {
            "name": "quotation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quotation"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "quotation"
        ],
        "operationId": "delete_quotation",
        "parameters": [
          {
            "name": "quotation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quotations/{quotation_id}/pdf": {
      "get": {
        "tags": [
          "quotation"
        ],
        "operationId": "download_quotation_pdf",
        "parameters": [
          {
            "name": "quotation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF file",
            "content": {
              "application/pdf": {}
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quotations/{quotation_id}/pursue": {
      "post": {
        "tags": [
          "quotation"
        ],
        "operationId": "pursue_quotation",
        "parameters": [
          {
            "name": "quotation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created OrderConfirmation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderConfirmation"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quotations/{quotation_id}/restore": {
      "post": {
        "tags": [
          "quotation"
        ],
        "operationId": "quotation_restore",
        "parameters": [
          {
            "name": "quotation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quotation"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/recurring-templates": {
      "post": {
        "tags": [
          "recurring_template"
        ],
        "operationId": "create_recurring_template",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/recurring-templates/": {
      "get": {
        "tags": [
          "recurring_template"
        ],
        "operationId": "list_recurring_templates",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RecurringTemplate"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/recurring-templates/{template_id}": {
      "get": {
        "tags": [
          "recurring_template"
        ],
        "operationId": "get_recurring_template",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringTemplate"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "recurring_template"
        ],
        "operationId": "delete_recurring_template",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reorder-proposals": {
      "get": {
        "tags": [
          "reorder_proposal"
        ],
        "operationId": "get_reorder_proposal",
        "parameters": [
          {
            "name": "configuredOnly",
            "in": "query",
            "description": "Only include products with a reorder point configured (`min_stock`).",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "description": "Limit to a single warehouse id.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReorderProposalResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reorder-proposals/apply": {
      "post": {
        "tags": [
          "reorder_proposal"
        ],
        "summary": "Convert a reorder proposal into a draft purchase order.",
        "description": "Returns the created purchase order id. Suggested line items are generated\nwith the current reorder quantity per product.",
        "operationId": "apply_reorder_proposal",
        "parameters": [
          {
            "name": "configuredOnly",
            "in": "query",
            "description": "Only include products with a reorder point configured (`min_stock`).",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "description": "Limit to a single warehouse id.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/replenishments": {
      "get": {
        "tags": [
          "replenishment"
        ],
        "operationId": "get_replenishments",
        "parameters": [
          {
            "name": "targetWarehouseId",
            "in": "query",
            "description": "Warehouse to be replenished. Defaults to the tenant's default warehouse.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "sourceWarehouseId",
            "in": "query",
            "description": "Restrict source warehouses to this id.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplenishmentResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/replenishments/apply": {
      "post": {
        "tags": [
          "replenishment"
        ],
        "summary": "Create one draft stock transfer per (source → target) pair carrying all\nsuggested product lines for that pair.",
        "operationId": "apply_replenishments",
        "parameters": [
          {
            "name": "targetWarehouseId",
            "in": "query",
            "description": "Warehouse to be replenished. Defaults to the tenant's default warehouse.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "sourceWarehouseId",
            "in": "query",
            "description": "Restrict source warehouses to this id.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/returns": {
      "post": {
        "tags": [
          "return_order"
        ],
        "operationId": "create_return_order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReturnOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnOrder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/returns/": {
      "get": {
        "tags": [
          "return_order"
        ],
        "operationId": "list_return_orders",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "customer_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "order_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReturnOrder"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/returns/logistics-queue": {
      "get": {
        "tags": [
          "return_order"
        ],
        "operationId": "return_logistics_queue",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReturnLogisticsQueueItem"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/returns/logistics-summary": {
      "get": {
        "tags": [
          "return_order"
        ],
        "summary": "Returns-logistics aggregation for the dashboard: quantities received,\nrestocked and scrapped per warehouse.",
        "operationId": "return_logistics_summary",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnLogisticsSummary"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/returns/{return_order_id}": {
      "get": {
        "tags": [
          "return_order"
        ],
        "operationId": "get_return_order",
        "parameters": [
          {
            "name": "return_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnOrder"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "return_order"
        ],
        "operationId": "update_return_order",
        "parameters": [
          {
            "name": "return_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnOrder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "return_order"
        ],
        "operationId": "delete_return_order",
        "parameters": [
          {
            "name": "return_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/returns/{return_order_id}/status": {
      "put": {
        "tags": [
          "return_order"
        ],
        "operationId": "update_return_order_status",
        "parameters": [
          {
            "name": "return_order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReturnOrderStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnOrder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rfqs": {
      "post": {
        "tags": [
          "rfq"
        ],
        "operationId": "create_rfq",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Rfq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rfq"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rfqs/": {
      "get": {
        "tags": [
          "rfq"
        ],
        "operationId": "list_rfqs",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Rfq"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rfqs/{rfq_id}": {
      "get": {
        "tags": [
          "rfq"
        ],
        "operationId": "get_rfq",
        "parameters": [
          {
            "name": "rfq_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rfq"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "rfq"
        ],
        "operationId": "update_rfq",
        "parameters": [
          {
            "name": "rfq_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rfq"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "rfq"
        ],
        "operationId": "delete_rfq",
        "parameters": [
          {
            "name": "rfq_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rfqs/{rfq_id}/convert": {
      "post": {
        "tags": [
          "rfq"
        ],
        "summary": "Convert an RFQ into a draft purchase order using the quoted unit prices\n(falling back to the requested prices, then leaving them blank). Marks the\nRFQ as `converted`.",
        "operationId": "convert_rfq",
        "parameters": [
          {
            "name": "rfq_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rfqs/{rfq_id}/status": {
      "put": {
        "tags": [
          "rfq"
        ],
        "operationId": "update_rfq_status",
        "parameters": [
          {
            "name": "rfq_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RfqStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rfq"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "GET /api/v1/search?q=...",
        "operationId": "global_search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search text (min 2 chars)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/service-assignments": {
      "post": {
        "tags": [
          "service_assignment"
        ],
        "operationId": "create_service_assignment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceAssignmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceAssignment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/service-assignments/": {
      "get": {
        "tags": [
          "service_assignment"
        ],
        "operationId": "get_service_assignments",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ServiceAssignment"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/service-assignments/{id}": {
      "get": {
        "tags": [
          "service_assignment"
        ],
        "operationId": "get_service_assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceAssignment"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "service_assignment"
        ],
        "operationId": "update_service_assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceAssignmentUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceAssignment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "service_assignment"
        ],
        "operationId": "delete_service_assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/service-jobs": {
      "post": {
        "tags": [
          "service_job"
        ],
        "operationId": "create_service_job",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceJobCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceJob"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/service-jobs/": {
      "get": {
        "tags": [
          "service_job"
        ],
        "operationId": "get_service_jobs",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ServiceJob"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/service-jobs/{id}": {
      "get": {
        "tags": [
          "service_job"
        ],
        "operationId": "get_service_job",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceJob"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "service_job"
        ],
        "operationId": "update_service_job",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceJobUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceJob"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "service_job"
        ],
        "operationId": "delete_service_job",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/smtp": {
      "get": {
        "tags": [
          "onlineshop"
        ],
        "operationId": "get_smtp_config_api",
        "responses": {
          "200": {
            "description": "Tenant SMTP config (null if unset)",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/SmtpConfig"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "onlineshop"
        ],
        "operationId": "save_smtp_config_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/SmtpConfig"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tenant SMTP config saved",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/SmtpConfig"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/tenant": {
      "get": {
        "tags": [
          "tenant_settings"
        ],
        "operationId": "get_tenant_settings",
        "responses": {
          "200": {
            "description": "Tenant settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantSettings"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "tenant_settings"
        ],
        "operationId": "update_tenant_settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated tenant settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantSettings"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shareholders": {
      "post": {
        "tags": [
          "shareholder"
        ],
        "operationId": "create_shareholder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareholderCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shareholder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shareholders/": {
      "get": {
        "tags": [
          "shareholder"
        ],
        "operationId": "get_shareholders",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Shareholder"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shareholders/{id}": {
      "get": {
        "tags": [
          "shareholder"
        ],
        "operationId": "get_shareholder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shareholder"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "shareholder"
        ],
        "operationId": "update_shareholder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareholderUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shareholder"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "shareholder"
        ],
        "operationId": "delete_shareholder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipments": {
      "get": {
        "tags": [
          "shipment"
        ],
        "operationId": "list_shipments",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shipments found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Shipment"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "shipment"
        ],
        "operationId": "create_shipment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Shipment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Shipment created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipments/{shipment_id}": {
      "get": {
        "tags": [
          "shipment"
        ],
        "operationId": "get_shipment",
        "parameters": [
          {
            "name": "shipment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shipment found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "404": {
            "description": "Shipment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "shipment"
        ],
        "operationId": "delete_shipment",
        "parameters": [
          {
            "name": "shipment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Shipment deleted"
          },
          "404": {
            "description": "Shipment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipments/{shipment_id}/status": {
      "put": {
        "tags": [
          "shipment"
        ],
        "operationId": "update_shipment_status",
        "parameters": [
          {
            "name": "shipment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShipmentStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Status updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "404": {
            "description": "Shipment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipments/{shipment_id}/tracking": {
      "get": {
        "tags": [
          "shipment"
        ],
        "operationId": "track_shipment_api",
        "parameters": [
          {
            "name": "shipment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Live tracking info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingInfo"
                }
              }
            }
          },
          "404": {
            "description": "Shipment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping-rules": {
      "post": {
        "tags": [
          "shipping_rule"
        ],
        "operationId": "create_shipping_rule",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingRuleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingRule"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping-rules/": {
      "get": {
        "tags": [
          "shipping_rule"
        ],
        "operationId": "list_shipping_rules",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ShippingRule"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping-rules/{rule_id}": {
      "get": {
        "tags": [
          "shipping_rule"
        ],
        "operationId": "get_shipping_rule",
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingRule"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "shipping_rule"
        ],
        "operationId": "update_shipping_rule",
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingRuleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingRule"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "shipping_rule"
        ],
        "operationId": "delete_shipping_rule",
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping-thresholds": {
      "post": {
        "tags": [
          "shipping_threshold"
        ],
        "operationId": "create_shipping_threshold",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingThresholdCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingThreshold"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping-thresholds/": {
      "get": {
        "tags": [
          "shipping_threshold"
        ],
        "operationId": "list_shipping_thresholds",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "warehouse_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ShippingThreshold"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping-thresholds/deliverable": {
      "get": {
        "tags": [
          "shipping_threshold"
        ],
        "operationId": "get_deliverable",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliverableResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping-thresholds/{threshold_id}": {
      "get": {
        "tags": [
          "shipping_threshold"
        ],
        "operationId": "get_shipping_threshold",
        "parameters": [
          {
            "name": "threshold_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingThreshold"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "shipping_threshold"
        ],
        "operationId": "update_shipping_threshold",
        "parameters": [
          {
            "name": "threshold_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingThresholdUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingThreshold"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "shipping_threshold"
        ],
        "operationId": "delete_shipping_threshold",
        "parameters": [
          {
            "name": "threshold_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping/credentials": {
      "get": {
        "tags": [
          "shipping"
        ],
        "operationId": "get_credentials_api",
        "responses": {
          "200": {
            "description": "Configured shipping provider credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingCredentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "shipping"
        ],
        "operationId": "save_credentials_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingCredentials"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved shipping provider credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingCredentials"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping/providers": {
      "get": {
        "tags": [
          "shipping"
        ],
        "operationId": "list_providers_api",
        "responses": {
          "200": {
            "description": "List of shipping providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProviderInfo"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping/rates": {
      "post": {
        "tags": [
          "shipping"
        ],
        "operationId": "get_rates_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Shipping rates from configured providers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shipping/suitability": {
      "post": {
        "tags": [
          "suitability"
        ],
        "operationId": "shipping_suitability_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuitabilityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Shipping suitability results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuitabilityResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/shop/editor": {
      "post": {
        "tags": [
          "shop"
        ],
        "operationId": "shop_editor_save",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/silent-partners": {
      "post": {
        "tags": [
          "silent_partner"
        ],
        "operationId": "create_silent_partner",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilentPartnerCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SilentPartner"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/silent-partners/": {
      "get": {
        "tags": [
          "silent_partner"
        ],
        "operationId": "get_silent_partners",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SilentPartner"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/silent-partners/{id}": {
      "get": {
        "tags": [
          "silent_partner"
        ],
        "operationId": "get_silent_partner",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SilentPartner"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "silent_partner"
        ],
        "operationId": "update_silent_partner",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilentPartnerUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SilentPartner"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "silent_partner"
        ],
        "operationId": "delete_silent_partner",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-movements/": {
      "get": {
        "tags": [
          "stock_movement"
        ],
        "operationId": "list_stock_movements",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "productId",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "warehouseId",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "movementType",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Only movements on or after this date (inclusive).",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Only movements on or before this date (inclusive).",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StockMovement"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-movements/{movement_id}": {
      "get": {
        "tags": [
          "stock_movement"
        ],
        "operationId": "get_stock_movement",
        "parameters": [
          {
            "name": "movement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockMovement"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-transfers": {
      "post": {
        "tags": [
          "stock_transfer"
        ],
        "operationId": "create_stock_transfer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockTransfer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTransfer"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-transfers/": {
      "get": {
        "tags": [
          "stock_transfer"
        ],
        "operationId": "list_stock_transfers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "warehouse_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StockTransfer"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-transfers/{stock_transfer_id}": {
      "get": {
        "tags": [
          "stock_transfer"
        ],
        "operationId": "get_stock_transfer",
        "parameters": [
          {
            "name": "stock_transfer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTransfer"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "stock_transfer"
        ],
        "operationId": "delete_stock_transfer",
        "parameters": [
          {
            "name": "stock_transfer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-transfers/{stock_transfer_id}/status": {
      "put": {
        "tags": [
          "stock_transfer"
        ],
        "operationId": "update_stock_transfer_status",
        "parameters": [
          {
            "name": "stock_transfer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockTransferStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTransfer"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/subscription": {
      "get": {
        "tags": [
          "billing"
        ],
        "operationId": "get_subscription_api",
        "responses": {
          "200": {
            "description": "Tenant subscription overview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_SubscriptionOverview"
                }
              }
            }
          },
          "404": {
            "description": "Tenant not found"
          }
        }
      }
    },
    "/api/v1/supplier-conditions": {
      "post": {
        "tags": [
          "supplier_condition"
        ],
        "operationId": "create_supplier_condition",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierConditionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierCondition"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supplier-conditions/": {
      "get": {
        "tags": [
          "supplier_condition"
        ],
        "operationId": "list_supplier_conditions",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "supplier_contact_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SupplierCondition"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supplier-conditions/{supplier_condition_id}": {
      "get": {
        "tags": [
          "supplier_condition"
        ],
        "operationId": "get_supplier_condition",
        "parameters": [
          {
            "name": "supplier_condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierCondition"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "supplier_condition"
        ],
        "operationId": "update_supplier_condition",
        "parameters": [
          {
            "name": "supplier_condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierConditionUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierCondition"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "supplier_condition"
        ],
        "operationId": "delete_supplier_condition",
        "parameters": [
          {
            "name": "supplier_condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supplier-invoices": {
      "post": {
        "tags": [
          "supplier_invoice"
        ],
        "operationId": "create_supplier_invoice",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierInvoice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierInvoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supplier-invoices/": {
      "get": {
        "tags": [
          "supplier_invoice"
        ],
        "operationId": "list_supplier_invoices",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "purchase_order_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "supplier_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SupplierInvoice"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supplier-invoices/{supplier_invoice_id}": {
      "get": {
        "tags": [
          "supplier_invoice"
        ],
        "operationId": "get_supplier_invoice",
        "parameters": [
          {
            "name": "supplier_invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierInvoice"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "supplier_invoice"
        ],
        "operationId": "update_supplier_invoice",
        "parameters": [
          {
            "name": "supplier_invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierInvoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "supplier_invoice"
        ],
        "operationId": "delete_supplier_invoice",
        "parameters": [
          {
            "name": "supplier_invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supplier-invoices/{supplier_invoice_id}/status": {
      "put": {
        "tags": [
          "supplier_invoice"
        ],
        "operationId": "update_supplier_invoice_status",
        "parameters": [
          {
            "name": "supplier_invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierInvoiceStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierInvoice"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/support/ai/suggest": {
      "post": {
        "tags": [
          "ai"
        ],
        "operationId": "ai_suggest_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiSuggestionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "AI suggestion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiSuggestion"
                }
              }
            }
          },
          "500": {
            "description": "AI error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/support/ai/workers": {
      "get": {
        "tags": [
          "ai"
        ],
        "operationId": "list_workers_api",
        "responses": {
          "200": {
            "description": "List AI workers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AiWorkerConfig"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ai"
        ],
        "operationId": "create_worker_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Worker created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiWorkerConfig"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/support/ai/workers/{worker_id}/run": {
      "post": {
        "tags": [
          "ai"
        ],
        "operationId": "run_worker_api",
        "parameters": [
          {
            "name": "worker_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiSuggestionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Worker executed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiSuggestion"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/support/channels": {
      "get": {
        "tags": [
          "support_channel"
        ],
        "operationId": "list_channels_api",
        "responses": {
          "200": {
            "description": "List of channels",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SupportChannel"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "support_channel"
        ],
        "operationId": "create_channel_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Channel created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportChannel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/support/channels/{channel_id}": {
      "put": {
        "tags": [
          "support_channel"
        ],
        "operationId": "update_channel_api",
        "parameters": [
          {
            "name": "channel_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Channel updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportChannel"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "support_channel"
        ],
        "operationId": "delete_channel_api",
        "parameters": [
          {
            "name": "channel_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Channel deleted"
          }
        }
      }
    },
    "/api/v1/support/leads": {
      "get": {
        "tags": [
          "lead"
        ],
        "operationId": "list_leads_api",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Leads list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Lead"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/support/leads/{lead_id}": {
      "put": {
        "tags": [
          "lead"
        ],
        "operationId": "update_lead_api",
        "parameters": [
          {
            "name": "lead_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Lead updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lead"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/support/tickets": {
      "get": {
        "tags": [
          "support_ticket"
        ],
        "operationId": "list_tickets_api",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "assigned_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          },
          {
            "name": "channel_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tickets list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SupportTicket"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "support_ticket"
        ],
        "operationId": "create_ticket_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTicketRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Ticket created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTicket"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/support/tickets/{ticket_id}": {
      "get": {
        "tags": [
          "support_ticket"
        ],
        "operationId": "get_ticket_api",
        "parameters": [
          {
            "name": "ticket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTicket"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "support_ticket"
        ],
        "operationId": "update_ticket_api",
        "parameters": [
          {
            "name": "ticket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportTicketUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ticket updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTicket"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "support_ticket"
        ],
        "operationId": "delete_ticket_api",
        "parameters": [
          {
            "name": "ticket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Ticket deleted"
          }
        }
      }
    },
    "/api/v1/support/tickets/{ticket_id}/messages": {
      "get": {
        "tags": [
          "ticket_message"
        ],
        "operationId": "list_messages_api",
        "parameters": [
          {
            "name": "ticket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Messages for a ticket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TicketMessage"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ticket_message"
        ],
        "operationId": "send_message_api",
        "parameters": [
          {
            "name": "ticket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Message sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TicketMessage"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tax-rates": {
      "get": {
        "tags": [
          "tax"
        ],
        "summary": "List the calling tenant's tax rates.",
        "operationId": "list_tax_rates",
        "responses": {
          "200": {
            "description": "Tenant's tax rates"
          }
        }
      },
      "post": {
        "tags": [
          "tax"
        ],
        "summary": "Create a tax rate (`admin:settings`).",
        "operationId": "create_tax_rate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRateCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tax rate created"
          },
          "400": {
            "description": "Invalid body"
          },
          "403": {
            "description": "Missing admin:settings permission"
          },
          "409": {
            "description": "Default rate for the country already exists"
          }
        }
      }
    },
    "/api/v1/tax-rates/{id}": {
      "put": {
        "tags": [
          "tax"
        ],
        "summary": "Update a tax rate by id (`admin:settings`). Replaces all body fields.",
        "operationId": "update_tax_rate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRateCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tax rate updated"
          },
          "400": {
            "description": "Invalid body"
          },
          "403": {
            "description": "Missing admin:settings permission"
          },
          "404": {
            "description": "Tax rate not found"
          },
          "409": {
            "description": "Default rate for the country already exists"
          }
        }
      },
      "delete": {
        "tags": [
          "tax"
        ],
        "summary": "Delete a tax rate by id (`admin:settings`).",
        "operationId": "delete_tax_rate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tax rate deleted"
          },
          "403": {
            "description": "Missing admin:settings permission"
          },
          "404": {
            "description": "Tax rate not found"
          }
        }
      }
    },
    "/api/v1/time-entries": {
      "get": {
        "tags": [
          "time_entries"
        ],
        "summary": "List time entries with optional date-range / active / employee filters.",
        "operationId": "list_time_entries",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "active",
            "in": "query",
            "description": "Only currently running shifts (clock_in set, clock_out null).",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          },
          {
            "name": "employee_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TimeEntryDto"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "time_entries"
        ],
        "summary": "Clock in for the authenticated user (resolved via their employee profile).",
        "operationId": "clock_in_time_entry",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimeEntryClockIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryDto"
                }
              }
            }
          },
          "400": {
            "description": "No employee profile for this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/time-entries/{id}": {
      "patch": {
        "tags": [
          "time_entries"
        ],
        "summary": "Clock out an entry: the entry's owner, or anyone with `time_entries:write`.",
        "operationId": "clock_out_time_entry",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimeEntryClockOut"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeEntryDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/training-assignments": {
      "post": {
        "tags": [
          "training_assignment"
        ],
        "operationId": "create_training_assignment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingAssignmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/training-assignments/": {
      "get": {
        "tags": [
          "training_assignment"
        ],
        "operationId": "get_training_assignments",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 1
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "description": "Soft-delete entities: set true to include rows with `deleted_at` set.",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TrainingAssignment"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/training-assignments/{id}": {
      "get": {
        "tags": [
          "training_assignment"
        ],
        "operationId": "get_training_assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignment"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "training_assignment"
        ],
        "operationId": "update_training_assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingAssignmentUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "training_assignment"
        ],
        "operationId": "delete_training_assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trainings/content/{code}": {
      "get": {
        "tags": [
          "trainings"
        ],
        "operationId": "get_training_content",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "description": "Training code, e.g. data_privacy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Interactive training content for the frontend player",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingContent"
                }
              }
            }
          },
          "404": {
            "description": "Unknown training code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trainings/me": {
      "get": {
        "tags": [
          "trainings"
        ],
        "operationId": "get_my_trainings",
        "responses": {
          "200": {
            "description": "Required trainings for the current employee",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MyTrainingItem"
                  }
                }
              }
            }
          },
          "404": {
            "description": "No employee linked to user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trainings/overview": {
      "get": {
        "tags": [
          "trainings"
        ],
        "operationId": "get_training_overview",
        "responses": {
          "200": {
            "description": "HR overview of assigned trainings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HrTrainingOverview"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/trainings/submit-result": {
      "post": {
        "tags": [
          "trainings"
        ],
        "operationId": "submit_training_result",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitResultDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Result recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResultResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid score or training",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/usage": {
      "get": {
        "tags": [
          "billing"
        ],
        "operationId": "get_usage_api",
        "parameters": [
          {
            "name": "meter",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metered usage this period"
          }
        }
      }
    },
    "/api/v1/users": {
      "get": {
        "tags": [
          "user_management"
        ],
        "operationId": "list_users",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantUser"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/users/{user_id}": {
      "get": {
        "tags": [
          "user_management"
        ],
        "operationId": "get_user",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantUser"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "delete": {
        "tags": [
          "user_management"
        ],
        "operationId": "remove_user",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/users/{user_id}/permissions": {
      "put": {
        "tags": [
          "user_management"
        ],
        "operationId": "update_user_permissions",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePermissionsPayload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/users/{user_id}/role": {
      "put": {
        "tags": [
          "user_management"
        ],
        "operationId": "update_user_role",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRolePayload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/vouchers": {
      "post": {
        "tags": [
          "voucher"
        ],
        "operationId": "create_voucher",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoucherCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Voucher"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vouchers/": {
      "get": {
        "tags": [
          "voucher"
        ],
        "operationId": "list_vouchers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "voucher_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "voucher_status",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "contact_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Voucher"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vouchers/{voucher_id}": {
      "get": {
        "tags": [
          "voucher"
        ],
        "operationId": "get_voucher",
        "parameters": [
          {
            "name": "voucher_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Voucher"
                }
              }
            },
            "links": {
              "getVoucherContact": {
                "operation_id": "get_contact",
                "parameters": {
                  "contact_id": "$response.body#/contactId"
                },
                "description": "Contact referenced by `contactId`."
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "voucher"
        ],
        "operationId": "update_voucher",
        "parameters": [
          {
            "name": "voucher_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Voucher"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Voucher not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "voucher"
        ],
        "operationId": "delete_voucher",
        "parameters": [
          {
            "name": "voucher_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vouchers/{voucher_id}/restore": {
      "post": {
        "tags": [
          "voucher"
        ],
        "operationId": "voucher_restore",
        "parameters": [
          {
            "name": "voucher_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Voucher"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/warehouses": {
      "post": {
        "tags": [
          "warehouse"
        ],
        "operationId": "create_warehouse",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Warehouse"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Warehouse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/warehouses/": {
      "get": {
        "tags": [
          "warehouse"
        ],
        "operationId": "list_warehouses",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Warehouse"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/warehouses/{warehouse_id}": {
      "get": {
        "tags": [
          "warehouse"
        ],
        "operationId": "get_warehouse",
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Warehouse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "warehouse"
        ],
        "operationId": "update_warehouse",
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Warehouse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "warehouse"
        ],
        "operationId": "delete_warehouse",
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/warehouses/{warehouse_id}/stock": {
      "get": {
        "tags": [
          "warehouse_stock"
        ],
        "operationId": "list_warehouse_stock",
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WarehouseStock"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "warehouse_stock"
        ],
        "operationId": "create_warehouse_stock",
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseStock"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/warehouses/{warehouse_id}/stock/{product_id}": {
      "put": {
        "tags": [
          "warehouse_stock"
        ],
        "operationId": "update_warehouse_stock",
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseStock"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "warehouse_stock"
        ],
        "operationId": "delete_warehouse_stock",
        "parameters": [
          {
            "name": "warehouse_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-events": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List webhook events (inbound + outbound log).",
        "operationId": "list_event",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookEvent"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-subscriptions": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "List webhook subscriptions for the tenant.",
        "operationId": "list_subscriptions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookSubscription"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Create a webhook subscription (outbound hook).",
        "operationId": "create_subscription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscription"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhook-subscriptions/{subscription_id}": {
      "put": {
        "tags": [
          "webhooks"
        ],
        "summary": "Update a webhook subscription.",
        "operationId": "update_subscription",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscription"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "webhooks"
        ],
        "summary": "Delete a webhook subscription.",
        "operationId": "delete_subscription",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/api/v1/webhooks/emit": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Manually fire an event against matching hooks (for testing/flows).",
        "operationId": "emit_api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmitEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Emitted"
          }
        }
      }
    },
    "/api/v1/workflows": {
      "get": {
        "tags": [
          "workflows"
        ],
        "operationId": "list_workflows_api",
        "responses": {
          "200": {
            "description": "Workflows (seeded with defaults on first access)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Workflow"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflow_id}/enabled": {
      "put": {
        "tags": [
          "workflows"
        ],
        "operationId": "set_workflow_enabled_api",
        "parameters": [
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowEnabledUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workflow enabled state updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workflow"
                }
              }
            }
          },
          "404": {
            "description": "Workflow not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginError"
                }
              }
            }
          }
        }
      }
    },
    "/api/webhooks/paddle/subscription": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Paddle Billing subscription webhook. Verifies the `Paddle-Signature`\nheader (HMAC-SHA256 over `\"{ts}:{raw_body}\"` with the webhook secret),\nthen updates `billing_info` and `tenants.plan` for the tenant identified\nby the subscription `custom_data` (JSON `{\"tenant_id\": \"...\"}` or a bare\ntenant UUID).",
        "operationId": "paddle_subscription_webhook",
        "responses": {
          "200": {
            "description": "Webhook processed"
          },
          "401": {
            "description": "Signature verification failed"
          }
        }
      }
    },
    "/auth/accept-invite": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Accept an invite: create the account (or reuse an existing one) and join\nthe inviting tenant. The invite token proves control of the mailbox.",
        "operationId": "accept_invite",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Invitation accepted"
          },
          "400": {
            "description": "Weak password or privacy policy not accepted"
          },
          "401": {
            "description": "Invalid or expired invite token"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/auth/forgot-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Send a password reset email to the user",
        "operationId": "forgot_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password reset email sent if the account exists"
          },
          "404": {
            "description": "User not found"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Authenticate a user with email + password (optional TOTP)",
        "operationId": "login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Login successful, returns JWT tokens",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Log out the current user (kills the assay session)",
        "operationId": "logout",
        "responses": {
          "200": {
            "description": "Logged out successfully"
          }
        }
      }
    },
    "/auth/magic-link": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Request a magic link login (sends an email with a one-time link)",
        "operationId": "magic_link_login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MagicLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Magic link email sent if the account exists"
          },
          "404": {
            "description": "User not found"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/auth/magic-link/verify": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Verify a magic link token and log the user in",
        "operationId": "magic_link_verify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MagicLinkVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Magic link verified, returns JWT tokens",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired token"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/auth/register": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Register a new user account",
        "operationId": "register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "User registered, verification email sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "409": {
            "description": "User already exists"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/auth/reset-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Reset the user's password using a reset token",
        "operationId": "reset_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password reset successfully"
          },
          "401": {
            "description": "Invalid or expired token"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/auth/totp/enable": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Enable TOTP two-factor authentication by verifying a code",
        "operationId": "totp_enable",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TotpEnableRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "TOTP enabled successfully"
          },
          "401": {
            "description": "Invalid TOTP code"
          }
        }
      }
    },
    "/auth/totp/setup": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Set up TOTP two-factor authentication (generates secret + backup codes)",
        "operationId": "totp_setup",
        "responses": {
          "200": {
            "description": "TOTP setup data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TotpSetupResponse"
                }
              }
            }
          },
          "409": {
            "description": "TOTP already enabled"
          }
        }
      }
    },
    "/auth/verify-email": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Verify a user's email address using a verification token",
        "operationId": "verify_email",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Email verified successfully"
          },
          "401": {
            "description": "Invalid or expired token"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/user/api-key": {
      "post": {
        "tags": [
          "user"
        ],
        "summary": "Generate a new API key for the current user",
        "operationId": "generate_api_key",
        "responses": {
          "200": {
            "description": "API key generated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_String"
                }
              }
            }
          }
        }
      }
    },
    "/user/change-password": {
      "post": {
        "tags": [
          "user"
        ],
        "summary": "Change the current user's password (requires the current password).",
        "operationId": "change_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password changed"
          },
          "400": {
            "description": "Wrong current password or weak new password"
          }
        }
      }
    },
    "/user/invite": {
      "post": {
        "tags": [
          "user"
        ],
        "summary": "Invite a user to the current tenant/organization",
        "operationId": "invite_user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Invitation sent"
          }
        }
      }
    },
    "/user/profile": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Get the current user's profile",
        "operationId": "user_profile",
        "responses": {
          "200": {
            "description": "User profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_UserProfile"
                }
              }
            }
          },
          "404": {
            "description": "User not found"
          }
        }
      },
      "put": {
        "tags": [
          "user"
        ],
        "summary": "Update the current user's profile",
        "operationId": "update_profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Profile updated"
          }
        }
      }
    },
    "/user/remove": {
      "delete": {
        "tags": [
          "user"
        ],
        "summary": "Remove a user from the current organization",
        "operationId": "remove_user_from_org",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "User removed"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/user/teams": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "List all teams in the current tenant",
        "operationId": "list_teams",
        "responses": {
          "200": {
            "description": "List of teams",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Vec_Team"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "user"
        ],
        "summary": "Create a new team within the current tenant",
        "operationId": "create_team",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Team created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Team"
                }
              }
            }
          }
        }
      }
    },
    "/user/tenants": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "List all tenants (organizations) the current user belongs to",
        "operationId": "user_tenants",
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Vec_UserTenantInfo"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Absence": {
        "type": "object",
        "properties": {
          "absenceType": {
            "$ref": "#/components/schemas/AbsenceType",
            "description": "One of \"vacation\", \"sick\", \"sabbatical\", \"parental\", \"other\"."
          },
          "approvedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "approvedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the user entity."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "employeeId": {
            "type": "string",
            "format": "uuid",
            "description": "References the employee entity."
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/AbsenceStatus",
            "description": "One of \"pending\", \"approved\", \"rejected\", \"cancelled\"."
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AbsenceCreate": {
        "type": "object",
        "properties": {
          "absenceType": {
            "$ref": "#/components/schemas/AbsenceType",
            "description": "One of \"vacation\", \"sick\", \"sabbatical\", \"parental\", \"other\"."
          },
          "approvedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "approvedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the user entity."
          },
          "employeeId": {
            "type": "string",
            "format": "uuid",
            "description": "References the employee entity."
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/AbsenceStatus",
            "description": "One of \"pending\", \"approved\", \"rejected\", \"cancelled\"."
          }
        }
      },
      "AbsenceStatus": {
        "type": "string",
        "description": "Absence request status.",
        "enum": [
          "pending",
          "approved",
          "rejected",
          "cancelled"
        ]
      },
      "AbsenceType": {
        "type": "string",
        "description": "Absence type.",
        "enum": [
          "vacation",
          "sick",
          "sabbatical",
          "parental",
          "other"
        ]
      },
      "AbsenceUpdate": {
        "type": "object",
        "properties": {
          "absenceType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AbsenceType",
                "description": "One of \"vacation\", \"sick\", \"sabbatical\", \"parental\", \"other\"."
              }
            ]
          },
          "approvedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "approvedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the user entity."
          },
          "employeeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the employee entity."
          },
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AbsenceStatus",
                "description": "One of \"pending\", \"approved\", \"rejected\", \"cancelled\"."
              }
            ]
          }
        }
      },
      "AcceptInviteRequest": {
        "type": "object",
        "required": [
          "token",
          "password",
          "first_name",
          "last_name",
          "privacy_accepted"
        ],
        "properties": {
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "privacy_accepted": {
            "type": "boolean",
            "description": "GDPR consent — rejected unless true."
          },
          "token": {
            "type": "string"
          }
        }
      },
      "AccountOverview": {
        "type": "object",
        "required": [
          "account",
          "account_name",
          "debit_total",
          "credit_total",
          "balance"
        ],
        "properties": {
          "account": {
            "type": "string"
          },
          "account_name": {
            "type": "string"
          },
          "balance": {
            "type": "string"
          },
          "credit_total": {
            "type": "string"
          },
          "debit_total": {
            "type": "string"
          }
        }
      },
      "Activity": {
        "type": "object",
        "required": [
          "activityType",
          "subject",
          "status"
        ],
        "properties": {
          "activityType": {
            "$ref": "#/components/schemas/ActivityType",
            "description": "One of: call | email | meeting | task | note"
          },
          "assignedTo": {
            "type": [
              "string",
              "null"
            ],
            "description": "User responsible (`employee.employee_id`)."
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contact this activity belongs to (`contact.contact_id`).\nReferences the contact entity."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Follow-up / Wiedervorlage date. Open activities with a due date in the\npast are overdue."
          },
          "reminderDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "When to remind about the follow-up."
          },
          "status": {
            "$ref": "#/components/schemas/ActivityStatus",
            "description": "One of: open | done | cancelled"
          },
          "subject": {
            "type": "string",
            "description": "Short subject line."
          }
        }
      },
      "ActivityCreate": {
        "type": "object",
        "required": [
          "activityType",
          "subject",
          "status"
        ],
        "properties": {
          "activityType": {
            "$ref": "#/components/schemas/ActivityType",
            "description": "One of: call | email | meeting | task | note"
          },
          "assignedTo": {
            "type": [
              "string",
              "null"
            ],
            "description": "User responsible (`employee.employee_id`)."
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contact this activity belongs to (`contact.contact_id`).\nReferences the contact entity."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Follow-up / Wiedervorlage date. Open activities with a due date in the\npast are overdue."
          },
          "reminderDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "When to remind about the follow-up."
          },
          "status": {
            "$ref": "#/components/schemas/ActivityStatus",
            "description": "One of: open | done | cancelled"
          },
          "subject": {
            "type": "string",
            "description": "Short subject line."
          }
        }
      },
      "ActivityStatus": {
        "type": "string",
        "description": "Activity status.",
        "enum": [
          "open",
          "done",
          "cancelled"
        ]
      },
      "ActivityStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "ActivityType": {
        "type": "string",
        "description": "Activity type.",
        "enum": [
          "call",
          "email",
          "meeting",
          "task",
          "note"
        ]
      },
      "ActivityUpdate": {
        "type": "object",
        "properties": {
          "activityType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ActivityType",
                "description": "One of: call | email | meeting | task | note"
              }
            ]
          },
          "assignedTo": {
            "type": [
              "string",
              "null"
            ],
            "description": "User responsible (`employee.employee_id`)."
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contact this activity belongs to (`contact.contact_id`).\nReferences the contact entity."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Follow-up / Wiedervorlage date. Open activities with a due date in the\npast are overdue."
          },
          "reminderDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "When to remind about the follow-up."
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ActivityStatus",
                "description": "One of: open | done | cancelled"
              }
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short subject line."
          }
        }
      },
      "Address": {
        "type": "object",
        "required": [
          "name",
          "street",
          "street_number",
          "zip",
          "city",
          "country"
        ],
        "properties": {
          "city": {
            "type": "string"
          },
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code (e.g. \"DE\", \"PL\", \"FR\")."
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "street": {
            "type": "string"
          },
          "street_number": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          }
        }
      },
      "AiConfigDto": {
        "type": "object",
        "required": [
          "name",
          "provider",
          "model"
        ],
        "properties": {
          "auto_reply": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "max_tool_calls": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "model": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "system_prompt": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger_on": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AiSuggestion": {
        "type": "object",
        "required": [
          "suggested_reply",
          "confidence",
          "tool_calls",
          "reasoning"
        ],
        "properties": {
          "confidence": {
            "type": "number",
            "format": "double"
          },
          "reasoning": {
            "type": "string"
          },
          "suggested_priority": {
            "type": [
              "string",
              "null"
            ]
          },
          "suggested_reply": {
            "type": "string"
          },
          "suggested_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AiSuggestionRequest": {
        "type": "object",
        "required": [
          "ticket_id"
        ],
        "properties": {
          "instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_body": {
            "type": [
              "string",
              "null"
            ]
          },
          "ticket_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "AiWorkerConfig": {
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "name",
          "is_active",
          "provider",
          "model",
          "system_prompt",
          "trigger_on",
          "auto_reply",
          "max_tool_calls",
          "created_at"
        ],
        "properties": {
          "auto_reply": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "is_active": {
            "type": "boolean"
          },
          "max_tool_calls": {
            "type": "integer",
            "format": "int32"
          },
          "model": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "system_prompt": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "trigger_on": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AllocatePaymentRequest": {
        "type": "object",
        "required": [
          "payment_id",
          "invoice_id",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "invoice_id": {
            "type": "string"
          },
          "payment_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "AnlageGErgebnis": {
        "type": "object",
        "required": [
          "jahr",
          "gewinn_verlust",
          "gewst_pflichtig",
          "gewst_gezahlt",
          "gewst_messbetrag_approx",
          "kfz_hinweise"
        ],
        "properties": {
          "gewinn_verlust": {
            "type": "string"
          },
          "gewst_gezahlt": {
            "type": "string"
          },
          "gewst_messbetrag_approx": {
            "type": "string"
          },
          "gewst_pflichtig": {
            "type": "boolean"
          },
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "kfz_hinweise": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnlageGKfzHinweis"
            }
          }
        }
      },
      "AnlageGKfzHinweis": {
        "type": "object",
        "required": [
          "bezeichnung",
          "kennzeichen",
          "privat_anteil_prozent"
        ],
        "properties": {
          "bezeichnung": {
            "type": "string"
          },
          "kennzeichen": {
            "type": "string"
          },
          "privat_anteil_prozent": {
            "type": "string"
          }
        }
      },
      "AnlageSErgebnis": {
        "type": "object",
        "required": [
          "jahr",
          "gewinn_verlust",
          "kfz_hinweise"
        ],
        "properties": {
          "gewinn_verlust": {
            "type": "string"
          },
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "kfz_hinweise": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnlageSKfzHinweis"
            }
          }
        }
      },
      "AnlageSKfzHinweis": {
        "type": "object",
        "required": [
          "bezeichnung",
          "kennzeichen",
          "privat_anteil_prozent"
        ],
        "properties": {
          "bezeichnung": {
            "type": "string"
          },
          "kennzeichen": {
            "type": "string"
          },
          "privat_anteil_prozent": {
            "type": "string"
          }
        }
      },
      "ApiResponse_GdprExport": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "exportedAt",
              "generatedByAi",
              "user",
              "tenants",
              "billing",
              "apiKeys",
              "refreshTokens",
              "activityLog",
              "usageEvents",
              "notifications"
            ],
            "properties": {
              "activityLog": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GdprActivity"
                }
              },
              "apiKeys": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GdprApiKey"
                },
                "description": "Key identifiers and names only — never a usable credential."
              },
              "billing": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GdprBillingInfo"
                }
              },
              "exportedAt": {
                "type": "string",
                "format": "date-time"
              },
              "generatedByAi": {
                "type": "boolean",
                "description": "Honesty field: this document is a plain data dump, never AI-generated."
              },
              "notifications": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GdprNotification"
                }
              },
              "refreshTokens": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GdprRefreshToken"
                },
                "description": "Session records: metadata only, never the token hash."
              },
              "tenants": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GdprTenant"
                }
              },
              "usageEvents": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GdprUsageEvent"
                }
              },
              "user": {
                "$ref": "#/components/schemas/GdprUser"
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ApiResponse_String": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "data": {
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ApiResponse_SubscriptionOverview": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "data": {
            "type": "object",
            "description": "Tenant subscription overview for the billing page: current plan, status,\nperiod end, trial state, effective limits, current usage and feature\nflags. Backed by Paddle Billing webhook data written into `billing_info` +\n`tenants.plan`, and by the canonical plans in `crate::saasy::plans`.\n\nJSON contract (camelCase, matches the frontend): `plan`, `planName`,\n`priceEur`, `status`, `currentPeriodEnd`, `manageUrl`, `trialEndsAt`,\n`isTrialing`, `limits:{maxUsers,maxInvoicesPerMonth,maxConnectors}`,\n`usage:{users,invoicesThisMonth,connectors,overageSeats}`,\n`features:{taxAutomations,fancyReports,erp}`.",
            "required": [
              "plan",
              "planName",
              "priceEur",
              "isTrialing",
              "limits",
              "features",
              "usage"
            ],
            "properties": {
              "currentPeriodEnd": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "features": {
                "$ref": "#/components/schemas/PlanFeatures"
              },
              "isTrialing": {
                "type": "boolean"
              },
              "limits": {
                "$ref": "#/components/schemas/PlanLimits"
              },
              "manageUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "plan": {
                "type": "string",
                "description": "Resolved plan id (free/starter/business/enterprise, or a custom\noverride id)."
              },
              "planName": {
                "type": "string"
              },
              "priceEur": {
                "type": "number",
                "format": "double",
                "description": "Monthly price in EUR; `-1.0` = custom pricing (enterprise)."
              },
              "quantity": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int32"
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "subscriptionId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "trialEndsAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "usage": {
                "$ref": "#/components/schemas/UsageSnapshot"
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ApiResponse_Team": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "name",
              "tenant_id",
              "created_at",
              "updated_at"
            ],
            "properties": {
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "parent_team_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "tenant_id": {
                "type": "string",
                "format": "uuid"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ApiResponse_UserProfile": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "email",
              "first_name",
              "last_name",
              "full_name",
              "email_verified",
              "created_at"
            ],
            "properties": {
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "email": {
                "type": "string"
              },
              "email_verified": {
                "type": "boolean"
              },
              "first_name": {
                "type": "string"
              },
              "full_name": {
                "type": "string"
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "last_name": {
                "type": "string"
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ApiResponse_Vec_Plan": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One canonical plan. `price_eur == -1.0` means custom pricing.",
              "required": [
                "id",
                "name",
                "priceEur",
                "limits",
                "features"
              ],
              "properties": {
                "features": {
                  "$ref": "#/components/schemas/PlanFeatures"
                },
                "id": {
                  "type": "string"
                },
                "limits": {
                  "$ref": "#/components/schemas/PlanLimits"
                },
                "name": {
                  "type": "string"
                },
                "priceEur": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ApiResponse_Vec_Team": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "tenant_id",
                "created_at",
                "updated_at"
              ],
              "properties": {
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "parent_team_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "tenant_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ApiResponse_Vec_UserTenantInfo": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "tenant_id",
                "tenant_name",
                "role"
              ],
              "properties": {
                "custom_domain": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "role": {
                  "type": "string"
                },
                "subdomain": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tenant_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "tenant_name": {
                  "type": "string"
                }
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ApplicationFilter": {
        "type": "object",
        "properties": {
          "page": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "pageSize": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "postingId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ApplicationStatus": {
        "type": "string",
        "description": "Application status.",
        "enum": [
          "new",
          "reviewing",
          "interview",
          "hired",
          "rejected"
        ]
      },
      "ApplicationStatusDto": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "postingId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "AppointmentStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "AssignmentStatus": {
        "type": "string",
        "enum": [
          "required",
          "completed",
          "overdue",
          "waived"
        ]
      },
      "Attachment": {
        "type": "object",
        "required": [
          "fileName",
          "originalName"
        ],
        "properties": {
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contact this attachment belongs to (per-contact DMS).\nReferences the contact entity."
          },
          "fileName": {
            "type": "string"
          },
          "fileSize": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "ocrText": {
            "type": [
              "string",
              "null"
            ],
            "description": "Raw text extracted by client-side OCR (tesseract.js), if run."
          },
          "originalName": {
            "type": "string"
          },
          "pdfaPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "sha256Hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "uploadedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "AttachmentCreate": {
        "type": "object",
        "required": [
          "fileName",
          "originalName"
        ],
        "properties": {
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contact this attachment belongs to (per-contact DMS).\nReferences the contact entity."
          },
          "fileName": {
            "type": "string"
          },
          "fileSize": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "originalName": {
            "type": "string"
          },
          "pdfaPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "sha256Hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "uploadedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "AttachmentVersion": {
        "type": "object",
        "required": [
          "attachmentId",
          "versionNumber",
          "fileName"
        ],
        "properties": {
          "attachmentId": {
            "type": "string",
            "format": "uuid",
            "description": "Parent attachment whose history this row records."
          },
          "fileName": {
            "type": "string",
            "description": "Storage key of this version's bytes."
          },
          "fileSize": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "originalName": {
            "type": [
              "string",
              "null"
            ]
          },
          "sha256Hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "uploadedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "versionNumber": {
            "type": "integer",
            "format": "int32",
            "description": "1-based; ascending per attachment in upload order."
          }
        }
      },
      "AuthResponse": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "access_token": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "refresh_token": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Model"
              }
            ]
          }
        }
      },
      "Automation": {
        "type": "object",
        "required": [
          "tenantId",
          "automationKey",
          "enabled",
          "config",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "automationKey": {
            "type": "string"
          },
          "config": {},
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "lastRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "nextRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AutomationDto": {
        "type": "object",
        "required": [
          "automationKey",
          "enabled",
          "config",
          "kind",
          "scheduleKind",
          "description"
        ],
        "properties": {
          "automationKey": {
            "type": "string"
          },
          "config": {},
          "defaultDay": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "kind": {
            "type": "string"
          },
          "lastRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "nextRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "scheduleKind": {
            "type": "string"
          }
        }
      },
      "BWAExpenses": {
        "type": "object",
        "required": [
          "total_expenses",
          "expense_breakdown"
        ],
        "properties": {
          "expense_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseItem"
            }
          },
          "total_expenses": {
            "type": "string"
          }
        }
      },
      "BWAReport": {
        "type": "object",
        "required": [
          "period",
          "generated_at",
          "revenue",
          "expenses",
          "summary"
        ],
        "properties": {
          "expenses": {
            "$ref": "#/components/schemas/BWAExpenses"
          },
          "generated_at": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "revenue": {
            "$ref": "#/components/schemas/BWARevenue"
          },
          "summary": {
            "$ref": "#/components/schemas/BWASummary"
          }
        }
      },
      "BWARevenue": {
        "type": "object",
        "required": [
          "total_revenue",
          "revenue_breakdown"
        ],
        "properties": {
          "revenue_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RevenueItem"
            }
          },
          "total_revenue": {
            "type": "string"
          }
        }
      },
      "BWASummary": {
        "type": "object",
        "required": [
          "gross_profit",
          "net_profit",
          "profit_margin",
          "open_invoices_count",
          "open_invoices_total",
          "overdue_invoices_count",
          "overdue_invoices_total"
        ],
        "properties": {
          "gross_profit": {
            "type": "string"
          },
          "net_profit": {
            "type": "string"
          },
          "open_invoices_count": {
            "type": "integer",
            "format": "int64"
          },
          "open_invoices_total": {
            "type": "string"
          },
          "overdue_invoices_count": {
            "type": "integer",
            "format": "int64"
          },
          "overdue_invoices_total": {
            "type": "string"
          },
          "profit_margin": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "BalanceItem": {
        "type": "object",
        "required": [
          "account",
          "account_name",
          "amount"
        ],
        "properties": {
          "account": {
            "type": "string"
          },
          "account_name": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          }
        }
      },
      "BalanceSheet": {
        "type": "object",
        "required": [
          "total_assets",
          "total_equity_liabilities",
          "balanced",
          "assets",
          "equity_liabilities"
        ],
        "properties": {
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceItem"
            }
          },
          "balanced": {
            "type": "boolean"
          },
          "equity_liabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceItem"
            }
          },
          "total_assets": {
            "type": "string"
          },
          "total_equity_liabilities": {
            "type": "string"
          }
        }
      },
      "BankLookup": {
        "type": "object",
        "required": [
          "iban",
          "psd2_supported"
        ],
        "properties": {
          "bank_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "bic": {
            "type": [
              "string",
              "null"
            ]
          },
          "iban": {
            "type": "string"
          },
          "nextgenpsd2_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "psd2_supported": {
            "type": "boolean"
          }
        }
      },
      "Betriebsstaette": {
        "type": "object",
        "description": "Eine Betriebsstätte mit der Anzahl der sozialversicherungspflichtig\nBeschäftigten (Jahresdurchschnitt des Vorjahres).",
        "required": [
          "name",
          "beschaefigte"
        ],
        "properties": {
          "beschaefigte": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "name": {
            "type": "string"
          }
        }
      },
      "BetriebsstaettenDetail": {
        "type": "object",
        "required": [
          "name",
          "beschaefigte",
          "monatlicher_beitrag"
        ],
        "properties": {
          "beschaefigte": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "monatlicher_beitrag": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "BilanzItem": {
        "type": "object",
        "required": [
          "konto",
          "name",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "string"
          },
          "konto": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "BilanzReport": {
        "type": "object",
        "required": [
          "period",
          "generated_at",
          "aktiva",
          "total_aktiva",
          "passiva",
          "total_passiva",
          "balanced"
        ],
        "properties": {
          "aktiva": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BilanzItem"
            }
          },
          "balanced": {
            "type": "boolean"
          },
          "generated_at": {
            "type": "string"
          },
          "passiva": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BilanzItem"
            }
          },
          "period": {
            "type": "string"
          },
          "total_aktiva": {
            "type": "string"
          },
          "total_passiva": {
            "type": "string"
          }
        }
      },
      "Bom": {
        "type": "object",
        "required": [
          "name",
          "productId"
        ],
        "properties": {
          "components": {
            "description": "JSON array of `{product_id, name, quantity, unit, scrap_rate}`."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "outputQuantity": {
            "type": "integer",
            "format": "int64",
            "description": "Output quantity per production run (defaults to 1)."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "The finished product this BOM produces.\nReferences the product entity."
          },
          "status": {
            "$ref": "#/components/schemas/BomStatus",
            "description": "One of: draft | active | archived"
          }
        }
      },
      "BomCreate": {
        "type": "object",
        "required": [
          "name",
          "productId"
        ],
        "properties": {
          "components": {
            "description": "JSON array of `{product_id, name, quantity, unit, scrap_rate}`."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "outputQuantity": {
            "type": "integer",
            "format": "int64",
            "description": "Output quantity per production run (defaults to 1)."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "The finished product this BOM produces.\nReferences the product entity."
          },
          "status": {
            "$ref": "#/components/schemas/BomStatus",
            "description": "One of: draft | active | archived"
          }
        }
      },
      "BomStatus": {
        "type": "string",
        "description": "BOM lifecycle status.",
        "enum": [
          "draft",
          "active",
          "archived"
        ]
      },
      "BomUpdate": {
        "type": "object",
        "properties": {
          "components": {
            "description": "JSON array of `{product_id, name, quantity, unit, scrap_rate}`."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "outputQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Output quantity per production run (defaults to 1)."
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The finished product this BOM produces.\nReferences the product entity."
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BomStatus",
                "description": "One of: draft | active | archived"
              }
            ]
          }
        }
      },
      "BoxFit": {
        "type": "object",
        "required": [
          "length_cm",
          "width_cm",
          "height_cm",
          "volume_cm3",
          "item_count"
        ],
        "properties": {
          "height_cm": {
            "type": "number",
            "format": "double"
          },
          "item_count": {
            "type": "integer",
            "minimum": 0
          },
          "length_cm": {
            "type": "number",
            "format": "double"
          },
          "volume_cm3": {
            "type": "number",
            "format": "double"
          },
          "width_cm": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "Budget": {
        "type": "object",
        "required": [
          "year",
          "category",
          "monthlyGoal"
        ],
        "properties": {
          "category": {
            "type": "string",
            "description": "Posting category key (matches `category` on journal entries)."
          },
          "monthlyGoal": {
            "type": "string",
            "description": "Monthly goal amount (gross). 0 means \"no goal set\"."
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "Budget year the goal applies to."
          }
        }
      },
      "BudgetErgebnis": {
        "type": "object",
        "required": [
          "jahr",
          "monat",
          "monats_budget",
          "prognose_restjahr"
        ],
        "properties": {
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "monat": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "monats_budget": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetKategorie"
            }
          },
          "prognose_restjahr": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetKategorie"
            }
          }
        }
      },
      "BudgetGoalRequest": {
        "type": "object",
        "required": [
          "year",
          "monthly_goal"
        ],
        "properties": {
          "monthly_goal": {
            "type": "string",
            "description": "Monthly goal amount (gross). 0 means \"no goal\" (fallback to default)."
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "Budget year the goal applies to."
          }
        }
      },
      "BudgetKategorie": {
        "type": "object",
        "required": [
          "kategorie",
          "budget",
          "ist",
          "differenz"
        ],
        "properties": {
          "budget": {
            "type": "string"
          },
          "differenz": {
            "type": "string"
          },
          "goal": {
            "type": [
              "string",
              "null"
            ],
            "description": "User-set monthly goal for the category, if any."
          },
          "ist": {
            "type": "string"
          },
          "kategorie": {
            "type": "string"
          }
        }
      },
      "CartItemInput": {
        "type": "object",
        "required": [
          "product_id",
          "quantity"
        ],
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "CashflowReport": {
        "type": "object",
        "required": [
          "period",
          "operating_cashflow",
          "investing_cashflow",
          "financing_cashflow",
          "net_cashflow",
          "opening_balance",
          "closing_balance"
        ],
        "properties": {
          "closing_balance": {
            "type": "number",
            "format": "double"
          },
          "financing_cashflow": {
            "type": "number",
            "format": "double"
          },
          "investing_cashflow": {
            "type": "number",
            "format": "double"
          },
          "net_cashflow": {
            "type": "number",
            "format": "double"
          },
          "opening_balance": {
            "type": "number",
            "format": "double"
          },
          "operating_cashflow": {
            "type": "number",
            "format": "double"
          },
          "period": {
            "type": "string"
          }
        }
      },
      "CategoryTotal": {
        "type": "object",
        "required": [
          "category_id",
          "tco2e",
          "share_pct"
        ],
        "properties": {
          "category_id": {
            "type": "string"
          },
          "share_pct": {
            "type": "number",
            "format": "double"
          },
          "tco2e": {
            "type": "string"
          }
        }
      },
      "ChangePasswordRequest": {
        "type": "object",
        "required": [
          "current_password",
          "new_password"
        ],
        "properties": {
          "current_password": {
            "type": "string"
          },
          "new_password": {
            "type": "string"
          }
        }
      },
      "ChangelogEntry": {
        "type": "object",
        "description": "One changelog entry for a plugin release.",
        "required": [
          "version",
          "date",
          "notes"
        ],
        "properties": {
          "date": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "CheckStatus": {
        "type": "string",
        "enum": [
          "Ok",
          "Warning",
          "Error"
        ]
      },
      "CommunicationChannel": {
        "type": "string",
        "description": "Channel the communication took place on.",
        "enum": [
          "email",
          "call",
          "meeting",
          "chat",
          "note"
        ]
      },
      "CommunicationDirection": {
        "type": "string",
        "description": "Direction of the communication relative to the business.",
        "enum": [
          "inbound",
          "outbound"
        ]
      },
      "CompanyType": {
        "type": "string",
        "description": "Legal form / company type of the tenant.",
        "enum": [
          "gmbh",
          "ug",
          "einzelhaendler",
          "freiberufler",
          "ag",
          "gbr"
        ]
      },
      "ComplianceEntry": {
        "type": "object",
        "required": [
          "module",
          "regulations",
          "description"
        ],
        "properties": {
          "description": {
            "type": "string"
          },
          "module": {
            "type": "string"
          },
          "regulations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ComplianceTraining": {
        "type": "object",
        "properties": {
          "assignable": {
            "type": "boolean",
            "description": "Whether HR can assign this training as required for employees."
          },
          "code": {
            "type": "string",
            "description": "Stable code used by plugins and frontend players (e.g. \"data_privacy\").",
            "maxLength": 64,
            "minLength": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "passScore": {
            "type": "integer",
            "format": "int32",
            "description": "Minimum score (0–100) required to pass."
          },
          "pluginPlatform": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace plugin platform id when source = Plugin.",
            "maxLength": 64
          },
          "source": {
            "$ref": "#/components/schemas/TrainingSource"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "validityMonths": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Certificate validity in months; null = no expiry."
          }
        }
      },
      "ComplianceTrainingCreate": {
        "type": "object",
        "properties": {
          "assignable": {
            "type": "boolean",
            "description": "Whether HR can assign this training as required for employees."
          },
          "code": {
            "type": "string",
            "description": "Stable code used by plugins and frontend players (e.g. \"data_privacy\").",
            "maxLength": 64,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "passScore": {
            "type": "integer",
            "format": "int32",
            "description": "Minimum score (0–100) required to pass."
          },
          "pluginPlatform": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace plugin platform id when source = Plugin.",
            "maxLength": 64
          },
          "source": {
            "$ref": "#/components/schemas/TrainingSource"
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1
          },
          "validityMonths": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Certificate validity in months; null = no expiry."
          }
        }
      },
      "ComplianceTrainingUpdate": {
        "type": "object",
        "properties": {
          "assignable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether HR can assign this training as required for employees."
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable code used by plugins and frontend players (e.g. \"data_privacy\").",
            "maxLength": 64,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "passScore": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Minimum score (0–100) required to pass."
          },
          "pluginPlatform": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace plugin platform id when source = Plugin.",
            "maxLength": 64
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TrainingSource"
              }
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "minLength": 1
          },
          "validityMonths": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Certificate validity in months; null = no expiry."
          }
        }
      },
      "ConfigFieldInfo": {
        "type": "object",
        "description": "Owned, API-safe copy of a [`ConfigField`] for DTOs / OpenAPI\n([`ConfigField`] borrows `&'static str`, which cannot round-trip\n`Deserialize`).",
        "required": [
          "name",
          "label",
          "kind",
          "required"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/ConfigFieldKind"
          },
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "placeholder": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean"
          }
        }
      },
      "ConfigFieldKind": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "secret"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "url"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "options",
              "type"
            ],
            "properties": {
              "options": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "type": {
                "type": "string",
                "enum": [
                  "select"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "bool"
                ]
              }
            }
          }
        ]
      },
      "ConnectorType": {
        "type": "string",
        "description": "How a marketplace connector authenticates: static API key or OAuth2.",
        "enum": [
          "apikey",
          "oauth"
        ]
      },
      "Contact": {
        "type": "object",
        "required": [
          "contact_id",
          "contact_type",
          "name",
          "social_media",
          "contact_persons",
          "created_at"
        ],
        "properties": {
          "account_holder": {
            "type": [
              "string",
              "null"
            ]
          },
          "acquisition_cost": {
            "type": [
              "string",
              "null"
            ]
          },
          "address_supplement": {
            "type": [
              "string",
              "null"
            ]
          },
          "attention": {
            "type": [
              "string",
              "null"
            ]
          },
          "bank_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "bic": {
            "type": [
              "string",
              "null"
            ]
          },
          "buyer_reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "certificate_authority": {
            "type": [
              "string",
              "null"
            ]
          },
          "certificate_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "certificate_paragraph": {
            "type": [
              "string",
              "null"
            ]
          },
          "certificate_valid_until": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_id": {
            "type": "string"
          },
          "contact_persons": {},
          "contact_type": {
            "type": "string"
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "readOnly": true
          },
          "credit_limit": {
            "type": [
              "string",
              "null"
            ]
          },
          "creditor_account_skr03": {
            "type": [
              "string",
              "null"
            ]
          },
          "creditor_account_skr04": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "debitor_account_skr03": {
            "type": [
              "string",
              "null"
            ]
          },
          "debitor_account_skr04": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_debitor_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_block": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "department": {
            "type": [
              "string",
              "null"
            ]
          },
          "discount_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "discount_percentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "donation_receipt_eligible": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "fax": {
            "type": [
              "string",
              "null"
            ]
          },
          "iban": {
            "type": [
              "string",
              "null"
            ]
          },
          "industry": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "is_member": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "is_nonprofit": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "last_contact_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_purchase_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "leitweg_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "lifetime_value": {
            "type": [
              "string",
              "null"
            ]
          },
          "mandate_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "mandate_reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketing_consent": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "marketing_consent_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketing_consent_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "mobile": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "next_contact_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "opening_balance": {
            "type": [
              "string",
              "null"
            ]
          },
          "opening_balance_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "order_reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_block": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "payment_grace_period_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "payment_methods": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "payment_terms": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "rating": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "sales_representative": {
            "type": [
              "string",
              "null"
            ]
          },
          "social_media": {},
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": [
              "string",
              "null"
            ]
          },
          "street": {
            "type": [
              "string",
              "null"
            ]
          },
          "street_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "supplier_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "tax_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_office": {
            "type": [
              "string",
              "null"
            ]
          },
          "total_invoices": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "total_revenue": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "vat_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "vat_id_validated": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "vat_id_validation_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "zip": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ContactCreate": {
        "type": "object",
        "required": [
          "contactType",
          "name"
        ],
        "properties": {
          "accountHolder": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "acquisitionCost": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressSupplement": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "attention": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "bankName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "bic": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$"
          },
          "buyerReference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "certificateAuthority": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "certificateNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "certificateParagraph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "certificateValidUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "companyName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "contactPersons": {},
          "contactType": {
            "$ref": "#/components/schemas/ContactType"
          },
          "country": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "creditLimit": {
            "type": [
              "string",
              "null"
            ]
          },
          "creditorAccountSkr03": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "creditorAccountSkr04": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 3
          },
          "customFields": {},
          "customerNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "debitorAccountSkr03": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "debitorAccountSkr04": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "defaultDebitorNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "deliveryBlock": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "department": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "discountDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 365,
            "minimum": 0
          },
          "discountPercentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "donationReceiptEligible": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "fax": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "iban": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2}\\d{2}[A-Z0-9]{4,30}$"
          },
          "industry": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "isMember": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "isNonprofit": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "lastContactDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lastPurchaseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "leitwegId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "lifetimeValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "mandateDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "mandateReference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 35
          },
          "marketingConsent": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "marketingConsentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "marketingConsentSource": {
            "type": [
              "string",
              "null"
            ]
          },
          "mobile": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "nextContactDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10000
          },
          "openingBalance": {
            "type": [
              "string",
              "null"
            ]
          },
          "openingBalanceDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "orderReference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "paymentBlock": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "paymentGracePeriodDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 365,
            "minimum": 0
          },
          "paymentMethods": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "paymentTerms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "rating": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 5,
            "minimum": 1
          },
          "salesRepresentative": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "sepaBatchBooking": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "sepaSequenceType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SepaSequenceType"
              }
            ]
          },
          "socialMedia": {},
          "source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "streetNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "supplierNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "taxCountry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "taxNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30
          },
          "taxOffice": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "totalInvoices": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "totalRevenue": {
            "type": [
              "string",
              "null"
            ]
          },
          "vatId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2}[0-9A-Z]{8,15}$"
          },
          "vatIdValidated": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "vatIdValidationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          }
        }
      },
      "ContactHistoryResponse": {
        "type": "object",
        "description": "Aggregated history for a single contact: all communications plus a\nlightweight per-channel breakdown.",
        "required": [
          "contactId",
          "items",
          "inboundCount",
          "outboundCount"
        ],
        "properties": {
          "contactId": {
            "type": "string"
          },
          "inboundCount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCommunication"
            }
          },
          "outboundCount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ContactInfo": {
        "type": "object",
        "required": [
          "role",
          "roleEn",
          "hint",
          "hintEn"
        ],
        "properties": {
          "hint": {
            "type": "string"
          },
          "hintEn": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "roleEn": {
            "type": "string"
          }
        }
      },
      "ContactTimelineResponse": {
        "type": "object",
        "description": "Aggregated per-contact timeline.",
        "required": [
          "contactId",
          "events"
        ],
        "properties": {
          "contactId": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimelineEvent"
            }
          }
        }
      },
      "ContactType": {
        "type": "string",
        "description": "Contact category: customer or supplier.",
        "enum": [
          "customer",
          "supplier"
        ]
      },
      "ContactUpdate": {
        "type": "object",
        "properties": {
          "accountHolder": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "acquisitionCost": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressSupplement": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "attention": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "bankName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "bic": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$"
          },
          "buyerReference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "certificateAuthority": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "certificateNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "certificateParagraph": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "certificateValidUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "companyName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "contactPersons": {},
          "contactType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ContactType"
              }
            ]
          },
          "country": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "creditLimit": {
            "type": [
              "string",
              "null"
            ]
          },
          "creditorAccountSkr03": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "creditorAccountSkr04": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 3
          },
          "customFields": {},
          "customerNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "debitorAccountSkr03": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "debitorAccountSkr04": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "defaultDebitorNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "deliveryBlock": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "department": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "discountDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 365,
            "minimum": 0
          },
          "discountPercentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "donationReceiptEligible": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "fax": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "iban": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2}\\d{2}[A-Z0-9]{4,30}$"
          },
          "industry": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "isMember": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "isNonprofit": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "lastContactDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lastPurchaseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "leitwegId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "lifetimeValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "mandateDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "mandateReference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 35
          },
          "marketingConsent": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "marketingConsentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "marketingConsentSource": {
            "type": [
              "string",
              "null"
            ]
          },
          "mobile": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "minLength": 1
          },
          "nextContactDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10000
          },
          "openingBalance": {
            "type": [
              "string",
              "null"
            ]
          },
          "openingBalanceDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "orderReference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "paymentBlock": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "paymentGracePeriodDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 365,
            "minimum": 0
          },
          "paymentMethods": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "paymentTerms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "rating": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 5,
            "minimum": 1
          },
          "salesRepresentative": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "sepaBatchBooking": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "sepaSequenceType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SepaSequenceType"
              }
            ]
          },
          "socialMedia": {},
          "source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "street": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "streetNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "supplierNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "taxCountry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "taxNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30
          },
          "taxOffice": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "totalInvoices": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "totalRevenue": {
            "type": [
              "string",
              "null"
            ]
          },
          "vatId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2}[0-9A-Z]{8,15}$"
          },
          "vatIdValidated": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "vatIdValidationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          }
        }
      },
      "ConvertResponse": {
        "type": "object",
        "description": "Response of the proforma → invoice conversion.",
        "required": [
          "proformaId",
          "proformaNumber",
          "invoiceId",
          "invoiceNumber"
        ],
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "proformaId": {
            "type": "string"
          },
          "proformaNumber": {
            "type": "string"
          }
        }
      },
      "CostingLine": {
        "type": "object",
        "description": "A single costing line: material cost for one BOM component.",
        "required": [
          "productId",
          "name",
          "sku",
          "quantityPerUnit",
          "totalQuantity",
          "lineCost"
        ],
        "properties": {
          "lineCost": {
            "type": "string",
            "description": "total_quantity × unit_purchase_price (0 when price unknown)."
          },
          "name": {
            "type": "string"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "quantityPerUnit": {
            "type": "integer",
            "format": "int64",
            "description": "Component quantity required per finished unit."
          },
          "sku": {
            "type": "string"
          },
          "totalQuantity": {
            "type": "integer",
            "format": "int64",
            "description": "Total component quantity consumed by this order."
          },
          "unitPurchasePrice": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CountryCode": {
        "type": "string",
        "enum": [
          "ABW",
          "AFG",
          "AGO",
          "AIA",
          "ALA",
          "ALB",
          "AND",
          "ARE",
          "ARG",
          "ARM",
          "ASM",
          "ATA",
          "ATF",
          "ATG",
          "AUS",
          "AUT",
          "AZE",
          "BDI",
          "BEL",
          "BEN",
          "BES",
          "BFA",
          "BGD",
          "BGR",
          "BHR",
          "BHS",
          "BIH",
          "BLM",
          "BLR",
          "BLZ",
          "BMU",
          "BOL",
          "BRA",
          "BRB",
          "BRN",
          "BTN",
          "BVT",
          "BWA",
          "CAF",
          "CAN",
          "CCK",
          "CHE",
          "CHL",
          "CHN",
          "CIV",
          "CMR",
          "COD",
          "COG",
          "COK",
          "COL",
          "COM",
          "CPV",
          "CRI",
          "CUB",
          "CUW",
          "CXR",
          "CYM",
          "CYP",
          "CZE",
          "DEU",
          "DJI",
          "DMA",
          "DNK",
          "DOM",
          "DZA",
          "ECU",
          "EGY",
          "ERI",
          "ESH",
          "ESP",
          "EST",
          "ETH",
          "FIN",
          "FJI",
          "FLK",
          "FRA",
          "FRO",
          "FSM",
          "GAB",
          "GBR",
          "GEO",
          "GGY",
          "GHA",
          "GIB",
          "GIN",
          "GLP",
          "GMB",
          "GNB",
          "GNQ",
          "GRC",
          "GRD",
          "GRL",
          "GTM",
          "GUF",
          "GUM",
          "GUY",
          "HKG",
          "HMD",
          "HND",
          "HRV",
          "HTI",
          "HUN",
          "IDN",
          "IMN",
          "IND",
          "IOT",
          "IRL",
          "IRN",
          "IRQ",
          "ISL",
          "ISR",
          "ITA",
          "JAM",
          "JEY",
          "JOR",
          "JPN",
          "KAZ",
          "KEN",
          "KGZ",
          "KHM",
          "KIR",
          "KNA",
          "KOR",
          "KWT",
          "LAO",
          "LBN",
          "LBR",
          "LBY",
          "LCA",
          "LIE",
          "LKA",
          "LSO",
          "LTU",
          "LUX",
          "LVA",
          "MAC",
          "MAF",
          "MAR",
          "MCO",
          "MDA",
          "MDG",
          "MDV",
          "MEX",
          "MHL",
          "MKD",
          "MLI",
          "MLT",
          "MMR",
          "MNE",
          "MNG",
          "MNP",
          "MOZ",
          "MRT",
          "MSR",
          "MTQ",
          "MUS",
          "MWI",
          "MYS",
          "MYT",
          "NAM",
          "NCL",
          "NER",
          "NFK",
          "NGA",
          "NIC",
          "NIU",
          "NLD",
          "NOR",
          "NPL",
          "NRU",
          "NZL",
          "OMN",
          "PAK",
          "PAN",
          "PCN",
          "PER",
          "PHL",
          "PLW",
          "PNG",
          "POL",
          "PRI",
          "PRK",
          "PRT",
          "PRY",
          "PSE",
          "PYF",
          "QAT",
          "REU",
          "ROU",
          "RUS",
          "RWA",
          "SAU",
          "SDN",
          "SEN",
          "SGP",
          "SGS",
          "SHN",
          "SJM",
          "SLB",
          "SLE",
          "SLV",
          "SMR",
          "SOM",
          "SPM",
          "SRB",
          "SSD",
          "STP",
          "SUR",
          "SVK",
          "SVN",
          "SWE",
          "SWZ",
          "SXM",
          "SYC",
          "SYR",
          "TCA",
          "TCD",
          "TGO",
          "THA",
          "TJK",
          "TKL",
          "TKM",
          "TLS",
          "TON",
          "TTO",
          "TUN",
          "TUR",
          "TUV",
          "TWN",
          "TZA",
          "UGA",
          "UKR",
          "UMI",
          "URY",
          "USA",
          "UZB",
          "VAT",
          "VCT",
          "VEN",
          "VGB",
          "VIR",
          "VNM",
          "VUT",
          "WLF",
          "WSM",
          "YEM",
          "ZAF",
          "ZMB",
          "ZWE"
        ]
      },
      "Coupon": {
        "type": "object",
        "required": [
          "code",
          "discountType",
          "discountValue"
        ],
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "discountType": {
            "$ref": "#/components/schemas/DiscountType"
          },
          "discountValue": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "isCombineable": {
            "type": "boolean"
          },
          "maxDiscountAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "maxUses": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "maxUsesPerCustomer": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "minOrderAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "productIds": {},
          "startsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CouponCreate": {
        "type": "object",
        "required": [
          "code",
          "discountType",
          "discountValue"
        ],
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "discountType": {
            "$ref": "#/components/schemas/DiscountType"
          },
          "discountValue": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "isCombineable": {
            "type": "boolean"
          },
          "maxDiscountAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "maxUses": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "maxUsesPerCustomer": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "minOrderAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "productIds": {},
          "startsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CouponUpdate": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "discountType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DiscountType"
              }
            ]
          },
          "discountValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "isCombineable": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "maxDiscountAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "maxUses": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "maxUsesPerCustomer": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "minOrderAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "productIds": {},
          "startsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CouponValidation": {
        "type": "object",
        "required": [
          "valid",
          "code",
          "discount_type",
          "discount_value",
          "discounted_amount"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "discount_type": {
            "type": "string"
          },
          "discount_value": {
            "type": "string"
          },
          "discounted_amount": {
            "type": "string"
          },
          "max_discount_amount": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "valid": {
            "type": "boolean"
          }
        }
      },
      "CreateChannelDto": {
        "type": "object",
        "required": [
          "channel_type",
          "name",
          "config"
        ],
        "properties": {
          "channel_type": {
            "type": "string"
          },
          "config": {},
          "name": {
            "type": "string"
          }
        }
      },
      "CreateConnectionRequest": {
        "type": "object",
        "required": [
          "platform",
          "label"
        ],
        "properties": {
          "api_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_secret": {
            "type": [
              "string",
              "null"
            ]
          },
          "config": {},
          "label": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "shop_domain": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CreateEmissionEntry": {
        "type": "object",
        "required": [
          "year",
          "scope",
          "category_id",
          "description",
          "activity_value",
          "unit",
          "method"
        ],
        "properties": {
          "activity_value": {
            "type": "string"
          },
          "category_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "CreateEmissionTarget": {
        "type": "object",
        "required": [
          "scope",
          "base_year",
          "base_value",
          "target_year",
          "target_value",
          "description"
        ],
        "properties": {
          "base_value": {
            "type": "string"
          },
          "base_year": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "target_value": {
            "type": "string"
          },
          "target_year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "CreateShipmentRequest": {
        "type": "object",
        "required": [
          "carrier"
        ],
        "properties": {
          "carrier": {
            "type": "string",
            "description": "Carrier name as configured in shipping settings: `ups` or `dhl`."
          },
          "service": {
            "type": [
              "string",
              "null"
            ]
          },
          "weight_kg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "CreateSubscriptionRequest": {
        "type": "object",
        "required": [
          "name",
          "event_type",
          "url"
        ],
        "properties": {
          "event_type": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "CreateTicketRequest": {
        "type": "object",
        "description": "Request body for creating a support ticket.\nWraps the generated `SupportTicketCreateDto` fields plus `message_body`\nwhich is not a Model field (used to create the initial `ticket_message`).",
        "required": [
          "subject",
          "message_body"
        ],
        "properties": {
          "channel_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "channel_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_body": {
            "type": "string"
          },
          "order_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": "string"
          }
        }
      },
      "CurrencyCode": {
        "type": "string",
        "enum": [
          "ADP",
          "AED",
          "AFA",
          "AFN",
          "ALL",
          "AMD",
          "ANG",
          "AOA",
          "AOK",
          "AOR",
          "ARS",
          "ATS",
          "AUD",
          "AWG",
          "AZM",
          "AZN",
          "BAD",
          "BAM",
          "BBD",
          "BDT",
          "BEC",
          "BEF",
          "BEL",
          "BGJ",
          "BGN",
          "BHD",
          "BIF",
          "BMD",
          "BND",
          "BOB",
          "BOV",
          "BRB",
          "BRL",
          "BRR",
          "BSD",
          "BTN",
          "BWP",
          "BYB",
          "BYN",
          "BYR",
          "BZD",
          "CAD",
          "CDF",
          "CHE",
          "CHF",
          "CHW",
          "CLF",
          "CLP",
          "CNY",
          "COP",
          "COU",
          "CRC",
          "CSD",
          "CSK",
          "CUC",
          "CUP",
          "CVE",
          "CYP",
          "CZK",
          "DDM",
          "DJF",
          "DKK",
          "DOP",
          "DZD",
          "ECS",
          "ECV",
          "EEK",
          "EGP",
          "ERN",
          "ESA",
          "ESB",
          "ESP",
          "ETB",
          "EUR",
          "FIM",
          "FJD",
          "FKP",
          "FRF",
          "GBP",
          "GEK",
          "GEL",
          "GHC",
          "GHP",
          "GHS",
          "GIP",
          "GMD",
          "GNF",
          "GQE",
          "GRD",
          "GTQ",
          "GWE",
          "GYD",
          "HKD",
          "HNL",
          "HRD",
          "HTG",
          "HUF",
          "IDR",
          "IEP",
          "ILS",
          "INR",
          "IQD",
          "IRR",
          "ISK",
          "ITL",
          "JMD",
          "JOD",
          "JPY",
          "KES",
          "KGS",
          "KHR",
          "KMF",
          "KPW",
          "KRW",
          "KWD",
          "KYD",
          "KZT",
          "LAK",
          "LBP",
          "LKR",
          "LRD",
          "LSL",
          "LTL",
          "LUC",
          "LUF",
          "LUL",
          "LVL",
          "LYD",
          "MAD",
          "MDL",
          "MGA",
          "MGF",
          "MKD",
          "MLF",
          "MMK",
          "MNT",
          "MOP",
          "MRO",
          "MRU",
          "MTL",
          "MUR",
          "MVR",
          "MWK",
          "MXN",
          "MXV",
          "MYR",
          "MZE",
          "MZN",
          "NAD",
          "NGN",
          "NIO",
          "NLG",
          "NOK",
          "NPR",
          "NZD",
          "OMR",
          "PAB",
          "PEN",
          "PGK",
          "PHP",
          "PKR",
          "PLN",
          "PLZ",
          "PTE",
          "PYG",
          "QAR",
          "RHD",
          "ROK",
          "RON",
          "RSD",
          "RUB",
          "RUR",
          "RWF",
          "SAR",
          "SBD",
          "SCR",
          "SDD",
          "SDG",
          "SEK",
          "SGD",
          "SHP",
          "SIT",
          "SKK",
          "SLE",
          "SLL",
          "SOS",
          "SRD",
          "SRG",
          "SSP",
          "STD",
          "STN",
          "SVC",
          "SYP",
          "SZL",
          "THB",
          "TJR",
          "TJS",
          "TMM",
          "TMT",
          "TND",
          "TOP",
          "TPE",
          "TRL",
          "TRY",
          "TTD",
          "TWD",
          "TZS",
          "UAH",
          "UAK",
          "UGX",
          "USD",
          "USN",
          "USS",
          "UYI",
          "UYU",
          "UYW",
          "UZS",
          "VEB",
          "VED",
          "VEF",
          "VES",
          "VND",
          "VUV",
          "WST",
          "XAD",
          "XAF",
          "XAG",
          "XAU",
          "XBA",
          "XBB",
          "XBC",
          "XBD",
          "XCD",
          "XDR",
          "XEU",
          "XOF",
          "XPD",
          "XPF",
          "XPT",
          "XSU",
          "XTS",
          "XUA",
          "XXX",
          "YDD",
          "YER",
          "YUD",
          "ZAL",
          "ZAR",
          "ZMK",
          "ZMW",
          "ZRN",
          "ZWG",
          "ZWL",
          "ZWN",
          "ZWR"
        ]
      },
      "CurrentInventoryValue": {
        "type": "object",
        "required": [
          "total_purchase_value",
          "total_sales_value",
          "product_count",
          "history"
        ],
        "properties": {
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryValuePoint"
            }
          },
          "product_count": {
            "type": "integer",
            "format": "int64"
          },
          "total_purchase_value": {
            "type": "string"
          },
          "total_sales_value": {
            "type": "string"
          }
        }
      },
      "Customer": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "address": {},
          "contactPerson": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "externalOrderNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "paymentGracePeriodDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 365,
            "minimum": 0
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "vatId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2}[0-9A-Z]{8,15}$"
          }
        }
      },
      "CustomerCommunication": {
        "type": "object",
        "required": [
          "contactId",
          "channel",
          "direction"
        ],
        "properties": {
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "The message body, call summary or note text."
          },
          "channel": {
            "$ref": "#/components/schemas/CommunicationChannel"
          },
          "contactId": {
            "type": "string",
            "description": "The contact (customer/supplier) this communication belongs to.\nReferences the contact entity."
          },
          "counterparty": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email/phone of the counterparty, if applicable."
          },
          "direction": {
            "$ref": "#/components/schemas/CommunicationDirection"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the communication happened (defaults to now on create)."
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "description": "Free-form tags, e.g. `[\"follow-up-required\"]`."
          }
        }
      },
      "CustomerCommunicationCreate": {
        "type": "object",
        "required": [
          "contactId",
          "channel",
          "direction"
        ],
        "properties": {
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "The message body, call summary or note text."
          },
          "channel": {
            "$ref": "#/components/schemas/CommunicationChannel"
          },
          "contactId": {
            "type": "string",
            "description": "The contact (customer/supplier) this communication belongs to.\nReferences the contact entity."
          },
          "counterparty": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email/phone of the counterparty, if applicable."
          },
          "direction": {
            "$ref": "#/components/schemas/CommunicationDirection"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the communication happened (defaults to now on create)."
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "description": "Free-form tags, e.g. `[\"follow-up-required\"]`."
          }
        }
      },
      "CustomerCommunicationUpdate": {
        "type": "object",
        "properties": {
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "The message body, call summary or note text."
          },
          "channel": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CommunicationChannel"
              }
            ]
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The contact (customer/supplier) this communication belongs to.\nReferences the contact entity."
          },
          "counterparty": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email/phone of the counterparty, if applicable."
          },
          "direction": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CommunicationDirection"
              }
            ]
          },
          "occurredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the communication happened (defaults to now on create)."
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "description": "Free-form tags, e.g. `[\"follow-up-required\"]`."
          }
        }
      },
      "CustomerCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "address": {},
          "contactPerson": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "externalOrderNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "paymentGracePeriodDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 365,
            "minimum": 0
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "vatId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2}[0-9A-Z]{8,15}$"
          }
        }
      },
      "CustomerGroup": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "memberIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Contact ids that are members of this group."
          },
          "membershipFilter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rule description for membership, e.g. \"orders > 5 last 12 months\"."
          },
          "name": {
            "type": "string",
            "description": "Unique group name, e.g. \"VIP\", \"Wholesale\", \"Newsletter\"."
          }
        }
      },
      "CustomerGroupCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "memberIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Contact ids that are members of this group."
          },
          "membershipFilter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rule description for membership, e.g. \"orders > 5 last 12 months\"."
          },
          "name": {
            "type": "string",
            "description": "Unique group name, e.g. \"VIP\", \"Wholesale\", \"Newsletter\"."
          }
        }
      },
      "CustomerGroupUpdate": {
        "type": "object",
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "memberIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Contact ids that are members of this group."
          },
          "membershipFilter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rule description for membership, e.g. \"orders > 5 last 12 months\"."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Unique group name, e.g. \"VIP\", \"Wholesale\", \"Newsletter\"."
          }
        }
      },
      "CustomerInfo": {
        "type": "object",
        "description": "Additional information about the customer placing the shipment.",
        "required": [
          "is_registered",
          "annual_volume"
        ],
        "properties": {
          "annual_volume": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "is_registered": {
            "type": "boolean"
          }
        }
      },
      "CustomerUpdate": {
        "type": "object",
        "properties": {
          "address": {},
          "contactPerson": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "externalOrderNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "minLength": 1
          },
          "paymentGracePeriodDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "maximum": 365,
            "minimum": 0
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "vatId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2}[0-9A-Z]{8,15}$"
          }
        }
      },
      "DataQuality": {
        "type": "object",
        "required": [
          "activity_lines",
          "spend_lines",
          "activity_share_pct"
        ],
        "properties": {
          "activity_lines": {
            "type": "integer",
            "minimum": 0
          },
          "activity_share_pct": {
            "type": "number",
            "format": "double"
          },
          "spend_lines": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "DatevBookingPreview": {
        "type": "object",
        "required": [
          "document_date",
          "account_number",
          "opposite_account",
          "debit_credit",
          "net_amount",
          "document_text"
        ],
        "properties": {
          "account_number": {
            "type": "string"
          },
          "debit_credit": {
            "type": "string"
          },
          "document_date": {
            "type": "string"
          },
          "document_text": {
            "type": "string"
          },
          "net_amount": {
            "type": "string"
          },
          "opposite_account": {
            "type": "string"
          },
          "tax_amount": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_rate": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DatevExportResponse": {
        "type": "object",
        "required": [
          "csv_content",
          "filename",
          "booking_count"
        ],
        "properties": {
          "booking_count": {
            "type": "integer",
            "minimum": 0
          },
          "csv_content": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "DatevImportResponse": {
        "type": "object",
        "required": [
          "rows",
          "count",
          "filename"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "filename": {
            "type": "string"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DatevImportRow"
            }
          }
        }
      },
      "DatevImportRow": {
        "type": "object",
        "required": [
          "amount",
          "debit_credit",
          "currency",
          "exchange_rate",
          "base_amount",
          "base_currency",
          "account",
          "opposite_account",
          "bu_key",
          "document_date",
          "document_number",
          "document_field2",
          "discount",
          "booking_text",
          "cost_center1",
          "cost_center2",
          "eu_country_vat_id",
          "eu_tax_rate"
        ],
        "properties": {
          "account": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "base_amount": {
            "type": "string"
          },
          "base_currency": {
            "type": "string"
          },
          "booking_text": {
            "type": "string"
          },
          "bu_key": {
            "type": "string"
          },
          "cost_center1": {
            "type": "string"
          },
          "cost_center2": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "debit_credit": {
            "type": "string"
          },
          "discount": {
            "type": "string"
          },
          "document_date": {
            "type": "string"
          },
          "document_field2": {
            "type": "string"
          },
          "document_number": {
            "type": "string"
          },
          "eu_country_vat_id": {
            "type": "string"
          },
          "eu_tax_rate": {
            "type": "string"
          },
          "exchange_rate": {
            "type": "string"
          },
          "opposite_account": {
            "type": "string"
          }
        }
      },
      "Declaration": {
        "type": "object",
        "properties": {
          "declarationType": {
            "$ref": "#/components/schemas/DeclarationType",
            "description": "Art der Erklärung: \"dcgk\" (Entsprechenserklärung § 161 AktG) oder\n\"unternehmensfuehrung\" (Erklärung zur Unternehmensführung § 289f HGB)."
          },
          "isCurrent": {
            "type": "boolean",
            "description": "Kennzeichnet die aktuell gültige Fassung (max. eine je Mandant)."
          },
          "text": {
            "type": "string",
            "description": "Inhalt der Erklärung als Markdown.",
            "maxLength": 20000,
            "minLength": 1
          },
          "validFrom": {
            "type": "string",
            "format": "date",
            "description": "Datum, ab dem die Erklärung gilt."
          },
          "version": {
            "type": "string",
            "description": "Versionsbezeichnung der Erklärung (z.B. \"2025-01\").",
            "maxLength": 50,
            "minLength": 1
          }
        }
      },
      "DeclarationCreate": {
        "type": "object",
        "properties": {
          "declarationType": {
            "$ref": "#/components/schemas/DeclarationType",
            "description": "Art der Erklärung: \"dcgk\" (Entsprechenserklärung § 161 AktG) oder\n\"unternehmensfuehrung\" (Erklärung zur Unternehmensführung § 289f HGB)."
          },
          "isCurrent": {
            "type": "boolean",
            "description": "Kennzeichnet die aktuell gültige Fassung (max. eine je Mandant)."
          },
          "text": {
            "type": "string",
            "description": "Inhalt der Erklärung als Markdown.",
            "maxLength": 20000,
            "minLength": 1
          },
          "validFrom": {
            "type": "string",
            "format": "date",
            "description": "Datum, ab dem die Erklärung gilt."
          },
          "version": {
            "type": "string",
            "description": "Versionsbezeichnung der Erklärung (z.B. \"2025-01\").",
            "maxLength": 50,
            "minLength": 1
          }
        }
      },
      "DeclarationType": {
        "type": "string",
        "description": "Art der Erklärung: \"dcgk\" (Entsprechenserklärung § 161 AktG) oder\n\"unternehmensfuehrung\" (Erklärung zur Unternehmensführung § 289f HGB).",
        "enum": [
          "dcgk",
          "unternehmensfuehrung"
        ]
      },
      "DeclarationUpdate": {
        "type": "object",
        "properties": {
          "declarationType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DeclarationType",
                "description": "Art der Erklärung: \"dcgk\" (Entsprechenserklärung § 161 AktG) oder\n\"unternehmensfuehrung\" (Erklärung zur Unternehmensführung § 289f HGB)."
              }
            ]
          },
          "isCurrent": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Kennzeichnet die aktuell gültige Fassung (max. eine je Mandant)."
          },
          "text": {
            "type": [
              "string",
              "null"
            ],
            "description": "Inhalt der Erklärung als Markdown.",
            "maxLength": 20000,
            "minLength": 1
          },
          "validFrom": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Datum, ab dem die Erklärung gilt."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Versionsbezeichnung der Erklärung (z.B. \"2025-01\").",
            "maxLength": 50,
            "minLength": 1
          }
        }
      },
      "DeliverableResponse": {
        "type": "object",
        "required": [
          "productId",
          "availableStock",
          "reservedStock",
          "deliverableQuantity"
        ],
        "properties": {
          "availableStock": {
            "type": "integer",
            "format": "int64"
          },
          "deliverableQuantity": {
            "type": "integer",
            "format": "int64"
          },
          "maxSellable": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "reservedStock": {
            "type": "integer",
            "format": "int64"
          },
          "warehouseId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DeliveryAppointment": {
        "type": "object",
        "required": [
          "warehouseId",
          "supplierName",
          "email",
          "requestedDate",
          "status"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestedDate": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/DeliveryAppointmentStatus",
            "description": "One of: requested | confirmed | arrived | cancelled | completed"
          },
          "supplierName": {
            "type": "string"
          },
          "timeSlot": {
            "type": [
              "string",
              "null"
            ],
            "description": "e.g. \"08:00-10:00\""
          },
          "warehouseId": {
            "type": "string",
            "description": "References the warehouse entity."
          }
        }
      },
      "DeliveryAppointmentCreate": {
        "type": "object",
        "required": [
          "warehouseId",
          "supplierName",
          "email",
          "requestedDate",
          "status"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestedDate": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/DeliveryAppointmentStatus",
            "description": "One of: requested | confirmed | arrived | cancelled | completed"
          },
          "supplierName": {
            "type": "string"
          },
          "timeSlot": {
            "type": [
              "string",
              "null"
            ],
            "description": "e.g. \"08:00-10:00\""
          },
          "warehouseId": {
            "type": "string",
            "description": "References the warehouse entity."
          }
        }
      },
      "DeliveryAppointmentStatus": {
        "type": "string",
        "description": "Delivery appointment status.",
        "enum": [
          "requested",
          "confirmed",
          "arrived",
          "cancelled",
          "completed"
        ]
      },
      "DeliveryDate": {
        "type": "object",
        "required": [
          "orderNumber",
          "promisedDate",
          "status"
        ],
        "properties": {
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "fulfilledDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date actually delivered (set on fulfillment)."
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": "string",
            "description": "Sales order number (`order.order_number`)."
          },
          "originalDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Original date promised before rescheduling."
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product line item this date applies to, if per-item.\nReferences the product entity."
          },
          "promisedDate": {
            "type": "string",
            "format": "date",
            "description": "Date promised to the customer."
          },
          "status": {
            "$ref": "#/components/schemas/DeliveryDateStatus",
            "description": "One of: promised | confirmed | rescheduled | fulfilled | late | cancelled"
          }
        }
      },
      "DeliveryDateCreate": {
        "type": "object",
        "required": [
          "orderNumber",
          "promisedDate",
          "status"
        ],
        "properties": {
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "fulfilledDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date actually delivered (set on fulfillment)."
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": "string",
            "description": "Sales order number (`order.order_number`)."
          },
          "originalDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Original date promised before rescheduling."
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product line item this date applies to, if per-item.\nReferences the product entity."
          },
          "promisedDate": {
            "type": "string",
            "format": "date",
            "description": "Date promised to the customer."
          },
          "status": {
            "$ref": "#/components/schemas/DeliveryDateStatus",
            "description": "One of: promised | confirmed | rescheduled | fulfilled | late | cancelled"
          }
        }
      },
      "DeliveryDateStatus": {
        "type": "string",
        "description": "Delivery date status.",
        "enum": [
          "promised",
          "confirmed",
          "rescheduled",
          "fulfilled",
          "late",
          "cancelled"
        ]
      },
      "DeliveryDateStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "DeliveryDateUpdate": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "fulfilledDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date actually delivered (set on fulfillment)."
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sales order number (`order.order_number`)."
          },
          "originalDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Original date promised before rescheduling."
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product line item this date applies to, if per-item.\nReferences the product entity."
          },
          "promisedDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date promised to the customer."
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DeliveryDateStatus",
                "description": "One of: promised | confirmed | rescheduled | fulfilled | late | cancelled"
              }
            ]
          }
        }
      },
      "DeliveryNote": {
        "type": "object",
        "required": [
          "voucherStatus",
          "voucherDate",
          "currency"
        ],
        "properties": {
          "address": {},
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "deliveryDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "deliveryNoteNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "files": {},
          "introduction": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "precedingSalesVoucherId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the preceding sales voucher entity."
          },
          "precedingSalesVoucherType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrecedingSalesVoucherType"
              }
            ]
          },
          "remark": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "shippingMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "subtotal": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherDate": {
            "type": "string",
            "format": "date"
          },
          "voucherStatus": {
            "$ref": "#/components/schemas/VoucherStatus"
          }
        }
      },
      "DeliveryNoteCreate": {
        "type": "object",
        "required": [
          "voucherStatus",
          "voucherDate",
          "currency"
        ],
        "properties": {
          "address": {},
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "deliveryDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "deliveryNoteNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "files": {},
          "introduction": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "precedingSalesVoucherId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the preceding sales voucher entity."
          },
          "precedingSalesVoucherType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrecedingSalesVoucherType"
              }
            ]
          },
          "remark": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "shippingMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherDate": {
            "type": "string",
            "format": "date"
          },
          "voucherStatus": {
            "$ref": "#/components/schemas/VoucherStatus"
          }
        }
      },
      "DhlCredentials": {
        "type": "object",
        "required": [
          "api_key"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "DHL-API-Key from developer.dhl.com (required for tracking)."
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Client credentials from the DHL developer app; required for label creation."
          },
          "client_secret": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DiscountType": {
        "type": "string",
        "description": "Coupon discount type.",
        "enum": [
          "percentage",
          "fixed_amount"
        ]
      },
      "DocumentType": {
        "type": "string",
        "description": "Document kind of the invoice record.",
        "enum": [
          "invoice",
          "creditnote",
          "advancepayment",
          "downpaymentinvoice",
          "deliverynote",
          "orderconfirmation",
          "quotation",
          "proformainvoice"
        ]
      },
      "DownPaymentInvoice": {
        "type": "object",
        "required": [
          "id",
          "voucher_status",
          "voucher_date",
          "total_amount",
          "currency",
          "paid_amount",
          "created_at"
        ],
        "properties": {
          "contact_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "readOnly": true
          },
          "currency": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "paid_amount": {
            "type": "string"
          },
          "total_amount": {
            "type": "string"
          },
          "voucher_date": {
            "type": "string",
            "format": "date"
          },
          "voucher_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucher_status": {
            "type": "string"
          }
        }
      },
      "DpaAcceptRequest": {
        "type": "object",
        "description": "Request body to record DPA acceptance (`PUT /api/v1/gdpr/dpa`).",
        "required": [
          "version",
          "acceptedByName"
        ],
        "properties": {
          "acceptedByName": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "DpaStatus": {
        "type": "object",
        "description": "DPA acceptance status of the tenant.",
        "required": [
          "accepted"
        ],
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "acceptedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "acceptedBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DunningResult": {
        "type": "object",
        "required": [
          "invoices_processed",
          "message"
        ],
        "properties": {
          "invoices_processed": {
            "type": "integer",
            "minimum": 0
          },
          "message": {
            "type": "string"
          }
        }
      },
      "EBilanzReport": {
        "type": "object",
        "required": [
          "period",
          "generated_at",
          "balance_sheet",
          "income_statement",
          "vat_summary",
          "account_overview"
        ],
        "properties": {
          "account_overview": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountOverview"
            }
          },
          "balance_sheet": {
            "$ref": "#/components/schemas/BalanceSheet"
          },
          "generated_at": {
            "type": "string"
          },
          "income_statement": {
            "$ref": "#/components/schemas/IncomeStatement"
          },
          "period": {
            "type": "string"
          },
          "vat_summary": {
            "$ref": "#/components/schemas/VatSummary"
          }
        }
      },
      "EksErgebnis": {
        "type": "object",
        "required": [
          "zeitraum_von",
          "zeitraum_bis",
          "monate",
          "summe_einnahmen",
          "summe_ausgaben",
          "gesamtergebnis",
          "prognose_naechste_6_monate"
        ],
        "properties": {
          "gesamtergebnis": {
            "type": "string"
          },
          "monate": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EksMonatsWert"
            }
          },
          "prognose_naechste_6_monate": {
            "type": "string"
          },
          "summe_ausgaben": {
            "type": "string"
          },
          "summe_einnahmen": {
            "type": "string"
          },
          "zeitraum_bis": {
            "type": "string"
          },
          "zeitraum_von": {
            "type": "string"
          }
        }
      },
      "EksMonatsWert": {
        "type": "object",
        "required": [
          "monat",
          "einnahmen",
          "ausgaben",
          "ergebnis"
        ],
        "properties": {
          "ausgaben": {
            "type": "string"
          },
          "einnahmen": {
            "type": "string"
          },
          "ergebnis": {
            "type": "string"
          },
          "monat": {
            "type": "string"
          }
        }
      },
      "ElsterStatus": {
        "type": "object",
        "required": [
          "feature_enabled",
          "eric_available",
          "cert_configured",
          "vendor_id_configured",
          "mode",
          "hint"
        ],
        "properties": {
          "cert_configured": {
            "type": "boolean"
          },
          "eric_available": {
            "type": "boolean"
          },
          "eric_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "feature_enabled": {
            "type": "boolean"
          },
          "hint": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "vendor_id_configured": {
            "type": "boolean"
          }
        }
      },
      "EmailTemplate": {
        "type": "object",
        "required": [
          "name",
          "subject",
          "body",
          "status"
        ],
        "properties": {
          "body": {
            "type": "string",
            "description": "E-mail body with optional placeholders.",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "description": "Human-readable template name, e.g. \"Follow-up after quote\".",
            "minLength": 1
          },
          "status": {
            "$ref": "#/components/schemas/EmailTemplateStatus",
            "description": "One of: active | inactive"
          },
          "subject": {
            "type": "string",
            "description": "E-mail subject line with optional placeholders.",
            "minLength": 1
          },
          "variables": {
            "description": "Placeholders used by this template, e.g. `[\"contact.first_name\"]`."
          }
        }
      },
      "EmailTemplateCreate": {
        "type": "object",
        "required": [
          "name",
          "subject",
          "body",
          "status"
        ],
        "properties": {
          "body": {
            "type": "string",
            "description": "E-mail body with optional placeholders.",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "description": "Human-readable template name, e.g. \"Follow-up after quote\".",
            "minLength": 1
          },
          "status": {
            "$ref": "#/components/schemas/EmailTemplateStatus",
            "description": "One of: active | inactive"
          },
          "subject": {
            "type": "string",
            "description": "E-mail subject line with optional placeholders.",
            "minLength": 1
          },
          "variables": {
            "description": "Placeholders used by this template, e.g. `[\"contact.first_name\"]`."
          }
        }
      },
      "EmailTemplateStatus": {
        "type": "string",
        "description": "Email template status.",
        "enum": [
          "active",
          "inactive"
        ]
      },
      "EmailTemplateUpdate": {
        "type": "object",
        "properties": {
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "E-mail body with optional placeholders.",
            "minLength": 1
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable template name, e.g. \"Follow-up after quote\".",
            "minLength": 1
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailTemplateStatus",
                "description": "One of: active | inactive"
              }
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ],
            "description": "E-mail subject line with optional placeholders.",
            "minLength": 1
          },
          "variables": {
            "description": "Placeholders used by this template, e.g. `[\"contact.first_name\"]`."
          }
        }
      },
      "EmissionEntry": {
        "type": "object",
        "required": [
          "year",
          "scope",
          "categoryId",
          "description",
          "activityValue",
          "unit",
          "method",
          "efSource",
          "efVersion",
          "tco2e"
        ],
        "properties": {
          "activityValue": {
            "type": "string",
            "description": "Activity amount in `unit` (kWh, l, km, t, tkm, EUR)."
          },
          "categoryId": {
            "type": "string",
            "description": "GHG-Protocol category key, e.g. \"purchased_goods\", \"business_travel\"."
          },
          "description": {
            "type": "string"
          },
          "efSource": {
            "type": "string",
            "description": "Emission-factor source, e.g. \"UBA-2024\", \"DEFRA-2024\"."
          },
          "efVersion": {
            "type": "string"
          },
          "method": {
            "$ref": "#/components/schemas/EmissionMethod",
            "description": "\"activity\" | \"spend\" | \"supplier\"."
          },
          "scope": {
            "$ref": "#/components/schemas/GhgScope",
            "description": "GHG scope: \"1\" | \"2\" | \"3\"."
          },
          "tco2e": {
            "type": "string",
            "description": "Computed server-side: activity * factor / 1000, rounded to 4 dp."
          },
          "unit": {
            "type": "string",
            "description": "Unit of the activity value."
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "Reporting year."
          }
        }
      },
      "EmissionFactorResponse": {
        "type": "object",
        "required": [
          "category_id",
          "name_de",
          "unit",
          "kg_co2e_per_unit",
          "source",
          "version"
        ],
        "properties": {
          "category_id": {
            "type": "string"
          },
          "kg_co2e_per_unit": {
            "type": "number",
            "format": "double"
          },
          "name_de": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "EmissionMethod": {
        "type": "string",
        "description": "Emission calculation method: \"activity\" | \"spend\" | \"supplier\".",
        "enum": [
          "activity",
          "spend",
          "supplier"
        ]
      },
      "EmissionTarget": {
        "type": "object",
        "required": [
          "scope",
          "baseYear",
          "baseValue",
          "targetYear",
          "targetValue",
          "description"
        ],
        "properties": {
          "baseValue": {
            "type": "string"
          },
          "baseYear": {
            "type": "integer",
            "format": "int32",
            "description": "tCO2e in the base year (actuals)."
          },
          "description": {
            "type": "string",
            "description": "Transition-plan narrative (ESRS E1-1 light), may be empty."
          },
          "scope": {
            "$ref": "#/components/schemas/EmissionTargetScope",
            "description": "\"total\" | \"1\" | \"2\" | \"3\"."
          },
          "targetValue": {
            "type": "string"
          },
          "targetYear": {
            "type": "integer",
            "format": "int32",
            "description": "tCO2e target for the target year."
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "EmissionTargetScope": {
        "type": "string",
        "description": "Emission target scope: \"total\" | \"1\" | \"2\" | \"3\".",
        "enum": [
          "total",
          "1",
          "2",
          "3"
        ]
      },
      "EmissionsExportResponse": {
        "type": "object",
        "required": [
          "csv_content",
          "filename"
        ],
        "properties": {
          "csv_content": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "EmissionsReport": {
        "type": "object",
        "required": [
          "total_tco2e",
          "by_scope",
          "by_category",
          "by_year",
          "data_quality",
          "targets"
        ],
        "properties": {
          "by_category": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategoryTotal"
            }
          },
          "by_scope": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScopeTotal"
            }
          },
          "by_year": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearTotal"
            }
          },
          "data_quality": {
            "$ref": "#/components/schemas/DataQuality"
          },
          "intensity_per_employee": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "intensity_per_revenue_mio": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "tCO2e per million EUR net revenue."
          },
          "net_revenue": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Sum of paid/sent/partially-paid invoices (EUR net) in the year."
          },
          "spend_based_estimate_tco2e": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Spend-based estimate from bookkeeping payments (EXIOBASE factor)."
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TargetProgress"
            }
          },
          "total_tco2e": {
            "type": "string"
          }
        }
      },
      "EmitEventRequest": {
        "type": "object",
        "required": [
          "event_type"
        ],
        "properties": {
          "event_type": {
            "type": "string"
          },
          "payload": {}
        }
      },
      "Employee": {
        "type": "object",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "backupEmployeeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References another employee who covers when this employee is absent."
          },
          "bic": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "country": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "departmentId": {
            "type": "string",
            "format": "uuid",
            "description": "References the department entity."
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender",
                "description": "Gender for pay-transparency reporting: \"male\", \"female\" or \"diverse\"."
              }
            ]
          },
          "hireDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "hourlyCost": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hourly cost rate in EUR for labor-cost reporting; when unset the rate\nis derived from `monthly_salary / (weekly_hours * 4.33)`."
          },
          "iban": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "jobTitle": {
            "type": "string",
            "maxLength": 100
          },
          "lastLogin": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "lastUpdated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "monthlySalary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Gross monthly salary in EUR for pay-transparency reporting."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "status": {
            "$ref": "#/components/schemas/EmployeeStatus"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "userId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the user entity."
          },
          "weeklyHours": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contractual weekly working hours for pay-transparency normalization."
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          }
        }
      },
      "EmployeeCreate": {
        "type": "object",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "backupEmployeeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References another employee who covers when this employee is absent."
          },
          "bic": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "country": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "departmentId": {
            "type": "string",
            "format": "uuid",
            "description": "References the department entity."
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender",
                "description": "Gender for pay-transparency reporting: \"male\", \"female\" or \"diverse\"."
              }
            ]
          },
          "hireDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "hourlyCost": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hourly cost rate in EUR for labor-cost reporting; when unset the rate\nis derived from `monthly_salary / (weekly_hours * 4.33)`."
          },
          "iban": {
            "type": [
              "string",
              "null"
            ]
          },
          "jobTitle": {
            "type": "string",
            "maxLength": 100
          },
          "lastLogin": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "lastUpdated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "monthlySalary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Gross monthly salary in EUR for pay-transparency reporting."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "status": {
            "$ref": "#/components/schemas/EmployeeStatus"
          },
          "userId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the user entity."
          },
          "weeklyHours": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contractual weekly working hours for pay-transparency normalization."
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          }
        }
      },
      "EmployeeStatus": {
        "type": "string",
        "description": "Employment status.",
        "enum": [
          "active",
          "inactive",
          "terminated"
        ]
      },
      "EmployeeUpdate": {
        "type": "object",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "backupEmployeeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References another employee who covers when this employee is absent."
          },
          "bic": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "country": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "departmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the department entity."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "firstName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "minLength": 1
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender",
                "description": "Gender for pay-transparency reporting: \"male\", \"female\" or \"diverse\"."
              }
            ]
          },
          "hireDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "hourlyCost": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hourly cost rate in EUR for labor-cost reporting; when unset the rate\nis derived from `monthly_salary / (weekly_hours * 4.33)`."
          },
          "iban": {
            "type": [
              "string",
              "null"
            ]
          },
          "jobTitle": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "lastLogin": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "minLength": 1
          },
          "lastUpdated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "monthlySalary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Gross monthly salary in EUR for pay-transparency reporting."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+?[0-9\\s\\-\\(\\)]{7,20}$"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmployeeStatus"
              }
            ]
          },
          "userId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the user entity."
          },
          "weeklyHours": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contractual weekly working hours for pay-transparency normalization."
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          }
        }
      },
      "EmploymentType": {
        "type": "string",
        "description": "Employment type.",
        "enum": [
          "fulltime",
          "parttime",
          "contract",
          "internship",
          "temporary"
        ]
      },
      "EuerDetailErgebnis": {
        "type": "object",
        "required": [
          "jahr",
          "zeilen"
        ],
        "properties": {
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "zeilen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EuerZeileDetail"
            }
          }
        }
      },
      "EuerErgebnis": {
        "type": "object",
        "required": [
          "jahr",
          "zeilen",
          "summe_einnahmen",
          "summe_ausgaben",
          "gewinn_verlust",
          "anlage_zugaenge"
        ],
        "properties": {
          "anlage_zugaenge": {
            "type": "string"
          },
          "gewinn_verlust": {
            "type": "string"
          },
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "summe_ausgaben": {
            "type": "string"
          },
          "summe_einnahmen": {
            "type": "string"
          },
          "zeilen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EuerZeile"
            }
          }
        }
      },
      "EuerKatSumme": {
        "type": "object",
        "required": [
          "name",
          "betrag"
        ],
        "properties": {
          "betrag": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "EuerZeile": {
        "type": "object",
        "required": [
          "zeile",
          "bezeichnung",
          "abschnitt",
          "betrag"
        ],
        "properties": {
          "abschnitt": {
            "type": "string"
          },
          "betrag": {
            "type": "string"
          },
          "bezeichnung": {
            "type": "string"
          },
          "zeile": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "EuerZeileDetail": {
        "type": "object",
        "required": [
          "zeile",
          "bezeichnung",
          "abschnitt",
          "betrag_gesamt",
          "kategorien"
        ],
        "properties": {
          "abschnitt": {
            "type": "string"
          },
          "betrag_gesamt": {
            "type": "string"
          },
          "bezeichnung": {
            "type": "string"
          },
          "kategorien": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EuerKatSumme"
            }
          },
          "zeile": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "EventSubscription": {
        "type": "object",
        "required": [
          "subscription_id",
          "event_type",
          "callback_url",
          "is_active"
        ],
        "properties": {
          "callback_url": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "subscription_id": {
            "type": "string"
          }
        }
      },
      "ExecutionStatus": {
        "type": "string",
        "description": "Recurring template execution status.",
        "enum": [
          "ACTIVE",
          "PAUSED",
          "COMPLETED"
        ]
      },
      "ExpenseItem": {
        "type": "object",
        "required": [
          "category",
          "amount",
          "percentage"
        ],
        "properties": {
          "amount": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "percentage": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ExtraPayment": {
        "type": "object",
        "required": [
          "employee_id",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "string"
          },
          "employee_id": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FeatureSettings": {
        "type": "object",
        "description": "Feature toggles for a tenant.",
        "required": [
          "onlineshop",
          "reportGuv",
          "reportBilanz",
          "reportBwa",
          "reportEuer",
          "reportUstva",
          "reportGewerbesteuer",
          "reportKst"
        ],
        "properties": {
          "onlineshop": {
            "type": "boolean",
            "description": "Online shop / storefront module (default: enabled)."
          },
          "reportBilanz": {
            "type": "boolean",
            "description": "Bilanz (balance sheet) report."
          },
          "reportBwa": {
            "type": "boolean",
            "description": "BWA (betriebswirtschaftliche Auswertung)."
          },
          "reportEuer": {
            "type": "boolean",
            "description": "EÜR (Einnahmen-Überschuss-Rechnung)."
          },
          "reportGewerbesteuer": {
            "type": "boolean",
            "description": "Gewerbesteuer report."
          },
          "reportGuv": {
            "type": "boolean",
            "description": "GuV (profit & loss) report."
          },
          "reportKst": {
            "type": "boolean",
            "description": "KSt (Körperschaftsteuer) report."
          },
          "reportUstva": {
            "type": "boolean",
            "description": "UStVA (Umsatzsteuervoranmeldung)."
          }
        }
      },
      "ForgotPasswordRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          }
        }
      },
      "FristEintrag": {
        "type": "object",
        "required": [
          "typ",
          "bezeichnung",
          "zeitraum",
          "faellig_original",
          "faellig"
        ],
        "properties": {
          "bezeichnung": {
            "type": "string"
          },
          "faellig": {
            "type": "string"
          },
          "faellig_original": {
            "type": "string"
          },
          "hinweis": {
            "type": [
              "string",
              "null"
            ]
          },
          "typ": {
            "type": "string"
          },
          "zeitraum": {
            "type": "string"
          }
        }
      },
      "FristenErgebnis": {
        "type": "object",
        "required": [
          "fristen",
          "anzahl"
        ],
        "properties": {
          "anzahl": {
            "type": "integer",
            "minimum": 0
          },
          "fristen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FristEintrag"
            }
          }
        }
      },
      "GatewayOAuthAuthorizeRequest": {
        "type": "object",
        "required": [
          "gateway_type",
          "redirect_uri"
        ],
        "properties": {
          "gateway_type": {
            "type": "string"
          },
          "redirect_uri": {
            "type": "string"
          }
        }
      },
      "GatewayOAuthAuthorizeResponse": {
        "type": "object",
        "required": [
          "authorization_url",
          "state"
        ],
        "properties": {
          "authorization_url": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "GatewayOAuthCallbackRequest": {
        "type": "object",
        "required": [
          "gateway_type",
          "code",
          "state",
          "redirect_uri"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "gateway_type": {
            "type": "string"
          },
          "redirect_uri": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "GatewayType": {
        "type": "string",
        "enum": [
          "stripe",
          "paypal",
          "klarna",
          "sofort",
          "bancontact",
          "ideal",
          "bank_transfer",
          "mollie",
          "bitpay",
          "braintree",
          "adyen",
          "paddle",
          "viva_wallet",
          "reepay",
          "sumup",
          "test"
        ]
      },
      "GdprActivity": {
        "type": "object",
        "required": [
          "id",
          "tenantId",
          "action",
          "createdAt"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "GdprApiKey": {
        "type": "object",
        "required": [
          "id",
          "name",
          "keyId",
          "createdAt",
          "revoked"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "keyId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "revoked": {
            "type": "boolean"
          }
        }
      },
      "GdprBillingInfo": {
        "type": "object",
        "required": [
          "tenantId"
        ],
        "properties": {
          "currentPeriodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "currentPeriodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "plan": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "GdprExport": {
        "type": "object",
        "required": [
          "exportedAt",
          "generatedByAi",
          "user",
          "tenants",
          "billing",
          "apiKeys",
          "refreshTokens",
          "activityLog",
          "usageEvents",
          "notifications"
        ],
        "properties": {
          "activityLog": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GdprActivity"
            }
          },
          "apiKeys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GdprApiKey"
            },
            "description": "Key identifiers and names only — never a usable credential."
          },
          "billing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GdprBillingInfo"
            }
          },
          "exportedAt": {
            "type": "string",
            "format": "date-time"
          },
          "generatedByAi": {
            "type": "boolean",
            "description": "Honesty field: this document is a plain data dump, never AI-generated."
          },
          "notifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GdprNotification"
            }
          },
          "refreshTokens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GdprRefreshToken"
            },
            "description": "Session records: metadata only, never the token hash."
          },
          "tenants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GdprTenant"
            }
          },
          "usageEvents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GdprUsageEvent"
            }
          },
          "user": {
            "$ref": "#/components/schemas/GdprUser"
          }
        }
      },
      "GdprNotification": {
        "type": "object",
        "required": [
          "id",
          "tenantId",
          "title",
          "isRead",
          "createdAt"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "isRead": {
            "type": "boolean"
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "GdprRefreshToken": {
        "type": "object",
        "required": [
          "id",
          "tenantId",
          "createdAt",
          "expiresAt"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "GdprTenant": {
        "type": "object",
        "required": [
          "tenantId",
          "name",
          "role"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "GdprUsageEvent": {
        "type": "object",
        "required": [
          "id",
          "tenantId",
          "eventType",
          "quantity",
          "createdAt"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "eventType": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "GdprUser": {
        "type": "object",
        "required": [
          "id",
          "email",
          "name",
          "createdAt"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Gender": {
        "type": "string",
        "description": "Gender for pay-transparency reporting.",
        "enum": [
          "male",
          "female",
          "diverse"
        ]
      },
      "GenerateCountRequest": {
        "type": "object",
        "description": "Body for the cycle-count generator: create a draft count document for a\nwarehouse, optionally restricted to a set of product ids.",
        "required": [
          "warehouseId"
        ],
        "properties": {
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "productIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "warehouseId": {
            "type": "string"
          }
        }
      },
      "GenerateVariantsRequest": {
        "type": "object",
        "description": "Request body for generating the full variant set from option values.",
        "required": [
          "productId"
        ],
        "properties": {
          "options": {
            "type": "object",
            "description": "Option name → list of values, e.g. `{\"Color\": [\"Red\", \"Blue\"],\n\"Size\": [\"S\", \"M\"]}`. The cartesian product of these lists is\ngenerated.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "priceDelta": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional per-variant price delta applied to every generated variant."
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "skuPrefix": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional prefix for the generated SKUs (suffix is the option values\njoined by `-`). Falls back to the parent product's SKU."
          }
        }
      },
      "GewerbesteuerErgebnis": {
        "type": "object",
        "required": [
          "jahr",
          "land",
          "gewerbeertrag",
          "freibetrag",
          "messbetrag",
          "hebesatz",
          "steuer",
          "steuer_art",
          "koerperschaftsteuer",
          "gesamtbelastung"
        ],
        "properties": {
          "freibetrag": {
            "type": "string"
          },
          "gesamtbelastung": {
            "type": "string"
          },
          "gewerbeertrag": {
            "type": "string"
          },
          "hebesatz": {
            "type": "string"
          },
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "koerperschaftsteuer": {
            "type": "string"
          },
          "land": {
            "type": "string"
          },
          "messbetrag": {
            "type": "string"
          },
          "steuer": {
            "type": "string"
          },
          "steuer_art": {
            "type": "string"
          }
        }
      },
      "GewinnverwendungsExportResponse": {
        "type": "object",
        "required": [
          "csv_content",
          "filename"
        ],
        "properties": {
          "csv_content": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "GewinnverwendungsReport": {
        "type": "object",
        "required": [
          "year",
          "jahresueberschuss",
          "gezeichnetes_kapital",
          "gesetzliche_ruecklage_bestand",
          "gesetzliche_ruecklage_soll",
          "gesetzliche_ruecklage_cap",
          "gesetzliche_ruecklage_nach",
          "bilanzgewinn",
          "zeilen"
        ],
        "properties": {
          "bilanzgewinn": {
            "type": "string",
            "description": "Bilanzgewinn nach Einstellung (§ 174 AktG, Beschluss der HV)."
          },
          "gesetzliche_ruecklage_bestand": {
            "type": "string"
          },
          "gesetzliche_ruecklage_cap": {
            "type": "string",
            "description": "Deckel: 10 % des Grundkapitals (§ 150 Abs. 2 AktG)."
          },
          "gesetzliche_ruecklage_nach": {
            "type": "string",
            "description": "Rücklage nach Einstellung."
          },
          "gesetzliche_ruecklage_soll": {
            "type": "string",
            "description": "Vorgeschlagene Einstellung in die gesetzliche Rücklage (§ 150 Abs. 2 AktG)."
          },
          "gezeichnetes_kapital": {
            "type": "string"
          },
          "jahresueberschuss": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "zeilen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GewinnverwendungsZeile"
            }
          }
        }
      },
      "GewinnverwendungsZeile": {
        "type": "object",
        "required": [
          "label",
          "betrag"
        ],
        "properties": {
          "betrag": {
            "type": "string",
            "description": "Betrag in EUR (2 Nachkommastellen, als String formatiert)."
          },
          "label": {
            "type": "string",
            "description": "Deutsche Bezeichnung der Zeile."
          }
        }
      },
      "GezReport": {
        "type": "object",
        "description": "Berechnungsergebnis des Rundfunkbeitrags für ein Unternehmen.",
        "required": [
          "jahr",
          "monatlicher_beitrag",
          "vierteljaehrlicher_beitrag",
          "jaehrlicher_beitrag",
          "betriebsstaetten",
          "kfz_beitrag",
          "hotelzimmer_beitrag",
          "beitragsfreie_kfz",
          "beitragspflichtige_kfz",
          "hinweis"
        ],
        "properties": {
          "beitragsfreie_kfz": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "beitragspflichtige_kfz": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "betriebsstaetten": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BetriebsstaettenDetail"
            }
          },
          "hinweis": {
            "type": "string"
          },
          "hotelzimmer_beitrag": {
            "type": "string"
          },
          "jaehrlicher_beitrag": {
            "type": "string"
          },
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "kfz_beitrag": {
            "type": "string"
          },
          "monatlicher_beitrag": {
            "type": "string"
          },
          "vierteljaehrlicher_beitrag": {
            "type": "string"
          }
        }
      },
      "GhgScope": {
        "type": "string",
        "description": "GHG scope: \"1\" | \"2\" | \"3\".",
        "enum": [
          "1",
          "2",
          "3"
        ]
      },
      "GoBDExportResponse": {
        "type": "object",
        "required": [
          "csv_content",
          "filename",
          "booking_count"
        ],
        "properties": {
          "booking_count": {
            "type": "integer",
            "minimum": 0
          },
          "csv_content": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "GoodsReceipt": {
        "type": "object",
        "required": [
          "grNumber",
          "warehouseId",
          "receiptDate",
          "lineItems"
        ],
        "properties": {
          "grNumber": {
            "type": "string"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, batch_number?, expiry_date?, bin_location?}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "purchaseOrderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the purchase order entity."
          },
          "receiptDate": {
            "type": "string",
            "format": "date"
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          },
          "warehouseId": {
            "type": "string",
            "description": "References the warehouse entity."
          }
        }
      },
      "GroupFigure": {
        "type": "object",
        "required": [
          "year"
        ],
        "properties": {
          "bilanzsumme": {
            "type": "string",
            "description": "Bilanzsumme in EUR (§ 293 Abs. 1 Nr. 1 HGB)."
          },
          "exemptionClaimed": {
            "type": "boolean",
            "description": "§ 291-Befreiung in Anspruch genommen."
          },
          "mitarbeiter": {
            "type": "integer",
            "format": "int64",
            "description": "Durchschnittliche Arbeitnehmerzahl (§ 293 Abs. 1 Nr. 3 HGB)."
          },
          "nettoUmsatz": {
            "type": "string",
            "description": "Netto-Umsatzerlöse in EUR (§ 293 Abs. 1 Nr. 2 HGB)."
          },
          "parentName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name des Mutterunternehmens (§ 291 HGB, Zwischenholding).",
            "maxLength": 200
          },
          "parentSitus": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sitz des Mutterunternehmens, z. B. \"EU/EWR\" (§ 291 HGB).",
            "maxLength": 100
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "GroupFigureCreate": {
        "type": "object",
        "properties": {
          "bilanzsumme": {
            "type": "string",
            "description": "Bilanzsumme in EUR (§ 293 Abs. 1 Nr. 1 HGB)."
          },
          "exemptionClaimed": {
            "type": "boolean",
            "description": "§ 291-Befreiung in Anspruch genommen."
          },
          "mitarbeiter": {
            "type": "integer",
            "format": "int64",
            "description": "Durchschnittliche Arbeitnehmerzahl (§ 293 Abs. 1 Nr. 3 HGB)."
          },
          "nettoUmsatz": {
            "type": "string",
            "description": "Netto-Umsatzerlöse in EUR (§ 293 Abs. 1 Nr. 2 HGB)."
          },
          "parentName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name des Mutterunternehmens (§ 291 HGB, Zwischenholding).",
            "maxLength": 200
          },
          "parentSitus": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sitz des Mutterunternehmens, z. B. \"EU/EWR\" (§ 291 HGB).",
            "maxLength": 100
          }
        }
      },
      "GroupFigureUpdate": {
        "type": "object",
        "properties": {
          "bilanzsumme": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bilanzsumme in EUR (§ 293 Abs. 1 Nr. 1 HGB)."
          },
          "exemptionClaimed": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "§ 291-Befreiung in Anspruch genommen."
          },
          "mitarbeiter": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Durchschnittliche Arbeitnehmerzahl (§ 293 Abs. 1 Nr. 3 HGB)."
          },
          "nettoUmsatz": {
            "type": [
              "string",
              "null"
            ],
            "description": "Netto-Umsatzerlöse in EUR (§ 293 Abs. 1 Nr. 2 HGB)."
          },
          "parentName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name des Mutterunternehmens (§ 291 HGB, Zwischenholding).",
            "maxLength": 200
          },
          "parentSitus": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sitz des Mutterunternehmens, z. B. \"EU/EWR\" (§ 291 HGB).",
            "maxLength": 100
          }
        }
      },
      "GuVItem": {
        "type": "object",
        "required": [
          "account",
          "name",
          "amount"
        ],
        "properties": {
          "account": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "GuVReport": {
        "type": "object",
        "required": [
          "period",
          "generated_at",
          "revenue",
          "total_revenue",
          "expenses",
          "total_expenses",
          "net_income"
        ],
        "properties": {
          "expenses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuVItem"
            }
          },
          "generated_at": {
            "type": "string"
          },
          "net_income": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "revenue": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GuVItem"
            }
          },
          "total_expenses": {
            "type": "string"
          },
          "total_revenue": {
            "type": "string"
          }
        }
      },
      "HebesatzLookup": {
        "type": "object",
        "required": [
          "gemeindeschluessel",
          "gemeinde_name",
          "bundesland",
          "hebesatz_gewerbesteuer",
          "jahr",
          "country_code",
          "valid_from"
        ],
        "properties": {
          "bundesland": {
            "type": "string"
          },
          "country_code": {
            "type": "string"
          },
          "gemeinde_name": {
            "type": "string"
          },
          "gemeindeschluessel": {
            "type": "string"
          },
          "hebesatz_gewerbesteuer": {
            "type": "number",
            "format": "double"
          },
          "hebesatz_grundsteuer_b": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "landkreis": {
            "type": [
              "string",
              "null"
            ]
          },
          "valid_from": {
            "type": "string"
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HrTrainingOverview": {
        "type": "object",
        "required": [
          "trainingId",
          "code",
          "title",
          "assignedCount",
          "completedCount",
          "overdueCount"
        ],
        "properties": {
          "assignedCount": {
            "type": "integer",
            "format": "int64"
          },
          "code": {
            "type": "string"
          },
          "completedCount": {
            "type": "integer",
            "format": "int64"
          },
          "overdueCount": {
            "type": "integer",
            "format": "int64"
          },
          "title": {
            "type": "string"
          },
          "trainingId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ImportJobStatus": {
        "type": "object",
        "required": [
          "job_id",
          "status",
          "progress",
          "stage",
          "processed",
          "total"
        ],
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set only when the job failed."
          },
          "job_id": {
            "type": "string"
          },
          "processed": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "progress": {
            "type": "integer",
            "format": "int32",
            "description": "0–100",
            "minimum": 0
          },
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which competitor the import came from (lexoffice | billbee); the\nfrontend uses it to label the job. Absent for legacy jobs."
          },
          "stage": {
            "type": "string",
            "description": "queued | fetching | downloading | importing | done"
          },
          "status": {
            "type": "string",
            "description": "pending | running | done | failed"
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ImportStartRequest": {
        "type": "object",
        "required": [
          "provider",
          "apiKey",
          "years"
        ],
        "properties": {
          "apiKey": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "years": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      },
      "ImportStartResponse": {
        "type": "object",
        "required": [
          "job_id"
        ],
        "properties": {
          "job_id": {
            "type": "string"
          }
        }
      },
      "ImportTestRequest": {
        "type": "object",
        "required": [
          "provider",
          "apiKey"
        ],
        "properties": {
          "apiKey": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          }
        }
      },
      "ImportTestResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "ok": {
            "type": "boolean"
          }
        }
      },
      "IncomeStatement": {
        "type": "object",
        "required": [
          "total_revenue",
          "total_expenses",
          "net_income",
          "revenue_items",
          "expense_items"
        ],
        "properties": {
          "expense_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PnLItem"
            }
          },
          "net_income": {
            "type": "string"
          },
          "revenue_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PnLItem"
            }
          },
          "total_expenses": {
            "type": "string"
          },
          "total_revenue": {
            "type": "string"
          }
        }
      },
      "InstituteCheckItem": {
        "type": "object",
        "required": [
          "name",
          "exists",
          "source"
        ],
        "properties": {
          "exists": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        }
      },
      "InstituteDeadlines": {
        "type": "object",
        "required": [
          "offenlegungMonths"
        ],
        "properties": {
          "abschlusspruefungMonths": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "HGB § 340k/§ 341k: Abschlussprüfung (5 Monate)."
          },
          "jahresabschlussBafinMonths": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "KWG § 26: Jahresabschluss an die BaFin (3 Monate, nur KWG-Institute)."
          },
          "offenlegungMonths": {
            "type": "integer",
            "format": "int32",
            "description": "HGB § 325 Abs. 4: Offenlegung (4 kapitalmarktorientiert / 12 sonst)."
          }
        }
      },
      "InstituteProfile": {
        "type": "object",
        "properties": {
          "instituteType": {
            "$ref": "#/components/schemas/InstituteType",
            "description": "Institutsart: \"kein\" | \"kreditinstitut\" | \"finanzdienstleistungsinstitut\" | \"finanzunternehmen\" | \"versicherung\"."
          },
          "kapitalmarktorientiert": {
            "type": "boolean",
            "description": "Kapitalmarktorientierung (§ 325 Abs. 4 HGB): Offenlegungsfrist 4 statt 12 Monate."
          }
        }
      },
      "InstituteProfileUpdate": {
        "type": "object",
        "description": "Partial update of the institute profile.",
        "properties": {
          "instituteType": {
            "type": [
              "string",
              "null"
            ]
          },
          "kapitalmarktorientiert": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "InstituteStatus": {
        "type": "object",
        "required": [
          "instituteType",
          "kapitalmarktorientiert",
          "deadlines",
          "checklist"
        ],
        "properties": {
          "checklist": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstituteCheckItem"
            }
          },
          "deadlines": {
            "$ref": "#/components/schemas/InstituteDeadlines"
          },
          "instituteType": {
            "type": "string"
          },
          "kapitalmarktorientiert": {
            "type": "boolean"
          }
        }
      },
      "InstituteType": {
        "type": "string",
        "description": "Institutsart (KWG § 1).",
        "enum": [
          "kein",
          "kreditinstitut",
          "finanzdienstleistungsinstitut",
          "finanzunternehmen",
          "versicherung"
        ]
      },
      "InstrumentType": {
        "type": "string",
        "description": "Silent-partnership instrument: \"typisch\" | \"atypisch\".",
        "enum": [
          "typisch",
          "atypisch"
        ]
      },
      "InventoryCount": {
        "type": "object",
        "required": [
          "countNumber",
          "warehouseId",
          "status",
          "countDate",
          "lineItems"
        ],
        "properties": {
          "countDate": {
            "type": "string",
            "format": "date"
          },
          "countNumber": {
            "type": "string"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, sku, expected_quantity,\ncounted_quantity, bin_location?, batch_number?, variance}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/InventoryCountStatus",
            "description": "One of: draft | counting | reviewed | posted"
          },
          "warehouseId": {
            "type": "string",
            "description": "References the warehouse entity."
          }
        }
      },
      "InventoryCountCreate": {
        "type": "object",
        "required": [
          "countNumber",
          "warehouseId",
          "status",
          "countDate",
          "lineItems"
        ],
        "properties": {
          "countDate": {
            "type": "string",
            "format": "date"
          },
          "countNumber": {
            "type": "string"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, sku, expected_quantity,\ncounted_quantity, bin_location?, batch_number?, variance}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/InventoryCountStatus",
            "description": "One of: draft | counting | reviewed | posted"
          },
          "warehouseId": {
            "type": "string",
            "description": "References the warehouse entity."
          }
        }
      },
      "InventoryCountStatus": {
        "type": "string",
        "description": "Inventory count status.",
        "enum": [
          "draft",
          "counting",
          "reviewed",
          "posted"
        ]
      },
      "InventoryCountStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "InventoryCountUpdate": {
        "type": "object",
        "properties": {
          "countDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "countNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, sku, expected_quantity,\ncounted_quantity, bin_location?, batch_number?, variance}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InventoryCountStatus",
                "description": "One of: draft | counting | reviewed | posted"
              }
            ]
          },
          "warehouseId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the warehouse entity."
          }
        }
      },
      "InventoryValuePoint": {
        "type": "object",
        "required": [
          "recorded_at",
          "total_purchase_value",
          "total_sales_value",
          "product_count"
        ],
        "properties": {
          "product_count": {
            "type": "integer",
            "format": "int64"
          },
          "recorded_at": {
            "type": "string",
            "format": "date-time"
          },
          "total_purchase_value": {
            "type": "string"
          },
          "total_sales_value": {
            "type": "string"
          }
        }
      },
      "InviteRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          }
        }
      },
      "Invoice": {
        "type": "object",
        "required": [
          "invoiceType",
          "status",
          "issueDate",
          "lineItems",
          "subtotal",
          "totalTax",
          "totalAmount",
          "currency"
        ],
        "properties": {
          "attachments": {},
          "billingPeriodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "billingPeriodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "cancellationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "cancellationInvoiceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the invoice entity."
          },
          "cancellationReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "contractId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the contract entity."
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "discountAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "discountDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "discountPercentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "documentType": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "dunningLevel": {
            "type": "integer",
            "format": "int32"
          },
          "inputVatAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "inputVatDeductible": {
            "type": "boolean"
          },
          "inputVatPercentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "introductionText": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoiceType": {
            "$ref": "#/components/schemas/InvoiceType"
          },
          "isCancelled": {
            "type": "boolean"
          },
          "isDraft": {
            "type": "boolean"
          },
          "isEuAcquisition": {
            "type": "boolean"
          },
          "isEuDelivery": {
            "type": "boolean"
          },
          "isIntraCommunityAcquisition": {
            "type": "boolean"
          },
          "isReverseCharge": {
            "type": "boolean"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "ledgerAccount": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "margin25a": {
            "type": "boolean"
          },
          "margin25aGross": {
            "type": [
              "string",
              "null"
            ]
          },
          "margin25aPurchasePrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "originalPdfPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "paidAmount": {
            "type": "string"
          },
          "paymentDueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "paymentStatus": {
            "$ref": "#/components/schemas/PaymentStatus"
          },
          "paymentTermsText": {
            "type": [
              "string",
              "null"
            ]
          },
          "precedingSalesVoucherId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the preceding sales voucher entity."
          },
          "precedingSalesVoucherType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrecedingSalesVoucherType"
              }
            ]
          },
          "receiptConfirmationAvailable": {
            "type": "boolean"
          },
          "relatedInvoiceId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the invoice entity."
          },
          "relationshipType": {
            "type": [
              "string",
              "null"
            ]
          },
          "senderSnapshot": {},
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "servicePeriodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "servicePeriodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/InvoiceStatus"
          },
          "subtotal": {
            "type": "string"
          },
          "supplierId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "taxExemptionReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalAmount": {
            "type": "string"
          },
          "totalTax": {
            "type": "string"
          },
          "vatCountry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "vatSpecialCase": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "InvoiceCreate": {
        "type": "object",
        "required": [
          "invoiceType",
          "status",
          "issueDate",
          "lineItems",
          "subtotal",
          "totalTax",
          "totalAmount",
          "currency"
        ],
        "properties": {
          "attachments": {},
          "billingPeriodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "billingPeriodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "cancellationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "cancellationInvoiceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the invoice entity."
          },
          "cancellationReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "contractId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the contract entity."
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "discountAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "discountDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "discountPercentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "documentType": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "dunningLevel": {
            "type": "integer",
            "format": "int32"
          },
          "inputVatAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "inputVatDeductible": {
            "type": "boolean"
          },
          "inputVatPercentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "introductionText": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoiceType": {
            "$ref": "#/components/schemas/InvoiceType"
          },
          "isCancelled": {
            "type": "boolean"
          },
          "isDraft": {
            "type": "boolean"
          },
          "isEuAcquisition": {
            "type": "boolean"
          },
          "isEuDelivery": {
            "type": "boolean"
          },
          "isIntraCommunityAcquisition": {
            "type": "boolean"
          },
          "isReverseCharge": {
            "type": "boolean"
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "ledgerAccount": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "margin25a": {
            "type": "boolean"
          },
          "margin25aGross": {
            "type": [
              "string",
              "null"
            ]
          },
          "margin25aPurchasePrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "originalPdfPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "paidAmount": {
            "type": "string"
          },
          "paymentDueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "paymentStatus": {
            "$ref": "#/components/schemas/PaymentStatus"
          },
          "paymentTermsText": {
            "type": [
              "string",
              "null"
            ]
          },
          "precedingSalesVoucherId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the preceding sales voucher entity."
          },
          "precedingSalesVoucherType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrecedingSalesVoucherType"
              }
            ]
          },
          "receiptConfirmationAvailable": {
            "type": "boolean"
          },
          "relatedInvoiceId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the invoice entity."
          },
          "relationshipType": {
            "type": [
              "string",
              "null"
            ]
          },
          "senderSnapshot": {},
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "servicePeriodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "servicePeriodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/InvoiceStatus"
          },
          "subtotal": {
            "type": "string"
          },
          "supplierId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "taxExemptionReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalAmount": {
            "type": "string"
          },
          "totalTax": {
            "type": "string"
          },
          "vatCountry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "vatSpecialCase": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "InvoiceLineItem": {
        "type": "object",
        "required": [
          "position",
          "description",
          "quantity",
          "unit",
          "unit_price",
          "line_total"
        ],
        "properties": {
          "article_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string",
            "example": "Electricity Work Price"
          },
          "discount_amount": {
            "type": [
              "string",
              "null"
            ]
          },
          "discount_percentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "input_vat_deductible": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "input_vat_rate": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_intra_community_acquisition": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "is_margin_25a": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "ledger_account": {
            "type": [
              "string",
              "null"
            ]
          },
          "line_total": {
            "type": "string",
            "example": 19.9
          },
          "line_total_gross": {
            "type": [
              "string",
              "null"
            ]
          },
          "margin_25a_purchase_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "meter_point_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "position": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "price_components": {},
          "product_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "product_sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "string",
            "example": "10.0"
          },
          "supplier_article_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_rate": {
            "type": [
              "string",
              "null"
            ],
            "example": 19.0
          },
          "unit": {},
          "unit_price": {
            "type": "string",
            "example": 1.99
          },
          "usage_data_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "vat_rate_nominal": {
            "type": [
              "string",
              "null"
            ]
          },
          "vat_special_case": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "InvoiceMatchRequest": {
        "type": "object",
        "required": [
          "supplier_invoice_id"
        ],
        "properties": {
          "supplier_invoice_id": {
            "type": "string"
          }
        }
      },
      "InvoicePdfUrlResponse": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string"
          }
        }
      },
      "InvoiceStatus": {
        "type": "string",
        "enum": [
          "Draft",
          "Sent",
          "PartiallyPaid",
          "Paid",
          "Overdue",
          "Cancelled",
          "Credited",
          "Expired",
          "Dunning",
          "CollectDebt"
        ]
      },
      "InvoiceType": {
        "type": "string",
        "enum": [
          "Invoice",
          "CreditNote",
          "AdvancePayment",
          "FinalSettlement",
          "SpecialBilling",
          "DownPaymentInvoice",
          "Proforma",
          "Recurring",
          "CancellationInvoice"
        ]
      },
      "JahresUstErgebnis": {
        "type": "object",
        "required": [
          "jahr",
          "von",
          "bis",
          "ist_kleinunternehmer",
          "kz_81",
          "kz_83",
          "kz_86",
          "kz_88",
          "kz_41",
          "kz_43",
          "kz_89",
          "kz_93",
          "kz_46",
          "kz_47",
          "kz_84",
          "kz_85",
          "kz_66",
          "kz_61",
          "kz_67",
          "zahllast",
          "kz_48",
          "summe_vorauszahlungen",
          "restschuld",
          "gespeicherte_perioden",
          "hat_ig_transaktionen"
        ],
        "properties": {
          "bis": {
            "type": "string"
          },
          "gespeicherte_perioden": {
            "type": "integer",
            "format": "int32"
          },
          "hat_ig_transaktionen": {
            "type": "boolean"
          },
          "ist_kleinunternehmer": {
            "type": "boolean"
          },
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "kz_41": {
            "type": "string"
          },
          "kz_43": {
            "type": "string"
          },
          "kz_46": {
            "type": "string"
          },
          "kz_47": {
            "type": "string"
          },
          "kz_48": {
            "type": "string"
          },
          "kz_61": {
            "type": "string"
          },
          "kz_66": {
            "type": "string"
          },
          "kz_67": {
            "type": "string"
          },
          "kz_81": {
            "type": "string"
          },
          "kz_83": {
            "type": "string"
          },
          "kz_84": {
            "type": "string"
          },
          "kz_85": {
            "type": "string"
          },
          "kz_86": {
            "type": "string"
          },
          "kz_88": {
            "type": "string"
          },
          "kz_89": {
            "type": "string"
          },
          "kz_93": {
            "type": "string"
          },
          "restschuld": {
            "type": "string"
          },
          "summe_vorauszahlungen": {
            "type": "string"
          },
          "von": {
            "type": "string"
          },
          "zahllast": {
            "type": "string"
          }
        }
      },
      "Job": {
        "type": "object",
        "required": [
          "jobType",
          "status",
          "maxAttempts"
        ],
        "properties": {
          "attempts": {
            "type": "integer",
            "format": "int32"
          },
          "jobType": {
            "type": "string",
            "description": "Discriminator the worker dispatches on (e.g. \"webhook.deliver\")."
          },
          "maxAttempts": {
            "type": "integer",
            "format": "int32"
          },
          "payload": {},
          "runAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Earliest execution time; None = run now."
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus",
            "description": "pending | running | done | failed"
          }
        }
      },
      "JobApplication": {
        "type": "object",
        "required": [
          "source",
          "status"
        ],
        "properties": {
          "cvFile": {
            "type": [
              "string",
              "null"
            ],
            "description": "Relative path of the stored CV file under the upload dir."
          },
          "cvText": {
            "type": [
              "string",
              "null"
            ],
            "description": "Extracted CV text, used for match-scoring."
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "matchReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "matchScore": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "0-100 LLM match score against the posting's required profile."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "postingId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the job_posting entity."
          },
          "source": {
            "type": "string",
            "description": "website | email | board"
          },
          "status": {
            "$ref": "#/components/schemas/ApplicationStatus",
            "description": "new | reviewing | interview | hired | rejected"
          }
        }
      },
      "JobPosting": {
        "type": "object",
        "required": [
          "title",
          "description",
          "requiredSkills",
          "remote",
          "status"
        ],
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "department": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string",
            "description": "What the job is; markdown/HTML.",
            "minLength": 1
          },
          "employmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmploymentType",
                "description": "full_time | part_time | contract | internship | temporary"
              }
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote": {
            "type": "boolean"
          },
          "requiredSkills": {
            "description": "List of required skill names (JSON array of strings)."
          },
          "requirements": {
            "type": [
              "string",
              "null"
            ],
            "description": "Structured profile of the required candidate (skills, experience)."
          },
          "salaryMax": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "salaryMin": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "status": {
            "$ref": "#/components/schemas/JobPostingStatus",
            "description": "draft | published | closed"
          },
          "title": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "JobPostingCreate": {
        "type": "object",
        "required": [
          "title",
          "description",
          "requiredSkills",
          "remote",
          "status"
        ],
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "department": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string",
            "description": "What the job is; markdown/HTML.",
            "minLength": 1
          },
          "employmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmploymentType",
                "description": "full_time | part_time | contract | internship | temporary"
              }
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote": {
            "type": "boolean"
          },
          "requiredSkills": {
            "description": "List of required skill names (JSON array of strings)."
          },
          "requirements": {
            "type": [
              "string",
              "null"
            ],
            "description": "Structured profile of the required candidate (skills, experience)."
          },
          "salaryMax": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "salaryMin": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "status": {
            "$ref": "#/components/schemas/JobPostingStatus",
            "description": "draft | published | closed"
          },
          "title": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "JobPostingFilter": {
        "type": "object",
        "properties": {
          "page": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "pageSize": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "JobPostingStatus": {
        "type": "string",
        "description": "Job posting status.",
        "enum": [
          "draft",
          "published",
          "closed"
        ]
      },
      "JobPostingUpdate": {
        "type": "object",
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "department": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the job is; markdown/HTML.",
            "minLength": 1
          },
          "employmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmploymentType",
                "description": "full_time | part_time | contract | internship | temporary"
              }
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "requiredSkills": {
            "description": "List of required skill names (JSON array of strings)."
          },
          "requirements": {
            "type": [
              "string",
              "null"
            ],
            "description": "Structured profile of the required candidate (skills, experience)."
          },
          "salaryMax": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "salaryMin": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JobPostingStatus",
                "description": "draft | published | closed"
              }
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          }
        }
      },
      "JobStatus": {
        "type": "string",
        "description": "Job queue status.",
        "enum": [
          "pending",
          "running",
          "done",
          "failed"
        ]
      },
      "JobTitleGap": {
        "type": "object",
        "required": [
          "job_title",
          "employee_count",
          "male_mean_hourly",
          "female_mean_hourly",
          "mean_gap_pct",
          "median_gap_pct"
        ],
        "properties": {
          "employee_count": {
            "type": "integer",
            "minimum": 0
          },
          "female_mean_hourly": {
            "type": "string"
          },
          "job_title": {
            "type": "string"
          },
          "male_mean_hourly": {
            "type": "string"
          },
          "mean_gap_pct": {
            "type": "number",
            "format": "double"
          },
          "median_gap_pct": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "KontoItem": {
        "type": "object",
        "required": [
          "konto",
          "name",
          "anfangsbestand",
          "soll_umsatz",
          "haben_umsatz",
          "saldo"
        ],
        "properties": {
          "anfangsbestand": {
            "type": "string"
          },
          "haben_umsatz": {
            "type": "string"
          },
          "konto": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "saldo": {
            "type": "string"
          },
          "soll_umsatz": {
            "type": "string"
          }
        }
      },
      "KontoReport": {
        "type": "object",
        "required": [
          "period",
          "generated_at",
          "konten"
        ],
        "properties": {
          "generated_at": {
            "type": "string"
          },
          "konten": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KontoItem"
            }
          },
          "period": {
            "type": "string"
          }
        }
      },
      "KonzernBeteiligung": {
        "type": "object",
        "required": [
          "company_name",
          "ownership_pct",
          "controlled",
          "control_basis"
        ],
        "properties": {
          "company_name": {
            "type": "string"
          },
          "control_basis": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Erfüllte Kontroll-Indikatoren (§ 290 Abs. 2 HGB) als deutsche Bezeichnungen."
          },
          "controlled": {
            "type": "boolean"
          },
          "ownership_pct": {
            "type": "string"
          }
        }
      },
      "KonzernExportResponse": {
        "type": "object",
        "required": [
          "csv_content",
          "filename"
        ],
        "properties": {
          "csv_content": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "KonzernStatus": {
        "type": "object",
        "required": [
          "year",
          "mutterunternehmen",
          "konzernabschlusspflicht",
          "groessenbefreit",
          "zwischenholding_befreit",
          "missing_group_figures",
          "kapitalmarktorientiert",
          "thresholds",
          "participations"
        ],
        "properties": {
          "groessenbefreit": {
            "type": "boolean"
          },
          "kapitalmarktorientiert": {
            "type": "boolean"
          },
          "konzernabschlusspflicht": {
            "type": "boolean"
          },
          "missing_group_figures": {
            "type": "boolean",
            "description": "Keine group_figures-Zeile für das Jahr vorhanden → keine Größenbefreiung."
          },
          "mutterunternehmen": {
            "type": "boolean",
            "description": "Mutterunternehmen: mindestens eine beherrschte Beteiligung (§ 290 Abs. 1 HGB)."
          },
          "parent_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Mutterunternehmen für die Zwischenholding-Befreiung (§ 291 HGB)."
          },
          "parent_situs": {
            "type": [
              "string",
              "null"
            ]
          },
          "participations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KonzernBeteiligung"
            }
          },
          "thresholds": {
            "$ref": "#/components/schemas/KonzernThresholds"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "zwischenholding_befreit": {
            "type": "boolean"
          },
          "zwischenholding_hinweis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hinweis zu den § 291-Voraussetzungen (EU/EWR-Sitz, geprüfter Konzernabschluss)."
          }
        }
      },
      "KonzernThresholds": {
        "type": "object",
        "required": [
          "bilanzsumme",
          "netto_umsatz",
          "mitarbeiter"
        ],
        "properties": {
          "bilanzsumme": {
            "type": "string"
          },
          "mitarbeiter": {
            "type": "integer",
            "format": "int64"
          },
          "netto_umsatz": {
            "type": "string"
          }
        }
      },
      "KostenEintrag": {
        "type": "object",
        "required": [
          "datum",
          "typ",
          "beschreibung",
          "betrag"
        ],
        "properties": {
          "beschreibung": {
            "type": "string"
          },
          "betrag": {
            "type": "string"
          },
          "datum": {
            "type": "string"
          },
          "typ": {
            "type": "string"
          }
        }
      },
      "KostenVorschau": {
        "type": "object",
        "required": [
          "eintraege",
          "gesamt"
        ],
        "properties": {
          "eintraege": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KostenEintrag"
            }
          },
          "gesamt": {
            "type": "string"
          }
        }
      },
      "KstErgebnis": {
        "type": "object",
        "required": [
          "jahr",
          "gewinn",
          "koerperschaftsteuer",
          "solidaritaetszuschlag",
          "gesamt",
          "gewerbesteuer",
          "gesamtbelastung",
          "ist_kapitalgesellschaft"
        ],
        "properties": {
          "gesamt": {
            "type": "string"
          },
          "gesamtbelastung": {
            "type": "string"
          },
          "gewerbesteuer": {
            "type": "string"
          },
          "gewinn": {
            "type": "string"
          },
          "ist_kapitalgesellschaft": {
            "type": "boolean"
          },
          "jahr": {
            "type": "integer",
            "format": "int32"
          },
          "koerperschaftsteuer": {
            "type": "string"
          },
          "solidaritaetszuschlag": {
            "type": "string"
          }
        }
      },
      "KycRecord": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "description": "Referenz auf den Kunden/Kontakt."
          },
          "customerName": {
            "type": "string",
            "description": "Name des Kunden (für die Suche).",
            "maxLength": 200,
            "minLength": 1
          },
          "kycDate": {
            "type": "string",
            "format": "date",
            "description": "Datum der KYC-Prüfung (GwG § 8)."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freitext-Notizen.",
            "maxLength": 500
          },
          "retentionUntil": {
            "type": "string",
            "format": "date",
            "description": "Aufbewahrungsfrist (GwG § 8 Abs. 4: 5 Jahre)."
          },
          "riskAssessment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Risikoeinschätzung (z. B. Risikoklasse).",
            "maxLength": 500
          }
        }
      },
      "KycRecordCreate": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "description": "Referenz auf den Kunden/Kontakt."
          },
          "customerName": {
            "type": "string",
            "description": "Name des Kunden (für die Suche).",
            "maxLength": 200,
            "minLength": 1
          },
          "kycDate": {
            "type": "string",
            "format": "date",
            "description": "Datum der KYC-Prüfung (GwG § 8)."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freitext-Notizen.",
            "maxLength": 500
          },
          "retentionUntil": {
            "type": "string",
            "format": "date",
            "description": "Aufbewahrungsfrist (GwG § 8 Abs. 4: 5 Jahre)."
          },
          "riskAssessment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Risikoeinschätzung (z. B. Risikoklasse).",
            "maxLength": 500
          }
        }
      },
      "KycRecordUpdate": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Referenz auf den Kunden/Kontakt."
          },
          "customerName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name des Kunden (für die Suche).",
            "maxLength": 200,
            "minLength": 1
          },
          "kycDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Datum der KYC-Prüfung (GwG § 8)."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freitext-Notizen.",
            "maxLength": 500
          },
          "retentionUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Aufbewahrungsfrist (GwG § 8 Abs. 4: 5 Jahre)."
          },
          "riskAssessment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Risikoeinschätzung (z. B. Risikoklasse).",
            "maxLength": 500
          }
        }
      },
      "LaborCostRow": {
        "type": "object",
        "required": [
          "groupKey",
          "hours",
          "cost"
        ],
        "properties": {
          "cost": {
            "type": "string"
          },
          "employeeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "groupKey": {
            "type": "string"
          },
          "hours": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LanguageCode": {
        "type": "string",
        "enum": [
          "DE",
          "EN",
          "FR",
          "ES",
          "IT",
          "NL",
          "PL",
          "PT",
          "TR",
          "RU",
          "UK",
          "CS",
          "EL",
          "HU",
          "RO",
          "SV",
          "DA",
          "FI",
          "NO",
          "SK",
          "SL",
          "HR",
          "BG",
          "ET",
          "LV",
          "LT",
          "MT",
          "AR",
          "ZH",
          "JA",
          "KO",
          "TH",
          "VI",
          "ID",
          "HI",
          "AB",
          "AA",
          "AF",
          "AK",
          "SQ",
          "AM",
          "AN",
          "HY",
          "AS",
          "AV",
          "AE",
          "AY",
          "AZ",
          "BM",
          "BA",
          "EU",
          "BE",
          "BN",
          "BI",
          "BS",
          "BR",
          "MY",
          "CA",
          "CH",
          "CE",
          "NY",
          "CU",
          "CV",
          "KW",
          "CO",
          "CR",
          "DV",
          "DZ",
          "EO",
          "EE",
          "FO",
          "FJ",
          "FY",
          "FF",
          "GD",
          "GL",
          "LG",
          "KA",
          "KL",
          "GN",
          "GU",
          "HT",
          "HA",
          "HE",
          "HZ",
          "HO",
          "IS",
          "IO",
          "IG",
          "IA",
          "IE",
          "IU",
          "IK",
          "GA",
          "JV",
          "KN",
          "KR",
          "KS",
          "KK",
          "KM",
          "KI",
          "RW",
          "KY",
          "KV",
          "KG",
          "KJ",
          "KU",
          "LO",
          "LA",
          "LI",
          "LN",
          "LU",
          "LB",
          "MK",
          "MG",
          "MS",
          "ML",
          "GV",
          "MI",
          "MR",
          "MH",
          "MN",
          "NA",
          "NV",
          "ND",
          "NR",
          "NG",
          "NE",
          "NB",
          "NN",
          "OC",
          "OJ",
          "OR",
          "OM",
          "OS",
          "PI",
          "PS",
          "FA",
          "PA",
          "QU",
          "RM",
          "RN",
          "SE",
          "SM",
          "SG",
          "SA",
          "SC",
          "SR",
          "SN",
          "SD",
          "SI",
          "SO",
          "ST",
          "SU",
          "SW",
          "SS",
          "TL",
          "TY",
          "TG",
          "TA",
          "TT",
          "TE",
          "BO",
          "TI",
          "TO",
          "TS",
          "TN",
          "TK",
          "TW",
          "UG",
          "UR",
          "UZ",
          "VE",
          "VO",
          "WA",
          "CY",
          "WO",
          "XH",
          "II",
          "YI",
          "YO",
          "ZA",
          "ZU",
          "BB",
          "CB",
          "DB",
          "EB",
          "FB",
          "GB",
          "HB",
          "IB",
          "JB",
          "KB",
          "MB",
          "OB",
          "PB",
          "QB",
          "RB",
          "SB",
          "TB",
          "UB",
          "VB",
          "WB",
          "XB",
          "YB",
          "ZB"
        ]
      },
      "Lead": {
        "type": "object",
        "required": [
          "tenantId",
          "source",
          "name",
          "status",
          "score",
          "tags",
          "firstContactAt",
          "createdAt"
        ],
        "properties": {
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "convertedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstContactAt": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "score": {
            "type": "integer",
            "format": "int32"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "tags": {},
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LeadStatus": {
        "type": "string",
        "description": "Lead status.",
        "enum": [
          "new",
          "qualified"
        ]
      },
      "LeadUpdate": {
        "type": "object",
        "properties": {
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "convertedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstContactAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "score": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadStatus"
              }
            ]
          },
          "tags": {},
          "tenantId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LegalDocType": {
        "type": "string",
        "description": "Legal document type (matches `DOC_TYPES` in legal_defaults.rs).",
        "enum": [
          "imprint",
          "privacy",
          "terms",
          "withdrawal",
          "refund",
          "shipping",
          "gpsr",
          "cookie_notice"
        ]
      },
      "LegalDocument": {
        "type": "object",
        "required": [
          "docType",
          "lang",
          "title",
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "Plain text, `\\n\\n` separates paragraphs."
          },
          "docType": {
            "$ref": "#/components/schemas/LegalDocType"
          },
          "lang": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "LegalDocumentReset": {
        "type": "object",
        "description": "Optional filter for `POST /api/v1/legal/documents/reset`; empty body\nrestores every document of the tenant.",
        "properties": {
          "docType": {
            "type": [
              "string",
              "null"
            ]
          },
          "lang": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LegalDocumentUpsert": {
        "type": "object",
        "description": "One document to upsert (`PUT /api/v1/legal/documents` body element).",
        "required": [
          "docType",
          "lang",
          "title",
          "content"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "docType": {
            "type": "string"
          },
          "lang": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "LiquidityPosition": {
        "type": "object",
        "required": [
          "cash_and_equivalents",
          "accounts_receivable",
          "accounts_payable",
          "working_capital",
          "current_ratio",
          "quick_ratio"
        ],
        "properties": {
          "accounts_payable": {
            "type": "number",
            "format": "double"
          },
          "accounts_receivable": {
            "type": "number",
            "format": "double"
          },
          "cash_and_equivalents": {
            "type": "number",
            "format": "double"
          },
          "current_ratio": {
            "type": "number",
            "format": "double"
          },
          "quick_ratio": {
            "type": "number",
            "format": "double"
          },
          "working_capital": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "totp_code": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MagicLinkRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          }
        }
      },
      "MagicLinkVerifyRequest": {
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string"
          }
        }
      },
      "MarketplaceConnection": {
        "type": "object",
        "required": [
          "tenant_id",
          "connection_id",
          "platform",
          "label",
          "connector_type",
          "config",
          "is_active",
          "created_at"
        ],
        "properties": {
          "config": {},
          "connection_id": {
            "type": "string"
          },
          "connector_type": {
            "$ref": "#/components/schemas/ConnectorType"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "is_active": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "last_sync_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "platform": {
            "type": "string"
          },
          "platform_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "scopes": {
            "type": [
              "string",
              "null"
            ]
          },
          "shop_domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "shop_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "sync_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "MarketplaceSyncLog": {
        "type": "object",
        "required": [
          "connectionId",
          "platform",
          "syncType",
          "status",
          "itemsSynced",
          "itemsFailed",
          "startedAt"
        ],
        "properties": {
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "connectionId": {
            "type": "string",
            "description": "References the marketplace connection entity."
          },
          "errorMessage": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemsFailed": {
            "type": "integer",
            "format": "int32"
          },
          "itemsSynced": {
            "type": "integer",
            "format": "int32"
          },
          "platform": {
            "type": "string"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/SyncLogStatus"
          },
          "syncType": {
            "$ref": "#/components/schemas/SyncType"
          }
        }
      },
      "MarketplaceWebhookEvent": {
        "type": "object",
        "required": [
          "connectionId",
          "platform",
          "eventType"
        ],
        "properties": {
          "connectionId": {
            "type": "string",
            "description": "References the marketplace connection entity."
          },
          "eventBody": {},
          "eventType": {
            "type": "string"
          },
          "headers": {},
          "platform": {
            "type": "string"
          },
          "processed": {
            "type": "boolean"
          },
          "processingError": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MessageDirection": {
        "type": "string",
        "description": "Message direction relative to the business.",
        "enum": [
          "inbound",
          "outbound",
          "internal"
        ]
      },
      "MessageType": {
        "type": "string",
        "description": "Body format of a ticket message.",
        "enum": [
          "text",
          "html"
        ]
      },
      "MeteredUsage": {
        "type": "object",
        "required": [
          "meter",
          "used",
          "limit"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "format": "int64"
          },
          "meter": {
            "type": "string"
          },
          "used": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "MethodSuitability": {
        "type": "object",
        "required": [
          "carrier",
          "service",
          "suitable",
          "reasons"
        ],
        "properties": {
          "carrier": {
            "type": "string"
          },
          "rate": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ShippingRate"
              }
            ]
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "service": {
            "type": "string"
          },
          "suitable": {
            "type": "boolean"
          }
        }
      },
      "MirrorTriggerResponse": {
        "type": "object",
        "required": [
          "job_id"
        ],
        "properties": {
          "job_id": {
            "type": "string"
          }
        }
      },
      "Model": {
        "type": "object",
        "required": [
          "id",
          "email",
          "name",
          "password_hash",
          "created_at",
          "updated_at",
          "is_active",
          "email_verified",
          "is_totp_enabled",
          "backup_codes"
        ],
        "properties": {
          "backup_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "email": {
            "type": "string"
          },
          "email_verified": {
            "type": "boolean"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "is_active": {
            "type": "boolean"
          },
          "is_totp_enabled": {
            "type": "boolean"
          },
          "last_login": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "oauth_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "oauth_provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "password_changed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set on password change; auth/refresh tokens issued before this\ntimestamp are rejected by the auth middleware."
          },
          "password_hash": {
            "type": "string"
          },
          "picture": {
            "type": [
              "string",
              "null"
            ]
          },
          "privacy_accepted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the user accepted the data privacy policy (GDPR consent record)."
          },
          "totp_secret": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MovementType": {
        "type": "string",
        "description": "Stock movement type.",
        "enum": [
          "goods_receipt",
          "goods_receipt_reversal",
          "transfer_in",
          "transfer_out",
          "return_restock",
          "production_consumption",
          "production_completion",
          "inventory_adjustment",
          "sale",
          "other"
        ]
      },
      "MyTrainingItem": {
        "type": "object",
        "required": [
          "assignmentId",
          "trainingId",
          "code",
          "title",
          "status",
          "passScore"
        ],
        "properties": {
          "assignmentId": {
            "type": "string",
            "format": "uuid"
          },
          "certificateId": {
            "type": [
              "string",
              "null"
            ]
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lastScore": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "passScore": {
            "type": "integer",
            "format": "int32"
          },
          "passed": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/AssignmentStatus"
          },
          "title": {
            "type": "string"
          },
          "trainingId": {
            "type": "string",
            "format": "uuid"
          },
          "validUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "NewVersionRequest": {
        "type": "object",
        "description": "Body for uploading a new version. Bytes must already be stored under\n`file_name` via the object storage API.",
        "required": [
          "fileName"
        ],
        "properties": {
          "fileName": {
            "type": "string",
            "description": "Storage key of the already-uploaded bytes."
          },
          "fileSize": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "originalName": {
            "type": [
              "string",
              "null"
            ]
          },
          "sha256Hash": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "NotificationDto": {
        "type": "object",
        "description": "Wire shape of a notification row (mirrors frontend Notification type).",
        "required": [
          "id",
          "user_id",
          "tenant_id",
          "title",
          "is_read",
          "sent_via_email",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "is_read": {
            "type": "boolean"
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "sent_via_email": {
            "type": "boolean"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "OAuthAuthorizeRequest": {
        "type": "object",
        "required": [
          "platform",
          "redirect_uri"
        ],
        "properties": {
          "config": {
            "description": "Optional platform-specific config (e.g. Shopify `shop_domain`,\n`api_key`, `api_secret`) needed to build the authorization URL."
          },
          "platform": {
            "type": "string"
          },
          "redirect_uri": {
            "type": "string"
          }
        }
      },
      "OAuthAuthorizeResponse": {
        "type": "object",
        "required": [
          "authorization_url",
          "state"
        ],
        "properties": {
          "authorization_url": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "OAuthCallbackRequest": {
        "type": "object",
        "required": [
          "platform",
          "code",
          "state"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "config": {},
          "connection_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "platform": {
            "type": "string"
          },
          "shop_domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string"
          }
        }
      },
      "OcrTextRequest": {
        "type": "object",
        "properties": {
          "ocrText": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OffenlegungItem": {
        "type": "object",
        "required": [
          "name",
          "exists",
          "source"
        ],
        "properties": {
          "exists": {
            "type": "boolean",
            "description": "Ob die zugrunde liegenden Daten im System vorhanden sind."
          },
          "name": {
            "type": "string",
            "description": "Bezeichnung des Offenlegungsbestandteils (§ 325 Abs. 1 HGB)."
          },
          "source": {
            "type": "string",
            "description": "Woher der Bestandteil stammt bzw. fehlt."
          }
        }
      },
      "OffenlegungReport": {
        "type": "object",
        "required": [
          "year",
          "deadline_months",
          "deadline",
          "kapitalmarktorientiert",
          "note",
          "items"
        ],
        "properties": {
          "deadline": {
            "type": "string",
            "format": "date",
            "description": "Fristende (Abschlussstichtag + Frist)."
          },
          "deadline_months": {
            "type": "integer",
            "format": "int32",
            "description": "Offenlegungsfrist in Monaten (§ 325 Abs. 4 HGB)."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OffenlegungItem"
            }
          },
          "kapitalmarktorientiert": {
            "type": "boolean",
            "description": "Annahme über die Kapitalmarktorientierung."
          },
          "note": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "Berichtsjahr (laufendes Kalenderjahr)."
          }
        }
      },
      "OpenItem": {
        "type": "object",
        "required": [
          "invoice_id",
          "invoice_number",
          "amount_due",
          "amount_paid",
          "open_amount",
          "issue_date",
          "reminder_level"
        ],
        "properties": {
          "amount_due": {
            "type": "string"
          },
          "amount_paid": {
            "type": "string"
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "days_overdue": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_id": {
            "type": "string"
          },
          "invoice_number": {
            "type": "string"
          },
          "issue_date": {
            "type": "string"
          },
          "open_amount": {
            "type": "string"
          },
          "reminder_level": {
            "$ref": "#/components/schemas/ReminderLevel"
          }
        }
      },
      "Order": {
        "type": "object",
        "required": [
          "customerId",
          "orderStatus",
          "tags",
          "shippingMethod",
          "shippingCost",
          "shippingWeight",
          "totalCost",
          "paymentMethod",
          "currency"
        ],
        "properties": {
          "auditLog": {},
          "currency": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "References the customer entity."
          },
          "externalReference": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoiceAddress": {},
          "items": {},
          "language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "orderStatus": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "paymentMethod": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "shippingAddress": {},
          "shippingCost": {
            "type": "string"
          },
          "shippingMethod": {
            "type": "string"
          },
          "shippingWeight": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalCost": {
            "type": "string"
          }
        }
      },
      "OrderConfirmation": {
        "type": "object",
        "required": [
          "voucherStatus",
          "voucherDate",
          "currency"
        ],
        "properties": {
          "address": {},
          "confirmationNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "files": {},
          "introduction": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "precedingSalesVoucherId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the preceding sales voucher entity."
          },
          "precedingSalesVoucherType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrecedingSalesVoucherType"
              }
            ]
          },
          "remark": {
            "type": [
              "string",
              "null"
            ]
          },
          "subtotal": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxCondition": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalTax": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherDate": {
            "type": "string",
            "format": "date"
          },
          "voucherStatus": {
            "$ref": "#/components/schemas/VoucherStatus"
          }
        }
      },
      "OrderConfirmationCreate": {
        "type": "object",
        "required": [
          "voucherStatus",
          "voucherDate",
          "currency"
        ],
        "properties": {
          "address": {},
          "confirmationNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "files": {},
          "introduction": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "precedingSalesVoucherId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the preceding sales voucher entity."
          },
          "precedingSalesVoucherType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrecedingSalesVoucherType"
              }
            ]
          },
          "remark": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxCondition": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherDate": {
            "type": "string",
            "format": "date"
          },
          "voucherStatus": {
            "$ref": "#/components/schemas/VoucherStatus"
          }
        }
      },
      "OrderCreate": {
        "type": "object",
        "required": [
          "customerId",
          "orderStatus",
          "tags",
          "shippingMethod",
          "shippingCost",
          "shippingWeight",
          "totalCost",
          "paymentMethod",
          "currency"
        ],
        "properties": {
          "auditLog": {},
          "currency": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "References the customer entity."
          },
          "externalReference": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoiceAddress": {},
          "items": {},
          "language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "orderStatus": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "paymentMethod": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "shippingAddress": {},
          "shippingCost": {
            "type": "string"
          },
          "shippingMethod": {
            "type": "string"
          },
          "shippingWeight": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalCost": {
            "type": "string"
          }
        }
      },
      "OrderStateUpdate": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "send_state_to_shop": {
            "type": "boolean"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "OrderStatus": {
        "type": "string",
        "enum": [
          "pending",
          "ordered",
          "confirmed",
          "processing",
          "paid",
          "shipped",
          "completed",
          "closed",
          "cancelled",
          "refunded",
          "failed"
        ]
      },
      "OrderTagsRequest": {
        "type": "object",
        "required": [
          "tags"
        ],
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "OrderUpdate": {
        "type": "object",
        "properties": {
          "auditLog": {},
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "externalReference": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoiceAddress": {},
          "items": {},
          "language": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LanguageCode"
              }
            ]
          },
          "orderStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OrderStatus"
              }
            ]
          },
          "paymentMethod": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaymentMethod"
              }
            ]
          },
          "shippingAddress": {},
          "shippingCost": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingWeight": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "totalCost": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OssDependency": {
        "type": "object",
        "required": [
          "name",
          "version",
          "dependency_type"
        ],
        "properties": {
          "dependency_type": {
            "type": "string"
          },
          "license": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "OssReport": {
        "type": "object",
        "required": [
          "dependencies",
          "total_count"
        ],
        "properties": {
          "dependencies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OssDependency"
            }
          },
          "total_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "Package": {
        "type": "object",
        "required": [
          "weight_kg"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "height_cm": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "length_cm": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "weight_kg": {
            "type": "number",
            "format": "double"
          },
          "width_cm": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "PackingCompleteRequest": {
        "type": "object",
        "required": [
          "order_number"
        ],
        "properties": {
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "order_number": {
            "type": "string"
          },
          "shipment_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PackingCompleteResponse": {
        "type": "object",
        "required": [
          "success",
          "order_number",
          "new_state",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          },
          "new_state": {
            "type": "string"
          },
          "order_number": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "PackingQueue": {
        "type": "object",
        "required": [
          "items",
          "total_count",
          "page",
          "page_size"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PackingQueueItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "page_size": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "total_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "PackingQueueItem": {
        "type": "object",
        "required": [
          "order_number",
          "customer_id",
          "order_status",
          "shipping_method",
          "items",
          "items_count",
          "created_at",
          "label_printed",
          "delivery_note_printed"
        ],
        "properties": {
          "created_at": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "delivery_note_printed": {
            "type": "boolean"
          },
          "items": {},
          "items_count": {
            "type": "integer",
            "format": "int32"
          },
          "label_printed": {
            "type": "boolean"
          },
          "order_number": {
            "type": "string"
          },
          "order_status": {
            "type": "string"
          },
          "shipment_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipping_address": {},
          "shipping_method": {
            "type": "string"
          },
          "tracking_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_recording": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PackingVideoResponse": {
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          },
          "recording_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "PartialFeatureSettings": {
        "type": "object",
        "description": "Partial feature toggles: `None` keeps the company-type default, `Some`\noverrides it.",
        "properties": {
          "onlineshop": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reportBilanz": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reportBwa": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reportEuer": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reportGewerbesteuer": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reportGuv": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reportKst": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reportUstva": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "Participation": {
        "type": "object",
        "properties": {
          "acquiredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Datum des Erwerbs der Beteiligung."
          },
          "boardAppointment": {
            "type": "boolean",
            "description": "Bestellungsrecht für Geschäftsführung/Aufsichtsrat (§ 290 Abs. 2 Nr. 2 HGB)."
          },
          "companyName": {
            "type": "string",
            "description": "Name des Beteiligungsunternehmens (§ 271 HGB).",
            "maxLength": 200,
            "minLength": 1
          },
          "controlAgreement": {
            "type": "boolean",
            "description": "Beherrschungsvertrag (§ 290 Abs. 2 Nr. 3 HGB)."
          },
          "legalForm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rechtsform, z. B. \"GmbH\".",
            "maxLength": 100
          },
          "ownershipPct": {
            "type": "string",
            "description": "Anteilsquote in Prozent (§ 271 HGB; > 20 % widerlegbare Vermutung)."
          },
          "purposeVehicle": {
            "type": "boolean",
            "description": "Zweckgesellschaft (§ 290 Abs. 2 Nr. 4 HGB)."
          },
          "votingMajority": {
            "type": "boolean",
            "description": "Stimmrechtsmehrheit (§ 290 Abs. 2 Nr. 1 HGB)."
          }
        }
      },
      "ParticipationCreate": {
        "type": "object",
        "properties": {
          "acquiredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Datum des Erwerbs der Beteiligung."
          },
          "boardAppointment": {
            "type": "boolean",
            "description": "Bestellungsrecht für Geschäftsführung/Aufsichtsrat (§ 290 Abs. 2 Nr. 2 HGB)."
          },
          "companyName": {
            "type": "string",
            "description": "Name des Beteiligungsunternehmens (§ 271 HGB).",
            "maxLength": 200,
            "minLength": 1
          },
          "controlAgreement": {
            "type": "boolean",
            "description": "Beherrschungsvertrag (§ 290 Abs. 2 Nr. 3 HGB)."
          },
          "legalForm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rechtsform, z. B. \"GmbH\".",
            "maxLength": 100
          },
          "ownershipPct": {
            "type": "string",
            "description": "Anteilsquote in Prozent (§ 271 HGB; > 20 % widerlegbare Vermutung)."
          },
          "purposeVehicle": {
            "type": "boolean",
            "description": "Zweckgesellschaft (§ 290 Abs. 2 Nr. 4 HGB)."
          },
          "votingMajority": {
            "type": "boolean",
            "description": "Stimmrechtsmehrheit (§ 290 Abs. 2 Nr. 1 HGB)."
          }
        }
      },
      "ParticipationUpdate": {
        "type": "object",
        "properties": {
          "acquiredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Datum des Erwerbs der Beteiligung."
          },
          "boardAppointment": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Bestellungsrecht für Geschäftsführung/Aufsichtsrat (§ 290 Abs. 2 Nr. 2 HGB)."
          },
          "companyName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name des Beteiligungsunternehmens (§ 271 HGB).",
            "maxLength": 200,
            "minLength": 1
          },
          "controlAgreement": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Beherrschungsvertrag (§ 290 Abs. 2 Nr. 3 HGB)."
          },
          "legalForm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rechtsform, z. B. \"GmbH\".",
            "maxLength": 100
          },
          "ownershipPct": {
            "type": [
              "string",
              "null"
            ],
            "description": "Anteilsquote in Prozent (§ 271 HGB; > 20 % widerlegbare Vermutung)."
          },
          "purposeVehicle": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Zweckgesellschaft (§ 290 Abs. 2 Nr. 4 HGB)."
          },
          "votingMajority": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Stimmrechtsmehrheit (§ 290 Abs. 2 Nr. 1 HGB)."
          }
        }
      },
      "PayGapExportResponse": {
        "type": "object",
        "required": [
          "csv_content",
          "filename"
        ],
        "properties": {
          "csv_content": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "PayGapInfoResponse": {
        "type": "object",
        "required": [
          "employee_id",
          "first_name",
          "last_name",
          "job_title",
          "group_size"
        ],
        "properties": {
          "employee_id": {
            "type": "string",
            "format": "uuid"
          },
          "first_name": {
            "type": "string"
          },
          "gender": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_median_hourly": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "group_median_monthly": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "group_size": {
            "type": "integer",
            "minimum": 0
          },
          "job_title": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "overall_median_hourly": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "own_hourly_gross": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "own_monthly_gross": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "PayGapReport": {
        "type": "object",
        "required": [
          "employee_count",
          "female_count",
          "male_count",
          "diverse_count",
          "mean_gap_pct",
          "median_gap_pct",
          "by_job_title",
          "quartiles"
        ],
        "properties": {
          "by_job_title": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobTitleGap"
            }
          },
          "diverse_count": {
            "type": "integer",
            "minimum": 0
          },
          "employee_count": {
            "type": "integer",
            "minimum": 0
          },
          "female_count": {
            "type": "integer",
            "minimum": 0
          },
          "male_count": {
            "type": "integer",
            "minimum": 0
          },
          "mean_gap_pct": {
            "type": "number",
            "format": "double"
          },
          "median_gap_pct": {
            "type": "number",
            "format": "double"
          },
          "quartiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuartileBand"
            }
          }
        }
      },
      "Payment": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "attachment": {},
          "currency": {
            "type": "string"
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {},
          "method": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "paymentDate": {
            "type": "string",
            "format": "date-time"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PaymentCondition": {
        "type": "object",
        "required": [
          "id",
          "name",
          "payment_term_days",
          "discount_percentage",
          "discount_days"
        ],
        "properties": {
          "discount_days": {
            "type": "integer",
            "format": "int32"
          },
          "discount_percentage": {
            "type": "number",
            "format": "double"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "payment_term_days": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PaymentCreate": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string"
          },
          "attachment": {},
          "currency": {
            "type": "string"
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {},
          "method": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "paymentDate": {
            "type": "string",
            "format": "date-time"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PaymentGateway": {
        "type": "object",
        "required": [
          "tenantId",
          "gatewayId",
          "gatewayType",
          "label",
          "enabled",
          "config",
          "createdAt"
        ],
        "properties": {
          "config": {},
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "gatewayId": {
            "type": "string"
          },
          "gatewayType": {
            "$ref": "#/components/schemas/GatewayType"
          },
          "label": {
            "type": "string"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PaymentGatewayCreate": {
        "type": "object",
        "required": [
          "gatewayType",
          "label",
          "enabled",
          "config",
          "createdAt"
        ],
        "properties": {
          "config": {},
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "gatewayType": {
            "$ref": "#/components/schemas/GatewayType"
          },
          "label": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PaymentGatewayUpdate": {
        "type": "object",
        "properties": {
          "config": {},
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "gatewayType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GatewayType"
              }
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PaymentMethod": {
        "type": "string",
        "enum": [
          "bank_transfer",
          "sepa_direct_debit",
          "cash",
          "credit_card",
          "paypal",
          "sumup",
          "viva_wallet",
          "reepay",
          "none"
        ]
      },
      "PaymentStatus": {
        "type": "string",
        "description": "Payment state of an invoice.",
        "enum": [
          "unpaid",
          "paid"
        ]
      },
      "PayrollAutopayPayload": {
        "type": "object",
        "properties": {
          "debtor_bic": {
            "type": [
              "string",
              "null"
            ]
          },
          "debtor_iban": {
            "type": [
              "string",
              "null"
            ]
          },
          "debtor_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "execution_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        }
      },
      "PayrollCreatePayload": {
        "type": "object",
        "required": [
          "year",
          "month",
          "employee_ids"
        ],
        "properties": {
          "employee_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "extra_payments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ExtraPayment"
            }
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PayrollEntryApi": {
        "type": "object",
        "required": [
          "entry_id",
          "run_id",
          "employee_id",
          "gross_salary",
          "extra_payments",
          "lohnsteuer",
          "soli",
          "church_tax_amount",
          "kv_employee",
          "pv_employee",
          "rv_employee",
          "av_employee",
          "kv_employer",
          "pv_employer",
          "rv_employer",
          "av_employer",
          "total_deductions",
          "net_salary",
          "total_employer_cost",
          "vacation_days_used",
          "sick_days",
          "status"
        ],
        "properties": {
          "av_employee": {
            "type": "string"
          },
          "av_employer": {
            "type": "string"
          },
          "church_tax_amount": {
            "type": "string"
          },
          "employee": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Employee"
              }
            ]
          },
          "employee_id": {
            "type": "string",
            "format": "uuid"
          },
          "entry_id": {
            "type": "string",
            "format": "uuid"
          },
          "extra_payment_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "extra_payments": {
            "type": "string"
          },
          "gross_salary": {
            "type": "string"
          },
          "kv_employee": {
            "type": "string"
          },
          "kv_employer": {
            "type": "string"
          },
          "lohnsteuer": {
            "type": "string"
          },
          "net_salary": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "pv_employee": {
            "type": "string"
          },
          "pv_employer": {
            "type": "string"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "rv_employee": {
            "type": "string"
          },
          "rv_employer": {
            "type": "string"
          },
          "sick_days": {
            "type": "integer",
            "format": "int32"
          },
          "soli": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PayrollRunStatus"
          },
          "total_deductions": {
            "type": "string"
          },
          "total_employer_cost": {
            "type": "string"
          },
          "vacation_days_used": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PayrollMonth": {
        "type": "object",
        "required": [
          "month",
          "gross",
          "net"
        ],
        "properties": {
          "gross": {
            "type": "string"
          },
          "month": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "net": {
            "type": "string"
          }
        }
      },
      "PayrollPayPayload": {
        "type": "object",
        "required": [
          "payment_date"
        ],
        "properties": {
          "payment_date": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "PayrollRunApi": {
        "type": "object",
        "required": [
          "run_id",
          "tenant_id",
          "year",
          "month",
          "period_label",
          "status",
          "entries",
          "total_gross",
          "total_net",
          "total_employer_cost",
          "total_taxes",
          "total_social_security",
          "total_employee_count",
          "created_at"
        ],
        "properties": {
          "approved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "approved_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayrollEntryApi"
            }
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "payment_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "period_label": {
            "type": "string"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/PayrollRunStatus"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "total_employee_count": {
            "type": "integer",
            "format": "int32"
          },
          "total_employer_cost": {
            "type": "string"
          },
          "total_gross": {
            "type": "string"
          },
          "total_net": {
            "type": "string"
          },
          "total_social_security": {
            "type": "string"
          },
          "total_taxes": {
            "type": "string"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PayrollRunStatus": {
        "type": "string",
        "enum": [
          "draft",
          "calculated",
          "approved",
          "paid"
        ]
      },
      "PayrollSummary": {
        "type": "object",
        "required": [
          "id",
          "firstName",
          "lastName",
          "jobTitle",
          "year",
          "months"
        ],
        "properties": {
          "firstName": {
            "type": "string"
          },
          "hourlyGross": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "jobTitle": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "monthlySalary": {
            "type": [
              "string",
              "null"
            ]
          },
          "months": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayrollMonth"
            }
          },
          "weeklyHours": {
            "type": [
              "string",
              "null"
            ]
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PayrollSummaryItem": {
        "type": "object",
        "required": [
          "month",
          "year",
          "total_gross",
          "total_net",
          "total_employer_cost",
          "employee_count",
          "status"
        ],
        "properties": {
          "employee_count": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PayrollRunStatus"
          },
          "total_employer_cost": {
            "type": "string"
          },
          "total_gross": {
            "type": "string"
          },
          "total_net": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PeppolResponse": {
        "type": "object",
        "required": [
          "content",
          "content_type",
          "filename"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "Plan": {
        "type": "object",
        "description": "One canonical plan. `price_eur == -1.0` means custom pricing.",
        "required": [
          "id",
          "name",
          "priceEur",
          "limits",
          "features"
        ],
        "properties": {
          "features": {
            "$ref": "#/components/schemas/PlanFeatures"
          },
          "id": {
            "type": "string"
          },
          "limits": {
            "$ref": "#/components/schemas/PlanLimits"
          },
          "name": {
            "type": "string"
          },
          "priceEur": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "PlanFeatures": {
        "type": "object",
        "description": "Feature flags per plan.",
        "required": [
          "taxAutomations",
          "fancyReports",
          "erp",
          "connectors"
        ],
        "properties": {
          "connectors": {
            "type": "boolean"
          },
          "erp": {
            "type": "boolean"
          },
          "fancyReports": {
            "type": "boolean"
          },
          "taxAutomations": {
            "type": "boolean"
          }
        }
      },
      "PlanLimits": {
        "type": "object",
        "description": "Per-plan numeric limits. `-1` in any field means unlimited.",
        "required": [
          "maxUsers",
          "maxInvoicesPerMonth",
          "maxConnectors",
          "paidConnectors"
        ],
        "properties": {
          "maxConnectors": {
            "type": "integer",
            "format": "int32"
          },
          "maxInvoicesPerMonth": {
            "type": "integer",
            "format": "int64"
          },
          "maxUsers": {
            "type": "integer",
            "format": "int32"
          },
          "metered": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "paidConnectors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Connectors that are *not* included in this plan (require a higher\ntier). Empty = all connectors included on this plan."
          }
        }
      },
      "PlatformInfo": {
        "type": "object",
        "description": "Public metadata for one registered plugin (admin UI). Maps 1:1 from\n[`plugin_core::PluginInfo`] (same field shape as before).",
        "required": [
          "platform",
          "display_name",
          "author",
          "version",
          "supports_oauth",
          "config_fields",
          "config_field_names",
          "supports_import",
          "supports_export",
          "supported_entities",
          "pricing",
          "changelog"
        ],
        "properties": {
          "author": {
            "type": "string"
          },
          "changelog": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChangelogEntry"
            }
          },
          "config_field_names": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "config_fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConfigFieldInfo"
            }
          },
          "display_name": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "pricing": {
            "$ref": "#/components/schemas/PluginPricing"
          },
          "supported_entities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "supports_export": {
            "type": "boolean"
          },
          "supports_import": {
            "type": "boolean"
          },
          "supports_oauth": {
            "type": "boolean"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "PlausibilityCheck": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "detail",
          "severity"
        ],
        "properties": {
          "detail": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "severity": {
            "$ref": "#/components/schemas/Severity"
          },
          "status": {
            "$ref": "#/components/schemas/CheckStatus"
          }
        }
      },
      "PlausibilityReport": {
        "type": "object",
        "required": [
          "generated_at",
          "checks",
          "summary"
        ],
        "properties": {
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlausibilityCheck"
            }
          },
          "generated_at": {
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/PlausibilitySummary"
          }
        }
      },
      "PlausibilitySummary": {
        "type": "object",
        "required": [
          "total_checks",
          "passed",
          "warnings",
          "errors",
          "overall_status"
        ],
        "properties": {
          "errors": {
            "type": "integer",
            "minimum": 0
          },
          "overall_status": {
            "$ref": "#/components/schemas/CheckStatus"
          },
          "passed": {
            "type": "integer",
            "minimum": 0
          },
          "total_checks": {
            "type": "integer",
            "minimum": 0
          },
          "warnings": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "PluginError": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "BadRequest"
            ],
            "properties": {
              "BadRequest": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "maxItems": 2,
                "minItems": 2
              }
            },
            "example": "Invalid input data"
          },
          {
            "type": "object",
            "required": [
              "NotFound"
            ],
            "properties": {
              "NotFound": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "maxItems": 2,
                "minItems": 2
              }
            },
            "example": "Resource not found"
          },
          {
            "type": "object",
            "required": [
              "Unauthorized"
            ],
            "properties": {
              "Unauthorized": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "maxItems": 2,
                "minItems": 2
              }
            },
            "example": "Authentication required"
          },
          {
            "type": "object",
            "required": [
              "InternalError"
            ],
            "properties": {
              "InternalError": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "maxItems": 2,
                "minItems": 2
              }
            },
            "example": "Internal server error"
          },
          {
            "type": "object",
            "required": [
              "DatabaseError"
            ],
            "properties": {
              "DatabaseError": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "maxItems": 2,
                "minItems": 2
              }
            }
          },
          {
            "type": "object",
            "required": [
              "ValidationError"
            ],
            "properties": {
              "ValidationError": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "maxItems": 2,
                "minItems": 2
              }
            },
            "example": "Validation failed"
          },
          {
            "type": "object",
            "required": [
              "NotImplemented"
            ],
            "properties": {
              "NotImplemented": {
                "type": "string"
              }
            },
            "example": "sync_orders not implemented for plugin"
          }
        ]
      },
      "PluginPricing": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "free"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "price",
              "type"
            ],
            "properties": {
              "price": {
                "type": "number",
                "format": "double"
              },
              "type": {
                "type": "string",
                "enum": [
                  "one_time"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "price_per_month",
              "type"
            ],
            "properties": {
              "price_per_month": {
                "type": "number",
                "format": "double"
              },
              "type": {
                "type": "string",
                "enum": [
                  "recurring"
                ]
              }
            }
          }
        ],
        "description": "How a plugin is priced in the marketplace. Tagged on `type` so the same\nenum deserializes both the API DTO and the `plugin_marketplace.json`\nmanifest (`{\"type\":\"free\"}` / `{\"type\":\"one_time\",\"price\":99.0}` /\n`{\"type\":\"recurring\",\"price_per_month\":19.9}`)."
      },
      "PnLItem": {
        "type": "object",
        "required": [
          "account",
          "account_name",
          "amount"
        ],
        "properties": {
          "account": {
            "type": "string"
          },
          "account_name": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          }
        }
      },
      "PosRegister": {
        "type": "object",
        "description": "A point-of-sale register (Kasse). Registers are the billable unit of the\nPOS feature: each active register costs a monthly fee per tenant, billed\nthrough Paddle. `status`: `active` | `disabled`.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1
          },
          "status": {
            "$ref": "#/components/schemas/PosRegisterStatus"
          }
        }
      },
      "PosRegisterCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1
          },
          "status": {
            "$ref": "#/components/schemas/PosRegisterStatus"
          }
        }
      },
      "PosRegisterStatus": {
        "type": "string",
        "description": "POS register status.",
        "enum": [
          "active",
          "disabled"
        ]
      },
      "PosTable": {
        "type": "object",
        "description": "A physical table at a restaurant/cafe POS. `current_order_number` links\nthe open order occupying the table; `None` means free.",
        "required": [
          "name"
        ],
        "properties": {
          "currentOrderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1
          },
          "status": {
            "$ref": "#/components/schemas/PosTableStatus"
          }
        }
      },
      "PosTableCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "currentOrderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1
          },
          "status": {
            "$ref": "#/components/schemas/PosTableStatus"
          }
        }
      },
      "PosTableStatus": {
        "type": "string",
        "description": "POS table status.",
        "enum": [
          "free",
          "occupied"
        ]
      },
      "PostingCategory": {
        "type": "object",
        "required": [
          "category_id",
          "name",
          "type",
          "skr_version",
          "is_system",
          "default_vat_rate",
          "is_active"
        ],
        "properties": {
          "account_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_number_skr03": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_number_skr04": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_number_skr49": {
            "type": [
              "string",
              "null"
            ]
          },
          "category_id": {
            "type": "string"
          },
          "default_vat_rate": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "eks_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "is_system": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "skr_version": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "PostingCategoryCreate": {
        "type": "object",
        "required": [
          "name",
          "categoryType",
          "skrVersion",
          "isSystem",
          "userModifiedSkr03",
          "userModifiedSkr04",
          "inputVatPercentage",
          "defaultVatRate",
          "isActive",
          "createdAt"
        ],
        "properties": {
          "accountNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountNumberSkr03": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountNumberSkr04": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountNumberSkr49": {
            "type": [
              "string",
              "null"
            ]
          },
          "categoryType": {
            "$ref": "#/components/schemas/PostingCategoryType"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "defaultVatRate": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "eksCategory": {
            "type": [
              "string",
              "null"
            ]
          },
          "euVatLine": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "inputVatPercentage": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "isSystem": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "skrVersion": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "userModifiedSkr03": {
            "type": "boolean"
          },
          "userModifiedSkr04": {
            "type": "boolean"
          }
        }
      },
      "PostingCategoryType": {
        "type": "string",
        "description": "Posting category type: income or expense.",
        "enum": [
          "income",
          "expense"
        ]
      },
      "PostingCategoryUpdate": {
        "type": "object",
        "properties": {
          "accountNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountNumberSkr03": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountNumberSkr04": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountNumberSkr49": {
            "type": [
              "string",
              "null"
            ]
          },
          "categoryType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PostingCategoryType"
              }
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "defaultVatRate": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "eksCategory": {
            "type": [
              "string",
              "null"
            ]
          },
          "euVatLine": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "inputVatPercentage": {
            "type": [
              "string",
              "null"
            ]
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "isSystem": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "skrVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "userModifiedSkr03": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "userModifiedSkr04": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "PrecedingSalesVoucherType": {
        "type": "string",
        "description": "Type of the sales voucher that preceded this document.",
        "enum": [
          "order_confirmation",
          "quotation",
          "proforma_invoice"
        ]
      },
      "PriceTier": {
        "type": "object",
        "required": [
          "productId",
          "unitPrice"
        ],
        "properties": {
          "customerGroupId": {
            "type": [
              "string",
              "null"
            ],
            "description": "None = tier applies to all customers; otherwise a customer group id."
          },
          "minQuantity": {
            "type": "integer",
            "format": "int64",
            "description": "Quantity from which this tier applies (inclusive)."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "References the product entity."
          },
          "unitPrice": {
            "type": "string",
            "description": "Net unit price once `min_quantity` is reached."
          }
        }
      },
      "PriceTierCreate": {
        "type": "object",
        "required": [
          "productId",
          "unitPrice"
        ],
        "properties": {
          "customerGroupId": {
            "type": [
              "string",
              "null"
            ],
            "description": "None = tier applies to all customers; otherwise a customer group id."
          },
          "minQuantity": {
            "type": "integer",
            "format": "int64",
            "description": "Quantity from which this tier applies (inclusive)."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "References the product entity."
          },
          "unitPrice": {
            "type": "string",
            "description": "Net unit price once `min_quantity` is reached."
          }
        }
      },
      "PriceTierUpdate": {
        "type": "object",
        "required": [
          "unitPrice"
        ],
        "properties": {
          "customerGroupId": {
            "type": [
              "string",
              "null"
            ],
            "description": "None = tier applies to all customers; otherwise a customer group id."
          },
          "minQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Quantity from which this tier applies (inclusive)."
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the product entity."
          },
          "unitPrice": {
            "type": "string",
            "description": "Net unit price once `min_quantity` is reached."
          }
        }
      },
      "PrintDeliveryNoteResponse": {
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "PrintLabelResponse": {
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "properties": {
          "label_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": "string"
          },
          "sscc": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          },
          "tracking_number": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Product": {
        "type": "object",
        "required": [
          "productCode",
          "name",
          "sku"
        ],
        "properties": {
          "availability": {
            "type": [
              "string",
              "null"
            ]
          },
          "barcode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "brand": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "categoryId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultLedgerAccount": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "defaultPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultPriceFormulaId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the price formula entity."
          },
          "defaultTaxRate": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "gtin": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "height": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageLink": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "images": {},
          "isTaxable": {
            "type": "boolean"
          },
          "length": {
            "type": [
              "string",
              "null"
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "maxStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Target stock level used by reorder proposals."
          },
          "minStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Reorder point — when stock falls below this, a reorder is suggested."
          },
          "mpn": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "packageHeight": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageLength": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageWeightUnit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "packageWeightValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageWidth": {
            "type": [
              "string",
              "null"
            ]
          },
          "productCode": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "productType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "purchasePrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "reorderQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Suggested purchase quantity when a reorder proposal is created."
          },
          "salePrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingRequiresInsurance": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "sku": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "stockQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "tags": {},
          "taxPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackBatch": {
            "type": "boolean",
            "description": "Whether this product requires batch (Chargennummer) tracking."
          },
          "trackSerial": {
            "type": "boolean",
            "description": "Whether this product requires serial-number tracking."
          },
          "unit": {},
          "weightUnit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "weightValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProductAttribute": {
        "type": "object",
        "required": [
          "productId",
          "name",
          "value"
        ],
        "properties": {
          "isFilterable": {
            "type": "boolean",
            "description": "Whether this attribute participates in the shop's faceted filters."
          },
          "name": {
            "type": "string",
            "description": "Attribute name, e.g. `Material`, `Farbe`, `Gewicht`.",
            "minLength": 1
          },
          "position": {
            "type": "integer",
            "format": "int32",
            "description": "Ordering position within the product's attribute list."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "The product this attribute belongs to.\nReferences the product entity."
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional unit of measure for numeric attributes, e.g. `g`, `cm`."
          },
          "value": {
            "type": "string",
            "description": "Attribute value, e.g. `Baumwolle`, `Rot`, `180g`.",
            "minLength": 1
          }
        }
      },
      "ProductAttributeCreate": {
        "type": "object",
        "required": [
          "productId",
          "name",
          "value"
        ],
        "properties": {
          "isFilterable": {
            "type": "boolean",
            "description": "Whether this attribute participates in the shop's faceted filters."
          },
          "name": {
            "type": "string",
            "description": "Attribute name, e.g. `Material`, `Farbe`, `Gewicht`.",
            "minLength": 1
          },
          "position": {
            "type": "integer",
            "format": "int32",
            "description": "Ordering position within the product's attribute list."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "The product this attribute belongs to.\nReferences the product entity."
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional unit of measure for numeric attributes, e.g. `g`, `cm`."
          },
          "value": {
            "type": "string",
            "description": "Attribute value, e.g. `Baumwolle`, `Rot`, `180g`.",
            "minLength": 1
          }
        }
      },
      "ProductAttributeUpdate": {
        "type": "object",
        "properties": {
          "isFilterable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this attribute participates in the shop's faceted filters."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute name, e.g. `Material`, `Farbe`, `Gewicht`.",
            "minLength": 1
          },
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Ordering position within the product's attribute list."
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The product this attribute belongs to.\nReferences the product entity."
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional unit of measure for numeric attributes, e.g. `g`, `cm`."
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "Attribute value, e.g. `Baumwolle`, `Rot`, `180g`.",
            "minLength": 1
          }
        }
      },
      "ProductCategory": {
        "type": "object",
        "required": [
          "name",
          "sortOrder"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "parentCategoryId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the category entity."
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProductCategoryCreate": {
        "type": "object",
        "required": [
          "name",
          "sortOrder"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "parentCategoryId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the category entity."
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProductCategoryUpdate": {
        "type": "object",
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "parentCategoryId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the category entity."
          },
          "sortOrder": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          }
        }
      },
      "ProductCreate": {
        "type": "object",
        "required": [
          "productCode",
          "name",
          "sku"
        ],
        "properties": {
          "availability": {
            "type": [
              "string",
              "null"
            ]
          },
          "barcode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "brand": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "categoryId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultLedgerAccount": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "defaultPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultPriceFormulaId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the price formula entity."
          },
          "defaultTaxRate": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "gtin": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "height": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageLink": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "images": {},
          "isTaxable": {
            "type": "boolean"
          },
          "length": {
            "type": [
              "string",
              "null"
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "maxStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Target stock level used by reorder proposals."
          },
          "minStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Reorder point — when stock falls below this, a reorder is suggested."
          },
          "mpn": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "packageHeight": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageLength": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageWeightUnit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "packageWeightValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageWidth": {
            "type": [
              "string",
              "null"
            ]
          },
          "productCode": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "productType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "purchasePrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "reorderQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Suggested purchase quantity when a reorder proposal is created."
          },
          "salePrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingRequiresInsurance": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "sku": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "stockQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "tags": {},
          "taxPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackBatch": {
            "type": "boolean",
            "description": "Whether this product requires batch (Chargennummer) tracking."
          },
          "trackSerial": {
            "type": "boolean",
            "description": "Whether this product requires serial-number tracking."
          },
          "unit": {},
          "weightUnit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "weightValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProductStock": {
        "type": "object",
        "required": [
          "product_id",
          "name",
          "sku"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": "string"
          },
          "stock_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "ProductUpdate": {
        "type": "object",
        "properties": {
          "availability": {
            "type": [
              "string",
              "null"
            ]
          },
          "barcode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "brand": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "categoryId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultLedgerAccount": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "defaultPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultPriceFormulaId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the price formula entity."
          },
          "defaultTaxRate": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "gtin": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "height": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageLink": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "images": {},
          "isTaxable": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "length": {
            "type": [
              "string",
              "null"
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "maxStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Target stock level used by reorder proposals."
          },
          "minStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Reorder point — when stock falls below this, a reorder is suggested."
          },
          "mpn": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "minLength": 1
          },
          "packageHeight": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageLength": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageWeightUnit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "packageWeightValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "packageWidth": {
            "type": [
              "string",
              "null"
            ]
          },
          "productCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "minLength": 1
          },
          "productType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "purchasePrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "reorderQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Suggested purchase quantity when a reorder proposal is created."
          },
          "salePrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingRequiresInsurance": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "minLength": 1
          },
          "stockQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "tags": {},
          "taxPrice": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackBatch": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this product requires batch (Chargennummer) tracking."
          },
          "trackSerial": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this product requires serial-number tracking."
          },
          "unit": {},
          "weightUnit": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "weightValue": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProductVariant": {
        "type": "object",
        "required": [
          "productId",
          "sku"
        ],
        "properties": {
          "barcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageLink": {
            "type": [
              "string",
              "null"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable variant label, e.g. \"Red / M\"."
          },
          "optionValues": {
            "description": "Option name → value map, e.g. `{\"Color\": \"Red\", \"Size\": \"M\"}`."
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "Explicit override price for this variant (takes precedence over\nparent price + delta)."
          },
          "priceDelta": {
            "type": [
              "string",
              "null"
            ],
            "description": "Price adjustment relative to the parent product's `default_price`."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "The parent product this variant belongs to.\nReferences the product entity."
          },
          "sku": {
            "type": "string",
            "description": "Variant-specific SKU (must be unique per tenant)."
          },
          "stockQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Variant-level stock (optional — may be tracked on the parent only)."
          }
        }
      },
      "ProductVariantCreate": {
        "type": "object",
        "required": [
          "productId",
          "sku"
        ],
        "properties": {
          "barcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageLink": {
            "type": [
              "string",
              "null"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable variant label, e.g. \"Red / M\"."
          },
          "optionValues": {
            "description": "Option name → value map, e.g. `{\"Color\": \"Red\", \"Size\": \"M\"}`."
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "Explicit override price for this variant (takes precedence over\nparent price + delta)."
          },
          "priceDelta": {
            "type": [
              "string",
              "null"
            ],
            "description": "Price adjustment relative to the parent product's `default_price`."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "The parent product this variant belongs to.\nReferences the product entity."
          },
          "sku": {
            "type": "string",
            "description": "Variant-specific SKU (must be unique per tenant)."
          },
          "stockQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Variant-level stock (optional — may be tracked on the parent only)."
          }
        }
      },
      "ProductVariantUpdate": {
        "type": "object",
        "properties": {
          "barcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageLink": {
            "type": [
              "string",
              "null"
            ]
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable variant label, e.g. \"Red / M\"."
          },
          "optionValues": {
            "description": "Option name → value map, e.g. `{\"Color\": \"Red\", \"Size\": \"M\"}`."
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "Explicit override price for this variant (takes precedence over\nparent price + delta)."
          },
          "priceDelta": {
            "type": [
              "string",
              "null"
            ],
            "description": "Price adjustment relative to the parent product's `default_price`."
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The parent product this variant belongs to.\nReferences the product entity."
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "description": "Variant-specific SKU (must be unique per tenant)."
          },
          "stockQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Variant-level stock (optional — may be tracked on the parent only)."
          }
        }
      },
      "ProductionOrder": {
        "type": "object",
        "required": [
          "orderNumber",
          "productId",
          "quantity"
        ],
        "properties": {
          "bomId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the BOM entity."
          },
          "components": {
            "description": "JSON snapshot of the BOM components at creation time."
          },
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": "string"
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "The finished product to manufacture.\nReferences the product entity."
          },
          "quantity": {
            "type": "integer",
            "format": "int64",
            "description": "Quantity of finished product to produce."
          },
          "sourceWarehouseId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Warehouse components are consumed from.\nReferences the warehouse entity."
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/ProductionOrderStatus",
            "description": "One of: planned | in_production | completed | cancelled"
          },
          "targetWarehouseId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Warehouse the finished product is added to.\nReferences the warehouse entity."
          }
        }
      },
      "ProductionOrderCosting": {
        "type": "object",
        "description": "Actual-costing (Nachkalkulation) report for a production order.",
        "required": [
          "productionOrderId",
          "orderNumber",
          "quantity",
          "status",
          "materialCostTotal",
          "costSource",
          "costPerUnit",
          "lines"
        ],
        "properties": {
          "costPerUnit": {
            "type": "string",
            "description": "material_cost_total ÷ quantity."
          },
          "costSource": {
            "type": "string",
            "description": "\"actual\" when costed from stock-movement consumption, else \"planned\"."
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostingLine"
            }
          },
          "marginPerUnit": {
            "type": [
              "string",
              "null"
            ],
            "description": "sale_price − cost_per_unit."
          },
          "marginPercent": {
            "type": [
              "string",
              "null"
            ],
            "description": "margin_per_unit ÷ cost_per_unit as a percentage."
          },
          "materialCostTotal": {
            "type": "string",
            "description": "Total material cost for the whole order."
          },
          "orderNumber": {
            "type": "string"
          },
          "productionOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "integer",
            "format": "int64"
          },
          "salePrice": {
            "type": [
              "string",
              "null"
            ],
            "description": "Finished product's sale price per unit (used to compute margin)."
          },
          "status": {
            "type": "string"
          }
        }
      },
      "ProductionOrderStatus": {
        "type": "string",
        "description": "Production order status.",
        "enum": [
          "planned",
          "in_production",
          "completed",
          "cancelled"
        ]
      },
      "ProductionOrderStatusUpdate": {
        "type": "object",
        "description": "Status update request.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "ProformaInvoice": {
        "type": "object",
        "required": [
          "status",
          "issueDate",
          "lineItems",
          "subtotal",
          "totalTax",
          "totalAmount",
          "currency"
        ],
        "properties": {
          "convertedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "convertedToInvoiceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when the proforma was converted into a real invoice.\nReferences the invoice entity."
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "customerSnapshot": {
            "description": "Snapshot of the recipient at issue time (address, VAT id, …)."
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "lineItems": {},
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference to the order/quote this proforma belongs to."
          },
          "paymentDueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Optional deadline the real invoice should carry after conversion."
          },
          "quotationId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the quotation entity."
          },
          "status": {
            "$ref": "#/components/schemas/ProformaInvoiceStatus",
            "description": "`draft` | `sent` | `converted`."
          },
          "subtotal": {
            "type": "string"
          },
          "totalAmount": {
            "type": "string"
          },
          "totalTax": {
            "type": "string"
          }
        }
      },
      "ProformaInvoiceCreate": {
        "type": "object",
        "required": [
          "status",
          "issueDate",
          "lineItems",
          "subtotal",
          "totalTax",
          "totalAmount",
          "currency"
        ],
        "properties": {
          "convertedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "convertedToInvoiceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when the proforma was converted into a real invoice.\nReferences the invoice entity."
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "customerSnapshot": {
            "description": "Snapshot of the recipient at issue time (address, VAT id, …)."
          },
          "issueDate": {
            "type": "string",
            "format": "date"
          },
          "lineItems": {},
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference to the order/quote this proforma belongs to."
          },
          "paymentDueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Optional deadline the real invoice should carry after conversion."
          },
          "quotationId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the quotation entity."
          },
          "status": {
            "$ref": "#/components/schemas/ProformaInvoiceStatus",
            "description": "`draft` | `sent` | `converted`."
          },
          "subtotal": {
            "type": "string"
          },
          "totalAmount": {
            "type": "string"
          },
          "totalTax": {
            "type": "string"
          }
        }
      },
      "ProformaInvoiceStatus": {
        "type": "string",
        "description": "Lifecycle status of a proforma invoice.",
        "enum": [
          "draft",
          "sent",
          "converted"
        ]
      },
      "ProformaInvoiceUpdate": {
        "type": "object",
        "properties": {
          "convertedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "convertedToInvoiceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when the proforma was converted into a real invoice.\nReferences the invoice entity."
          },
          "currency": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CurrencyCode"
              }
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "customerSnapshot": {
            "description": "Snapshot of the recipient at issue time (address, VAT id, …)."
          },
          "issueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lineItems": {},
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference to the order/quote this proforma belongs to."
          },
          "paymentDueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Optional deadline the real invoice should carry after conversion."
          },
          "quotationId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the quotation entity."
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProformaInvoiceStatus",
                "description": "`draft` | `sent` | `converted`."
              }
            ]
          },
          "subtotal": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalTax": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProposedAssignment": {
        "type": "object",
        "required": [
          "payment_id",
          "amount_paid",
          "payment_date",
          "invoice_id",
          "invoice_number",
          "open_amount",
          "confidence",
          "reason"
        ],
        "properties": {
          "amount_paid": {
            "type": "string"
          },
          "confidence": {
            "type": "number",
            "format": "double"
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_id": {
            "type": "string"
          },
          "invoice_number": {
            "type": "string"
          },
          "open_amount": {
            "type": "string"
          },
          "payment_date": {
            "type": "string"
          },
          "payment_id": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProviderInfo": {
        "type": "object",
        "required": [
          "name",
          "display_name",
          "services",
          "requires_api_key",
          "supports_label_creation",
          "supports_tracking",
          "supports_rate_estimation"
        ],
        "properties": {
          "display_name": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "requires_api_key": {
            "type": "boolean"
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "supports_label_creation": {
            "type": "boolean"
          },
          "supports_rate_estimation": {
            "type": "boolean"
          },
          "supports_tracking": {
            "type": "boolean"
          }
        }
      },
      "PublicDeliveryAppointmentRequest": {
        "type": "object",
        "required": [
          "warehouseCode",
          "supplierName",
          "email",
          "requestedDate"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestedDate": {
            "type": "string",
            "format": "date"
          },
          "supplierName": {
            "type": "string"
          },
          "timeSlot": {
            "type": [
              "string",
              "null"
            ]
          },
          "warehouseCode": {
            "type": "string",
            "description": "Warehouse `code` — the supplier does not know the warehouse uuid."
          }
        }
      },
      "PublicDeliveryAppointmentResponse": {
        "type": "object",
        "required": [
          "appointmentId",
          "status",
          "message",
          "confirmationHint"
        ],
        "properties": {
          "appointmentId": {
            "type": "string"
          },
          "confirmationHint": {
            "type": "string",
            "description": "Carries the status-check token (email is out of scope for now)."
          },
          "message": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "PublicDeliveryAppointmentStatusResponse": {
        "type": "object",
        "required": [
          "appointmentId",
          "status",
          "requestedDate",
          "warehouseName"
        ],
        "properties": {
          "appointmentId": {
            "type": "string"
          },
          "requestedDate": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "type": "string"
          },
          "timeSlot": {
            "type": [
              "string",
              "null"
            ]
          },
          "warehouseName": {
            "type": "string"
          }
        }
      },
      "PublicPosting": {
        "type": "object",
        "description": "Minimal shape for the public careers page (no tenant internals).",
        "required": [
          "id",
          "title",
          "description",
          "requiredSkills",
          "remote"
        ],
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": "string"
          },
          "employmentType": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote": {
            "type": "boolean"
          },
          "requiredSkills": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requirements": {
            "type": [
              "string",
              "null"
            ]
          },
          "salaryMax": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "salaryMin": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "PublicReturnItem": {
        "type": "object",
        "required": [
          "productId",
          "quantity"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "productId": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "format": "int64"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PublicReturnRequest": {
        "type": "object",
        "required": [
          "orderNumber",
          "email",
          "items"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicReturnItem"
            }
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": "string"
          }
        }
      },
      "PublicReturnResponse": {
        "type": "object",
        "required": [
          "returnOrderId",
          "returnNumber",
          "status",
          "items",
          "createdAt"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "items": {},
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "returnNumber": {
            "type": "string"
          },
          "returnOrderId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PublicReturnStatusResponse": {
        "type": "object",
        "required": [
          "returnOrderId",
          "returnNumber",
          "status",
          "items",
          "createdAt"
        ],
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "items": {},
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "returnNumber": {
            "type": "string"
          },
          "returnOrderId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PurchaseOrder": {
        "type": "object",
        "required": [
          "poNumber",
          "status",
          "orderDate"
        ],
        "properties": {
          "currency": {
            "type": "string"
          },
          "deliveryAddress": {},
          "expectedDeliveryDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, unit_price_net, tax_rate, delivery_date}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderDate": {
            "type": "string",
            "format": "date"
          },
          "poNumber": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PurchaseOrderStatus",
            "description": "One of: draft | ordered | partially_received | received | cancelled"
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalGrossAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalNetAmount": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PurchaseOrderCreate": {
        "type": "object",
        "required": [
          "poNumber",
          "status",
          "orderDate"
        ],
        "properties": {
          "currency": {
            "type": "string"
          },
          "deliveryAddress": {},
          "expectedDeliveryDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, unit_price_net, tax_rate, delivery_date}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderDate": {
            "type": "string",
            "format": "date"
          },
          "poNumber": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PurchaseOrderStatus",
            "description": "One of: draft | ordered | partially_received | received | cancelled"
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalGrossAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalNetAmount": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PurchaseOrderStatus": {
        "type": "string",
        "description": "Purchase order status.",
        "enum": [
          "draft",
          "ordered",
          "partially_received",
          "received",
          "cancelled"
        ]
      },
      "PurchaseOrderStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "PurchaseOrderUpdate": {
        "type": "object",
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "deliveryAddress": {},
          "expectedDeliveryDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, unit_price_net, tax_rate, delivery_date}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "poNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PurchaseOrderStatus",
                "description": "One of: draft | ordered | partially_received | received | cancelled"
              }
            ]
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalGrossAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalNetAmount": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "QRCodeResponse": {
        "type": "object",
        "required": [
          "qr_code_base64",
          "content_type"
        ],
        "properties": {
          "content_type": {
            "type": "string"
          },
          "qr_code_base64": {
            "type": "string"
          }
        }
      },
      "QuartileBand": {
        "type": "object",
        "required": [
          "quartile",
          "hourly_median",
          "female_share_pct",
          "male_share_pct"
        ],
        "properties": {
          "female_share_pct": {
            "type": "number",
            "format": "double"
          },
          "hourly_median": {
            "type": "string"
          },
          "male_share_pct": {
            "type": "number",
            "format": "double"
          },
          "quartile": {
            "type": "string"
          }
        }
      },
      "QuizQuestion": {
        "type": "object",
        "required": [
          "id",
          "question",
          "questionEn",
          "options",
          "optionsEn"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "optionsEn": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "question": {
            "type": "string"
          },
          "questionEn": {
            "type": "string"
          }
        }
      },
      "QuotaOverride": {
        "type": "object",
        "description": "Schema of the `tenants.quotas` JSON override column. Any field that is\npresent overrides the plan-derived value.",
        "properties": {
          "features": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/QuotaOverrideFeatures"
              }
            ],
            "default": null
          },
          "max_connectors": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "default": null
          },
          "max_invoices_per_month": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "default": null
          },
          "max_users": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "default": null
          },
          "metered": {
            "type": [
              "object",
              "null"
            ],
            "default": null,
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "plan": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom plan id; unknown ids resolve to enterprise limits.",
            "default": null
          }
        }
      },
      "QuotaOverrideFeatures": {
        "type": "object",
        "properties": {
          "erp": {
            "type": [
              "boolean",
              "null"
            ],
            "default": null
          },
          "fancy_reports": {
            "type": [
              "boolean",
              "null"
            ],
            "default": null
          },
          "tax_automations": {
            "type": [
              "boolean",
              "null"
            ],
            "default": null
          }
        }
      },
      "QuotaOverview": {
        "type": "object",
        "required": [
          "plan",
          "planName",
          "isTrialing",
          "limits",
          "features",
          "usage",
          "metered"
        ],
        "properties": {
          "features": {
            "$ref": "#/components/schemas/PlanFeatures"
          },
          "isTrialing": {
            "type": "boolean"
          },
          "limits": {
            "$ref": "#/components/schemas/PlanLimits"
          },
          "metered": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MeteredUsage"
            }
          },
          "plan": {
            "type": "string"
          },
          "planName": {
            "type": "string"
          },
          "trialEndsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageSnapshot"
          }
        }
      },
      "Quotation": {
        "type": "object",
        "required": [
          "voucherStatus",
          "voucherDate",
          "currency"
        ],
        "properties": {
          "address": {},
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "expirationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "files": {},
          "introduction": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "precedingSalesVoucherId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the preceding sales voucher entity."
          },
          "precedingSalesVoucherType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrecedingSalesVoucherType"
              }
            ]
          },
          "quotationNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "remark": {
            "type": [
              "string",
              "null"
            ]
          },
          "subtotal": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxCondition": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalTax": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherDate": {
            "type": "string",
            "format": "date"
          },
          "voucherStatus": {
            "$ref": "#/components/schemas/VoucherStatus"
          }
        }
      },
      "QuotationCreate": {
        "type": "object",
        "required": [
          "voucherStatus",
          "voucherDate",
          "currency"
        ],
        "properties": {
          "address": {},
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "expirationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "files": {},
          "introduction": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "precedingSalesVoucherId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the preceding sales voucher entity."
          },
          "precedingSalesVoucherType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrecedingSalesVoucherType"
              }
            ]
          },
          "quotationNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "remark": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxCondition": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherDate": {
            "type": "string",
            "format": "date"
          },
          "voucherStatus": {
            "$ref": "#/components/schemas/VoucherStatus"
          }
        }
      },
      "RateRequest": {
        "type": "object",
        "required": [
          "sender",
          "recipient",
          "packages"
        ],
        "properties": {
          "customer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CustomerInfo"
              }
            ]
          },
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Package"
            }
          },
          "recipient": {
            "$ref": "#/components/schemas/Address"
          },
          "sender": {
            "$ref": "#/components/schemas/Address"
          }
        }
      },
      "RateResponse": {
        "type": "object",
        "required": [
          "rates"
        ],
        "properties": {
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShippingRate"
            }
          }
        }
      },
      "RecurringTemplate": {
        "type": "object",
        "required": [
          "template_id",
          "name",
          "template_type",
          "voucher_data",
          "execution_interval",
          "start_date",
          "finalize",
          "execution_status",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "readOnly": true
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "end_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "execution_interval": {
            "type": "string"
          },
          "execution_status": {
            "type": "string"
          },
          "finalize": {
            "type": "boolean"
          },
          "last_executed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "next_execution_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "template_id": {
            "type": "string"
          },
          "template_type": {
            "type": "string"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "voucher_data": {}
        }
      },
      "RecurringTemplateCreate": {
        "type": "object",
        "required": [
          "name",
          "templateType",
          "executionInterval",
          "startDate",
          "executionStatus"
        ],
        "properties": {
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "executionInterval": {
            "type": "string"
          },
          "executionStatus": {
            "$ref": "#/components/schemas/ExecutionStatus"
          },
          "finalize": {
            "type": "boolean"
          },
          "lastExecutedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "nextExecutionAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "templateType": {
            "$ref": "#/components/schemas/RecurringTemplateType"
          },
          "voucherData": {}
        }
      },
      "RecurringTemplateType": {
        "type": "string",
        "description": "Recurring template type.",
        "enum": [
          "invoice",
          "report"
        ]
      },
      "RecurringTemplateUpdate": {
        "type": "object",
        "properties": {
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "executionInterval": {
            "type": [
              "string",
              "null"
            ]
          },
          "executionStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExecutionStatus"
              }
            ]
          },
          "finalize": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "lastExecutedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "nextExecutionAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "templateType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecurringTemplateType"
              }
            ]
          },
          "voucherData": {}
        }
      },
      "ReferenceType": {
        "type": "string",
        "description": "Stock movement reference type.",
        "enum": [
          "goods_receipt",
          "production_order",
          "transfer_in",
          "stock_transfer",
          "return_order",
          "inventory_count"
        ]
      },
      "RegisterRequest": {
        "type": "object",
        "required": [
          "email",
          "first_name",
          "last_name",
          "password",
          "company_name",
          "privacy_accepted"
        ],
        "properties": {
          "company_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "privacy_accepted": {
            "type": "boolean",
            "description": "GDPR consent — registration is rejected unless true."
          }
        }
      },
      "ReminderLevel": {
        "type": "string",
        "enum": [
          "none",
          "due",
          "level1",
          "level2",
          "level3"
        ]
      },
      "RemoveUserRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          }
        }
      },
      "ReorderProposalLine": {
        "type": "object",
        "description": "A single reorder proposal line.",
        "required": [
          "productId",
          "productName",
          "sku",
          "currentStock",
          "suggestedQuantity"
        ],
        "properties": {
          "currentStock": {
            "type": "integer",
            "format": "int64"
          },
          "maxStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "minStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productName": {
            "type": "string"
          },
          "reorderQuantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "sku": {
            "type": "string"
          },
          "suggestedQuantity": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ReorderProposalResponse": {
        "type": "object",
        "description": "The response envelope for a reorder proposal run.",
        "required": [
          "lines",
          "totalSuggestedQuantity",
          "generatedAt"
        ],
        "properties": {
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReorderProposalLine"
            }
          },
          "totalSuggestedQuantity": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ReplenishmentResponse": {
        "type": "object",
        "required": [
          "targetWarehouseId",
          "lines",
          "totalSuggestedQuantity",
          "generatedAt"
        ],
        "properties": {
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReplenishmentSuggestionLine"
            }
          },
          "targetWarehouseId": {
            "type": "string"
          },
          "totalSuggestedQuantity": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ReplenishmentSuggestionLine": {
        "type": "object",
        "description": "A single replenishment suggestion.",
        "required": [
          "productId",
          "productName",
          "sku",
          "targetWarehouseId",
          "sourceWarehouseId",
          "currentStock",
          "sourceAvailable",
          "suggestedQuantity"
        ],
        "properties": {
          "currentStock": {
            "type": "integer",
            "format": "int64",
            "description": "Current stock in the target warehouse."
          },
          "maxStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "minStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productName": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "sourceAvailable": {
            "type": "integer",
            "format": "int64",
            "description": "Surplus available in the source warehouse (above its target)."
          },
          "sourceWarehouseId": {
            "type": "string"
          },
          "suggestedQuantity": {
            "type": "integer",
            "format": "int64"
          },
          "targetWarehouseId": {
            "type": "string"
          }
        }
      },
      "ResetPasswordRequest": {
        "type": "object",
        "required": [
          "token",
          "new_password"
        ],
        "properties": {
          "new_password": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        }
      },
      "ResolvedPriceResponse": {
        "type": "object",
        "required": [
          "productId",
          "quantity",
          "unitPrice",
          "isListPrice"
        ],
        "properties": {
          "isListPrice": {
            "type": "boolean",
            "description": "True when no tier matched and the product list price was used."
          },
          "priceTierId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Applied tier, if any matched."
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "integer",
            "format": "int64"
          },
          "unitPrice": {
            "type": "string"
          }
        }
      },
      "ReturnLogisticsQueueItem": {
        "type": "object",
        "description": "One open return awaiting warehouse processing (inbound queue).",
        "required": [
          "returnOrderId",
          "returnNumber",
          "status",
          "lineItems",
          "ageDays",
          "createdAt"
        ],
        "properties": {
          "ageDays": {
            "type": "integer",
            "format": "int64",
            "description": "Days since creation, oldest first."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "customerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {},
          "orderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "returnNumber": {
            "type": "string"
          },
          "returnOrderId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "warehouseId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ReturnLogisticsSummary": {
        "type": "object",
        "description": "Warehouse-level aggregation for the returns logistics dashboard.",
        "required": [
          "totalReturns",
          "byStatus",
          "totalItems",
          "itemsRestocked",
          "itemsScrapped",
          "byWarehouse"
        ],
        "properties": {
          "byStatus": {
            "description": "Number of return orders per status."
          },
          "byWarehouse": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReturnWarehouseSummary"
            },
            "description": "Per-warehouse aggregation."
          },
          "itemsRestocked": {
            "type": "integer",
            "format": "int64",
            "description": "Sum of `restock: true` line-item quantities."
          },
          "itemsScrapped": {
            "type": "integer",
            "format": "int64",
            "description": "Sum of `restock: false` line-item quantities (scrapped/disposed)."
          },
          "totalItems": {
            "type": "integer",
            "format": "int64",
            "description": "Sum of all line-item quantities across returns."
          },
          "totalReturns": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of return orders (excluding soft-deleted).",
            "minimum": 0
          }
        }
      },
      "ReturnOrder": {
        "type": "object",
        "required": [
          "returnNumber",
          "status"
        ],
        "properties": {
          "customerContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "customerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, condition, restock, batch_number?}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "orderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the order entity."
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "returnNumber": {
            "type": "string"
          },
          "returnReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ReturnOrderStatus",
            "description": "One of: requested | received | inspected | restocked | closed"
          },
          "warehouseId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Warehouse into which restockable items are returned.\nReferences the warehouse entity."
          }
        }
      },
      "ReturnOrderStatus": {
        "type": "string",
        "description": "Return order status.",
        "enum": [
          "requested",
          "received",
          "inspected",
          "restocked",
          "closed"
        ]
      },
      "ReturnOrderStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "ReturnWarehouseSummary": {
        "type": "object",
        "description": "Aggregation for a single warehouse.",
        "required": [
          "returns",
          "itemsRestocked",
          "itemsScrapped"
        ],
        "properties": {
          "itemsRestocked": {
            "type": "integer",
            "format": "int64"
          },
          "itemsScrapped": {
            "type": "integer",
            "format": "int64"
          },
          "returns": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "warehouseId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RevenueItem": {
        "type": "object",
        "required": [
          "category",
          "amount",
          "percentage"
        ],
        "properties": {
          "amount": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "percentage": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "Rfq": {
        "type": "object",
        "required": [
          "rfqNumber",
          "status",
          "requestedDate",
          "lineItems"
        ],
        "properties": {
          "currency": {
            "type": "string"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, sku, quantity, requested_unit_price?,\nquoted_unit_price?}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestedDate": {
            "type": "string",
            "format": "date"
          },
          "responseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "rfqNumber": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RfqStatus",
            "description": "One of: draft | sent | offer_received | rejected | converted"
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RfqCreate": {
        "type": "object",
        "required": [
          "rfqNumber",
          "status",
          "requestedDate",
          "lineItems"
        ],
        "properties": {
          "currency": {
            "type": "string"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, sku, quantity, requested_unit_price?,\nquoted_unit_price?}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestedDate": {
            "type": "string",
            "format": "date"
          },
          "responseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "rfqNumber": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RfqStatus",
            "description": "One of: draft | sent | offer_received | rejected | converted"
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RfqStatus": {
        "type": "string",
        "description": "RFQ status.",
        "enum": [
          "draft",
          "sent",
          "offer_received",
          "rejected",
          "converted"
        ]
      },
      "RfqStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "RfqUpdate": {
        "type": "object",
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, sku, quantity, requested_unit_price?,\nquoted_unit_price?}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestedDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "responseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "rfqNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RfqStatus",
                "description": "One of: draft | sent | offer_received | rejected | converted"
              }
            ]
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SalesVolumeItem": {
        "type": "object",
        "required": [
          "contact_id",
          "name",
          "contact_type",
          "total_revenue",
          "total_invoices"
        ],
        "properties": {
          "contact_id": {
            "type": "string"
          },
          "contact_type": {
            "type": "string"
          },
          "last_purchase_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "total_invoices": {
            "type": "integer",
            "format": "int32"
          },
          "total_revenue": {
            "type": "string"
          }
        }
      },
      "SalesVolumeReport": {
        "type": "object",
        "required": [
          "items",
          "total_count",
          "grand_total"
        ],
        "properties": {
          "grand_total": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesVolumeItem"
            }
          },
          "total_count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ScopeTotal": {
        "type": "object",
        "required": [
          "scope",
          "tco2e"
        ],
        "properties": {
          "scope": {
            "type": "string"
          },
          "tco2e": {
            "type": "string"
          }
        }
      },
      "Section": {
        "type": "object",
        "required": [
          "id",
          "title",
          "titleEn",
          "bodyHtml",
          "bodyHtmlEn"
        ],
        "properties": {
          "bodyHtml": {
            "type": "string"
          },
          "bodyHtmlEn": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "titleEn": {
            "type": "string"
          }
        }
      },
      "SendMessageDto": {
        "type": "object",
        "required": [
          "body"
        ],
        "properties": {
          "body": {
            "type": "string"
          },
          "is_internal": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "SepaDirectDebitResponse": {
        "type": "object",
        "required": [
          "xml_content",
          "content_type",
          "filename"
        ],
        "properties": {
          "content_type": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "xml_content": {
            "type": "string"
          }
        }
      },
      "SepaSequenceType": {
        "type": "string",
        "description": "SEPA mandate sequence type (ISO 20022 mandate codes).",
        "enum": [
          "FRST",
          "RCUR",
          "FNAL",
          "OOFF"
        ]
      },
      "ServiceAssignment": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "format": "uuid",
            "description": "References the employees entity."
          },
          "jobId": {
            "type": "string",
            "format": "uuid",
            "description": "References the service_jobs entity."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "scheduledDate": {
            "type": "string",
            "format": "date",
            "description": "Work day the assignment is scheduled for."
          },
          "scheduledEnd": {
            "type": [
              "string",
              "null"
            ],
            "description": "Planned end time of the assignment."
          },
          "scheduledStart": {
            "type": [
              "string",
              "null"
            ],
            "description": "Planned start time of the assignment."
          },
          "status": {
            "$ref": "#/components/schemas/ServiceAssignmentStatus",
            "description": "Assignment lifecycle status: \"planned\", \"confirmed\", \"en_route\",\n\"in_progress\", \"completed\" or \"cancelled\"."
          }
        }
      },
      "ServiceAssignmentCreate": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "format": "uuid",
            "description": "References the employees entity."
          },
          "jobId": {
            "type": "string",
            "format": "uuid",
            "description": "References the service_jobs entity."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "scheduledDate": {
            "type": "string",
            "format": "date",
            "description": "Work day the assignment is scheduled for."
          },
          "scheduledEnd": {
            "type": [
              "string",
              "null"
            ],
            "description": "Planned end time of the assignment."
          },
          "scheduledStart": {
            "type": [
              "string",
              "null"
            ],
            "description": "Planned start time of the assignment."
          },
          "status": {
            "$ref": "#/components/schemas/ServiceAssignmentStatus",
            "description": "Assignment lifecycle status: \"planned\", \"confirmed\", \"en_route\",\n\"in_progress\", \"completed\" or \"cancelled\"."
          }
        }
      },
      "ServiceAssignmentStatus": {
        "type": "string",
        "description": "Service assignment status.",
        "enum": [
          "planned",
          "confirmed",
          "en_route",
          "in_progress",
          "completed",
          "cancelled"
        ]
      },
      "ServiceAssignmentUpdate": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the employees entity."
          },
          "jobId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the service_jobs entity."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "scheduledDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Work day the assignment is scheduled for."
          },
          "scheduledEnd": {
            "type": [
              "string",
              "null"
            ],
            "description": "Planned end time of the assignment."
          },
          "scheduledStart": {
            "type": [
              "string",
              "null"
            ],
            "description": "Planned start time of the assignment."
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ServiceAssignmentStatus",
                "description": "Assignment lifecycle status: \"planned\", \"confirmed\", \"en_route\",\n\"in_progress\", \"completed\" or \"cancelled\"."
              }
            ]
          }
        }
      },
      "ServiceJob": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Street + zip + city of the job location.",
            "maxLength": 255,
            "minLength": 1
          },
          "customerEmail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer email for email notifications."
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the customer entity."
          },
          "customerName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Denormalized customer name for quick display."
          },
          "customerPhone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer phone for SMS notifications later."
          },
          "description": {
            "type": "string",
            "description": "What work needs to be done.",
            "maxLength": 1000,
            "minLength": 1
          },
          "estimatedDurationMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Estimated time for the job in minutes.",
            "maximum": 100000,
            "minimum": 1
          },
          "lat": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Latitude for map display (OpenStreetMap)."
          },
          "lng": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Longitude for map display (OpenStreetMap)."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ServiceJobStatus",
            "description": "Dispatch status: \"pending\", \"assigned\", \"en_route\", \"in_progress\", \"completed\", \"cancelled\"."
          }
        }
      },
      "ServiceJobCreate": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Street + zip + city of the job location.",
            "maxLength": 255,
            "minLength": 1
          },
          "customerEmail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer email for email notifications."
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the customer entity."
          },
          "customerName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Denormalized customer name for quick display."
          },
          "customerPhone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer phone for SMS notifications later."
          },
          "description": {
            "type": "string",
            "description": "What work needs to be done.",
            "maxLength": 1000,
            "minLength": 1
          },
          "estimatedDurationMinutes": {
            "type": "integer",
            "format": "int32",
            "description": "Estimated time for the job in minutes.",
            "maximum": 100000,
            "minimum": 1
          },
          "lat": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Latitude for map display (OpenStreetMap)."
          },
          "lng": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Longitude for map display (OpenStreetMap)."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ServiceJobStatus",
            "description": "Dispatch status: \"pending\", \"assigned\", \"en_route\", \"in_progress\", \"completed\", \"cancelled\"."
          }
        }
      },
      "ServiceJobStatus": {
        "type": "string",
        "description": "Service job dispatch status.",
        "enum": [
          "pending",
          "assigned",
          "en_route",
          "in_progress",
          "completed",
          "cancelled"
        ]
      },
      "ServiceJobUpdate": {
        "type": "object",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Street + zip + city of the job location.",
            "maxLength": 255,
            "minLength": 1
          },
          "customerEmail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer email for email notifications."
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the customer entity."
          },
          "customerName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Denormalized customer name for quick display."
          },
          "customerPhone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer phone for SMS notifications later."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What work needs to be done.",
            "maxLength": 1000,
            "minLength": 1
          },
          "estimatedDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Estimated time for the job in minutes.",
            "maximum": 100000,
            "minimum": 1
          },
          "lat": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Latitude for map display (OpenStreetMap)."
          },
          "lng": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Longitude for map display (OpenStreetMap)."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ServiceJobStatus",
                "description": "Dispatch status: \"pending\", \"assigned\", \"en_route\", \"in_progress\", \"completed\", \"cancelled\"."
              }
            ]
          }
        }
      },
      "Severity": {
        "type": "string",
        "enum": [
          "Info",
          "Warning",
          "Critical"
        ]
      },
      "Shareholder": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Anschrift des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 255,
            "minLength": 1
          },
          "birthDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Geburtsdatum des Aktionärs (§ 67 Abs. 1 AktG)."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Elektronische Adresse (E-Mail) für die Kommunikation der Gesellschaft."
          },
          "firstName": {
            "type": "string",
            "description": "Vorname des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 100,
            "minLength": 1
          },
          "lastName": {
            "type": "string",
            "description": "Nachname des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 100,
            "minLength": 1
          },
          "shareNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Aktiennummer bzw. Sammelurkunde (bei Nennbetragsaktien).",
            "maxLength": 100
          },
          "shares": {
            "type": "string",
            "description": "Stückzahl der gehaltenen Stückaktien (§ 67 Abs. 1 AktG)."
          }
        }
      },
      "ShareholderCreate": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Anschrift des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 255,
            "minLength": 1
          },
          "birthDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Geburtsdatum des Aktionärs (§ 67 Abs. 1 AktG)."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Elektronische Adresse (E-Mail) für die Kommunikation der Gesellschaft."
          },
          "firstName": {
            "type": "string",
            "description": "Vorname des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 100,
            "minLength": 1
          },
          "lastName": {
            "type": "string",
            "description": "Nachname des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 100,
            "minLength": 1
          },
          "shareNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Aktiennummer bzw. Sammelurkunde (bei Nennbetragsaktien).",
            "maxLength": 100
          },
          "shares": {
            "type": "string",
            "description": "Stückzahl der gehaltenen Stückaktien (§ 67 Abs. 1 AktG)."
          }
        }
      },
      "ShareholderUpdate": {
        "type": "object",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Anschrift des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 255,
            "minLength": 1
          },
          "birthDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Geburtsdatum des Aktionärs (§ 67 Abs. 1 AktG)."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Elektronische Adresse (E-Mail) für die Kommunikation der Gesellschaft."
          },
          "firstName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vorname des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 100,
            "minLength": 1
          },
          "lastName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Nachname des Aktionärs (§ 67 Abs. 1 AktG).",
            "maxLength": 100,
            "minLength": 1
          },
          "shareNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Aktiennummer bzw. Sammelurkunde (bei Nennbetragsaktien).",
            "maxLength": 100
          },
          "shares": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stückzahl der gehaltenen Stückaktien (§ 67 Abs. 1 AktG)."
          }
        }
      },
      "Shipment": {
        "type": "object",
        "required": [
          "orderId",
          "shippingCarrier",
          "shipmentDate",
          "status"
        ],
        "properties": {
          "deliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "labelUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItemsShipment": {},
          "orderId": {
            "type": "string",
            "description": "References the order entity."
          },
          "recipientAddress": {},
          "shipmentDate": {
            "type": "string",
            "format": "date"
          },
          "shippingCarrier": {
            "type": "string"
          },
          "shippingCost": {
            "type": [
              "string",
              "null"
            ]
          },
          "shippingMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "signedBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "trackingEvents": {
            "description": "Latest carrier tracking events (from the live tracking API)."
          },
          "trackingNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "trackingUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "weightKg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "ShipmentStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "delivered_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "signed_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "tracking_number": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ShippingCredentials": {
        "type": "object",
        "description": "Per-tenant credentials for real shipping provider APIs (stored in the\n`shipping` key of the settings JSON blob). Auth is either OAuth client\ncredentials (UPS) or a user-supplied API key (DHL).",
        "properties": {
          "dhl": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DhlCredentials"
              }
            ]
          },
          "ups": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpsCredentials"
              }
            ]
          }
        }
      },
      "ShippingRate": {
        "type": "object",
        "required": [
          "carrier",
          "service",
          "rate",
          "weight_kg",
          "origin_country",
          "destination_country",
          "from_api"
        ],
        "properties": {
          "breakdown": {
            "type": [
              "string",
              "null"
            ]
          },
          "carrier": {
            "type": "string"
          },
          "cross_border_surcharge": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination_country": {
            "type": "string",
            "description": "ISO-2 code of destination country."
          },
          "estimated_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "from_api": {
            "type": "boolean",
            "description": "True when the rate was obtained via an API call rather than calculation."
          },
          "insured_value": {
            "type": [
              "string",
              "null"
            ]
          },
          "island_surcharge": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin_country": {
            "type": "string",
            "description": "ISO-2 code of origin country."
          },
          "rate": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "volume_discount": {
            "type": [
              "string",
              "null"
            ]
          },
          "weight_kg": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ShippingRule": {
        "type": "object",
        "required": [
          "name",
          "price"
        ],
        "properties": {
          "carrier": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider that auto-filled this rule (e.g. \"ups\"), if any."
          },
          "country": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode",
                "description": "None = applies to all countries."
              }
            ]
          },
          "deliveryTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery time text, e.g. \"1-3\"."
          },
          "isActive": {
            "type": "boolean"
          },
          "maxWeightKg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "minWeightKg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "name": {
            "type": "string",
            "description": "Delivery-method label, e.g. \"Standardversand\".",
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": "string",
            "description": "Shipping cost in the shop's currency."
          },
          "priority": {
            "type": "integer",
            "format": "int32",
            "description": "Lower wins when multiple rules match."
          }
        }
      },
      "ShippingRuleCreate": {
        "type": "object",
        "required": [
          "name",
          "price"
        ],
        "properties": {
          "carrier": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider that auto-filled this rule (e.g. \"ups\"), if any."
          },
          "country": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode",
                "description": "None = applies to all countries."
              }
            ]
          },
          "deliveryTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery time text, e.g. \"1-3\"."
          },
          "isActive": {
            "type": "boolean"
          },
          "maxWeightKg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "minWeightKg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "name": {
            "type": "string",
            "description": "Delivery-method label, e.g. \"Standardversand\".",
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": "string",
            "description": "Shipping cost in the shop's currency."
          },
          "priority": {
            "type": "integer",
            "format": "int32",
            "description": "Lower wins when multiple rules match."
          }
        }
      },
      "ShippingRuleUpdate": {
        "type": "object",
        "properties": {
          "carrier": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider that auto-filled this rule (e.g. \"ups\"), if any."
          },
          "country": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode",
                "description": "None = applies to all countries."
              }
            ]
          },
          "deliveryTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery time text, e.g. \"1-3\"."
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "maxWeightKg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "minWeightKg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Delivery-method label, e.g. \"Standardversand\".",
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "Shipping cost in the shop's currency."
          },
          "priority": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Lower wins when multiple rules match."
          }
        }
      },
      "ShippingThreshold": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "isActive": {
            "type": "boolean"
          },
          "maxSellable": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Optional ceiling for the deliverable quantity."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "None = applies to all products.\nReferences the product entity."
          },
          "reserveStock": {
            "type": "integer",
            "format": "int64",
            "description": "Buffer of stock that must not be sold."
          },
          "warehouseId": {
            "type": [
              "string",
              "null"
            ],
            "description": "None = applies to all warehouses.\nReferences the warehouse entity."
          }
        }
      },
      "ShippingThresholdCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "isActive": {
            "type": "boolean"
          },
          "maxSellable": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Optional ceiling for the deliverable quantity."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "None = applies to all products.\nReferences the product entity."
          },
          "reserveStock": {
            "type": "integer",
            "format": "int64",
            "description": "Buffer of stock that must not be sold."
          },
          "warehouseId": {
            "type": [
              "string",
              "null"
            ],
            "description": "None = applies to all warehouses.\nReferences the warehouse entity."
          }
        }
      },
      "ShippingThresholdUpdate": {
        "type": "object",
        "properties": {
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "maxSellable": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Optional ceiling for the deliverable quantity."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "productId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "None = applies to all products.\nReferences the product entity."
          },
          "reserveStock": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Buffer of stock that must not be sold."
          },
          "warehouseId": {
            "type": [
              "string",
              "null"
            ],
            "description": "None = applies to all warehouses.\nReferences the warehouse entity."
          }
        }
      },
      "SilentPartner": {
        "type": "object",
        "required": [
          "instrumentType"
        ],
        "properties": {
          "contractDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Datum des Vertragsabschlusses."
          },
          "einlage": {
            "type": "string",
            "description": "Einlage (§ 230 HGB)."
          },
          "gewinnquotePct": {
            "type": "string",
            "description": "Gewinnbeteiligungsquote in Prozent (§ 231 HGB)."
          },
          "gewinnvortrag": {
            "type": "string",
            "description": "Nicht erhobene Gewinne (§ 232 Abs. 3 HGB)."
          },
          "instrumentType": {
            "$ref": "#/components/schemas/InstrumentType",
            "description": "Instrument: \"typisch\" | \"atypisch\" | \"partiarisches_darlehen\" | \"genussrecht\"."
          },
          "kestPflichtig": {
            "type": "boolean",
            "description": "25 % Kapitalertragsteuer einbehalten (§ 43 Abs. 1 Nr. 3 EStG; typisch + partiarisches Darlehen)."
          },
          "name": {
            "type": "string",
            "description": "Name des stillen Gesellschafters.",
            "maxLength": 200,
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freitext-Notizen.",
            "maxLength": 500
          },
          "verlustVerrechnungskonto": {
            "type": "string",
            "description": "Kumulierte Verluste gegen die Einlage (§ 232 Abs. 2 HGB, ≤ Einlage)."
          },
          "verlustbeteiligung": {
            "type": "boolean",
            "description": "Verlustbeteiligung (§ 231 Abs. 2 HGB; kann ausgeschlossen werden)."
          }
        }
      },
      "SilentPartnerCreate": {
        "type": "object",
        "required": [
          "instrumentType"
        ],
        "properties": {
          "contractDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Datum des Vertragsabschlusses."
          },
          "einlage": {
            "type": "string",
            "description": "Einlage (§ 230 HGB)."
          },
          "gewinnquotePct": {
            "type": "string",
            "description": "Gewinnbeteiligungsquote in Prozent (§ 231 HGB)."
          },
          "gewinnvortrag": {
            "type": "string",
            "description": "Nicht erhobene Gewinne (§ 232 Abs. 3 HGB)."
          },
          "instrumentType": {
            "$ref": "#/components/schemas/InstrumentType",
            "description": "Instrument: \"typisch\" | \"atypisch\" | \"partiarisches_darlehen\" | \"genussrecht\"."
          },
          "kestPflichtig": {
            "type": "boolean",
            "description": "25 % Kapitalertragsteuer einbehalten (§ 43 Abs. 1 Nr. 3 EStG; typisch + partiarisches Darlehen)."
          },
          "name": {
            "type": "string",
            "description": "Name des stillen Gesellschafters.",
            "maxLength": 200,
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freitext-Notizen.",
            "maxLength": 500
          },
          "verlustVerrechnungskonto": {
            "type": "string",
            "description": "Kumulierte Verluste gegen die Einlage (§ 232 Abs. 2 HGB, ≤ Einlage)."
          },
          "verlustbeteiligung": {
            "type": "boolean",
            "description": "Verlustbeteiligung (§ 231 Abs. 2 HGB; kann ausgeschlossen werden)."
          }
        }
      },
      "SilentPartnerUpdate": {
        "type": "object",
        "properties": {
          "contractDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Datum des Vertragsabschlusses."
          },
          "einlage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Einlage (§ 230 HGB)."
          },
          "gewinnquotePct": {
            "type": [
              "string",
              "null"
            ],
            "description": "Gewinnbeteiligungsquote in Prozent (§ 231 HGB)."
          },
          "gewinnvortrag": {
            "type": [
              "string",
              "null"
            ],
            "description": "Nicht erhobene Gewinne (§ 232 Abs. 3 HGB)."
          },
          "instrumentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InstrumentType",
                "description": "Instrument: \"typisch\" | \"atypisch\" | \"partiarisches_darlehen\" | \"genussrecht\"."
              }
            ]
          },
          "kestPflichtig": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "25 % Kapitalertragsteuer einbehalten (§ 43 Abs. 1 Nr. 3 EStG; typisch + partiarisches Darlehen)."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name des stillen Gesellschafters.",
            "maxLength": 200,
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Freitext-Notizen.",
            "maxLength": 500
          },
          "verlustVerrechnungskonto": {
            "type": [
              "string",
              "null"
            ],
            "description": "Kumulierte Verluste gegen die Einlage (§ 232 Abs. 2 HGB, ≤ Einlage)."
          },
          "verlustbeteiligung": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Verlustbeteiligung (§ 231 Abs. 2 HGB; kann ausgeschlossen werden)."
          }
        }
      },
      "SmtpConfig": {
        "type": "object",
        "required": [
          "host",
          "port",
          "encryption",
          "username",
          "password",
          "from_address"
        ],
        "properties": {
          "encryption": {
            "$ref": "#/components/schemas/SmtpEncryption"
          },
          "from_address": {
            "type": "string"
          },
          "from_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "host": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "timeout_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "username": {
            "type": "string"
          }
        }
      },
      "SmtpEncryption": {
        "type": "string",
        "enum": [
          "StartTls",
          "Tls"
        ]
      },
      "StilleExportResponse": {
        "type": "object",
        "required": [
          "csv_content",
          "filename"
        ],
        "properties": {
          "csv_content": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "StillePartnerZeile": {
        "type": "object",
        "required": [
          "name",
          "instrument_type",
          "gewinnanteil",
          "verlustanteil",
          "kest",
          "verlust_verrechnungskonto",
          "gewinnvortrag",
          "auseinandersetzungsguthaben"
        ],
        "properties": {
          "auseinandersetzungsguthaben": {
            "type": "string"
          },
          "gewinnanteil": {
            "type": "string"
          },
          "gewinnvortrag": {
            "type": "string"
          },
          "hinweis": {
            "type": [
              "string",
              "null"
            ]
          },
          "instrument_type": {
            "type": "string"
          },
          "kest": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "verlust_verrechnungskonto": {
            "type": "string"
          },
          "verlustanteil": {
            "type": "string"
          }
        }
      },
      "StilleReport": {
        "type": "object",
        "required": [
          "year",
          "jahresueberschuss",
          "partners"
        ],
        "properties": {
          "jahresueberschuss": {
            "type": "string"
          },
          "partners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StillePartnerZeile"
            }
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "StockAdjustment": {
        "type": "object",
        "required": [
          "quantity"
        ],
        "properties": {
          "batchNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "binLocation": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiryDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "integer",
            "format": "int64"
          },
          "serialNumbers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "StockMovement": {
        "type": "object",
        "required": [
          "productId",
          "warehouseId",
          "movementType",
          "quantity",
          "delta"
        ],
        "properties": {
          "delta": {
            "type": "integer",
            "format": "int64",
            "description": "Signed movement: positive = into stock, negative = out of stock."
          },
          "movementType": {
            "$ref": "#/components/schemas/MovementType",
            "description": "One of the `MOVEMENT_*` constants."
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "description": "References the product entity."
          },
          "quantity": {
            "type": "integer",
            "format": "int64",
            "description": "Absolute quantity moved (always >= 0)."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "referenceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary-key of the referencing entity."
          },
          "referenceType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReferenceType",
                "description": "Entity that caused the movement, e.g. `goods_receipt`, `stock_transfer`."
              }
            ]
          },
          "warehouseId": {
            "type": "string",
            "description": "References the warehouse entity."
          }
        }
      },
      "StockTransfer": {
        "type": "object",
        "required": [
          "transferNumber",
          "sourceWarehouseId",
          "targetWarehouseId",
          "status",
          "transferDate",
          "lineItems"
        ],
        "properties": {
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, batch_number?}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceWarehouseId": {
            "type": "string",
            "description": "References the warehouse entity."
          },
          "status": {
            "$ref": "#/components/schemas/StockTransferStatus",
            "description": "One of: draft | completed | cancelled"
          },
          "targetWarehouseId": {
            "type": "string",
            "description": "References the warehouse entity."
          },
          "transferDate": {
            "type": "string",
            "format": "date"
          },
          "transferNumber": {
            "type": "string"
          }
        }
      },
      "StockTransferStatus": {
        "type": "string",
        "description": "Stock transfer status.",
        "enum": [
          "draft",
          "completed",
          "cancelled"
        ]
      },
      "StockTransferStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "StockUpdateRequest": {
        "type": "object",
        "required": [
          "quantity"
        ],
        "properties": {
          "quantity": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SubmitResultDto": {
        "type": "object",
        "required": [
          "trainingCode",
          "score",
          "answers"
        ],
        "properties": {
          "answers": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Selected answer indices (required for scored builtin trainings)."
          },
          "assignmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "score": {
            "type": "integer",
            "format": "int32",
            "description": "Score 0–100. Only trusted for plugin trainings without server-side\nscoring; builtin trainings are always re-scored from `answers`."
          },
          "trainingCode": {
            "type": "string"
          }
        }
      },
      "SubmitResultResponse": {
        "type": "object",
        "required": [
          "completionId",
          "passed",
          "score",
          "passScore"
        ],
        "properties": {
          "certificateId": {
            "type": [
              "string",
              "null"
            ]
          },
          "completionId": {
            "type": "string",
            "format": "uuid"
          },
          "passScore": {
            "type": "integer",
            "format": "int32"
          },
          "passed": {
            "type": "boolean"
          },
          "score": {
            "type": "integer",
            "format": "int32"
          },
          "validUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SubscriptionOverview": {
        "type": "object",
        "description": "Tenant subscription overview for the billing page: current plan, status,\nperiod end, trial state, effective limits, current usage and feature\nflags. Backed by Paddle Billing webhook data written into `billing_info` +\n`tenants.plan`, and by the canonical plans in `crate::saasy::plans`.\n\nJSON contract (camelCase, matches the frontend): `plan`, `planName`,\n`priceEur`, `status`, `currentPeriodEnd`, `manageUrl`, `trialEndsAt`,\n`isTrialing`, `limits:{maxUsers,maxInvoicesPerMonth,maxConnectors}`,\n`usage:{users,invoicesThisMonth,connectors,overageSeats}`,\n`features:{taxAutomations,fancyReports,erp}`.",
        "required": [
          "plan",
          "planName",
          "priceEur",
          "isTrialing",
          "limits",
          "features",
          "usage"
        ],
        "properties": {
          "currentPeriodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "features": {
            "$ref": "#/components/schemas/PlanFeatures"
          },
          "isTrialing": {
            "type": "boolean"
          },
          "limits": {
            "$ref": "#/components/schemas/PlanLimits"
          },
          "manageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "plan": {
            "type": "string",
            "description": "Resolved plan id (free/starter/business/enterprise, or a custom\noverride id)."
          },
          "planName": {
            "type": "string"
          },
          "priceEur": {
            "type": "number",
            "format": "double",
            "description": "Monthly price in EUR; `-1.0` = custom pricing (enterprise)."
          },
          "quantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "subscriptionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "trialEndsAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageSnapshot"
          }
        }
      },
      "SuitabilityRequest": {
        "type": "object",
        "required": [
          "items",
          "sender",
          "recipient"
        ],
        "properties": {
          "customer_annual_volume": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CartItemInput"
            }
          },
          "recipient": {
            "$ref": "#/components/schemas/Address"
          },
          "sender": {
            "$ref": "#/components/schemas/Address"
          }
        }
      },
      "SuitabilityResult": {
        "type": "object",
        "required": [
          "total_weight_kg",
          "total_value",
          "requires_insurance",
          "methods"
        ],
        "properties": {
          "methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MethodSuitability"
            }
          },
          "recommended_box": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BoxFit"
              }
            ]
          },
          "requires_insurance": {
            "type": "boolean"
          },
          "total_value": {
            "type": "string"
          },
          "total_weight_kg": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "SupplierCondition": {
        "type": "object",
        "required": [
          "supplierContactId",
          "currency"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "Currency for the minimum order value.",
            "maxLength": 3,
            "minLength": 3
          },
          "deliveryTerms": {
            "type": [
              "string",
              "null"
            ],
            "description": "Incoterms, e.g. \"EXW\", \"DAP\"."
          },
          "earlyPaymentDiscountPercent": {
            "type": [
              "string",
              "null"
            ],
            "description": "Early-payment discount percentage (Skonto), e.g. 2.0."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Is this the default condition for the supplier?"
          },
          "minimumOrderValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Minimum order value required for this supplier."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "paymentDueDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Number of days within which payment is due."
          },
          "paymentTerms": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment terms, e.g. \"14 Tage, 2% Skonto\"."
          },
          "supplierContactId": {
            "type": "string",
            "description": "The supplier this condition applies to (`contact_id`).\nReferences the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the supplier, denormalized for easy listing."
          },
          "volumeDiscountTiers": {
            "description": "Tiered discounts: JSON array of `{min_quantity, discount_percent}`."
          }
        }
      },
      "SupplierConditionCreate": {
        "type": "object",
        "required": [
          "supplierContactId",
          "currency"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "Currency for the minimum order value.",
            "maxLength": 3,
            "minLength": 3
          },
          "deliveryTerms": {
            "type": [
              "string",
              "null"
            ],
            "description": "Incoterms, e.g. \"EXW\", \"DAP\"."
          },
          "earlyPaymentDiscountPercent": {
            "type": [
              "string",
              "null"
            ],
            "description": "Early-payment discount percentage (Skonto), e.g. 2.0."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Is this the default condition for the supplier?"
          },
          "minimumOrderValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Minimum order value required for this supplier."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "paymentDueDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Number of days within which payment is due."
          },
          "paymentTerms": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment terms, e.g. \"14 Tage, 2% Skonto\"."
          },
          "supplierContactId": {
            "type": "string",
            "description": "The supplier this condition applies to (`contact_id`).\nReferences the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the supplier, denormalized for easy listing."
          },
          "volumeDiscountTiers": {
            "description": "Tiered discounts: JSON array of `{min_quantity, discount_percent}`."
          }
        }
      },
      "SupplierConditionUpdate": {
        "type": "object",
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Currency for the minimum order value.",
            "maxLength": 3,
            "minLength": 3
          },
          "deliveryTerms": {
            "type": [
              "string",
              "null"
            ],
            "description": "Incoterms, e.g. \"EXW\", \"DAP\"."
          },
          "earlyPaymentDiscountPercent": {
            "type": [
              "string",
              "null"
            ],
            "description": "Early-payment discount percentage (Skonto), e.g. 2.0."
          },
          "isDefault": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Is this the default condition for the supplier?"
          },
          "minimumOrderValue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Minimum order value required for this supplier."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "paymentDueDays": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Number of days within which payment is due."
          },
          "paymentTerms": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment terms, e.g. \"14 Tage, 2% Skonto\"."
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The supplier this condition applies to (`contact_id`).\nReferences the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the supplier, denormalized for easy listing."
          },
          "volumeDiscountTiers": {
            "description": "Tiered discounts: JSON array of `{min_quantity, discount_percent}`."
          }
        }
      },
      "SupplierInvoice": {
        "type": "object",
        "required": [
          "invoiceNumber",
          "status",
          "invoiceDate",
          "lineItems"
        ],
        "properties": {
          "currency": {
            "type": "string"
          },
          "goodsReceiptId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the goods receipt entity."
          },
          "invoiceDate": {
            "type": "string",
            "format": "date"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, unitPriceNet, taxRate}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "purchaseOrderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the purchase order entity."
          },
          "status": {
            "$ref": "#/components/schemas/SupplierInvoiceStatus",
            "description": "One of: draft | matched | has_variances | posted | cancelled"
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalGrossAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalNetAmount": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SupplierInvoiceCreate": {
        "type": "object",
        "required": [
          "invoiceNumber",
          "status",
          "invoiceDate",
          "lineItems"
        ],
        "properties": {
          "currency": {
            "type": "string"
          },
          "goodsReceiptId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the goods receipt entity."
          },
          "invoiceDate": {
            "type": "string",
            "format": "date"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, unitPriceNet, taxRate}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "purchaseOrderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the purchase order entity."
          },
          "status": {
            "$ref": "#/components/schemas/SupplierInvoiceStatus",
            "description": "One of: draft | matched | has_variances | posted | cancelled"
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalGrossAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalNetAmount": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SupplierInvoiceStatus": {
        "type": "string",
        "description": "Supplier invoice status.",
        "enum": [
          "draft",
          "matched",
          "has_variances",
          "posted",
          "cancelled"
        ]
      },
      "SupplierInvoiceStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "SupplierInvoiceUpdate": {
        "type": "object",
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "goodsReceiptId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the goods receipt entity."
          },
          "invoiceDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "invoiceNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineItems": {
            "description": "JSON array of `{product_id, name, quantity, unitPriceNet, taxRate}`."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "purchaseOrderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the purchase order entity."
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SupplierInvoiceStatus",
                "description": "One of: draft | matched | has_variances | posted | cancelled"
              }
            ]
          },
          "supplierContactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the supplier entity."
          },
          "supplierName": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalGrossAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalNetAmount": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SupportChannel": {
        "type": "object",
        "required": [
          "tenantId",
          "channelType",
          "name",
          "isActive",
          "config",
          "createdAt"
        ],
        "properties": {
          "channelType": {
            "$ref": "#/components/schemas/SupportChannelType"
          },
          "config": {},
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SupportChannelType": {
        "type": "string",
        "description": "Support channel type: email or chat.",
        "enum": [
          "email",
          "chat"
        ]
      },
      "SupportTicket": {
        "type": "object",
        "required": [
          "tenantId",
          "status",
          "priority",
          "subject",
          "tags",
          "firstMessageAt",
          "lastMessageAt",
          "messageCount",
          "createdAt"
        ],
        "properties": {
          "assignedTo": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "channelId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "channelType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SupportChannelType"
              }
            ]
          },
          "closedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "customerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "customerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstMessageAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastMessageAt": {
            "type": "string",
            "format": "date-time"
          },
          "leadId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the lead entity."
          },
          "messageCount": {
            "type": "integer",
            "format": "int32"
          },
          "orderRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "priority": {
            "$ref": "#/components/schemas/TicketPriority"
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/SupportTicketStatus"
          },
          "subject": {
            "type": "string"
          },
          "tags": {},
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SupportTicketStatus": {
        "type": "string",
        "description": "Support ticket status.",
        "enum": [
          "open",
          "awaiting_reply",
          "resolved",
          "closed"
        ]
      },
      "SupportTicketUpdate": {
        "type": "object",
        "properties": {
          "assignedTo": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "channelId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "channelType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SupportChannelType"
              }
            ]
          },
          "closedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "customerEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the customer entity."
          },
          "customerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstMessageAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastMessageAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "leadId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "References the lead entity."
          },
          "messageCount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "orderRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "priority": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TicketPriority"
              }
            ]
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SupportTicketStatus"
              }
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {},
          "tenantId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SyncLog": {
        "type": "object",
        "required": [
          "log_id",
          "connection_id",
          "platform",
          "sync_type",
          "status",
          "items_synced",
          "items_failed",
          "started_at"
        ],
        "properties": {
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "connection_id": {
            "type": "string"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "items_failed": {
            "type": "integer",
            "format": "int32"
          },
          "items_synced": {
            "type": "integer",
            "format": "int32"
          },
          "log_id": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "sync_type": {
            "type": "string"
          }
        }
      },
      "SyncLogStatus": {
        "type": "string",
        "description": "Marketplace sync log status.",
        "enum": [
          "running",
          "success",
          "error"
        ]
      },
      "SyncStatus": {
        "type": "string",
        "description": "Marketplace sync status.",
        "enum": [
          "pending",
          "connected",
          "success",
          "error"
        ]
      },
      "SyncSummary": {
        "type": "object",
        "description": "Result of a sync/export run — what the app reports back to the admin UI.",
        "properties": {
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "items_failed": {
            "type": "integer",
            "format": "int32"
          },
          "items_synced": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "SyncType": {
        "type": "string",
        "description": "Marketplace sync type.",
        "enum": [
          "orders",
          "products",
          "inventory",
          "invoices",
          "shipments",
          "contacts",
          "prices",
          "config",
          "branding",
          "legal"
        ]
      },
      "TargetProgress": {
        "type": "object",
        "required": [
          "id",
          "scope",
          "base_year",
          "base_value",
          "target_year",
          "target_value",
          "description"
        ],
        "properties": {
          "base_value": {
            "type": "number",
            "format": "double"
          },
          "base_year": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "progress_pct": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Current year's emissions for the scope as % of the target. None when no data."
          },
          "scope": {
            "type": "string"
          },
          "target_value": {
            "type": "number",
            "format": "double"
          },
          "target_year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TaxRateCreate": {
        "type": "object",
        "required": [
          "countryCode",
          "ratePercent",
          "name",
          "isDefault"
        ],
        "properties": {
          "countryCode": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code."
          },
          "effectiveFrom": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date this rate took effect; `None` = not date-bound."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Default rate for the country (one per country); fallback for lookups\nwhen no dated rate applies."
          },
          "name": {
            "type": "string",
            "description": "Human name, e.g. \"VAT\"."
          },
          "ratePercent": {
            "type": "integer",
            "format": "int64",
            "description": "Rate in hundredths of a percent: 1900 = 19.00%."
          }
        }
      },
      "Team": {
        "type": "object",
        "required": [
          "id",
          "name",
          "tenant_id",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "parent_team_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TeamCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "parentTeamId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "TenantSettings": {
        "type": "object",
        "required": [
          "companyType",
          "features"
        ],
        "properties": {
          "companyType": {
            "$ref": "#/components/schemas/CompanyType"
          },
          "dpaAcceptedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dpaAcceptedBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "dpaVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "features": {
            "description": "Active feature toggles for the tenant."
          }
        }
      },
      "TenantUser": {
        "type": "object",
        "required": [
          "user_id",
          "email",
          "name",
          "role",
          "permissions",
          "is_active",
          "email_verified",
          "joined_at"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "email_verified": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_login": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "role": {
            "type": "string"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "TicketMessage": {
        "type": "object",
        "required": [
          "tenantId",
          "ticketId",
          "direction",
          "messageType",
          "body",
          "isInternal",
          "metadata",
          "createdAt"
        ],
        "properties": {
          "authorEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "authorName": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string"
          },
          "bodyHtml": {
            "type": [
              "string",
              "null"
            ]
          },
          "channelId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "direction": {
            "$ref": "#/components/schemas/MessageDirection"
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "isInternal": {
            "type": "boolean"
          },
          "messageType": {
            "$ref": "#/components/schemas/MessageType"
          },
          "metadata": {},
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "ticketId": {
            "type": "string",
            "format": "uuid",
            "description": "References the ticket entity."
          }
        }
      },
      "TicketPriority": {
        "type": "string",
        "description": "Support ticket priority.",
        "enum": [
          "normal",
          "high"
        ]
      },
      "TimeEntryClockIn": {
        "type": "object",
        "properties": {
          "notes": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "TimeEntryClockOut": {
        "type": "object",
        "required": [
          "clock_out"
        ],
        "properties": {
          "clock_out": {
            "type": "string",
            "format": "date-time"
          },
          "hours": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional manual hours; when absent, derived from clock_in..clock_out."
          }
        }
      },
      "TimeEntryDto": {
        "type": "object",
        "description": "API shape returned to the frontend (matches `frontend/src/types/time-entry.ts`).",
        "required": [
          "time_entry_id",
          "employee_id",
          "date",
          "created_at"
        ],
        "properties": {
          "clock_in": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "clock_out": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "employee_id": {
            "type": "string",
            "format": "uuid"
          },
          "hours": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "time_entry_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "TimelineEvent": {
        "type": "object",
        "description": "Single timeline entry aggregated from the contact's activity across all\nrelated modules (communications, quotations, orders, invoices, documents).",
        "required": [
          "type",
          "id",
          "title",
          "date"
        ],
        "properties": {
          "date": {
            "type": "string",
            "description": "RFC3339 UTC timestamp for sorting."
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "description": "Source record id (stringified)."
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Source module: communication | quotation | order | invoice | attachment."
          }
        }
      },
      "TotpEnableRequest": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string"
          }
        }
      },
      "TotpSetupResponse": {
        "type": "object",
        "required": [
          "secret",
          "qr_code_url",
          "backup_codes"
        ],
        "properties": {
          "backup_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "qr_code_url": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          }
        }
      },
      "TrackOrderRequest": {
        "type": "object",
        "description": "Refresh tracking for a shipment from the live carrier API and store the\nlatest status + events on the shipment row.",
        "required": [
          "order_number",
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "order_number": {
            "type": "string"
          }
        }
      },
      "TrackOrderResponse": {
        "type": "object",
        "required": [
          "order_number",
          "order_status",
          "shipments"
        ],
        "properties": {
          "order_number": {
            "type": "string"
          },
          "order_status": {
            "type": "string"
          },
          "shipments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackedShipment"
            }
          }
        }
      },
      "TrackedShipment": {
        "type": "object",
        "required": [
          "carrier",
          "status",
          "events"
        ],
        "properties": {
          "carrier": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackingEvent"
            }
          },
          "label_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "tracking_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "tracking_url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "TrackingEvent": {
        "type": "object",
        "required": [
          "date",
          "location",
          "status",
          "description"
        ],
        "properties": {
          "date": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "TrackingInfo": {
        "type": "object",
        "required": [
          "tracking_number",
          "carrier",
          "status",
          "events"
        ],
        "properties": {
          "carrier": {
            "type": "string"
          },
          "estimated_delivery": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackingEvent"
            }
          },
          "raw_response": {},
          "status": {
            "type": "string"
          },
          "tracking_number": {
            "type": "string"
          }
        }
      },
      "TrainingAssignment": {
        "type": "object",
        "properties": {
          "assignedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "employeeId": {
            "type": "string",
            "format": "uuid"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "status": {
            "$ref": "#/components/schemas/AssignmentStatus"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "trainingId": {
            "type": "string",
            "format": "uuid"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "TrainingAssignmentCreate": {
        "type": "object",
        "properties": {
          "assignedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "employeeId": {
            "type": "string",
            "format": "uuid"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "status": {
            "$ref": "#/components/schemas/AssignmentStatus"
          },
          "trainingId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "TrainingAssignmentUpdate": {
        "type": "object",
        "properties": {
          "assignedBy": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "employeeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AssignmentStatus"
              }
            ]
          },
          "trainingId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "TrainingContent": {
        "type": "object",
        "required": [
          "code",
          "title",
          "titleEn",
          "sections",
          "quiz",
          "passScore",
          "contact"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "contact": {
            "$ref": "#/components/schemas/ContactInfo"
          },
          "passScore": {
            "type": "integer",
            "format": "int32"
          },
          "quiz": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizQuestion"
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Section"
            }
          },
          "title": {
            "type": "string"
          },
          "titleEn": {
            "type": "string"
          }
        }
      },
      "TrainingSource": {
        "type": "string",
        "description": "Source of the training content.",
        "enum": [
          "builtin",
          "plugin"
        ]
      },
      "UmsatzsteuerReport": {
        "type": "object",
        "required": [
          "period",
          "generated_at",
          "output_tax",
          "total_output_tax",
          "input_tax",
          "total_input_tax",
          "vat_payable",
          "vat_refund"
        ],
        "properties": {
          "generated_at": {
            "type": "string"
          },
          "input_tax": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VatDetail"
            }
          },
          "output_tax": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VatDetail"
            }
          },
          "period": {
            "type": "string"
          },
          "total_input_tax": {
            "type": "string"
          },
          "total_output_tax": {
            "type": "string"
          },
          "vat_payable": {
            "type": "string"
          },
          "vat_refund": {
            "type": "string"
          }
        }
      },
      "UpdateAutomation": {
        "type": "object",
        "properties": {
          "config": {},
          "enabled": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "UpdateChannelDto": {
        "type": "object",
        "properties": {
          "config": {},
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UpdateConnectionRequest": {
        "type": "object",
        "properties": {
          "api_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_secret": {
            "type": [
              "string",
              "null"
            ]
          },
          "config": {},
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "shop_domain": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UpdatePermissionsPayload": {
        "type": "object",
        "required": [
          "permissions"
        ],
        "properties": {
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpdateProfileRequest": {
        "type": "object",
        "properties": {
          "avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UpdateRolePayload": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string"
          },
          "sync_permissions": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "UpdateSubscriptionRequest": {
        "type": "object",
        "properties": {
          "event_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "secret": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UpdateSyncDirectionRequest": {
        "type": "object",
        "required": [
          "directions"
        ],
        "properties": {
          "directions": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "UpdateTenantSettings": {
        "type": "object",
        "description": "Request payload for updating tenant settings.",
        "required": [
          "companyType"
        ],
        "properties": {
          "companyType": {
            "$ref": "#/components/schemas/CompanyType"
          },
          "features": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PartialFeatureSettings"
              }
            ]
          }
        }
      },
      "UpsCredentials": {
        "type": "object",
        "required": [
          "client_id",
          "client_secret"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "description": "OAuth 2.0 client credentials from developer.ups.com."
          },
          "client_secret": {
            "type": "string"
          },
          "shipper_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "UPS account number; required for label creation, optional for rates/tracking."
          }
        }
      },
      "UsageSnapshot": {
        "type": "object",
        "description": "Current usage for a tenant. `overage_seats` is what billing charges\n5€/seat/month on.",
        "required": [
          "users",
          "invoicesThisMonth",
          "connectors",
          "overageSeats"
        ],
        "properties": {
          "connectors": {
            "type": "integer",
            "format": "int64"
          },
          "invoicesThisMonth": {
            "type": "integer",
            "format": "int64"
          },
          "overageSeats": {
            "type": "integer",
            "format": "int64"
          },
          "users": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "UserProfile": {
        "type": "object",
        "required": [
          "id",
          "email",
          "first_name",
          "last_name",
          "full_name",
          "email_verified",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "email": {
            "type": "string"
          },
          "email_verified": {
            "type": "boolean"
          },
          "first_name": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "last_name": {
            "type": "string"
          }
        }
      },
      "UserTenantInfo": {
        "type": "object",
        "required": [
          "tenant_id",
          "tenant_name",
          "role"
        ],
        "properties": {
          "custom_domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string"
          },
          "subdomain": {
            "type": [
              "string",
              "null"
            ]
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_name": {
            "type": "string"
          }
        }
      },
      "UstvaErgebnis": {
        "type": "object",
        "required": [
          "zeitraum",
          "zeitraum_typ",
          "von",
          "bis",
          "kz_81",
          "kz_83",
          "kz_86",
          "kz_88",
          "kz_41",
          "kz_43",
          "kz_89",
          "kz_93",
          "kz_46",
          "kz_47",
          "kz_84",
          "kz_85",
          "kz_66",
          "kz_61",
          "kz_67",
          "zahllast",
          "ist_kleinunternehmer"
        ],
        "properties": {
          "bis": {
            "type": "string"
          },
          "hinweis": {
            "type": [
              "string",
              "null"
            ]
          },
          "ist_kleinunternehmer": {
            "type": "boolean"
          },
          "kz_41": {
            "type": "string"
          },
          "kz_43": {
            "type": "string"
          },
          "kz_46": {
            "type": "string"
          },
          "kz_47": {
            "type": "string"
          },
          "kz_61": {
            "type": "string"
          },
          "kz_66": {
            "type": "string"
          },
          "kz_67": {
            "type": "string"
          },
          "kz_81": {
            "type": "string"
          },
          "kz_83": {
            "type": "string"
          },
          "kz_84": {
            "type": "string"
          },
          "kz_85": {
            "type": "string"
          },
          "kz_86": {
            "type": "string"
          },
          "kz_88": {
            "type": "string"
          },
          "kz_89": {
            "type": "string"
          },
          "kz_93": {
            "type": "string"
          },
          "von": {
            "type": "string"
          },
          "zahllast": {
            "type": "string"
          },
          "zeitraum": {
            "type": "string"
          },
          "zeitraum_typ": {
            "type": "string"
          }
        }
      },
      "VatDetail": {
        "type": "object",
        "required": [
          "tax_rate",
          "net_amount",
          "tax_amount",
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64"
          },
          "net_amount": {
            "type": "string"
          },
          "tax_amount": {
            "type": "string"
          },
          "tax_rate": {
            "type": "string"
          }
        }
      },
      "VatItem": {
        "type": "object",
        "required": [
          "tax_rate",
          "net_amount",
          "tax_amount"
        ],
        "properties": {
          "net_amount": {
            "type": "string"
          },
          "tax_amount": {
            "type": "string"
          },
          "tax_rate": {
            "type": "string"
          }
        }
      },
      "VatSummary": {
        "type": "object",
        "required": [
          "total_output_tax",
          "total_input_tax",
          "vat_due",
          "output_tax_items",
          "input_tax_items"
        ],
        "properties": {
          "input_tax_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VatItem"
            }
          },
          "output_tax_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VatItem"
            }
          },
          "total_input_tax": {
            "type": "string"
          },
          "total_output_tax": {
            "type": "string"
          },
          "vat_due": {
            "type": "string"
          }
        }
      },
      "Verfahrensdokumentation": {
        "type": "object",
        "required": [
          "title",
          "version",
          "generated_at",
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComplianceEntry"
            }
          },
          "generated_at": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "VerifyEmailRequest": {
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string"
          }
        }
      },
      "Voucher": {
        "type": "object",
        "required": [
          "voucherType",
          "voucherStatus",
          "voucherDate",
          "currency"
        ],
        "properties": {
          "categoryId": {
            "type": [
              "string",
              "null"
            ]
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "fileAttachments": {},
          "lineItems": {},
          "metadata": {},
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "openAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "paidDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "paymentStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaymentStatus"
              }
            ]
          },
          "taxAmounts": {},
          "taxCondition": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalGrossAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalNetAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherDate": {
            "type": "string",
            "format": "date"
          },
          "voucherNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherStatus": {
            "$ref": "#/components/schemas/VoucherStatus"
          },
          "voucherType": {
            "$ref": "#/components/schemas/VoucherType"
          }
        }
      },
      "VoucherCreate": {
        "type": "object",
        "required": [
          "voucherType",
          "voucherStatus",
          "voucherDate",
          "currency"
        ],
        "properties": {
          "categoryId": {
            "type": [
              "string",
              "null"
            ]
          },
          "contactId": {
            "type": [
              "string",
              "null"
            ],
            "description": "References the contact entity."
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "fileAttachments": {},
          "lineItems": {},
          "metadata": {},
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "openAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "paidDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "paymentStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PaymentStatus"
              }
            ]
          },
          "taxAmounts": {},
          "taxCondition": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalGrossAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalNetAmount": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherDate": {
            "type": "string",
            "format": "date"
          },
          "voucherNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "voucherStatus": {
            "$ref": "#/components/schemas/VoucherStatus"
          },
          "voucherType": {
            "$ref": "#/components/schemas/VoucherType"
          }
        }
      },
      "VoucherStatus": {
        "type": "string",
        "description": "Lifecycle status of a voucher.",
        "enum": [
          "open",
          "paid",
          "invoiced"
        ]
      },
      "VoucherType": {
        "type": "string",
        "description": "Kind of booking voucher.",
        "enum": [
          "invoice"
        ]
      },
      "Warehouse": {
        "type": "object",
        "required": [
          "name",
          "code"
        ],
        "properties": {
          "addressCity": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressCountry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "addressStreet": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressZip": {
            "type": [
              "string",
              "null"
            ]
          },
          "binLocations": {
            "description": "JSON array of bin locations, e.g. `[\"A-01-01\", \"A-01-02\"]`."
          },
          "code": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "WarehouseCreate": {
        "type": "object",
        "required": [
          "name",
          "code"
        ],
        "properties": {
          "addressCity": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressCountry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "addressStreet": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressZip": {
            "type": [
              "string",
              "null"
            ]
          },
          "binLocations": {
            "description": "JSON array of bin locations, e.g. `[\"A-01-01\", \"A-01-02\"]`."
          },
          "code": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "WarehouseStock": {
        "type": "object",
        "required": [
          "warehouseId",
          "productId",
          "quantity"
        ],
        "properties": {
          "batchNumber": {
            "type": [
              "string",
              "null"
            ],
            "description": "Batch/lot number (Chargennummer) — `None` for non-batched goods."
          },
          "binLocation": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiryDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Expiry date for batch-tracked goods."
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "integer",
            "format": "int64"
          },
          "serialNumbers": {
            "description": "JSON array of serial numbers (Seriennummern) in this stock row."
          },
          "warehouseId": {
            "type": "string"
          }
        }
      },
      "WarehouseUpdate": {
        "type": "object",
        "properties": {
          "addressCity": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressCountry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CountryCode"
              }
            ]
          },
          "addressStreet": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressZip": {
            "type": [
              "string",
              "null"
            ]
          },
          "binLocations": {
            "description": "JSON array of bin locations, e.g. `[\"A-01-01\", \"A-01-02\"]`."
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "isDefault": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "WebhookDirection": {
        "type": "string",
        "description": "Webhook event direction: inbound | outbound.",
        "enum": [
          "inbound",
          "outbound"
        ]
      },
      "WebhookEvent": {
        "type": "object",
        "required": [
          "direction",
          "eventType"
        ],
        "properties": {
          "attempts": {
            "type": "integer",
            "format": "int32"
          },
          "channel": {
            "type": "string",
            "description": "source for inbound, target URL for outbound."
          },
          "direction": {
            "$ref": "#/components/schemas/WebhookDirection",
            "description": "inbound | outbound"
          },
          "eventType": {
            "type": "string"
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "payload": {},
          "status": {
            "$ref": "#/components/schemas/WebhookEventStatus",
            "description": "accepted | delivered | failed"
          }
        }
      },
      "WebhookEventStatus": {
        "type": "string",
        "description": "Webhook event delivery status: accepted | delivered | failed.",
        "enum": [
          "accepted",
          "delivered",
          "failed",
          "received"
        ]
      },
      "WebhookSubscription": {
        "type": "object",
        "required": [
          "name",
          "eventType",
          "url",
          "secret"
        ],
        "properties": {
          "eventType": {
            "type": "string",
            "description": "Event type to react to (e.g. \"order.created\"); \"*\" = all events."
          },
          "isActive": {
            "type": "boolean"
          },
          "name": {
            "type": "string",
            "description": "Human label (e.g. \"Warehouse app\")."
          },
          "secret": {
            "type": "string",
            "description": "Shared secret for HMAC-SHA256 signature, sent as X-Signature."
          },
          "url": {
            "type": "string"
          }
        }
      },
      "Workflow": {
        "type": "object",
        "required": [
          "name",
          "triggerEvent"
        ],
        "properties": {
          "actions": {},
          "enabled": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "triggerEvent": {
            "type": "string",
            "description": "Event that triggers the workflow, e.g. `order.paid`, `order.shipped`."
          }
        }
      },
      "WorkflowAction": {
        "type": "object",
        "description": "One action inside a workflow. Only `email` is supported for now.",
        "required": [
          "action_type"
        ],
        "properties": {
          "action_type": {
            "type": "string"
          },
          "body": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "WorkflowEnabledUpdate": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "XRechnungResponse": {
        "type": "object",
        "required": [
          "content",
          "content_type",
          "filename"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "YearTotal": {
        "type": "object",
        "required": [
          "year",
          "tco2e"
        ],
        "properties": {
          "tco2e": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "YearlyPayrollSummary": {
        "type": "object",
        "required": [
          "year",
          "months",
          "yearly_gross",
          "yearly_net",
          "yearly_employer_cost",
          "avg_employee_count"
        ],
        "properties": {
          "avg_employee_count": {
            "type": "integer",
            "format": "int32"
          },
          "months": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayrollSummaryItem"
            }
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "yearly_employer_cost": {
            "type": "string"
          },
          "yearly_gross": {
            "type": "string"
          },
          "yearly_net": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearer_token": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT access token (RFC 6750 Bearer), issued by `POST /auth/login`. Claims: `sub` (user id), `org` (tenant id), `roles` (RBAC roles for frontend UI enforcement). Authorization is enforced server-side: the tenant-scoped roles are resolved to fine-grained permissions (e.g. `customer:read`, `bookkeeping:export`) and checked per endpoint. Roles, highest to lowest: Owner, Admin, Member, Viewer. Public endpoints (auth) are marked with an empty security requirement."
      }
    }
  },
  "security": [
    {
      "bearer_token": []
    }
  ],
  "tags": [
    {
      "name": "absence",
      "description": "Absence management. Required permissions: absence:read, absence:write, absence:delete."
    },
    {
      "name": "activity",
      "description": "Activity management. Required permissions: activity:read, activity:write, activity:delete."
    },
    {
      "name": "attachment",
      "description": "Attachment management. Required permissions: contact:read, contact:write, contact:delete."
    },
    {
      "name": "bom",
      "description": "Bom management. Required permissions: bom:read, bom:write, bom:delete."
    },
    {
      "name": "compliance_training",
      "description": "ComplianceTraining management. Required permissions: training:read, training:write, training:delete."
    },
    {
      "name": "contact",
      "description": "Contact management. Required permissions: contact:read, contact:write, contact:delete."
    },
    {
      "name": "coupon",
      "description": "Coupon management. Required permissions: coupons:read, coupons:write, coupons:delete."
    },
    {
      "name": "customer",
      "description": "Customer management. Required permissions: customer:read, customer:write, customer:delete."
    },
    {
      "name": "customer_communication",
      "description": "CustomerCommunication management. Required permissions: contact:read, contact:write, contact:delete."
    },
    {
      "name": "customer_group",
      "description": "CustomerGroup management. Required permissions: customer_group:read, customer_group:write, customer_group:delete."
    },
    {
      "name": "declaration",
      "description": "Declaration management. Required permissions: declaration:read, declaration:write, declaration:delete."
    },
    {
      "name": "delivery_appointment",
      "description": "DeliveryAppointment management. Required permissions: warehouse:read, warehouse:write, warehouse:delete."
    },
    {
      "name": "delivery_date",
      "description": "DeliveryDate management. Required permissions: delivery_date:read, delivery_date:write, delivery_date:delete."
    },
    {
      "name": "delivery_note",
      "description": "DeliveryNote management. Required permissions: delivery_note:read, delivery_note:write, delivery_note:delete."
    },
    {
      "name": "email_template",
      "description": "EmailTemplate management. Required permissions: email_template:read, email_template:write, email_template:delete."
    },
    {
      "name": "employee",
      "description": "Employee management. Required permissions: employee:read, employee:write, employee:delete."
    },
    {
      "name": "goods_receipt",
      "description": "GoodsReceipt management. Required permissions: goodsreceipt:read, goodsreceipt:write, goodsreceipt:delete."
    },
    {
      "name": "group_figure",
      "description": "GroupFigure management. Required permissions: group_figures:read, group_figures:write, group_figures:delete."
    },
    {
      "name": "inventory_count",
      "description": "InventoryCount management. Required permissions: inventorycount:read, inventorycount:write, inventorycount:delete."
    },
    {
      "name": "invoice",
      "description": "Invoice management. Required permissions: invoice:read, invoice:write, invoice:delete."
    },
    {
      "name": "job_application",
      "description": "JobApplication management. Required permissions: jobapplication:read, jobapplication:write, jobapplication:delete."
    },
    {
      "name": "job_posting",
      "description": "JobPosting management. Required permissions: hr:read, hr:write, hr:delete."
    },
    {
      "name": "kyc_record",
      "description": "KycRecord management. Required permissions: kyc_record:read, kyc_record:write, kyc_record:delete."
    },
    {
      "name": "lead",
      "description": "Lead management. Required permissions: lead:read, lead:write, lead:delete."
    },
    {
      "name": "legal_document",
      "description": "LegalDocument management. Required permissions: legaldocument:read, legaldocument:write, legaldocument:delete."
    },
    {
      "name": "order",
      "description": "Order management. Required permissions: order:read, order:write, order:delete."
    },
    {
      "name": "order_confirmation",
      "description": "OrderConfirmation management. Required permissions: confirmation:read, confirmation:write, confirmation:delete."
    },
    {
      "name": "participation",
      "description": "Participation management. Required permissions: participation:read, participation:write, participation:delete."
    },
    {
      "name": "payment",
      "description": "Payment management. Required permissions: payment:read, payment:write, payment:delete."
    },
    {
      "name": "payment_gateway",
      "description": "PaymentGateway management. Required permissions: paymentgateway:read, paymentgateway:write, paymentgateway:delete."
    },
    {
      "name": "posting_category",
      "description": "PostingCategory management. Required permissions: postingcategory:read, postingcategory:write, postingcategory:delete."
    },
    {
      "name": "price_tier",
      "description": "PriceTier management. Required permissions: price_tier:read, price_tier:write, price_tier:delete."
    },
    {
      "name": "product",
      "description": "Product management. Required permissions: product:read, product:write, product:delete."
    },
    {
      "name": "product_attribute",
      "description": "ProductAttribute management. Required permissions: product:read, product:write, product:delete."
    },
    {
      "name": "product_category",
      "description": "ProductCategory management. Required permissions: productcategory:read, productcategory:write, productcategory:delete."
    },
    {
      "name": "product_variant",
      "description": "ProductVariant management. Required permissions: productvariant:read, productvariant:write, productvariant:delete."
    },
    {
      "name": "proforma_invoice",
      "description": "ProformaInvoice management. Required permissions: proformainvoice:read, proformainvoice:write, proformainvoice:delete."
    },
    {
      "name": "purchase_order",
      "description": "PurchaseOrder management. Required permissions: purchaseorder:read, purchaseorder:write, purchaseorder:delete."
    },
    {
      "name": "quotation",
      "description": "Quotation management. Required permissions: quotation:read, quotation:write, quotation:delete."
    },
    {
      "name": "recurring_template",
      "description": "RecurringTemplate management. Required permissions: recurringtemplate:read, recurringtemplate:write, recurringtemplate:delete."
    },
    {
      "name": "rfq",
      "description": "Rfq management. Required permissions: rfq:read, rfq:write, rfq:delete."
    },
    {
      "name": "service_assignment",
      "description": "ServiceAssignment management. Required permissions: service_assignments:read, service_assignments:write, service_assignments:delete."
    },
    {
      "name": "service_job",
      "description": "ServiceJob management. Required permissions: service_jobs:read, service_jobs:write, service_jobs:delete."
    },
    {
      "name": "shareholder",
      "description": "Shareholder management. Required permissions: shareholder:read, shareholder:write, shareholder:delete."
    },
    {
      "name": "shipment",
      "description": "Shipment management. Required permissions: shipment:read, shipment:write, shipment:delete."
    },
    {
      "name": "shipping_rule",
      "description": "ShippingRule management. Required permissions: shipping_rule:read, shipping_rule:write, shipping_rule:delete."
    },
    {
      "name": "shipping_threshold",
      "description": "ShippingThreshold management. Required permissions: shipping_threshold:read, shipping_threshold:write, shipping_threshold:delete."
    },
    {
      "name": "silent_partner",
      "description": "SilentPartner management. Required permissions: silent_partner:read, silent_partner:write, silent_partner:delete."
    },
    {
      "name": "stock_movement",
      "description": "StockMovement management. Required permissions: stockmovement:read, stockmovement:write, stockmovement:delete."
    },
    {
      "name": "stock_transfer",
      "description": "StockTransfer management. Required permissions: stocktransfer:read, stocktransfer:write, stocktransfer:delete."
    },
    {
      "name": "supplier_condition",
      "description": "SupplierCondition management. Required permissions: supplier_condition:read, supplier_condition:write, supplier_condition:delete."
    },
    {
      "name": "supplier_invoice",
      "description": "SupplierInvoice management. Required permissions: supplierinvoice:read, supplierinvoice:write, supplierinvoice:delete."
    },
    {
      "name": "support_ticket",
      "description": "SupportTicket management. Required permissions: supportticket:read, supportticket:write, supportticket:delete."
    },
    {
      "name": "tenant_settings",
      "description": "TenantSettings management. Required permissions: tenantsettings:read, tenantsettings:write, tenantsettings:delete."
    },
    {
      "name": "training_assignment",
      "description": "TrainingAssignment management. Required permissions: training:read, training:write, training:delete."
    },
    {
      "name": "voucher",
      "description": "Voucher management. Required permissions: voucher:read, voucher:write, voucher:delete."
    },
    {
      "name": "warehouse",
      "description": "Warehouse management. Required permissions: warehouse:read, warehouse:write, warehouse:delete."
    },
    {
      "name": "warehouse_stock",
      "description": "WarehouseStock management. Required permissions: warehousestock:read, warehousestock:write, warehousestock:delete."
    },
    {
      "name": "auth",
      "description": "Authentication endpoints (login, register, verify, password reset, TOTP, magic link). Public endpoints."
    },
    {
      "name": "billing",
      "description": "Subscription plans and billing state. GET /api/v1/plans is public; subscription management requires authentication."
    },
    {
      "name": "admin",
      "description": "Administrative operations. Required role: Admin or Owner. Permissions: admin:users, admin:settings"
    },
    {
      "name": "bookkeeping",
      "description": "Bookkeeping reports & exports. Required role: Admin or higher. Permissions: bookkeeping:read, bookkeeping:export, bookkeeping:import"
    },
    {
      "name": "gdpr",
      "description": "GDPR data-subject export (Art. 15), erasure + account/tenant erasure (Art. 17) and DPA acceptance (Art. 28). Export: contact:read; erasure/DPA/account-erasure: admin:settings"
    },
    {
      "name": "user",
      "description": "User profile, API keys, team management, tenant switching. Required role: authenticated user."
    },
    {
      "name": "packing",
      "description": "Packing station workflow. Required role: Member or higher. Permissions: order:read, order:write"
    },
    {
      "name": "trainings",
      "description": "Compliance Schulungen (required trainings). Permissions: training:read, training:write, training:complete"
    },
    {
      "name": "automations",
      "description": "Tenant automations"
    }
  ],
  "externalDocs": {
    "url": "https://api.simplebilly.com/",
    "description": "SimpleBilly API documentation & OpenAPI specification"
  }
}