{
  "openapi": "3.1.1",
  "info": {
    "title": "Centriaa API",
    "description": "API completa do Centriaa com suporte a multi-tenant.\n\n## Autenticação\n\nA API utiliza autenticação JWT Bearer. Existem diferentes tipos de tokens:\n\n- **Access Token**: Token principal para acessar recursos protegidos (curta duração)\n- **Refresh Token**: Armazenado em cookie HttpOnly para renovar o access token\n- **Registration Token**: Token temporário usado durante o processo de registro\n- **Tenant Selection Token**: Token usado quando o usuário pertence a múltiplos tenants\n- **API Key**: Chave de acesso para integrações externas (header X-API-Key)\n\n## Fluxo de Autenticação\n\n1. **Login**: POST `/api/v1/auth/login` - Retorna access token e define refresh token no cookie\n2. **Refresh**: POST `/api/v1/auth/refresh` - Renova o access token usando o refresh token do cookie\n3. **Logout**: POST `/api/v1/auth/logout` - Revoga tokens e limpa cookies\n\n## Multi-Tenant\n\nO sistema suporta múltiplos tenants por usuário. Se um usuário pertence a mais de um tenant,\napós o login será necessário selecionar o tenant desejado via `/api/v1/auth/select-tenant`.\n\n## Códigos de Erro\n\nA API utiliza ProblemDetails (RFC 7807) para respostas de erro. Códigos HTTP comuns:\n\n- `400 Bad Request`: Dados de entrada inválidos\n- `401 Unauthorized`: Token ausente ou inválido\n- `403 Forbidden`: Permissão insuficiente\n- `404 Not Found`: Recurso não encontrado\n- `422 Unprocessable Entity`: Erro de validação de negócio\n- `500 Internal Server Error`: Erro interno do servidor",
    "version": "v1"
  },
  "paths": {
    "/ping": {
      "get": {
        "tags": [
          "Erp.Api"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/api-keys": {
      "post": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Cria uma nova API key",
        "description": "Gera uma nova chave de API para autenticação de serviços externos.\nA chave é retornada apenas nesta resposta — não é possível recuperá-la depois.\n\n**Requer:** Role de Admin.\n\n**Uso:** Inclua a chave no header `X-API-Key` das requisições.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "API key criada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreatedDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreatedDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreatedDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (role insuficiente)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Lista API keys do tenant com paginação",
        "description": "Retorna uma lista paginada de API keys. As chaves nunca são exibidas,\napenas o prefixo para identificação.\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome ou descrição)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de API keys retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfApiKeyResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfApiKeyResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfApiKeyResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/api-keys/{id}": {
      "get": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Obtém uma API key por ID",
        "description": "Retorna os detalhes de uma API key específica (sem a chave em texto).\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da API key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "API key não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Atualiza os escopos e IPs permitidos de uma API key existente",
        "description": "SH-B13: edita SOMENTE o controle de acesso (escopos de endpoint e allowlist de IP) de uma\nAPI key já criada. **Não** revela, não recria e não altera o segredo/hash da chave, nem o\nnome, a role ou a expiração. A lista enviada substitui a lista atual por completo\n(vazio/null = sem restrição). A chave deve pertencer ao tenant autenticado.\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da API key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApiKeyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApiKeyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "API key atualizada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos (escopo ou IP malformado)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (role insuficiente)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "API key não encontrada (ou de outro tenant)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Revoga uma API key",
        "description": "Revoga uma API key, impedindo seu uso para autenticação.\nEsta ação não pode ser desfeita.\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da API key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "API key revogada com sucesso"
          },
          "400": {
            "description": "API key já revogada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "API key não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Autentica um usuário com email e senha",
        "description": "Realiza a autenticação do usuário e retorna um token JWT.\n\n**Fluxo de autenticação:**\n- Se o usuário pertence a um único tenant: retorna o access token diretamente\n- Se o usuário pertence a múltiplos tenants: retorna um token de seleção de tenant\n  e a lista de tenants disponíveis para escolha via `/api/v1/auth/select-tenant`\n\nO refresh token é automaticamente definido em um cookie HttpOnly seguro.\n\n**Exemplo de request:**\n```json\n{\n  \"email\": \"usuario@exemplo.com\",\n  \"password\": \"SenhaSegura123!\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Login realizado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados de entrada inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Credenciais inválidas",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/csrf": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Emite um token antiforgery (XSRF) e o disponibiliza em cookie legível pelo SPA",
        "description": "Bootstrap do double-submit (ADR-0007). O SPA deve chamar este endpoint na inicialização,\nantes de operações cookie-driven (refresh/logout). O valor do token volta no corpo e no\ncookie `XSRF-TOKEN`; reenvie-o no header `X-XSRF-TOKEN`.",
        "responses": {
          "200": {
            "description": "Token emitido"
          }
        }
      }
    },
    "/api/v1/auth/select-tenant": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Seleciona um tenant após o login (quando usuário pertence a múltiplos tenants)",
        "description": "Este endpoint é utilizado quando o login retorna `RequiresTenantSelection = true`.\n\nO usuário deve escolher um dos tenants disponíveis na lista retornada pelo login\ne enviar o ID do tenant selecionado junto com seu próprio ID de usuário.\n\nRequer um token de seleção de tenant válido (obtido no login).\n\n**Exemplo de request:**\n```json\n{\n  \"userId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"tenantId\": \"7fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectTenantRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectTenantRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SelectTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tenant selecionado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SelectTenantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectTenantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectTenantResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados de entrada inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token inválido ou expirado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Usuário não tem acesso ao tenant selecionado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Tenant não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/switch-tenant": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Alterna para um tenant diferente (requer autenticação)",
        "description": "Permite que um usuário autenticado alterne entre os tenants aos quais pertence\nsem precisar fazer logout e login novamente.\n\nRequer um access token válido com role de usuário.\nUm novo token será gerado com o contexto do novo tenant.\n\n**Exemplo de request:**\n```json\n{\n  \"tenantId\": \"7fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchTenantRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchTenantRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tenant alterado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SwitchTenantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SwitchTenantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SwitchTenantResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados de entrada inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token inválido ou expirado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Usuário não tem acesso ao tenant",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Tenant não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Renova o access token usando o refresh token do cookie",
        "description": "Utiliza o refresh token armazenado no cookie HttpOnly para gerar um novo access token.\n\nO refresh token é rotacionado automaticamente - um novo refresh token é gerado\ne o antigo é invalidado (rotação de tokens para segurança).\n\n**Importante:** Este endpoint não requer o header Authorization, pois utiliza\no cookie de refresh token.",
        "responses": {
          "200": {
            "description": "Token renovado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshTokenResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshTokenResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshTokenResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Refresh token não encontrado, inválido ou expirado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Realiza logout do usuário - revoga refresh token e invalida access token",
        "description": "Encerra a sessão do usuário de forma segura:\n\n1. Revoga o refresh token armazenado no banco de dados\n2. Adiciona o access token atual à blacklist\n3. Remove o cookie de refresh token\n\n**Nota:** Requer um access token válido (SH-B17). O JTI é extraído do token autenticado\ne adicionado à blacklist para evitar reutilização após logout.",
        "responses": {
          "204": {
            "description": "Logout realizado com sucesso"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/forgot-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Solicita um link de redefinição de senha via email",
        "description": "Envia um email com um link para redefinição de senha.\n\n**Segurança:** Por motivos de segurança, este endpoint sempre retorna sucesso,\nmesmo se o email não estiver cadastrado (prevenção de enumeração de usuários).\n\nO link de redefinição expira após um período configurado (padrão: 1 hora).\n\n**Exemplo de request:**\n```json\n{\n  \"email\": \"usuario@exemplo.com\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Solicitação processada (email enviado se usuário existir)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Email inválido",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/reset-password/validate": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Valida um token de redefinição de senha",
        "description": "Verifica se o token de redefinição de senha ainda é válido antes de\nexibir o formulário de nova senha para o usuário.\n\n**Parâmetros:**\n- `token`: Token recebido no email de redefinição\n- `email`: Email do usuário (deve corresponder ao email do token)",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "description": "Token de reset recebido no email",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "Email do usuário",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token válido"
          },
          "400": {
            "description": "Token ou email inválido",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Token expirado ou já utilizado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/reset-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Redefine a senha usando um token de reset válido",
        "description": "Permite ao usuário definir uma nova senha usando o token recebido por email.\n\n**Requisitos de senha:**\n- Mínimo de 8 caracteres\n- Pelo menos uma letra maiúscula\n- Pelo menos uma letra minúscula\n- Pelo menos um número\n- Pelo menos um caractere especial\n\n**Exemplo de request:**\n```json\n{\n  \"token\": \"abc123...\",\n  \"email\": \"usuario@exemplo.com\",\n  \"newPassword\": \"NovaSenha123!\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Senha redefinida com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Token expirado, inválido ou senha não atende aos requisitos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/change-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Altera a senha do usuário autenticado",
        "description": "Requer o access token do usuário e a senha atual (re-autenticação). A nova senha deve atender\nà política forte (mínimo 8 caracteres, maiúscula, minúscula e número). Ao concluir, todas as\nsessões (refresh tokens) do usuário são revogadas — outras sessões precisam reautenticar.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Senha alterada com sucesso"
          },
          "400": {
            "description": "Nova senha não atende à política",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Senha atual inválida ou não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/barcode-conversions": {
      "get": {
        "tags": [
          "BarcodeConversions"
        ],
        "summary": "Lista todas as conversões de código de barras do tenant.",
        "description": "**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Lista de conversões retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "BarcodeConversions"
        ],
        "summary": "Cria uma nova conversão de código de barras.",
        "description": "**Requer:** Role de Manager ou superior.\n\n**Validações:** unidades de origem/destino obrigatórias e existentes no tenant; tipo de conversão\nválido; fator maior que zero.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarcodeConversionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarcodeConversionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarcodeConversionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Conversão criada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (role insuficiente)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Unidade de medida de origem/destino não encontrada (BARCODE_CONVERSION_UNIT_OF_MEASURE_NOT_FOUND)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/barcode-conversions/{id}": {
      "get": {
        "tags": [
          "BarcodeConversions"
        ],
        "summary": "Obtém uma conversão de código de barras por ID.",
        "description": "**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversão encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Conversão não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "BarcodeConversions"
        ],
        "summary": "Atualiza uma conversão de código de barras existente.",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBarcodeConversionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBarcodeConversionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBarcodeConversionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Conversão atualizada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeConversionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (role insuficiente)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Conversão não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "BarcodeConversions"
        ],
        "summary": "Exclui uma conversão de código de barras (soft delete).",
        "description": "**Requer:** Role de Admin.\n\n**Validações:** não permite exclusão enquanto a conversão estiver em uso por algum código de barras.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Conversão excluída com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (role insuficiente)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Conversão não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conversão em uso por códigos de barras (BARCODE_CONVERSION_IN_USE)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers": {
      "get": {
        "tags": [
          "Carriers"
        ],
        "summary": "Lista transportadoras com paginação e filtros",
        "description": "Retorna uma lista paginada de transportadoras com dados da pessoa associada.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, CarrierCode, CreatedAt, UpdatedAt, Priority, Status",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome, nome fantasia, documento ou código)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filtrar por status (Active, Suspended, Blocked)",
            "schema": {
              "$ref": "#/components/schemas/CarrierStatus"
            }
          },
          {
            "name": "personType",
            "in": "query",
            "description": "Filtrar por tipo de pessoa (Individual, LegalEntity)",
            "schema": {
              "$ref": "#/components/schemas/PersonType"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de transportadoras retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCarrierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Carriers"
        ],
        "summary": "Cria uma nova transportadora",
        "description": "Cria uma nova transportadora com os dados de pessoa associados.\nO documento (CPF/CNPJ) é validado de acordo com o país.\n\n**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCarrierDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCarrierDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCarrierDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Transportadora criada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers/{id}": {
      "get": {
        "tags": [
          "Carriers"
        ],
        "summary": "Obtém uma transportadora por ID com detalhes completos",
        "description": "Retorna os detalhes de uma transportadora específica incluindo dados da pessoa,\nendereços e contatos associados.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da transportadora",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transportadora encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Carriers"
        ],
        "summary": "Atualiza uma transportadora existente",
        "description": "Atualiza os dados da transportadora e da pessoa associada.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da transportadora",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCarrierDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCarrierDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCarrierDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transportadora atualizada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Carriers"
        ],
        "summary": "Exclui uma transportadora",
        "description": "Remove uma transportadora do sistema (soft delete).\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da transportadora",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Transportadora excluída"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers/by-person/{personId}": {
      "get": {
        "tags": [
          "Carriers"
        ],
        "summary": "Obtém uma transportadora pelo ID da pessoa",
        "description": "Retorna os detalhes de uma transportadora a partir do ID da pessoa associada.\nÚtil quando você tem o ID da pessoa e precisa verificar se ela é uma transportadora.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "ID da pessoa",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transportadora encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada para esta pessoa",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers/by-document/{document}": {
      "get": {
        "tags": [
          "Carriers"
        ],
        "summary": "Obtém uma transportadora pelo documento (CPF/CNPJ)",
        "description": "Retorna os dados de uma transportadora a partir do documento da pessoa associada.\nÚtil para verificar se já existe uma transportadora com determinado documento\ne carregar seus dados automaticamente no frontend.\n\nAceita CPF/CNPJ com ou sem formatação (pontos e traços). Exemplos válidos:\n- CPF: `12345678909` ou `529.982.247-25`\n- CNPJ: `11222333000181`\n\n**Nota:** A barra (`/`) presente no CNPJ formatado não é suportada na URL.\nRecomenda-se enviar apenas os dígitos do documento.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "description": "Documento (CPF/CNPJ), preferencialmente apenas dígitos.\nAceita formatação com pontos e traços (a barra do CNPJ requer URL encoding).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transportadora encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada para este documento",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers/{id}/activate": {
      "post": {
        "tags": [
          "Carriers"
        ],
        "summary": "Ativa uma transportadora",
        "description": "Altera o status da transportadora para Ativo.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da transportadora",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transportadora ativada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers/{id}/suspend": {
      "post": {
        "tags": [
          "Carriers"
        ],
        "summary": "Suspende uma transportadora",
        "description": "Altera o status da transportadora para Suspenso.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da transportadora",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transportadora suspensa",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers/{id}/block": {
      "post": {
        "tags": [
          "Carriers"
        ],
        "summary": "Bloqueia uma transportadora",
        "description": "Altera o status da transportadora para Bloqueado.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da transportadora",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transportadora bloqueada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers/{id}/deactivate-role": {
      "post": {
        "tags": [
          "Carriers"
        ],
        "summary": "Desabilita o papel de Transportadora (inativação reversível)",
        "description": "Inativa o papel de Transportadora preservando 100% dos dados. Distinto de DELETE e de Suspend.\nIdempotente: já inativo → 200 sem efeito adicional.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da transportadora",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transportadora inativada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/carriers/{id}/activate-role": {
      "post": {
        "tags": [
          "Carriers"
        ],
        "summary": "Reabilita o papel de Transportadora (reversão da inativação)",
        "description": "Reativa o papel de Transportadora voltando para o status Active. Reutiliza o registro existente\nsem criar duplicata. Idempotente: já ativo → 200 sem efeito adicional.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da transportadora",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transportadora reativada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarrierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Transportadora não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cities": {
      "get": {
        "tags": [
          "Cities"
        ],
        "summary": "Lista cidades com paginação e filtros em cascata",
        "description": "Retorna uma lista paginada de cidades. Suporta filtros em cascata por país e estado.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, Code, CreatedAt",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "countryId",
            "in": "query",
            "description": "Filtrar por país (código ISO)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stateCode",
            "in": "query",
            "description": "Filtrar por estado (código)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome ou código)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de cidades retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCityResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCityResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCityResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cities/{id}": {
      "get": {
        "tags": [
          "Cities"
        ],
        "summary": "Obtém uma cidade por ID",
        "description": "Retorna os detalhes de uma cidade específica incluindo país e estado.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da cidade",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cidade encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CityResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CityResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CityResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cidade não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/countries": {
      "get": {
        "tags": [
          "Countries"
        ],
        "summary": "Lista países com paginação e filtros",
        "description": "Retorna uma lista paginada de países.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, Id, PhoneCode, CreatedAt",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome, código ou código telefônico)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de países retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCountryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCountryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCountryResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/countries/{id}": {
      "get": {
        "tags": [
          "Countries"
        ],
        "summary": "Obtém um país por código ISO",
        "description": "Retorna os detalhes de um país pelo código ISO 3166-1 alpha-2 (ex: \"BR\", \"AR\").\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Código ISO do país (2 caracteres)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "País encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CountryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountryResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "País não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/countries/active": {
      "get": {
        "tags": [
          "Countries"
        ],
        "summary": "Lista todos os países ativos",
        "description": "Retorna uma lista de todos os países ativos para uso em seletores/dropdowns.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Lista de países ativos retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CountryResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CountryResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CountryResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/csp-report": {
      "post": {
        "tags": [
          "CspReport"
        ],
        "summary": "Recebe e registra um relatório de violação de CSP (formato report-uri ou report-to).",
        "responses": {
          "204": {
            "description": "Relatório recebido (a resposta é ignorada pelo navegador)."
          }
        }
      }
    },
    "/api/v1/customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Lista clientes com paginação e filtros",
        "description": "Retorna uma lista paginada de clientes com dados da pessoa associada.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, CustomerCode, CreatedAt, UpdatedAt, TotalPurchases, Status",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome, nome fantasia, documento ou código)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filtrar por status (Active, Suspended, Blocked)",
            "schema": {
              "$ref": "#/components/schemas/CustomerStatus"
            }
          },
          {
            "name": "personType",
            "in": "query",
            "description": "Filtrar por tipo de pessoa (Individual, LegalEntity)",
            "schema": {
              "$ref": "#/components/schemas/PersonType"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de clientes retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCustomerResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Cria um novo cliente",
        "description": "Cria um novo cliente com os dados de pessoa associados.\nO documento (CPF/CNPJ) é validado de acordo com o país.\n\n**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomerDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomerDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Cliente criado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Obtém um cliente por ID com detalhes completos",
        "description": "Retorna os detalhes de um cliente específico incluindo dados da pessoa,\nendereços e contatos associados.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Atualiza um cliente existente",
        "description": "Atualiza os dados do cliente e da pessoa associada.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCustomerDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCustomerDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCustomerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Cliente atualizado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Exclui um cliente",
        "description": "Remove um cliente do sistema (soft delete).\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Cliente excluído"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/by-person/{personId}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Obtém um cliente pelo ID da pessoa",
        "description": "Retorna os detalhes de um cliente a partir do ID da pessoa associada.\nÚtil quando você tem o ID da pessoa e precisa verificar se ela é um cliente.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "ID da pessoa",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado para esta pessoa",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/by-document/{document}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Obtém um cliente pelo documento (CPF/CNPJ)",
        "description": "Retorna os dados de um cliente a partir do documento da pessoa associada.\nÚtil para verificar se já existe um cliente com determinado documento\ne carregar seus dados automaticamente no frontend.\n\nAceita CPF/CNPJ com ou sem formatação (pontos e traços). Exemplos válidos:\n- CPF: `12345678909` ou `529.982.247-25`\n- CNPJ: `11222333000181`\n\n**Nota:** A barra (`/`) presente no CNPJ formatado não é suportada na URL.\nRecomenda-se enviar apenas os dígitos do documento.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "description": "Documento (CPF/CNPJ), preferencialmente apenas dígitos.\nAceita formatação com pontos e traços (a barra do CNPJ requer URL encoding).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado para este documento",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{id}/activate": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Ativa um cliente",
        "description": "Altera o status do cliente para Ativo.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente ativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{id}/suspend": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Suspende um cliente",
        "description": "Altera o status do cliente para Suspenso.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente suspenso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{id}/block": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Bloqueia um cliente",
        "description": "Altera o status do cliente para Bloqueado.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente bloqueado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{id}/deactivate-role": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Desabilita o papel de Cliente (inativação reversível)",
        "description": "Inativa o papel de Cliente preservando 100% dos dados. Distinto de DELETE (exclusão) e de\nSuspend (inadimplência). O registro NÃO é soft-deletado; pode ser reativado via /activate-role.\nIdempotente: já inativo → 200 sem efeito adicional.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente inativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/customers/{id}/activate-role": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Reabilita o papel de Cliente (reversão da inativação)",
        "description": "Reativa o papel de Cliente voltando para o status Active. Reutiliza o registro existente\nsem criar duplicata. Idempotente: já ativo → 200 sem efeito adicional.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do cliente",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cliente reativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Cliente não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dashboard": {
      "get": {
        "tags": [
          "Dashboard"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSummaryDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/document-lookup/settings": {
      "get": {
        "tags": [
          "DocumentLookupSettings"
        ],
        "summary": "Obtém o Direcionamento do tenant para um país (padrão lazy quando ainda não configurado).",
        "description": "**Requer:** Role de Admin. A resposta indica quais provedores já têm token, sem expor o token.",
        "parameters": [
          {
            "name": "countryId",
            "in": "query",
            "description": "Código do país (ISO alpha-2, ex.: BR). Padrão: BR.",
            "schema": {
              "type": "string",
              "default": "BR"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configuração retornada.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              }
            }
          },
          "400": {
            "description": "País não suportado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "DocumentLookupSettings"
        ],
        "summary": "Cria/atualiza o Direcionamento (provedor preferido, fallback, enabled, TTL). Auditado.",
        "description": "**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "countryId",
            "in": "query",
            "description": "Código do país (ISO alpha-2, ex.: BR). Padrão: BR.",
            "schema": {
              "type": "string",
              "default": "BR"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDocumentLookupSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDocumentLookupSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDocumentLookupSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Configuração atualizada.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              }
            }
          },
          "400": {
            "description": "Provedor/país inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/document-lookup/credentials": {
      "put": {
        "tags": [
          "DocumentLookupSettings"
        ],
        "summary": "Define/substitui o token de um provedor pago (gravado cifrado). Auditado. A resposta NÃO devolve o token.",
        "description": "**Requer:** Role de Admin. Só provedores que exigem token (ex.: ReceitaWS) aceitam esta operação.",
        "parameters": [
          {
            "name": "countryId",
            "in": "query",
            "description": "Código do país (ISO alpha-2, ex.: BR). Padrão: BR.",
            "schema": {
              "type": "string",
              "default": "BR"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDocumentLookupCredentialDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDocumentLookupCredentialDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDocumentLookupCredentialDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Credencial gravada; configuração retornada (sem token).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentLookupSettingsDto"
                }
              }
            }
          },
          "400": {
            "description": "Provedor/país inválido ou token ausente.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/document-registry/lookup/{countryId}/{document}": {
      "get": {
        "tags": [
          "DocumentRegistry"
        ],
        "summary": "Busca os dados cadastrais de um documento fiscal (autopreenchimento do cadastro de Pessoa).",
        "description": "Retorna razão social, nome fantasia, endereço, CNAE, sócios (QSA) e demais dados fiscais a partir\ndo país e documento. Para o Brasil (countryId = BR), o documento é o CNPJ, resolvido conforme o\n\"Direcionamento de API\" configurado pelo tenant (provedor preferido + fallback). Uma consulta dentro\nda janela de cache não chama o provedor externo.\n\nA resposta separa dois desfechos de falha, sem efeito colateral (o cadastro nunca é corrompido nem\nretorna 500): documento inexistente segundo a fonte → 404 (o usuário preenche manualmente); todos os\nprovedores indisponíveis/limitados (429, timeout, sem provedor utilizável) → 503 (tente novamente em\ninstantes).\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "countryId",
            "in": "path",
            "description": "Código do país (ISO alpha-2, ex.: BR).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "document",
            "in": "path",
            "description": "Documento fiscal (ex.: CNPJ, com ou sem máscara).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dados cadastrais encontrados.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentRegistryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentRegistryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentRegistryResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Documento inválido ou país não suportado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Dados cadastrais não encontrados.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Serviço de consulta indisponível/limite atingido; tente novamente em instantes.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/email-templates": {
      "get": {
        "tags": [
          "EmailTemplates"
        ],
        "summary": "Lista os tipos de e-mail CUSTOMIZÁVEIS pelo tenant corrente, com o status do override (se existe,\nse está ativo, quando foi atualizado). Não inclui os tipos cross-tenant (confirmação de conta,\nredefinição de senha) — esses nunca são customizáveis por tenant.",
        "description": "**Requer:** Role de Manager ou superior.",
        "responses": {
          "200": {
            "description": "Lista de tipos customizáveis + status do override.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmailTemplateListItemResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmailTemplateListItemResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmailTemplateListItemResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/email-templates/{emailType}/{locale}": {
      "get": {
        "tags": [
          "EmailTemplates"
        ],
        "summary": "Detalhe de um tipo/locale: se o tenant já tem override, devolve o override; senão devolve o\nconteúdo do template-base GLOBAL como ponto de partida para edição (com `isOverride=false`).",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "emailType",
            "in": "path",
            "description": "Tipo do e-mail (nome ou número do enum).",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/EmailType"
            }
          },
          {
            "name": "locale",
            "in": "path",
            "description": "Locale (ex.: `pt-BR`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detalhe do override (ou do default, como base de edição).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDetailResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDetailResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Tipo de e-mail não customizável pelo tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Nem override nem template-base para `(emailType, locale)`.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "EmailTemplates"
        ],
        "summary": "Cria ou atualiza (upsert) o override do tenant para `(emailType, locale)`. Recusa tipos não\ncustomizáveis (400). Valida o MJML por renderabilidade ANTES de gravar (mesma disciplina do editor\ndo operador). Audita (fail-closed, ADR-0028) e persiste atomicamente com a auditoria.",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "emailType",
            "in": "path",
            "description": "Tipo do e-mail (precisa ser customizável pelo tenant).",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/EmailType"
            }
          },
          {
            "name": "locale",
            "in": "path",
            "description": "Locale (ex.: `pt-BR`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertEmailTemplateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertEmailTemplateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertEmailTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Override criado/atualizado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDetailResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDetailResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Tipo não customizável, assunto vazio ou MJML que não compila.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "EmailTemplates"
        ],
        "summary": "Remove (soft-delete) o override do tenant para `(emailType, locale)` — o e-mail volta a usar\no template-base global. Audita (fail-closed).",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "emailType",
            "in": "path",
            "description": "Tipo do e-mail.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/EmailType"
            }
          },
          {
            "name": "locale",
            "in": "path",
            "description": "Locale (ex.: `pt-BR`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Override removido (ou já não existia)."
          },
          "400": {
            "description": "Tipo não customizável.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/email-templates/{emailType}/{locale}/preview": {
      "post": {
        "tags": [
          "EmailTemplates"
        ],
        "summary": "Pré-visualiza um rascunho (ou o override salvo, se o body vier vazio) compilando o MJML→HTML com\nvalores de EXEMPLO das merge-tags do tipo. Não persiste nada.",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "emailType",
            "in": "path",
            "description": "Tipo do e-mail.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/EmailType"
            }
          },
          {
            "name": "locale",
            "in": "path",
            "description": "Locale (ex.: `pt-BR`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento.",
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PreviewEmailTemplateRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PreviewEmailTemplateRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PreviewEmailTemplateRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assunto + HTML renderizados.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplatePreviewResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplatePreviewResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplatePreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Tipo não customizável ou MJML que não compila.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Sem rascunho no body E sem override/default salvo.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees": {
      "get": {
        "tags": [
          "Employees"
        ],
        "summary": "Lista funcionários com paginação e filtros",
        "description": "Retorna uma lista paginada de funcionários com dados da pessoa associada.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, EmployeeCode, CreatedAt, UpdatedAt, HireDate, JobTitle, Status",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome, nome fantasia, documento ou código)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filtrar por status (Active, Suspended, Blocked)",
            "schema": {
              "$ref": "#/components/schemas/EmployeeStatus"
            }
          },
          {
            "name": "personType",
            "in": "query",
            "description": "Filtrar por tipo de pessoa (Individual, LegalEntity)",
            "schema": {
              "$ref": "#/components/schemas/PersonType"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de funcionários retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfEmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfEmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfEmployeeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Employees"
        ],
        "summary": "Cria um novo funcionário",
        "description": "Cria um novo funcionário com os dados de pessoa associados.\nO documento (CPF/CNPJ) é validado de acordo com o país.\n\n**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmployeeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmployeeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmployeeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Funcionário criado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}": {
      "get": {
        "tags": [
          "Employees"
        ],
        "summary": "Obtém um funcionário por ID com detalhes completos",
        "description": "Retorna os detalhes de um funcionário específico incluindo dados da pessoa,\nendereços e contatos associados.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do funcionário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funcionário encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Employees"
        ],
        "summary": "Atualiza um funcionário existente",
        "description": "Atualiza os dados do funcionário e da pessoa associada.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do funcionário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmployeeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmployeeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmployeeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Funcionário atualizado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Employees"
        ],
        "summary": "Exclui um funcionário",
        "description": "Remove um funcionário do sistema (soft delete).\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do funcionário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Funcionário excluído"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/by-person/{personId}": {
      "get": {
        "tags": [
          "Employees"
        ],
        "summary": "Obtém um funcionário pelo ID da pessoa",
        "description": "Retorna os detalhes de um funcionário a partir do ID da pessoa associada.\nÚtil quando você tem o ID da pessoa e precisa verificar se ela é um funcionário.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "ID da pessoa",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funcionário encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado para esta pessoa",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/by-document/{document}": {
      "get": {
        "tags": [
          "Employees"
        ],
        "summary": "Obtém um funcionário pelo documento (CPF/CNPJ)",
        "description": "Retorna os dados de um funcionário a partir do documento da pessoa associada.\nÚtil para verificar se já existe um funcionário com determinado documento\ne carregar seus dados automaticamente no frontend.\n\nAceita CPF/CNPJ com ou sem formatação (pontos e traços). Exemplos válidos:\n- CPF: `12345678909` ou `529.982.247-25`\n- CNPJ: `11222333000181`\n\n**Nota:** A barra (`/`) presente no CNPJ formatado não é suportada na URL.\nRecomenda-se enviar apenas os dígitos do documento.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "description": "Documento (CPF/CNPJ), preferencialmente apenas dígitos.\nAceita formatação com pontos e traços (a barra do CNPJ requer URL encoding).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funcionário encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado para este documento",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}/activate": {
      "post": {
        "tags": [
          "Employees"
        ],
        "summary": "Ativa um funcionário",
        "description": "Altera o status do funcionário para Ativo.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do funcionário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funcionário ativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}/suspend": {
      "post": {
        "tags": [
          "Employees"
        ],
        "summary": "Suspende um funcionário",
        "description": "Altera o status do funcionário para Suspenso.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do funcionário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funcionário suspenso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}/block": {
      "post": {
        "tags": [
          "Employees"
        ],
        "summary": "Bloqueia um funcionário",
        "description": "Altera o status do funcionário para Bloqueado.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do funcionário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funcionário bloqueado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}/deactivate-role": {
      "post": {
        "tags": [
          "Employees"
        ],
        "summary": "Desabilita o papel de Funcionário (inativação reversível)",
        "description": "Inativa o papel de Funcionário preservando 100% dos dados. Distinto de DELETE e de Suspend.\nIdempotente: já inativo → 200 sem efeito adicional.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do funcionário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funcionário inativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/employees/{id}/activate-role": {
      "post": {
        "tags": [
          "Employees"
        ],
        "summary": "Reabilita o papel de Funcionário (reversão da inativação)",
        "description": "Reativa o papel de Funcionário voltando para o status Active. Reutiliza o registro existente\nsem criar duplicata. Idempotente: já ativo → 200 sem efeito adicional.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do funcionário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funcionário reativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmployeeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Funcionário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/field-metadata/{formKey}": {
      "get": {
        "tags": [
          "FieldMetadata"
        ],
        "summary": "Obtém a configuração de metadados de campo do tenant corrente para um formulário.",
        "description": "Devolve só as linhas EXPLICITAMENTE configuradas — campos ausentes usam o default\n`{hidden:false, required:false}`, aplicado pelo consumidor (front).\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "formKey",
            "in": "path",
            "description": "Chave do formulário (hoje só `\"person\"`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configuração retornada.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FieldMetadataFormDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldMetadataFormDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldMetadataFormDto"
                }
              }
            }
          },
          "400": {
            "description": "Formulário desconhecido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "FieldMetadata"
        ],
        "summary": "Cria/atualiza (upsert) a configuração de metadados de campo do tenant corrente para um formulário.",
        "description": "Upsert idempotente por (form, role, field). Rejeita `400` quando `formKey`, `role`\nou `fieldName` estão fora do allowlist. Coage a invariante `hidden ⇒ !required` antes de\npersistir. Registra auditoria (ADR-0028).\n\n**Requer:** Role de Admin (config sensível de tenant).",
        "parameters": [
          {
            "name": "formKey",
            "in": "path",
            "description": "Chave do formulário (hoje só `\"person\"`) — deve bater com o body.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertFieldMetadataDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertFieldMetadataDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertFieldMetadataDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Configuração atualizada.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FieldMetadataFormDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldMetadataFormDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldMetadataFormDto"
                }
              }
            }
          },
          "400": {
            "description": "Formulário/papel/campo fora do allowlist.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files/upload": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Faz upload de um arquivo",
        "description": "Realiza o upload de um arquivo para o storage configurado.\n\n**Tipos de domínio suportados:** Product, User, Document, Tenant\n\n**Limite de tamanho:** 100 MB por arquivo\n\n**Variações de imagem:** Para imagens, podem ser geradas automaticamente\nvariações em diferentes tamanhos (thumbnail, medium, large).\n\n**Arquivos órfãos:** Se `domainEntityId` não for informado, o arquivo\nficará como órfão e pode ser associado posteriormente via `/associate`.",
        "parameters": [
          {
            "name": "domainType",
            "in": "query",
            "description": "Tipo de domínio (Product, User, Document, Tenant)",
            "schema": {
              "$ref": "#/components/schemas/DomainType"
            }
          },
          {
            "name": "domainEntityId",
            "in": "query",
            "description": "ID da entidade para associar (opcional)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "generateVariations",
            "in": "query",
            "description": "Gerar variações de imagem (padrão: true)",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Arquivo enviado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StoredFileResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoredFileResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoredFileResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Arquivo vazio ou inválido",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Arquivo excede o limite de tamanho",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files/{id}": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Obtém informações de um arquivo por ID",
        "description": "Retorna metadados do arquivo (não o conteúdo). Para download, use `/download/{id}`.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do arquivo",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arquivo encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StoredFileResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoredFileResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoredFileResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Arquivo não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Files"
        ],
        "summary": "Remove um arquivo e suas variações",
        "description": "Exclui um arquivo e todas as suas variações (thumbnails, etc.) do storage.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do arquivo",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Arquivo removido com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Arquivo não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files/download/{id}": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Faz download do conteúdo de um arquivo",
        "description": "Retorna o conteúdo binário do arquivo para download.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do arquivo",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arquivo retornado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileStreamResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileStreamResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileStreamResult"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Arquivo não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files/public-by-id/{id}": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Faz download público de uma imagem por ID",
        "description": "Endpoint público para download de imagens usando o ID do arquivo.\nNão requer autenticação, útil para exibição de imagens em tags &lt;img&gt;.\n\n**Nota:** Apenas arquivos de imagem são permitidos neste endpoint.\nPara outros tipos de arquivo, use o endpoint autenticado.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do arquivo",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Imagem retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileStreamResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileStreamResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileStreamResult"
                }
              }
            }
          },
          "404": {
            "description": "Arquivo não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files/entity/{domainType}/{entityId}": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Lista arquivos de uma entidade de domínio",
        "description": "Retorna todos os arquivos associados a uma entidade específica.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "domainType",
            "in": "path",
            "description": "Tipo de domínio (Product, User, Document, Tenant)",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DomainType"
            }
          },
          {
            "name": "entityId",
            "in": "path",
            "description": "ID da entidade",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de arquivos retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StoredFileResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StoredFileResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StoredFileResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Files"
        ],
        "summary": "Remove todos os arquivos de uma entidade de domínio",
        "description": "Exclui todos os arquivos associados a uma entidade específica.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "domainType",
            "in": "path",
            "description": "Tipo de domínio",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DomainType"
            }
          },
          {
            "name": "entityId",
            "in": "path",
            "description": "ID da entidade",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arquivos removidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteFilesResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteFilesResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteFilesResult"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Lista arquivos com paginação",
        "description": "Retorna uma lista paginada de arquivos do tenant.\nPode filtrar por tipo de domínio.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "domainType",
            "in": "query",
            "description": "Filtrar por tipo de domínio (opcional)",
            "schema": {
              "$ref": "#/components/schemas/DomainType"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de arquivos retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStoredFileResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStoredFileResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStoredFileResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/files/{id}/associate/{entityId}": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Associa um arquivo órfão a uma entidade de domínio",
        "description": "Vincula um arquivo que foi enviado sem associação (órfão) a uma entidade.\n\n**Caso de uso típico:** Upload de arquivo antes da criação da entidade,\nseguido de associação após a entidade ser criada.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do arquivo",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "entityId",
            "in": "path",
            "description": "ID da entidade para associar",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Arquivo associado com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Arquivo não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Arquivo já está associado a outra entidade",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/game/scores": {
      "post": {
        "tags": [
          "GameScores"
        ],
        "summary": "Registra a pontuação do usuário autenticado no minijogo.",
        "description": "Upsert \"melhor score por (tenant, usuário, modo)\": se o score enviado bater o recorde\npessoal, atualiza; caso contrário, mantém o recorde mas atualiza o gamertag (apelido pode\nter mudado desde o último envio). UserId e TenantId vêm sempre do contexto autenticado,\nnunca do corpo do request.\n\n**Requer:** Role de User ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitGameScoreRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitGameScoreRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitGameScoreRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Pontuação registrada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GameScoreSubmissionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameScoreSubmissionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GameScoreSubmissionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos (gamertag/score fora da faixa permitida)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/game/leaderboard": {
      "get": {
        "tags": [
          "GameScores"
        ],
        "summary": "Obtém o ranking (top N) do tenant atual para um modo do minijogo.",
        "description": "Retorna o top N do tenant (não cross-tenant), marcando a linha do usuário autenticado\nquando ele aparece no top. Se o usuário tiver recorde mas estiver fora do top, a posição\ndele vem à parte em `currentUser`. DTO mínimo: nunca expõe UserId, e-mail ou nome real.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "top",
            "in": "query",
            "description": "Tamanho do top desejado (padrão: 10, máximo: 50)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "mode",
            "in": "query",
            "description": "Modo do jogo (padrão: \"runner\")",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranking retornado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LeaderboardResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeaderboardResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeaderboardResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/auth/refresh": {
      "post": {
        "tags": [
          "IntegrationAuth"
        ],
        "summary": "Rotaciona o par de tokens",
        "description": "Troca o token longo atual por um novo access JWT curto (48h) + um novo token longo (7d), girando ambos.\nO token longo pode vir no corpo (`{ \"refreshToken\": \"…\" }`) OU no header\n`Authorization: Bearer &lt;token longo&gt;`. Aplica a janela de graça até o 1º uso do sucessor\n(refresh do anterior é idempotente enquanto o novo não foi usado) e a detecção de reuso (apresentar o\nanterior depois de o sucessor ter sido usado revoga a cadeia inteira). O novo token longo é retornado\nem plaintext <b>apenas nesta resposta</b>.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RefreshIntegrationTokenRequestDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RefreshIntegrationTokenRequestDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RefreshIntegrationTokenRequestDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Par rotacionado: novo access + novo token longo",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshIntegrationTokenResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshIntegrationTokenResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshIntegrationTokenResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Token longo inválido, expirado, ou reuso detectado (cadeia revogada)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/credentials": {
      "post": {
        "tags": [
          "IntegrationCredentials"
        ],
        "summary": "Provisiona a credencial de integração",
        "description": "Provisiona (ou recupera/reseta) a credencial de integração do tenant corrente e emite o 1º token longo.\nDevolve o token longo plaintext <b>apenas nesta resposta</b> — só o hash SHA-256 é persistido\n(irrecuperável, SH-B18). Se já existir credencial ativa, mantém a mesma identidade (`client_id`) e\n<b>revoga a cadeia anterior</b> de tokens longos (recuperação/reset).\n\n**Requer:** role de Admin (token de acesso de usuário/API key — não é o token longo da integração).",
        "responses": {
          "200": {
            "description": "Credencial provisionada/resetada; token longo retornado (exibido uma única vez)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionIntegrationCredentialResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionIntegrationCredentialResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisionIntegrationCredentialResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (role insuficiente ou token de tipo inadequado)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Provisão concorrente da credencial (INTEGRATION_CREDENTIAL_PROVISION_CONCURRENCY) — re-tentar",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/listings": {
      "post": {
        "tags": [
          "IntegrationListings"
        ],
        "summary": "Cria um anúncio",
        "description": "Cria o ANÚNCIO INTEIRO: um item com `variations[]` (ao menos UMA — anúncio sem variação não\nexiste no canal). O `marketplace` é o TIPO (string), nunca GUID de conexão. Regra PxV por\nentrada: produto COM variações exige `variantId` em todas; produto simples aceita exatamente uma\nentrada sem `variantId` (nível-produto). `title`/`description` são OPCIONAIS —\nnulo/ausente/em branco herda o nome/descrição do produto na publicação; o teto do título é POR CANAL\n(Mercado Livre 60, Shopee 120; sem limite documentado → 200). Preço por variação: &gt; 0 → nasce fonte\n`fixed` (auditoria + evento na mesma transação); `0`/nulo → nasce fonte `table`. Envie\num header `Idempotency-Key` para que retries retornem o mesmo GUID sem duplicar.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationListingCreateDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationListingCreateDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationListingCreateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Criado — retorna o GUID do ANÚNCIO (o item); `Location` aponta para o GET.\n    Os ids das variações saem no GET.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingCreatedDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingCreatedDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingCreatedDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação, tipo de anúncio inválido/não configurado, regra PxV violada,\n    título acima do teto do canal ou bloco de preço inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Produto/variante não existe ou pertence a outro tenant, ou o tenant não tem\n    conexão do tipo enviado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Mais de uma conexão do tipo (alvo ambíguo); o anúncio já existe para\n    (produto, conexão, tipo de anúncio) — a metadata aponta o `listingItemId` a endereçar com\n    GET/PUT; ou corrida de criação concorrente (retentável).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "IntegrationListings"
        ],
        "summary": "Lista anúncios",
        "description": "Lista os ANÚNCIOS do tenant (página de ITENS com `variations` aninhadas; projeção minimizada;\nordem estável por criação). Filtros de query opcionais: `productId` e `marketplace` (o TIPO,\ncomo string). O tamanho da página é limitado a 100 no servidor. Estado de sync em DOIS grãos:\n`syncStatus`/`lastSyncedAt` do item são da publicação da CASCA; cada variação carrega os do\nMODELO. `title`/`description` são os ARMAZENADOS — `null` = herda do produto na\npublicação.",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "marketplace",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/MarketplaceType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Uma página de anúncios (itens com variações).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationListingDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationListingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationListingDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/listings/{id}": {
      "get": {
        "tags": [
          "IntegrationListings"
        ],
        "summary": "Lê um anúncio",
        "description": "Lê o ANÚNCIO pelo GUID do item: identidade, editorial armazenado (`null` = herda do produto),\nestado da CASCA no canal (`syncStatus`/`externalItemId`) e as variações vivas — cada uma com\nseu bloco de preço fixo, `priceSource` (`fixed`/`table`) e estado do MODELO\n(`externalModelId`). O `variations[].id` é o id que o contrato ANTERIOR devolvia — use-o\npara montar o de-para da migração.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A visão do anúncio (item + variações).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Anúncio não existe, foi removido ou pertence a outro tenant — ou o id é de uma\n    VARIAÇÃO do contrato antigo (`INTEGRATION_LISTING_ID_IS_VARIATION`, com o `listingItemId` a\n    usar na metadata).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "IntegrationListings"
        ],
        "summary": "Substitui um anúncio",
        "description": "SUBSTITUIÇÃO do anúncio inteiro (id = ITEM): o JSON é o estado final. Variação ausente de\n`variations[]` é REMOVIDA (soft-delete); nova é criada; presente tem o bloco de preço fixo\nsubstituído — bloco idêntico ao atual é no-op silencioso (sem auditoria/evento; re-push deliberado é o\nendpoint de sync). As flags `removePrice`/`removePromotion` NÃO EXISTEM MAIS: `price: 0`\nou `null` limpa o preço fixo (a variação volta à fonte `table`, com o fallback efetivo\nresolvido NA HORA e propagado no evento — sem fallback resolvível o evento sai com preço nulo e o\nconsumer registra o skip auditável); omitir a promoção a remove. A identidade\n(produto/marketplace/tipo de anúncio) NÃO é editável. Lista vazia = 400 (para apagar use DELETE).\nEditorial é substituição: nulo/em branco volta a herdar do produto. Não dispara re-sync do anúncio.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationListingReplaceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationListingReplaceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationListingReplaceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Substituído — retorna a visão atual do anúncio (item + variações).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationListingDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação, regra PxV violada, título acima do teto do canal, bloco de\n    preço inválido ou lista de variações vazia.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Anúncio não existe, foi removido ou pertence a outro tenant — ou o id é de uma\n    VARIAÇÃO do contrato antigo (`INTEGRATION_LISTING_ID_IS_VARIATION`, com o `listingItemId` a\n    usar na metadata).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Corrida com outra escrita concorrente do mesmo anúncio (retentável).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationListings"
        ],
        "summary": "Exclui um anúncio",
        "description": "Remove (soft-delete) o ANÚNCIO INTEIRO pelo GUID do item: o item e TODAS as variações vivas caem na\nMESMA transação (cascade). O hub deixa de gerenciar o anúncio; o item NÃO é encerrado no canal\n(comportamento atual documentado). Recriar o mesmo (produto, marketplace, tipo) depois cria um anúncio\nNOVO (id novo). Anúncio ausente/já removido/de outro tenant é 404 (anti-IDOR + idempotência).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removido (soft) — item e variações vivas."
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Anúncio não existe, já foi removido ou pertence a outro tenant — ou o id é de uma\n    VARIAÇÃO do contrato antigo (`INTEGRATION_LISTING_ID_IS_VARIATION`, com o `listingItemId` a\n    usar na metadata).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/logistics-demands": {
      "post": {
        "tags": [
          "IntegrationLogisticsDemands"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationLogisticsDemandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationLogisticsDemandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationLogisticsDemandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLogisticsDemandResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLogisticsDemandResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLogisticsDemandResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLogisticsDemandResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLogisticsDemandResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationLogisticsDemandResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/logistics-demands/{id}/update": {
      "post": {
        "tags": [
          "IntegrationLogisticsDemands"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateIntegratedLogisticsDemandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateIntegratedLogisticsDemandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateIntegratedLogisticsDemandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/logistics-demands/{id}/cancel": {
      "post": {
        "tags": [
          "IntegrationLogisticsDemands"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelIntegratedLogisticsDemandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelIntegratedLogisticsDemandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CancelIntegratedLogisticsDemandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/logistics-demands/{id}": {
      "get": {
        "tags": [
          "IntegrationLogisticsDemands"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/logistics-demands/by-origin/{documentId}": {
      "get": {
        "tags": [
          "IntegrationLogisticsDemands"
        ],
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegratedLogisticsDemandDetailsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/marketplaces": {
      "get": {
        "tags": [
          "IntegrationMarketplaces"
        ],
        "summary": "Lista marketplaces/conexões",
        "description": "Lista as conexões de marketplace do tenant. Conjunto de referência limitado (um punhado de lojas) — sem paginação.\nCada item é enriquecido com o nome amigável e o CNPJ do operador (do catálogo GLOBAL, resolvido por tipo).",
        "responses": {
          "200": {
            "description": "As conexões de marketplace do tenant (tipo, nome da conexão, shop id, nome, CNPJ).",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationMarketplaceDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationMarketplaceDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationMarketplaceDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/marketplaces/catalog": {
      "get": {
        "tags": [
          "IntegrationMarketplaces"
        ],
        "summary": "Lista o catálogo GLOBAL de marketplaces",
        "description": "Referência GLOBAL (não filtrada por tenant): mapeia cada tipo de marketplace ao nome amigável e ao CNPJ do\noperador (formatado, ou `null` quando a plataforma não tem CNPJ central — ex.: Loja Integrada).\nConjunto de referência (poucas linhas) — sem paginação. Ordem estável por tipo.",
        "responses": {
          "200": {
            "description": "O catálogo de marketplaces (tipo como string, nome, CNPJ ou null).",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationMarketplaceCatalogDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationMarketplaceCatalogDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationMarketplaceCatalogDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/product-brands": {
      "post": {
        "tags": [
          "IntegrationProductBrands"
        ],
        "summary": "Cria uma marca",
        "description": "Cria uma única marca. O servidor gera o GUID canônico e o retorna. Envie um header\n`Idempotency-Key` para que retries retornem o mesmo GUID sem duplicar.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductBrandDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductBrandDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductBrandDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Criado — retorna o GUID da marca; `Location` aponta para o GET.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação do payload (ex.: nome vazio/duplicado).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "IntegrationProductBrands"
        ],
        "summary": "Lista marcas",
        "description": "Lista as marcas do tenant (paginado). Filtros `searchTerm` (nome) + `isActive` opcionais; tamanho da página limitado a 100.",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Uma página de marcas.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductBrandResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductBrandResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductBrandResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/product-brands/{id}": {
      "get": {
        "tags": [
          "IntegrationProductBrands"
        ],
        "summary": "Lê uma marca",
        "description": "Lê uma marca pelo seu GUID canônico.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A visão da marca.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Marca não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "IntegrationProductBrands"
        ],
        "summary": "Atualiza uma marca",
        "description": "Atualiza uma marca pelo seu GUID canônico. O id vem do path — nunca do corpo.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductBrandDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductBrandDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductBrandDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Atualizado — retorna a marca atual.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação do payload.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Marca não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationProductBrands"
        ],
        "summary": "Exclui uma marca",
        "description": "Remove (soft-delete) uma marca pelo seu GUID canônico (delega ao delete do Catálogo — filtrado por\ntenant, mesma semântica da UI). Uma marca ausente/de outro tenant (ou já removida) é 404; uma marca ainda\nusada por produtos é 409 (`PRODUCT_BRAND_IN_USE`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removido (soft)."
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Marca não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Marca ainda é usada por um ou mais produtos.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/product-categories": {
      "post": {
        "tags": [
          "IntegrationProductCategories"
        ],
        "summary": "Cria uma categoria",
        "description": "Cria uma única categoria. O servidor gera o GUID canônico e o retorna. Envie um header\n`Idempotency-Key` para que retries retornem o mesmo GUID sem duplicar. Quando um\n`parentId` está presente, ele deve ser uma categoria já registrada deste tenant (resolve-or-fail).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductCategoryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductCategoryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductCategoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Criado — retorna o GUID da categoria; `Location` aponta para o GET.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação do payload (ex.: nome vazio/duplicado).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "O `parentId` referenciado não existe para o tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "IntegrationProductCategories"
        ],
        "summary": "Lista categorias",
        "description": "Lista as categorias do tenant (paginado). Filtros `searchTerm` (nome) + `isActive` opcionais; tamanho da página limitado a 100.",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Uma página de categorias.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductCategoryResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductCategoryResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductCategoryResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/product-categories/{id}": {
      "get": {
        "tags": [
          "IntegrationProductCategories"
        ],
        "summary": "Lê uma categoria",
        "description": "Lê uma categoria pelo seu GUID canônico.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A visão da categoria.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "IntegrationProductCategories"
        ],
        "summary": "Atualiza uma categoria",
        "description": "Atualiza os atributos de uma categoria pelo seu GUID canônico. O id vem do path — nunca do corpo.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductCategoryDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductCategoryDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductCategoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Atualizado — retorna a categoria atual.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação do payload.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationProductCategories"
        ],
        "summary": "Exclui uma categoria",
        "description": "Remove (soft-delete) uma categoria pelo seu GUID canônico (delega ao delete do Catálogo — filtrado por\ntenant, mesma semântica da UI). Uma categoria ausente/de outro tenant (ou já removida) é 404. Uma\ncategoria que tem categorias-filhas falha com `PRODUCT_CATEGORY_HAS_CHILDREN`, que o mapeador de erro\ncompartilhado (`ResultExtensions`) mapeia para <b>400</b> — o MESMO status que a UI retorna.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removido (soft)."
          },
          "400": {
            "description": "Categoria tem categorias-filhas (`PRODUCT_CATEGORY_HAS_CHILDREN`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/product-models": {
      "post": {
        "tags": [
          "IntegrationProductModels"
        ],
        "summary": "Cria um modelo",
        "description": "Cria um único modelo. O servidor gera o GUID canônico e o retorna. Envie um header\n`Idempotency-Key` para que retries retornem o mesmo GUID sem duplicar.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductModelDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductModelDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductModelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Criado — retorna o GUID do modelo; `Location` aponta para o GET.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação do payload (ex.: nome vazio/duplicado).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "IntegrationProductModels"
        ],
        "summary": "Lista modelos",
        "description": "Lista os modelos do tenant (paginado). Filtros `searchTerm` (nome) + `isActive` opcionais; tamanho da página limitado a 100.",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Uma página de modelos.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductModelResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductModelResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductModelResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/product-models/{id}": {
      "get": {
        "tags": [
          "IntegrationProductModels"
        ],
        "summary": "Lê um modelo",
        "description": "Lê um modelo pelo seu GUID canônico.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A visão do modelo.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Modelo não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "IntegrationProductModels"
        ],
        "summary": "Atualiza um modelo",
        "description": "Atualiza um modelo pelo seu GUID canônico. O id vem do path — nunca do corpo.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductModelDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductModelDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductModelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Atualizado — retorna o modelo atual.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductModelResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação do payload.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Modelo não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationProductModels"
        ],
        "summary": "Exclui um modelo",
        "description": "Remove (soft-delete) um modelo pelo seu GUID canônico (delega ao delete do Catálogo — filtrado por\ntenant, mesma semântica da UI). Um modelo ausente/de outro tenant (ou já removido) é 404; um modelo ainda\nusado por produtos é 409 (`PRODUCT_MODEL_IN_USE`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removido (soft)."
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Modelo não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Modelo ainda é usado por um ou mais produtos.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/products": {
      "post": {
        "tags": [
          "IntegrationProducts"
        ],
        "summary": "Cria um produto",
        "description": "Cria um único produto. O servidor gera o GUID canônico; a resposta o inclui junto do GUID de cada\nvariante criada (para o ERP externo endereçar estoque/preço por variante depois). Envie um header\n`Idempotency-Key` para que retries retornem o mesmo GUID sem duplicar.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Criado — retorna o GUID do produto + GUIDs das variantes; `Location` aponta para o GET.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductWriteResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductWriteResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductWriteResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação do payload, ou uma regra de variante/cauda foi violada.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Um auxiliar referenciado (marca/modelo/categoria/unidade) não existe para o tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "IntegrationProducts"
        ],
        "summary": "Lista produtos",
        "description": "Lista os produtos do tenant (paginado, projeção minimizada). Os filtros de query opcionais são apenas o\nsubconjunto da integração: `searchTerm` (nome) e `isActive`; o tamanho da página é limitado a 100 no servidor.",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Uma página de itens de produto.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductListItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductListItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfIntegrationProductListItemDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/products/{id}": {
      "get": {
        "tags": [
          "IntegrationProducts"
        ],
        "summary": "Lê um produto",
        "description": "Lê um produto pelo seu GUID canônico, incluindo variantes e seus GUIDs.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A visão do produto.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductDetailDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductDetailDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductDetailDto"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Produto não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "IntegrationProducts"
        ],
        "summary": "Atualiza um produto",
        "description": "Atualiza um produto por merge pelo seu GUID canônico (PUT — puro in-place, adendo do ADR-0042). O id vem\ndo path — nunca do corpo. Todo campo `null` = manter (só valores não nulos são gravados; um campo\nnão pode ser limpo por esta rota). Variantes são casadas pelo seu GUID (`variations[].id`): COM id\naltera in-place (GUID preservado); SEM id adiciona uma nova variante; variantes existentes não citadas\npermanecem intactas (nunca removidas — desative com `active:false`). A resposta retorna os GUIDs de\nvariante atuais (existentes inalteradas + novas) para reconciliação.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductUpdateDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductUpdateDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationProductUpdateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Atualizado — retorna o GUID do produto + GUIDs de variante atuais (inalteradas + novas).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductWriteResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductWriteResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductWriteResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação do payload, ou uma regra de variante/cauda foi violada.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Produto/variante não existe ou pertence a outro tenant, ou um auxiliar referenciado está ausente.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "IntegrationProducts"
        ],
        "summary": "Exclui um produto",
        "description": "Remove (soft-delete) um produto pelo seu GUID canônico (delega ao delete do Catálogo — filtrado por\ntenant, mesma semântica da UI). Um produto ausente/de outro tenant (ou já removido) é 404 (anti-IDOR + idempotência).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removido (soft)."
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Produto não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/products/batch": {
      "post": {
        "tags": [
          "IntegrationProducts"
        ],
        "summary": "Cria produtos em lote",
        "description": "Cria um lote de produtos (criação em massa — sem id externo, um item de lote só pode criar). Sucesso\nparcial por item: um item que falha reporta seu código de erro + mensagens sem abortar os demais. Envie\num header `Idempotency-Key` para que retries retornem o mesmo resultado agregado.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IntegrationProductDto"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IntegrationProductDto"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IntegrationProductDto"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Resultados por item (criado / falhou).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBatchResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBatchResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationProductBatchResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Lista vazia.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Itens demais no lote.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/products/{id}/stock": {
      "put": {
        "tags": [
          "IntegrationProducts"
        ],
        "summary": "Atualiza o saldo de estoque",
        "description": "Fase 3 (ADR-0042 decisão 6) — o ERP envia o saldo autoritativo de uma célula de variante. Aplicado\nLast-Write-Wins por `occurredAt` em `stock_projection` (push-only Model B — sem pull/ack) e\nre-sincronizado ao marketplace. Omita `stockLocationId` para mirar o local padrão do tenant. O id do\nproduto é o GUID do path; o tenant vem do claim do token (ADR-0009), nunca do corpo.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationStockPushDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationStockPushDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationStockPushDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Aplicado (ou um no-op descartado pelo LWW quando `occurredAt` não é mais novo)."
          },
          "400": {
            "description": "Falha de validação do payload, ou nenhum local de estoque padrão para um corpo sem um.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Produto/variante/local não existe ou pertence a outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/integration/stock-locations": {
      "get": {
        "tags": [
          "IntegrationStockLocations"
        ],
        "summary": "Lista locais de estoque",
        "description": "Lista os locais de estoque ativos do tenant. Conjunto de referência limitado (tamanho de dropdown) — sem paginação.",
        "responses": {
          "200": {
            "description": "Os locais de estoque ativos do tenant (id, nome, flag de padrão).",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationStockLocationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationStockLocationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntegrationStockLocationDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token de integração ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Cria um novo convite para um usuário ingressar no tenant atual",
        "description": "Envia um convite por email para um usuário entrar no tenant.\n\nO usuário convidado pode:\n- Já ter uma conta (será adicionado ao tenant)\n- Ser novo no sistema (precisará criar conta ao aceitar)\n\n**Roles disponíveis:** User, Manager, Admin\n\n**Requer:** Role de Manager ou superior no tenant atual.\n\n**Exemplo de request:**\n```json\n{\n  \"email\": \"convidado@exemplo.com\",\n  \"role\": \"User\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Convite criado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Usuário já pertence ao tenant ou convite pendente existe",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Invitations"
        ],
        "summary": "Lista todos os convites do tenant atual",
        "description": "Retorna todos os convites (pendentes, aceitos e expirados) do tenant.\n\n**Requer:** Role de Manager ou superior no tenant atual.",
        "responses": {
          "200": {
            "description": "Lista de convites retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/pending": {
      "get": {
        "tags": [
          "Invitations"
        ],
        "summary": "Lista convites pendentes para um email específico",
        "description": "Retorna todos os convites pendentes para um determinado email.\nÚtil para verificar convites disponíveis antes do login/registro.\n\nEste endpoint é público e não requer autenticação.",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "description": "Email para verificar convites",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de convites retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Email não informado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/details": {
      "get": {
        "tags": [
          "Invitations"
        ],
        "summary": "Obtém detalhes de um convite pelo token",
        "description": "Retorna informações do convite sem aceitá-lo.\nInclui se o usuário precisa se registrar ou se já tem conta.\n\nEste endpoint é público e utilizado para exibir informações\ndo convite antes do usuário decidir aceitar.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "description": "Token do convite",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detalhes do convite retornados",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationDetailsResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationDetailsResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationDetailsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Token não informado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Convite não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Convite expirado ou já utilizado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/accept": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Aceita um convite pelo token",
        "description": "Aceita o convite e adiciona o usuário ao tenant.\n\n**Para usuários novos:** Deve enviar nome e senha no body\n```json\n{\n  \"name\": \"João Silva\",\n  \"password\": \"SenhaSegura123!\"\n}\n```\n\n**Para usuários existentes:** Body pode ser vazio ou null\n\nRetorna um JWT token para login imediato no tenant.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "description": "Token do convite",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AcceptInvitationRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AcceptInvitationRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AcceptInvitationRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Convite aceito com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptInvitationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptInvitationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptInvitationResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Token não informado ou dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Convite não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Convite expirado, já utilizado, ou dados de usuário faltantes",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/{id}/resend": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Reenvia o email de um convite pendente",
        "description": "Envia novamente o email de convite para o destinatário.\nÚtil quando o email original não foi recebido.\n\n**Requer:** Role de Manager ou superior no tenant atual.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do convite",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Email reenviado com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Convite não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Convite não está mais pendente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/{id}": {
      "delete": {
        "tags": [
          "Invitations"
        ],
        "summary": "Revoga um convite pendente",
        "description": "Cancela um convite pendente, impedindo que seja aceito.\nO convite não poderá mais ser utilizado após revogado.\n\n**Requer:** Role de Manager ou superior no tenant atual.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do convite",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Convite revogado com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Convite não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Convite não está pendente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/{id}/link": {
      "get": {
        "tags": [
          "Invitations"
        ],
        "summary": "Obtém o link (token) do convite para compartilhamento",
        "description": "Retorna o token do convite para que possa ser copiado e \ncompartilhado manualmente (ex: via mensagem instantânea).\n\nO frontend pode usar este token para construir a URL completa do convite.\n\n**Requer:** Role de Manager ou superior no tenant atual.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do convite",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token retornado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationLinkResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationLinkResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationLinkResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Convite não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/kardex/stock": {
      "get": {
        "tags": [
          "Kardex"
        ],
        "summary": "Consulta paginada do kardex de estoque (movimento mais recente primeiro), com filtros opcionais.",
        "description": "**Requer:** Role de Manager ou superior (dado operacional/auditoria de estoque).",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "reasonCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Página do kardex retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfKardexEntryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfKardexEntryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfKardexEntryDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/kardex/stock/export": {
      "get": {
        "tags": [
          "Kardex"
        ],
        "summary": "Exporta o kardex de estoque filtrado como CSV (mais recente primeiro). Limitado a\nint KardexExportLimits.MaxRows linhas — restrinja o filtro (ex.: janela de datas) para\nkardexes grandes.",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "reasonCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arquivo CSV do kardex",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/kardex/price": {
      "get": {
        "tags": [
          "Kardex"
        ],
        "summary": "R4 / T-R4-18 — consulta paginada do kardex de preço (`price_changes`, mudança mais recente\nprimeiro), com filtros opcionais (produto / variante / tabela de preço / janela / reason code).",
        "description": "**Requer:** Role de Manager ou superior (dado operacional/auditoria de preço).",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "priceTableId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "reasonCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Página do kardex de preço retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPriceKardexEntryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPriceKardexEntryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPriceKardexEntryDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/kardex/price/current": {
      "get": {
        "tags": [
          "Kardex"
        ],
        "summary": "R4 / T-R4-18 — preço corrente (snapshot vivo de `product_prices`) de um produto. Com\n`variantId` retorna a célula daquela variante; senão todas as células de variante do produto.\nOpcionalmente restrito por `priceTableId`.",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "priceTableId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Células de preço corrente retornadas",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceCurrentDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceCurrentDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceCurrentDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/ready": {
      "post": {
        "tags": [
          "LoadOrderReadiness"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VersionedLoadOrderCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VersionedLoadOrderCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VersionedLoadOrderCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderStateResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderStateResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderStateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders": {
      "post": {
        "tags": [
          "LoadOrders"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLoadOrderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLoadOrderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLoadOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderCreationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderCreationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderCreationResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderCreationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderCreationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderCreationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "LoadOrderSupervision"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "stockLocationId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedLoadOrderPageResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedLoadOrderPageResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedLoadOrderPageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/assignments": {
      "post": {
        "tags": [
          "LoadOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignLoadOrderUserRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignLoadOrderUserRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AssignLoadOrderUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderAssignmentResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderAssignmentResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderAssignmentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/vehicle-assignment": {
      "post": {
        "tags": [
          "LoadOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignLoadOrderVehicleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignLoadOrderVehicleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AssignLoadOrderVehicleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderAssignmentResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderAssignmentResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderAssignmentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}": {
      "get": {
        "tags": [
          "LoadOrderSupervision"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedLoadOrderDetailsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedLoadOrderDetailsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedLoadOrderDetailsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/stop-sequence": {
      "post": {
        "tags": [
          "LoadOrderSupervision"
        ],
        "summary": "T029 / DP-LOG-023: reordena as paradas no planejamento, por token web.\nRota própria porque `reorder-stops` pertence à família de token\nmóvel — mesma regra de ordenação, prova de concorrência diferente:\naqui basta o `baseSequenceVersion`, sem sessão de execução, que\nsó nasce quando o motorista baixa o `mobile-snapshot`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteReorderPayloadRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteReorderPayloadRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RouteReorderPayloadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedRouteReorderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedRouteReorderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedRouteReorderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/audit-entries": {
      "get": {
        "tags": [
          "LogisticsAuditSupervision"
        ],
        "summary": "aggregateType e aggregateId são obrigatórios: a\npergunta que a trilha responde é \"o que aconteceu com ISTO\", e é o único recorte que o\níndice existente cobre. Filtro ausente responde 422, não uma página vazia.",
        "parameters": [
          {
            "name": "aggregateType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "aggregateId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "action",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "occurredFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "occurredTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedAuditEntryPageResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedAuditEntryPageResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedAuditEntryPageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/demands/pickups": {
      "post": {
        "tags": [
          "LogisticsDemands"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StandalonePickupRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StandalonePickupRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StandalonePickupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StandalonePickupResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandalonePickupResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandalonePickupResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StandalonePickupResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandalonePickupResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandalonePickupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/demands": {
      "get": {
        "tags": [
          "LogisticsDemandSupervision"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "stockLocationId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandPageResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandPageResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandPageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/demands/{id}": {
      "get": {
        "tags": [
          "LogisticsDemandSupervision"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandDetailsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandDetailsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandDetailsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/demands/{id}/cancel": {
      "post": {
        "tags": [
          "LogisticsDemandSupervision"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupervisedCancelDemandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SupervisedCancelDemandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SupervisedCancelDemandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandDetailsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandDetailsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupervisedDemandDetailsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/route-stops/{routeStopId}/evidence-package": {
      "post": {
        "tags": [
          "LogisticsEvidencePackages"
        ],
        "summary": "Sela o pacote da parada na revisão de execução corrente. Idempotente: já selado, devolve o\npacote existente com 200 em vez de produzir um segundo selo do mesmo fato.",
        "parameters": [
          {
            "name": "routeStopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageSummaryResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageSummaryResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageSummaryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{loadOrderId}/evidence-packages": {
      "get": {
        "tags": [
          "LogisticsEvidencePackages"
        ],
        "parameters": [
          {
            "name": "loadOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/evidence-packages/{packageId}/export": {
      "get": {
        "tags": [
          "LogisticsEvidencePackages"
        ],
        "summary": "Exportação INTEGRAL do pacote — manifesto inteiro mais o selo.",
        "parameters": [
          {
            "name": "packageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageExportResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageExportResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePackageExportResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/evidences/{id}/download": {
      "get": {
        "tags": [
          "LogisticsEvidences"
        ],
        "summary": "Devolve os bytes da evidência, com o hash que o servidor conferiu no commit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/me": {
      "get": {
        "tags": [
          "LogisticsOperationalContext"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MobileOperationalContextResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileOperationalContextResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileOperationalContextResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/operations-setup": {
      "get": {
        "tags": [
          "LogisticsOperationsSetup"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsOperationsSetupResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsOperationsSetupResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsOperationsSetupResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/operations-setup/users/{userId}": {
      "put": {
        "tags": [
          "LogisticsOperationsSetup"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLogisticsSetupUserRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLogisticsSetupUserRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLogisticsSetupUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/operations-setup/users/{userId}/supervision": {
      "put": {
        "tags": [
          "LogisticsOperationsSetup"
        ],
        "summary": "Concede ou revoga `logistics:supervise`.",
        "description": "Rota à parte de `PUT users/{userId}` por duas razões independentes: o gate é mais alto\n(Admin na empresa alvo <b>e</b> dono da organização, porque supervisão reabre parada e ordem)\ne a operação é pontual, não uma substituição de lista — assim um cliente que só conhece as\ncapacidades operacionais nunca revoga supervisão por efeito colateral.",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetLogisticsSetupSupervisionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetLogisticsSetupSupervisionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetLogisticsSetupSupervisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/operations-setup/vehicles": {
      "post": {
        "tags": [
          "LogisticsOperationsSetup"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLogisticsSetupVehicleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLogisticsSetupVehicleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLogisticsSetupVehicleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/operations-setup/vehicles/{vehicleId}": {
      "delete": {
        "tags": [
          "LogisticsOperationsSetup"
        ],
        "parameters": [
          {
            "name": "vehicleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteLogisticsSetupVehicleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteLogisticsSetupVehicleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteLogisticsSetupVehicleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/stops/{id}/reopen": {
      "post": {
        "tags": [
          "LogisticsReopen"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsReopenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsReopenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsReopenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RouteStopStateResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteStopStateResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteStopStateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/reopen": {
      "post": {
        "tags": [
          "LogisticsReopen"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsReopenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsReopenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsReopenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderStateResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderStateResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderStateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/retention-policy": {
      "get": {
        "tags": [
          "LogisticsRetention"
        ],
        "summary": "Prazo VIGENTE resolvido para o tenant corrente e a linha do tempo inteira das versões.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetentionPolicyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetentionPolicyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetentionPolicyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/retention-policy/versions": {
      "post": {
        "tags": [
          "LogisticsRetention"
        ],
        "summary": "Publica uma versão NOVA da exceção do tenant. Nunca altera uma existente.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetTenantRetentionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetTenantRetentionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetTenantRetentionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetentionPolicyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetentionPolicyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetentionPolicyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/legal-holds": {
      "get": {
        "tags": [
          "LogisticsRetention"
        ],
        "summary": "Legal holds ATIVOS do tenant corrente, resolvidos contra o instante da leitura.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LegalHoldResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LegalHoldResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LegalHoldResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "LogisticsRetention"
        ],
        "summary": "Aplica um hold. Congela a purga do que abrange; não torna nada público.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceLegalHoldRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceLegalHoldRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceLegalHoldRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/legal-holds/{holdId}/extensions": {
      "post": {
        "tags": [
          "LogisticsRetention"
        ],
        "summary": "Estende o hold por DECISÃO EXPLÍCITA: move o vencimento para a frente e conta a extensão.",
        "parameters": [
          {
            "name": "holdId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendLegalHoldRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendLegalHoldRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendLegalHoldRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/legal-holds/{holdId}/release": {
      "post": {
        "tags": [
          "LogisticsRetention"
        ],
        "summary": "Libera o hold. Idempotente: já liberado devolve o mesmo estado sem uma segunda linha de\ntrilha — expirar não é liberar, e liberar duas vezes não é liberar duas vezes.",
        "parameters": [
          {
            "name": "holdId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHoldResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/risk-profile": {
      "get": {
        "tags": [
          "LogisticsRiskProfile"
        ],
        "summary": "Política vigente e a linha do tempo inteira das versões, mais os critérios que o servidor\nsabe avaliar.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RiskProfilePolicyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiskProfilePolicyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiskProfilePolicyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/risk-profile/versions": {
      "post": {
        "tags": [
          "LogisticsRiskProfile"
        ],
        "summary": "Publica uma versão NOVA. Nunca altera uma existente.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishRiskProfileCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishRiskProfileCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PublishRiskProfileCommand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RiskProfilePolicyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiskProfilePolicyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiskProfilePolicyResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections": {
      "get": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "Lista todas as conexões de marketplace do tenant",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "Cria uma nova conexão de marketplace.",
        "description": "ADR-0048 — aceita a coleção OPCIONAL `listingTypes` (`{ listingType?, priceTableId,\npromotionalPriceTableId? }`) com o PREÇO POR TIPO DE ANÚNCIO. Presente: grava uma linha por tipo e a\nconexão herda o par do PRIMEIRO item (o par plano do corpo é ignorado). Ausente: comportamento legado —\no par plano vira a linha \"sem tipo\". Em ambos os casos a conexão SEMPRE nasce com configuração de preço.\nOs tipos válidos por marketplace vêm de `GET /api/v1/marketplaces` (`supportedListingTypes`).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarketplaceConnectionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarketplaceConnectionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarketplaceConnectionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{id}": {
      "get": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "Obtém uma conexão de marketplace por ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "Atualiza uma conexão de marketplace existente.",
        "description": "ADR-0048 — `listingTypes` presente SUBSTITUI o conjunto de configurações de preço por tipo de\nanúncio (upsert das informadas + soft-delete das que sumiram, na mesma transação). Ausente: o par plano\nreescreve a linha \"sem tipo\" e as linhas tipadas ficam intactas.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMarketplaceConnectionDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMarketplaceConnectionDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMarketplaceConnectionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "Exclui uma conexão de marketplace (soft-delete). ADR-0048: as linhas de configuração de preço por tipo\nde anúncio são soft-deletadas JUNTO.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{id}/oauth/url": {
      "get": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "Obtém a URL de autorização OAuth para a conexão",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceOAuthUrlResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceOAuthUrlResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceOAuthUrlResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{id}/oauth/callback": {
      "post": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "Processa o callback OAuth do marketplace",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceOAuthCallbackDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceOAuthCallbackDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceOAuthCallbackDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceConnectionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{id}/rotate-webhook-token": {
      "post": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "Rotaciona o webhook token de uma conexão Loja Integrada.\nRetorna o novo token plaintext UMA vez — configure-o imediatamente no painel da Loja Integrada.\nO hash do novo token é armazenado no servidor; o plaintext não é persistido. (SH-B18)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RotateWebhookTokenResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateWebhookTokenResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateWebhookTokenResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/{id}/enable-fractional-sync": {
      "post": {
        "tags": [
          "MarketplaceConnections"
        ],
        "summary": "R3 / T-R3-25 (§3.5): avalia o gate fracionário de uma conexão (4 condições). Retorna 200 OK quando\ntodas passam (sync de SKU fracionário liberado) ou 412 Precondition Failed com a lista das\ncondições que falharam. Não há override manual — só libera com as 4 verdes.",
        "description": "Rota ABSOLUTA (`~/`): o endpoint vive sob `api/v1/marketplace/{id}/...`, fora da rota\nbase `api/v1/marketplace/connections` deste controller (alinhado à §3.5 da spec).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EnableFractionalSyncResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableFractionalSyncResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableFractionalSyncResultDto"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EnableFractionalSyncResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableFractionalSyncResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableFractionalSyncResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/listings": {
      "post": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Cria um anúncio (item + variações)",
        "description": "ADR-0070 F3 — cria o ANÚNCIO INTEIRO: `marketplace` é o TIPO (string do enum), nunca GUID de\nconexão — a conexão é resolvida por tipo (0 → 404 `MARKETPLACE_CONNECTION_TYPE_NOT_FOUND`;\n&gt;1 → 409 `MARKETPLACE_CONNECTION_TYPE_AMBIGUOUS`). `variations` exige ao menos uma\nentrada; PxV: produto com variações exige `variantId` em todas, produto simples aceita exatamente\numa entrada sem `variantId`. `title`/`description` opcionais (nulo/em branco = herda do\nproduto na publicação); teto de título POR CANAL (ML 60, Shopee 120). Variação com `price` &gt; 0\nnasce fonte `fixed` (auditoria + `ListingPriceChanged` na mesma transação, source UI).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateListingItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateListingItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateListingItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Criado — a visão do anúncio; `Location` aponta para o GET.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação, tipo de anúncio inválido/não configurado, PxV violada,\n    título acima do teto do canal ou bloco de preço inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Produto/variante inexistente ou sem conexão do tipo.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Mais de uma conexão do tipo; anúncio já existente para (produto, conexão, tipo) —\n    metadata aponta o `listingItemId`; ou corrida de criação concorrente (retentável).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Lista mapeamentos de produtos paginados com filtros opcionais (connectionId, status, searchTerm)",
        "parameters": [
          {
            "name": "ConnectionId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "SearchTerm",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/SyncStatus"
            }
          },
          {
            "name": "PageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Take",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfListingResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfListingResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfListingResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/listings/{listingId}": {
      "get": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Lê um anúncio (item + variações)",
        "description": "ADR-0070 F3 — visão do anúncio pelo id do ITEM, com nomes de exibição (produto, conexão, rótulo de\nvariante) e estado de sync em DOIS grãos: o do item é a CASCA (publicação → `externalItemId`);\no de cada variação é o MODELO (`externalModelId` + push de preço/estoque). `title`/\n`description` são os ARMAZENADOS — nulo = herda do produto na publicação.",
        "parameters": [
          {
            "name": "listingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A visão do anúncio.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Anúncio inexistente, removido ou de outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Substitui um anúncio (item + variações)",
        "description": "ADR-0070 F3 — SUBSTITUIÇÃO do anúncio inteiro: o JSON é o estado final. Variação ausente é removida\n(soft-delete), nova é criada, bloco de preço idêntico é no-op silencioso; `price: 0` ou\n`null` limpa o preço fixo (volta à fonte `table`, com fallback resolvido na hora e propagado\nno evento); omitir a promoção a remove — as flags `removePrice`/`removePromotion` não\nexistem neste contrato. Identidade (produto/marketplace/tipo) não editável. Lista vazia = 400.",
        "parameters": [
          {
            "name": "listingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceListingItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceListingItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceListingItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Substituído — a visão atual do anúncio.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingItemResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Falha de validação, PxV violada, título acima do teto ou bloco de preço\n    inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Anúncio inexistente, removido ou de outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Corrida com outra escrita concorrente do mesmo anúncio (retentável).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Exclui um anúncio (item + variações)",
        "description": "ADR-0070 F3 — soft-delete do anúncio INTEIRO: item + todas as variações vivas na MESMA transação\n(cascade). O item NÃO é encerrado no canal (comportamento atual documentado); recriar o mesmo\n(produto, marketplace, tipo) cria um anúncio novo.",
        "parameters": [
          {
            "name": "listingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removido (soft) — item e variações vivas."
          },
          "401": {
            "description": "Não autenticado.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Anúncio inexistente, já removido ou de outro tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/products/{productId}/listings": {
      "get": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Lista mapeamentos de um produto específico com todas as conexões de marketplace",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ListingResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ListingResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ListingResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connectionId}/listings": {
      "post": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Cria um mapeamento de produto para a conexão.",
        "description": "ADR-0047/ADR-0048 — aceita `listingType` OPCIONAL (TIPO DE ANÚNCIO). Quando informado deve ser\nsuportado pelo marketplace (capability) E estar EFETIVAMENTE configurado na conexão — senão 400. A\nduplicidade considera o tipo: `(produto, variação, tipo)` repetido é conflito, mas o MESMO produto\ncom Clássico e Premium são dois anúncios válidos.",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateListingDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateListingDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateListingDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connectionId}/listings/{listingId}": {
      "delete": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Remove um mapeamento de produto",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "listingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/listings/{listingId}/marketplace-data": {
      "patch": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Atualiza os dados de marketplace de um mapeamento de produto",
        "parameters": [
          {
            "name": "listingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateListingMarketplaceDataDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateListingMarketplaceDataDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateListingMarketplaceDataDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/listings/{listingId}/price": {
      "put": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Substitui o bloco de preço fixo de um anúncio (base + promocional + janela)",
        "description": "ADR-0068 F3 — semântica de SUBSTITUIÇÃO (form completo, não merge): `removePrice=true` ignora\nos demais campos e limpa o bloco (o anúncio volta à fonte Table, com o preço efetivo de fallback\nresolvido e propagado na hora); senão `price` é obrigatório e `promotionalPrice` ausente\nREMOVE a promoção existente. Grava auditoria em `listing_price_changes` e publica\n`ListingPriceChanged` na mesma transação (outbox).",
        "parameters": [
          {
            "name": "listingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateListingPriceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateListingPriceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateListingPriceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connectionId}/listings/{listingId}/sync": {
      "post": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Solicita sincronização de um produto com o marketplace",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "listingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connectionId}/categories": {
      "get": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Lista categorias do marketplace. Se parentId for informado, retorna subcategorias.",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "parentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connectionId}/categories/predict": {
      "get": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Prediz a melhor categoria para um produto com base no título",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "title",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryPredictionDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryPredictionDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryPredictionDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connectionId}/categories/{categoryId}/attributes": {
      "get": {
        "tags": [
          "MarketplaceListings"
        ],
        "summary": "Retorna os atributos de uma categoria do marketplace",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "categoryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryAttributeDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryAttributeDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCategoryAttributeDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connectionId}/orders": {
      "get": {
        "tags": [
          "MarketplaceOrders"
        ],
        "summary": "Lista mapeamentos de pedidos para uma conexão",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/SyncStatus"
            }
          },
          {
            "name": "PageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "Take",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfMarketplaceOrderMappingResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfMarketplaceOrderMappingResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfMarketplaceOrderMappingResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/connections/{connectionId}/sync-logs": {
      "get": {
        "tags": [
          "MarketplaceOrders"
        ],
        "summary": "Lista logs de sincronização para uma conexão",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "take",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceSyncLogResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceSyncLogResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceSyncLogResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplaces": {
      "get": {
        "tags": [
          "Marketplaces"
        ],
        "summary": "Lista o catálogo GLOBAL de marketplaces (tipo, nome amigável, CNPJ formatado ou null).",
        "description": "Referência GLOBAL — qualquer usuário autenticado. Conjunto pequeno (uma linha por marketplace com\nprovider) — sem paginação. Ordem estável por tipo. O CNPJ é `null` quando a plataforma não tem CNPJ\ncentral (ex.: Loja Integrada).",
        "responses": {
          "200": {
            "description": "O catálogo de marketplaces.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCatalogResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCatalogResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceCatalogResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token de acesso ausente/inválido.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/marketplace/webhooks/shopee": {
      "post": {
        "tags": [
          "MarketplaceWebhooks"
        ],
        "summary": "Recebe webhook da Shopee",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/api/v1/marketplace/webhooks/loja-integrada": {
      "post": {
        "tags": [
          "MarketplaceWebhooks"
        ],
        "summary": "Recebe webhook da Loja Integrada.\nA Loja Integrada envia o token registrado no header Authorization (Bearer {token}),\nque é usado para identificar a conexão específica do tenant.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/api/v1/marketplace/webhooks/mercadolivre": {
      "post": {
        "tags": [
          "MarketplaceWebhooks"
        ],
        "summary": "Recebe webhook do Mercado Livre.\nO Mercado Livre envia notificações com topic e resource, validação via application_id.",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/api/v1/logistics/commands": {
      "get": {
        "tags": [
          "MobileCommandReceipts"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "deviceSessionId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsPendingCommandPageResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsPendingCommandPageResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsPendingCommandPageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/commands/{commandId}": {
      "get": {
        "tags": [
          "MobileCommandReceipts"
        ],
        "parameters": [
          {
            "name": "commandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/mine": {
      "get": {
        "tags": [
          "MobileLoadOrders"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MobileLoadOrderPageResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileLoadOrderPageResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileLoadOrderPageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{workItemRef}/mobile-snapshot": {
      "get": {
        "tags": [
          "MobileLoadOrders"
        ],
        "parameters": [
          {
            "name": "workItemRef",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Device-Session-Id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MobileSnapshotResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileSnapshotResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileSnapshotResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/start-loading": {
      "post": {
        "tags": [
          "MobileLoadOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/complete-loading": {
      "post": {
        "tags": [
          "MobileLoadOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/start-route": {
      "post": {
        "tags": [
          "MobileLoadOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Device-Session-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "mobileToken": [ ]
          }
        ]
      }
    },
    "/api/v1/logistics/load-orders/{id}/close": {
      "post": {
        "tags": [
          "MobileLoadOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Device-Session-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineLoadOrderCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderClosureResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderClosureResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadOrderClosureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "mobileToken": [ ]
          }
        ]
      }
    },
    "/api/v1/logistics/load-orders/{id}/load-checks": {
      "post": {
        "tags": [
          "MobileLoadOrders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadChecksCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadChecksCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoadChecksCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/auth/login": {
      "post": {
        "tags": [
          "MobileOperationsAuth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileLoginRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileLoginRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MobileLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/auth/refresh": {
      "post": {
        "tags": [
          "MobileOperationsAuth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileRefreshRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileRefreshRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MobileRefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/auth/quick-switch": {
      "post": {
        "tags": [
          "MobileOperationsAuth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileQuickSwitchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileQuickSwitchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MobileQuickSwitchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokenResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/auth/revoke": {
      "post": {
        "tags": [
          "MobileOperationsAuth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileRevokeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileRevokeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MobileRevokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/api/v1/operations/auth/operator-credentials": {
      "post": {
        "tags": [
          "MobileOperationsAuth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileOperatorCredentialRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileOperatorCredentialRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MobileOperatorCredentialRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MobileOperatorCredentialResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileOperatorCredentialResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileOperatorCredentialResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/operations/auth/operator-credentials/{userId}": {
      "delete": {
        "tags": [
          "MobileOperationsAuth"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/api/v1/logistics/load-orders/{id}/reorder-stops": {
      "post": {
        "tags": [
          "MobileRouteCommands"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteReorderCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteReorderCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RouteReorderCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/logistics/stops/{id}/arrive": {
      "post": {
        "tags": [
          "MobileRouteStops"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Device-Session-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopArrivalCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopArrivalCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopArrivalCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "mobileToken": [ ]
          }
        ]
      }
    },
    "/api/v1/logistics/stops/{id}/confirm-items": {
      "post": {
        "tags": [
          "MobileRouteStops"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Device-Session-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopItemConfirmationCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopItemConfirmationCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopItemConfirmationCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "mobileToken": [ ]
          }
        ]
      }
    },
    "/api/v1/logistics/stops/{id}/complete": {
      "post": {
        "tags": [
          "MobileRouteStops"
        ],
        "summary": "Concluir uma parada de rota",
        "description": "ADR-0071: os três desfechos são aceitos. `COMPLETED` exige todos os itens confirmados sem saldo; `PARTIAL` exige saldo com alguma quantidade concluída; `FAILED` exige nenhuma quantidade concluída. `PARTIAL` e `FAILED` exigem `outcomeReasonCode` da taxonomia vigente do tenant, e `COMPLETED` não o aceita.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Device-Session-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopCompletionCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopCompletionCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RouteStopCompletionCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "mobileToken": [ ]
          }
        ]
      }
    },
    "/api/v1/logistics/stops/{stopId}/evidences/upload-intents": {
      "post": {
        "tags": [
          "MobileRouteStops"
        ],
        "parameters": [
          {
            "name": "stopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Device-Session-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceUploadIntentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceUploadIntentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceUploadIntentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceUploadIntentResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceUploadIntentResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidenceUploadIntentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "mobileToken": [ ]
          }
        ]
      }
    },
    "/api/v1/logistics/stops/{stopId}/evidences/{evidenceId}/commit": {
      "post": {
        "tags": [
          "MobileRouteStops"
        ],
        "parameters": [
          {
            "name": "stopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "evidenceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Device-Session-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceCommitRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceCommitRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/EvidenceCommitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "mobileToken": [ ]
          }
        ]
      }
    },
    "/api/v1/navigation-insights": {
      "get": {
        "tags": [
          "NavigationInsights"
        ],
        "summary": "KPIs por módulo (janela de 30 dias vs período anterior) + badges de menu (contagens acionáveis) do\ntenant corrente. Cacheado em memória por tenant (TTL 5 min).",
        "responses": {
          "200": {
            "description": "Insights retornados",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NavigationInsightsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NavigationInsightsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NavigationInsightsDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/neighborhoods": {
      "get": {
        "tags": [
          "Neighborhoods"
        ],
        "summary": "Lista bairros com paginação e filtros",
        "description": "Retorna uma lista paginada de bairros. Suporta filtro por cidade.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, Code, CreatedAt",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "cityId",
            "in": "query",
            "description": "Filtrar por cidade",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome ou código)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de bairros retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfNeighborhoodResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfNeighborhoodResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfNeighborhoodResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/neighborhoods/{id}": {
      "get": {
        "tags": [
          "Neighborhoods"
        ],
        "summary": "Obtém um bairro por ID",
        "description": "Retorna os detalhes de um bairro específico incluindo a cidade.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do bairro",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bairro encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/NeighborhoodResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NeighborhoodResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/NeighborhoodResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Bairro não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Lista pedidos com paginação e filtros",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/OrderStatus"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "CreatedAt"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfOrderResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfOrderResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfOrderResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Cria um novo pedido",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Obtém um pedido por ID com detalhes completos",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Orders"
        ],
        "summary": "Atualiza um pedido existente (somente em rascunho)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Orders"
        ],
        "summary": "Exclui um pedido (somente em rascunho)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}/items": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Adiciona um item ao pedido (somente em rascunho)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddOrderItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddOrderItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddOrderItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}/items/{itemId}": {
      "put": {
        "tags": [
          "Orders"
        ],
        "summary": "Atualiza um item do pedido (somente em rascunho)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderItemDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderItemDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderItemDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Orders"
        ],
        "summary": "Remove um item do pedido (somente em rascunho)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}/confirm": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Confirma o pedido (Draft → Confirmed). Decrementa estoque.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}/process": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Inicia processamento do pedido (Confirmed → Processing)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}/ship": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Marca pedido como enviado (Processing → Shipped). Aceita, opcionalmente, o código de\nrastreio e a transportadora no corpo; ambos são opcionais (marcar como enviado sem rastreio\né válido). Para pedidos de marketplace, esses dados são propagados no evento de sincronização.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ShipOrderDto"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ShipOrderDto"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ShipOrderDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}/deliver": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Marca pedido como entregue (Shipped → Delivered)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}/cancel": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Cancela o pedido. Restaura estoque se já confirmado.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelOrderDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelOrderDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CancelOrderDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "GET /api/v1/organizations — orgs the authenticated user belongs to.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{orgId}": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "GET /api/v1/organizations/{orgId} — detail for a specific organization.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Organizations"
        ],
        "summary": "PATCH /api/v1/organizations/{orgId} — update name/contact (owner only).",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchOrganizationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchOrganizationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchOrganizationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{orgId}/transfer-ownership": {
      "post": {
        "tags": [
          "Organizations"
        ],
        "summary": "POST /api/v1/organizations/{orgId}/transfer-ownership — transfer ownership to a member.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOwnershipDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOwnershipDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOwnershipDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{orgId}/tenants": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "GET /api/v1/organizations/{orgId}/tenants — list workspaces in the organization.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceDto"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Organizations"
        ],
        "summary": "POST /api/v1/organizations/{orgId}/tenants — create a new workspace within the org.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/organizations/{orgId}/tenants/{tenantId}": {
      "delete": {
        "tags": [
          "Organizations"
        ],
        "summary": "DELETE /api/v1/organizations/{orgId}/tenants/{tenantId} — archive (soft-delete) a workspace.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Organizations"
        ],
        "summary": "PATCH /api/v1/organizations/{orgId}/tenants/{tenantId} — update workspace metadata.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchWorkspaceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchWorkspaceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchWorkspaceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/organizations": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "GET /api/v1/me/organizations — user-centric view: all orgs + visible workspaces.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MyOrganizationsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyOrganizationsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyOrganizationsDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/workspaces": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "GET /api/v1/me/workspaces?organizationId= — workspaces the user can access in an org.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceDto"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/default-organization": {
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "PUT /api/v1/me/default-organization — set the user's default organization.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDefaultOrganizationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDefaultOrganizationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetDefaultOrganizationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/default-workspace": {
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "PUT /api/v1/me/default-workspace — set the user's default workspace (updates last_selected_tenant_id).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDefaultWorkspaceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDefaultWorkspaceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetDefaultWorkspaceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/select-workspace": {
      "post": {
        "tags": [
          "Organizations"
        ],
        "summary": "POST /api/v1/auth/select-workspace — alias for select-tenant; accepts optional organizationId\nfor defense-in-depth validation that the tenant belongs to the expected org (spec §20.5).\nThe actual JWT generation is handled by the existing SelectTenant logic.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectWorkspaceDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectWorkspaceDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SelectWorkspaceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/persons/{personId}/addresses": {
      "get": {
        "tags": [
          "PersonAddresses"
        ],
        "summary": "Gets all addresses for a person",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AddressResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AddressResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AddressResponseDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PersonAddresses"
        ],
        "summary": "Creates a new address for a person",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Cancellation token",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAddressDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAddressDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAddressDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/persons/{personId}/addresses/{addressId}": {
      "get": {
        "tags": [
          "PersonAddresses"
        ],
        "summary": "Gets a specific address by ID",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "description": "Address ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "PersonAddresses"
        ],
        "summary": "Updates an existing address",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "description": "Address ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Cancellation token",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAddressDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAddressDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAddressDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PersonAddresses"
        ],
        "summary": "Deletes an address",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "description": "Address ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/persons/{personId}/addresses/{addressId}/set-primary": {
      "post": {
        "tags": [
          "PersonAddresses"
        ],
        "summary": "Sets an address as the primary address",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "addressId",
            "in": "path",
            "description": "Address ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/persons/{personId}/classifications": {
      "get": {
        "tags": [
          "PersonClassifications"
        ],
        "summary": "Lista os papéis ATIVOS de uma pessoa.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "ID da pessoa",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Classificações retornadas",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClassificationResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClassificationResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClassificationResponseDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pessoa não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PersonClassifications"
        ],
        "summary": "Atribui um papel LEVE a uma pessoa.",
        "description": "Idempotente: se o papel já está ativo é no-op; se existir mas inativo, é reativado.\nPapéis ricos (Customer/Supplier/Employee/Carrier) são rejeitados com 400 — eles são geridos\npela entidade própria do papel.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "ID da pessoa",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignClassificationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignClassificationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AssignClassificationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Papel atribuído",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClassificationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClassificationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClassificationResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Papel rico/ inválido",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Pessoa não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/persons/{personId}/classifications/{type}": {
      "delete": {
        "tags": [
          "PersonClassifications"
        ],
        "summary": "Remove (desativa) um papel LEVE de uma pessoa. Idempotente.",
        "description": "Role mínima = Manager (não Admin como o DELETE de Customer/PersonContact): remover um papel leve é\numa <b>desativação reversível</b> (`Deactivate`, a linha é mantida e basta reatribuir para\nreativar), não uma destruição irreversível — decisão consciente, não lapso (ADR-0027).",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "ID da pessoa",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "type",
            "in": "path",
            "description": "Papel a remover",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ParticipantRole"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Papel removido (ou já ausente)"
          },
          "400": {
            "description": "Papel rico/ inválido",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Pessoa não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/persons/{personId}/contacts": {
      "get": {
        "tags": [
          "PersonContacts"
        ],
        "summary": "Gets all contacts for a person",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContactResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContactResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContactResponseDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PersonContacts"
        ],
        "summary": "Creates a new contact for a person",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Cancellation token",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContactDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContactDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContactDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/persons/{personId}/contacts/{contactId}": {
      "get": {
        "tags": [
          "PersonContacts"
        ],
        "summary": "Gets a specific contact by ID",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "description": "Contact ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "PersonContacts"
        ],
        "summary": "Updates an existing contact",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "description": "Contact ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Cancellation token",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PersonContacts"
        ],
        "summary": "Deletes a contact",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "description": "Contact ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/persons/{personId}/contacts/{contactId}/set-primary": {
      "post": {
        "tags": [
          "PersonContacts"
        ],
        "summary": "Sets a contact as the primary contact of its type",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "Person ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "description": "Contact ID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/postal-codes": {
      "get": {
        "tags": [
          "PostalCodes"
        ],
        "summary": "Lista códigos postais com paginação e filtros",
        "description": "Retorna uma lista paginada de códigos postais. Suporta filtro por país.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Code, Street, CreatedAt",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "countryId",
            "in": "query",
            "description": "Filtrar por país (código ISO alpha-2)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (código ou logradouro)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Code)",
            "schema": {
              "type": "string",
              "default": "Code"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de códigos postais retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPostalCodeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPostalCodeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPostalCodeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/postal-codes/{id}": {
      "get": {
        "tags": [
          "PostalCodes"
        ],
        "summary": "Obtém um código postal por ID",
        "description": "Retorna os detalhes de um código postal específico incluindo todas as referências\n(cidade, estado, bairro).\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do código postal",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Código postal encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostalCodeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostalCodeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostalCodeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Código postal não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/postal-codes/lookup/{countryId}/{code}": {
      "get": {
        "tags": [
          "PostalCodes"
        ],
        "summary": "Busca um código postal pelo código (lookup para autopreenchimento de endereço)",
        "description": "Retorna os detalhes de um código postal a partir do país e código.\nEste endpoint é usado para autopreenchimento de endereço quando o usuário\ninforma o código postal (ex.: CEP no Brasil).\n\nPara o Brasil (countryId = BR), quando o código não existe na base local, o serviço\nconsulta o ViaCEP e, em caso de sucesso, cadastra automaticamente os dados de referência\nresolvidos (cidade, bairro e o próprio CEP) antes de responder. Qualquer falha do ViaCEP\n(indisponível, timeout, CEP inexistente ou pré-requisitos de UF/IBGE ausentes) é tratada\ncomo \"não encontrado\" (404), sem efeito colateral — o cadastro nunca é corrompido.\n\nO valor é encaminhado ao serviço de lookup exatamente como foi recebido,\nou seja, o controlador não remove nem adiciona caracteres de formatação\n(pontos, traços, espaços, etc.). A formatação esperada depende de como o\ncódigo postal é armazenado/configurado no sistema.\n\nExemplos de formatos aceitos, dependendo da configuração:\n- Numérico sem formatação: 01001000\n- Numérico formatado: 01001-000\n\nRetorna cidade, estado, bairro e logradouro associados.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "countryId",
            "in": "path",
            "description": "Código do país (ISO alpha-2, ex.: BR)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "path",
            "description": "Código postal, no mesmo formato em que é armazenado pelo sistema\n(podendo incluir ou não caracteres de formatação, ex.: 01001000 ou 01001-000).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Código postal encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostalCodeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostalCodeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostalCodeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Código postal não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/price-tables": {
      "get": {
        "tags": [
          "PriceTables"
        ],
        "summary": "Lista tabelas de preços com paginação e filtros",
        "description": "Retorna uma lista paginada de tabelas de preços.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, SortOrder, CreatedAt, StartDate, EndDate, IsActive",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome ou descrição)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isDefault",
            "in": "query",
            "description": "Filtrar por tabela padrão",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: SortOrder)",
            "schema": {
              "type": "string",
              "default": "SortOrder"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de tabelas de preços retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPriceTableResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPriceTableResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfPriceTableResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PriceTables"
        ],
        "summary": "Cria uma nova tabela de preços",
        "description": "Cria uma nova tabela de preços. O nome deve ser único dentro do tenant.\nSe IsDefault=true, a tabela padrão anterior será desmarcada.\n\n**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePriceTableRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePriceTableRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePriceTableRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Tabela de preços criada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos ou erro de validação (ex: nome duplicado)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Manager)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/price-tables/{id}": {
      "get": {
        "tags": [
          "PriceTables"
        ],
        "summary": "Obtém uma tabela de preços por ID",
        "description": "Retorna os detalhes de uma tabela de preços específica.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da tabela de preços",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tabela de preços encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Tabela de preços não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "PriceTables"
        ],
        "summary": "Atualiza uma tabela de preços existente",
        "description": "Atualiza os dados de uma tabela de preços existente.\nO nome deve ser único dentro do tenant.\nSe IsDefault=true, a tabela padrão anterior será desmarcada.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da tabela de preços a atualizar",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePriceTableRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePriceTableRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePriceTableRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tabela de preços atualizada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceTableResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos ou erro de validação",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Manager)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Tabela de preços não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PriceTables"
        ],
        "summary": "Exclui uma tabela de preços",
        "description": "Realiza exclusão lógica (soft delete) de uma tabela de preços.\nA exclusão falhará se a tabela estiver sendo usada como base por outra tabela\nou se estiver associada a clientes.\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da tabela de preços a excluir",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tabela de preços excluída com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Admin)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Tabela de preços não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Tabela de preços em uso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/price-tables/active": {
      "get": {
        "tags": [
          "PriceTables"
        ],
        "summary": "Lista todas as tabelas de preços ativas",
        "description": "Retorna todas as tabelas de preços ativas, ideal para preenchimento de dropdowns/selects.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Lista de tabelas de preços retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceTableResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceTableResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriceTableResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-brands": {
      "get": {
        "tags": [
          "ProductBrands"
        ],
        "summary": "Lista marcas de produtos com paginação e filtros",
        "description": "Retorna uma lista paginada de marcas.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, CreatedAt, UpdatedAt, IsActive",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome ou descrição)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de marcas retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductBrandResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductBrandResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductBrandResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ProductBrands"
        ],
        "summary": "Cria uma nova marca",
        "description": "Cria uma nova marca de produto. O nome deve ser único dentro do tenant.\n\n**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductBrandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductBrandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductBrandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Marca criada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Manager)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação (ex: nome duplicado)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-brands/{id}": {
      "get": {
        "tags": [
          "ProductBrands"
        ],
        "summary": "Obtém uma marca por ID",
        "description": "Retorna os detalhes de uma marca específica.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da marca",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Marca encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Marca não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ProductBrands"
        ],
        "summary": "Atualiza uma marca existente",
        "description": "Atualiza os dados de uma marca existente.\nO nome deve ser único dentro do tenant.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da marca a atualizar",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductBrandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductBrandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductBrandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Marca atualizada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductBrandResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Manager)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Marca não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ProductBrands"
        ],
        "summary": "Exclui uma marca",
        "description": "Realiza exclusão lógica (soft delete) de uma marca.\nA exclusão falhará se a marca estiver sendo usada por produtos.\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da marca a excluir",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Marca excluída com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Admin)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Marca não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Marca em uso por produtos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-brands/active": {
      "get": {
        "tags": [
          "ProductBrands"
        ],
        "summary": "Lista todas as marcas ativas",
        "description": "Retorna todas as marcas ativas, ideal para preenchimento de dropdowns/selects.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Lista de marcas retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductBrandResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductBrandResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductBrandResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories": {
      "get": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Lista categorias de produtos com paginação e filtros",
        "description": "Retorna uma lista paginada de categorias (formato flat, não hierárquico).\nPara obter a estrutura em árvore, use o endpoint `/tree`.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, SortOrder, CreatedAt",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parentId",
            "in": "query",
            "description": "Filtrar por categoria pai",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeRootOnly",
            "in": "query",
            "description": "Retornar apenas categorias raiz",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de categorias retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductCategoryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductCategoryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductCategoryResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Cria uma nova categoria de produto",
        "description": "Cria uma nova categoria, opcionalmente como filha de outra categoria.\n\n**Requer:** Role de Manager ou superior.\n\n**Exemplo de request:**\n```json\n{\n  \"name\": \"Eletrônicos\",\n  \"description\": \"Produtos eletrônicos em geral\",\n  \"parentId\": null,\n  \"sortOrder\": 1\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductCategoryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductCategoryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductCategoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Categoria criada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria pai não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Nome duplicado no mesmo nível",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories/{id}": {
      "get": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Obtém uma categoria por ID",
        "description": "Retorna os detalhes de uma categoria específica.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da categoria",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Categoria encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Atualiza uma categoria de produto",
        "description": "Atualiza os dados de uma categoria existente.\nApenas os campos fornecidos serão atualizados.\n\n**Requer:** Role de Manager ou superior.\n\n**Nota:** Para mover a categoria para outro pai, use o endpoint `/move`.\n\n**Exemplo de request:**\n```json\n{\n  \"name\": \"Novo Nome\",\n  \"isActive\": false\n}\n```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da categoria",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductCategoryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductCategoryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductCategoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Categoria atualizada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Nome duplicado no mesmo nível",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Remove uma categoria de produto (soft delete)",
        "description": "Remove uma categoria do sistema. A categoria é marcada como deletada (soft delete).\n\n**Requer:** Role de Admin.\n\n**Restrições:** Não é possível excluir uma categoria que possui filhos.\nPrimeiro, remova ou mova os filhos.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da categoria",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Categoria removida com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Categoria possui filhos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories/tree": {
      "get": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Obtém todas as categorias em estrutura de árvore",
        "description": "Retorna a estrutura hierárquica completa de categorias.\nIdeal para exibição em menus, sidebars ou seletores de categoria.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "activeOnly",
            "in": "query",
            "description": "Filtrar apenas categorias ativas (padrão: true)",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Filtrar por termo de busca",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Árvore de categorias retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryTreeDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryTreeDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryTreeDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories/{id}/tree": {
      "get": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Obtém uma subárvore a partir de uma categoria específica",
        "description": "Retorna a categoria especificada e todos os seus descendentes em estrutura de árvore.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da categoria raiz da subárvore",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "activeOnly",
            "in": "query",
            "description": "Filtrar apenas categorias ativas (padrão: true)",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subárvore retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryTreeDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryTreeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryTreeDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories/children": {
      "get": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Obtém filhos diretos de uma categoria",
        "description": "Retorna as categorias filhas imediatas.\nSe `parentId` não for informado, retorna as categorias raiz.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "parentId",
            "in": "query",
            "description": "ID da categoria pai (null para raiz)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de filhos retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories/{id}/ancestors": {
      "get": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Obtém os ancestrais de uma categoria (breadcrumb)",
        "description": "Retorna a cadeia de categorias pai, da raiz até a categoria especificada.\nIdeal para construir navegação breadcrumb.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da categoria",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de ancestrais retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategoryResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-categories/{id}/move": {
      "put": {
        "tags": [
          "ProductCategories"
        ],
        "summary": "Move uma categoria para um novo pai",
        "description": "Altera a posição de uma categoria na hierarquia.\nSe `newParentId` for null, a categoria será movida para a raiz.\n\n**Requer:** Role de Manager ou superior.\n\n**Restrições:**\n- Não é possível mover uma categoria para dentro de si mesma\n- Não é possível mover uma categoria para dentro de um descendente\n\n**Exemplo de request:**\n```json\n{\n  \"newParentId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n}\n```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da categoria a mover",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveProductCategoryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveProductCategoryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MoveProductCategoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Categoria movida com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Categoria não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Movimento inválido (ciclo ou nome duplicado)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-models": {
      "get": {
        "tags": [
          "ProductModels"
        ],
        "summary": "Lista modelos de produtos com paginação e filtros",
        "description": "Retorna uma lista paginada de modelos.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, CreatedAt, UpdatedAt, IsActive",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de modelos retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductModelResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductModelResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductModelResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ProductModels"
        ],
        "summary": "Cria um novo modelo",
        "description": "Cria um novo modelo de produto. O nome deve ser único dentro do tenant.\n\n**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductModelRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductModelRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductModelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Modelo criado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Manager)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação (ex: nome duplicado)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-models/{id}": {
      "get": {
        "tags": [
          "ProductModels"
        ],
        "summary": "Obtém um modelo por ID",
        "description": "Retorna os detalhes de um modelo específico.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do modelo",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Modelo encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Modelo não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ProductModels"
        ],
        "summary": "Atualiza um modelo existente",
        "description": "Atualiza os dados de um modelo existente.\nO nome deve ser único dentro do tenant.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do modelo a atualizar",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductModelRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductModelRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductModelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Modelo atualizado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductModelResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Manager)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Modelo não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ProductModels"
        ],
        "summary": "Exclui um modelo",
        "description": "Realiza exclusão lógica (soft delete) de um modelo.\nA exclusão falhará se o modelo estiver sendo usado por produtos.\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do modelo a excluir",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Modelo excluído com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Admin)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Modelo não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Modelo em uso por produtos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product-models/active": {
      "get": {
        "tags": [
          "ProductModels"
        ],
        "summary": "Lista todos os modelos ativos",
        "description": "Retorna todos os modelos ativos, ideal para preenchimento de dropdowns/selects.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Lista de modelos retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductModelResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductModelResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductModelResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Lista produtos com paginação e filtros",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "categoryId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "hasVariations",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductListItemDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductListItemDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductListItemDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Cria um novo produto",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Obtém um produto por ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Atualiza um produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Remove um produto (soft delete)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/barcode/{code}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Busca produto por código de barras",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeSearchResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeSearchResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeSearchResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/barcodes": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Lista códigos de barras de um produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/barcodes/{barcodeId}": {
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Atualiza código de barras do produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "barcodeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBarcodeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBarcodeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBarcodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Remove código de barras do produto (soft delete)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "barcodeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/variants": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Lista variantes de um produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductVariantResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductVariantResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductVariantResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Adiciona variante ao produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductVariantDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductVariantDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductVariantDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/variants/{variantId}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Obtém uma variante por ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Atualiza variante do produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductVariantRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductVariantRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductVariantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariantResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Remove variante do produto (soft delete)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/variants/{variantId}/barcodes": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Lista códigos de barras de uma variante",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BarcodeResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Adiciona código de barras à variante",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarcodeDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarcodeDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarcodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/variants/{variantId}/barcodes/{barcodeId}": {
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Remove código de barras da variante (soft delete)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "barcodeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/images": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Lista as imagens de um produto (imagens gerais, não específicas de variantes)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Faz upload de uma imagem para o produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "setAsPrimary",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/images/{imageId}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Obtém uma imagem específica de um produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Deleta uma imagem do produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/images/{imageId}/primary": {
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Define uma imagem como principal do produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/images/reorder": {
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Reordena as imagens do produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderProductImagesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderProductImagesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderProductImagesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/variants/{variantId}/images": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Lista as imagens de uma variante de produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do produto",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "description": "ID da variante",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "inheritFromProduct",
            "in": "query",
            "description": "Se true, retorna imagens do produto quando a variante não tem imagens próprias",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Faz upload de uma imagem para uma variante de produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "setAsPrimary",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/variants/{variantId}/images/{imageId}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Obtém uma imagem específica de uma variante de produto",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Deleta uma imagem de uma variante",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/variants/{variantId}/images/{imageId}/primary": {
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Define uma imagem como principal da variante",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImageResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{id}/variants/{variantId}/images/reorder": {
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Reordena as imagens de uma variante",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderProductImagesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderProductImagesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderProductImagesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductImageResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{productId}/variants/{variantId}/stock-locations": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Lista estoques por local de estoque de uma variação",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductStockLocationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductStockLocationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductStockLocationDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Atualiza estoques por local de estoque de uma variação",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductStockLocationsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductStockLocationsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductStockLocationsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductStockLocationDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductStockLocationDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductStockLocationDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{productId}/variants/{variantId}/prices": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Lista preços por tabela de preço de uma variação",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductPriceDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductPriceDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductPriceDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Products"
        ],
        "summary": "Atualiza preços por tabela de preço de uma variação",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductPricesDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductPricesDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductPricesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductPriceDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductPriceDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductPriceDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/registration/check-email": {
      "post": {
        "tags": [
          "Registration"
        ],
        "summary": "Verifica se um email já está registrado no sistema",
        "description": "Usado no início do fluxo de registro para determinar se o usuário:\n- É novo e precisa criar uma conta\n- Já existe e precisa apenas autenticar para criar um novo tenant\n\n**Exemplo de request:**\n```json\n{\n  \"email\": \"usuario@exemplo.com\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckEmailRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckEmailRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CheckEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verificação realizada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CheckEmailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckEmailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckEmailResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Email inválido",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/registration/register-user": {
      "post": {
        "tags": [
          "Registration"
        ],
        "summary": "Registra um novo usuário (etapa 1 para novos usuários)",
        "description": "Primeira etapa do registro para usuários que ainda não possuem conta.\n\nRetorna um token de registro temporário que deve ser usado na próxima etapa\npara criar o tenant (`/api/v1/registration/create-tenant`).\n\n**Requisitos de senha:**\n- Mínimo de 8 caracteres\n- Pelo menos uma letra maiúscula\n- Pelo menos uma letra minúscula\n- Pelo menos um número\n- Pelo menos um caractere especial\n\n**Exemplo de request:**\n```json\n{\n  \"email\": \"novousuario@exemplo.com\",\n  \"name\": \"João Silva\",\n  \"password\": \"SenhaSegura123!\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterUserRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterUserRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Usuário registrado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterUserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterUserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterUserResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Email já registrado ou senha não atende aos requisitos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/registration/authenticate-for-tenant": {
      "post": {
        "tags": [
          "Registration"
        ],
        "summary": "Autentica um usuário existente para criação de tenant (etapa 1 para usuários existentes)",
        "description": "Para usuários que já possuem conta e desejam criar um novo tenant.\n\nRetorna um token de registro temporário, informações do usuário e \na lista de tenants aos quais o usuário já pertence.\n\n**Exemplo de request:**\n```json\n{\n  \"email\": \"usuario@exemplo.com\",\n  \"password\": \"SenhaAtual123!\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthenticateForTenantRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthenticateForTenantRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AuthenticateForTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Autenticação realizada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticateForTenantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticateForTenantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticateForTenantResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Credenciais inválidas",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/registration/check-tenant-name": {
      "post": {
        "tags": [
          "Registration"
        ],
        "summary": "Verifica se o nome do tenant já está em uso no sistema",
        "description": "Usado na etapa de criação do tenant para verificar se o nome já existe,\npermitindo feedback ao usuário antes de submeter o formulário.\n\n**Exemplo de request:**\n```json\n{\n  \"name\": \"Minha Empresa LTDA\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckTenantNameRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckTenantNameRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CheckTenantNameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verificação realizada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CheckTenantNameResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckTenantNameResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckTenantNameResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Nome inválido",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/registration/create-tenant": {
      "post": {
        "tags": [
          "Registration"
        ],
        "summary": "Cria o tenant e associa ao usuário (etapa 2 - requer token de registro)",
        "description": "Etapa final do registro. Cria o tenant e associa o usuário como administrador.\n\n**Requer** o token de registro temporário obtido na etapa anterior\n(via `register-user` ou `authenticate-for-tenant`).\n\nRetorna o access token final com o contexto do tenant criado.\n\n**Exemplo de request:**\n```json\n{\n  \"companyName\": \"Minha Empresa LTDA\",\n  \"contactEmail\": \"contato@minhaempresa.com\",\n  \"contactPhone\": \"+55 11 99999-9999\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantFromRegistrationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantFromRegistrationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantFromRegistrationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Tenant criado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTenantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTenantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTenantResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Token de registro inválido ou expirado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Erro de validação (ex: nome de empresa duplicado)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/registration/confirm-email": {
      "post": {
        "tags": [
          "Registration"
        ],
        "summary": "Confirma o endereço de e-mail do usuário (double opt-in) — SH-B15",
        "description": "Recebe o token enviado no e-mail de confirmação. Valida (existe, não expirado, não usado),\nmarca o e-mail como confirmado e invalida o token (uso único / anti-replay).\n\n**Exemplo de request:**\n```json\n{\n  \"token\": \"abc123...\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmEmailRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmEmailRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "E-mail confirmado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailConfirmationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailConfirmationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailConfirmationResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Token expirado ou já utilizado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Token não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/registration/resend-confirmation": {
      "post": {
        "tags": [
          "Registration"
        ],
        "summary": "Reenvia o e-mail de confirmação de conta — SH-B15",
        "description": "Por segurança, sempre retorna sucesso, mesmo se o e-mail não estiver cadastrado ou já\nconfirmado (prevenção de enumeração de usuários). Limitado por rate limit (policy `auth`).\n\n**Exemplo de request:**\n```json\n{\n  \"email\": \"usuario@exemplo.com\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendConfirmationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendConfirmationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ResendConfirmationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Solicitação processada (e-mail enviado se aplicável)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmailConfirmationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailConfirmationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailConfirmationResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/states": {
      "get": {
        "tags": [
          "States"
        ],
        "summary": "Lista estados com paginação e filtros",
        "description": "Retorna uma lista paginada de estados/províncias.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, Code, CreatedAt",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "countryId",
            "in": "query",
            "description": "Filtrar por país (código ISO)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome ou código)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de estados retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStateResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStateResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStateResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/states/{countryId}/{code}": {
      "get": {
        "tags": [
          "States"
        ],
        "summary": "Obtém um estado pela chave composta (país + código)",
        "description": "Retorna os detalhes de um estado pela chave composta.\nExemplo: GET /api/v1/states/BR/SP\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "countryId",
            "in": "path",
            "description": "Código ISO do país (2 caracteres)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "path",
            "description": "Código do estado (ex: \"SP\", \"RJ\")",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Estado encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StateResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StateResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StateResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Estado não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/states/by-country/{countryId}": {
      "get": {
        "tags": [
          "States"
        ],
        "summary": "Lista todos os estados ativos de um país",
        "description": "Retorna uma lista de todos os estados ativos de um país para uso em seletores/dropdowns.\nExemplo: GET /api/v1/states/by-country/BR\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "countryId",
            "in": "path",
            "description": "Código ISO do país (2 caracteres)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de estados ativos retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StateResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StateResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StateResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-locations": {
      "get": {
        "tags": [
          "StockLocations"
        ],
        "summary": "Lista locais de estoque com paginação e filtros",
        "description": "Retorna uma lista paginada de locais de estoque.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, SortOrder, CreatedAt, IsActive",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome, descrição ou endereço)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "isDefault",
            "in": "query",
            "description": "Filtrar por local padrão",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: SortOrder)",
            "schema": {
              "type": "string",
              "default": "SortOrder"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de locais de estoque retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStockLocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStockLocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfStockLocationResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "StockLocations"
        ],
        "summary": "Cria um novo local de estoque",
        "description": "Cria um novo local de estoque. O nome deve ser único dentro do tenant.\nSe IsDefault=true, o local padrão anterior será desmarcado.\n\n**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateStockLocationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateStockLocationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateStockLocationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Local de estoque criado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos ou erro de validação (ex: nome duplicado)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Manager)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-locations/{id}": {
      "get": {
        "tags": [
          "StockLocations"
        ],
        "summary": "Obtém um local de estoque por ID",
        "description": "Retorna os detalhes de um local de estoque específico.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do local de estoque",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Local de estoque encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Local de estoque não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "StockLocations"
        ],
        "summary": "Atualiza um local de estoque existente",
        "description": "Atualiza os dados de um local de estoque existente.\nO nome deve ser único dentro do tenant.\nSe IsDefault=true, o local padrão anterior será desmarcado.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do local de estoque a atualizar",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStockLocationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStockLocationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStockLocationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Local de estoque atualizado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockLocationResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos ou erro de validação",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Manager)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Local de estoque não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "StockLocations"
        ],
        "summary": "Exclui um local de estoque",
        "description": "Realiza exclusão lógica (soft delete) de um local de estoque.\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do local de estoque a excluir",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Local de estoque excluído com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão (requer Admin)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Local de estoque não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stock-locations/active": {
      "get": {
        "tags": [
          "StockLocations"
        ],
        "summary": "Lista todos os locais de estoque ativos",
        "description": "Retorna todos os locais de estoque ativos, ideal para preenchimento de dropdowns/selects.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Lista de locais de estoque retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StockLocationResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StockLocationResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StockLocationResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Lista fornecedores com paginação e filtros",
        "description": "Retorna uma lista paginada de fornecedores com dados da pessoa associada.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, SupplierCode, CreatedAt, UpdatedAt, LeadTimeDays, Status",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome, nome fantasia, documento ou código)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filtrar por status (Active, Suspended, Blocked)",
            "schema": {
              "$ref": "#/components/schemas/SupplierStatus"
            }
          },
          {
            "name": "personType",
            "in": "query",
            "description": "Filtrar por tipo de pessoa (Individual, LegalEntity)",
            "schema": {
              "$ref": "#/components/schemas/PersonType"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de fornecedores retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfSupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfSupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfSupplierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Cria um novo fornecedor",
        "description": "Cria um novo fornecedor com os dados de pessoa associados.\nO documento (CPF/CNPJ) é validado de acordo com o país.\n\n**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSupplierDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSupplierDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSupplierDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Fornecedor criado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers/{id}": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Obtém um fornecedor por ID com detalhes completos",
        "description": "Retorna os detalhes de um fornecedor específico incluindo dados da pessoa,\nendereços e contatos associados.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do fornecedor",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fornecedor encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierDetailResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierDetailResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierDetailResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Atualiza um fornecedor existente",
        "description": "Atualiza os dados do fornecedor e da pessoa associada.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do fornecedor",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSupplierDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSupplierDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSupplierDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Fornecedor atualizado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Exclui um fornecedor",
        "description": "Remove um fornecedor do sistema (soft delete).\n\n**Requer:** Role de Admin.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do fornecedor",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Fornecedor excluído"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers/by-person/{personId}": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Obtém um fornecedor pelo ID da pessoa",
        "description": "Retorna os detalhes de um fornecedor a partir do ID da pessoa associada.\nÚtil quando você tem o ID da pessoa e precisa verificar se ela é um fornecedor.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "personId",
            "in": "path",
            "description": "ID da pessoa",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fornecedor encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado para esta pessoa",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers/by-document/{document}": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Obtém um fornecedor pelo documento (CPF/CNPJ)",
        "description": "Retorna os dados de um fornecedor a partir do documento da pessoa associada.\nÚtil para verificar se já existe um fornecedor com determinado documento\ne carregar seus dados automaticamente no frontend.\n\nAceita CPF/CNPJ com ou sem formatação (pontos e traços). Exemplos válidos:\n- CPF: `12345678909` ou `529.982.247-25`\n- CNPJ: `11222333000181`\n\n**Nota:** A barra (`/`) presente no CNPJ formatado não é suportada na URL.\nRecomenda-se enviar apenas os dígitos do documento.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "document",
            "in": "path",
            "description": "Documento (CPF/CNPJ), preferencialmente apenas dígitos.\nAceita formatação com pontos e traços (a barra do CNPJ requer URL encoding).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fornecedor encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado para este documento",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers/{id}/activate": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Ativa um fornecedor",
        "description": "Altera o status do fornecedor para Ativo.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do fornecedor",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fornecedor ativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers/{id}/suspend": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Suspende um fornecedor",
        "description": "Altera o status do fornecedor para Suspenso.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do fornecedor",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fornecedor suspenso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers/{id}/block": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Bloqueia um fornecedor",
        "description": "Altera o status do fornecedor para Bloqueado.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do fornecedor",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fornecedor bloqueado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers/{id}/deactivate-role": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Desabilita o papel de Fornecedor (inativação reversível)",
        "description": "Inativa o papel de Fornecedor preservando 100% dos dados. Distinto de DELETE e de Suspend.\nIdempotente: já inativo → 200 sem efeito adicional.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do fornecedor",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fornecedor inativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suppliers/{id}/activate-role": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Reabilita o papel de Fornecedor (reversão da inativação)",
        "description": "Reativa o papel de Fornecedor voltando para o status Active. Reutiliza o registro existente\nsem criar duplicata. Idempotente: já ativo → 200 sem efeito adicional.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do fornecedor",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fornecedor reativado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Fornecedor não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sync/health": {
      "get": {
        "tags": [
          "SyncHealth"
        ],
        "summary": "Agregado de saúde do sync de estoque do tenant: contagem por visibilidade (Visible/Paused/\nDeactivated/Error/Unknown) mais os derivados `under_backoff` e `with_drift`.\nR6 / T-R6-17 — inclui o semáforo do ERP externo (§8.2: Green/Yellow/Red), `null` p/ Modelo A.",
        "description": "**Requer:** Role de Manager ou superior (dado operacional de sync).",
        "responses": {
          "200": {
            "description": "Agregado de saúde retornado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SyncHealthSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncHealthSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncHealthSummaryDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sync/marketplaces/{connId}/state": {
      "get": {
        "tags": [
          "SyncHealth"
        ],
        "summary": "Resumo de sync por conexão: estado replicado de cada listing (não-deletado) da conexão —\nvisibilidade, desired/pushed/confirmed, drift e erro/backoff.",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "connId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de estados por listing",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceSyncStateDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceSyncStateDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceSyncStateDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Conexão não encontrada (ou de outro tenant)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sync/retry-failed": {
      "post": {
        "tags": [
          "SyncHealth"
        ],
        "summary": "Reenfileira todos os listings em `Error` do tenant (porta manual de saída do Error, §8.1):\nre-publica o evento de sync corrente e reseta o estado de Error para reentrar no fluxo. Retorna a\ncontagem reenfileirada.",
        "description": "**Requer:** Role de Admin (ação operacional sensível).",
        "responses": {
          "200": {
            "description": "Mappings reenfileirados (contagem em `requeued`)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RetryFailedResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetryFailedResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetryFailedResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sync/reconcile": {
      "post": {
        "tags": [
          "SyncHealth"
        ],
        "summary": "R5 / T-R5-10 — dispara uma reconciliação manual (§7.2.3). `scope` ∈ Full/Connection/Product\n(Connection exige `connectionId`, Product exige `productId`); `kind` ∈ Stock/Price\n(default Stock). Retorna o `runId` da run criada (consulte o status em `GET /sync/reconcile/{runId}`).",
        "description": "**Requer:** Role de Manager ou superior.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReconcileRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReconcileRequestDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReconcileRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Reconciliação disparada; `runId` retornado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReconcileResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconcileResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconcileResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Escopo/kind inválido ou faltando o id exigido pelo escopo",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sync/reconcile/{runId}": {
      "get": {
        "tags": [
          "SyncHealth"
        ],
        "summary": "R5 / T-R5-10 — status/resultado de uma run de reconciliação (§7.2.3): kind/scope/status + contadores\n(skus checados, drifts encontrados/corrigidos, erros) + duração.",
        "description": "**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Run encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationRunView"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationRunView"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationRunView"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Run não encontrada (ou de outro tenant)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sync/timeseries": {
      "get": {
        "tags": [
          "SyncHealth"
        ],
        "summary": "R5 / T-R5-17 — série temporal de saúde do sync para os gráficos do painel (§7.2.3): latência\navg/p95/p99 (exata por bucket), eventos, erros (Failure/Timeout) e drift de reconciliação, por\nbucket. `period=24h` retorna 24 pontos horários; `7d`/`30d` retornam 7/30 pontos\ndiários. Buckets sem dado vêm preenchidos com zero/null — o eixo x do gráfico é contínuo.",
        "description": "**Requer:** Role de Manager ou superior (dado operacional de sync).",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Série temporal retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SyncTimeseriesDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncTimeseriesDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncTimeseriesDto"
                }
              }
            }
          },
          "400": {
            "description": "`period` inválido (aceita apenas 24h, 7d, 30d)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Sem permissão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tenants": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Lista tenants com paginação e filtros",
        "description": "Retorna uma lista paginada de todos os tenants do sistema.\n\n**Requer:** Role de Admin.\n\n**Parâmetros de ordenação válidos:** Name, CreatedAt, Status\n\n**Status possíveis:** Active, Inactive, Suspended",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filtro por status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de tenants retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfTenantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfTenantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfTenantResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Tenants"
        ],
        "summary": "Cria um novo tenant",
        "description": "Cria um novo tenant (organização) no sistema.\n\n**Requer:** Role de Admin.\n\n**Exemplo de request:**\n```json\n{\n  \"name\": \"Nova Empresa LTDA\",\n  \"contactEmail\": \"contato@novaempresa.com\",\n  \"contactPhone\": \"+55 11 99999-9999\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Tenant criado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Nome de tenant já existe",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tenants/{id}": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "summary": "Obtém um tenant por ID",
        "description": "Retorna os detalhes de um tenant específico.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tenant encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Tenant não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Tenants"
        ],
        "summary": "Atualiza informações de um tenant",
        "description": "Atualiza os dados de um tenant existente.\nApenas os campos fornecidos serão atualizados.\n\n**Requer:** Role de Admin.\n\n**Exemplo de request:**\n```json\n{\n  \"name\": \"Novo Nome da Empresa\",\n  \"contactEmail\": \"novo@email.com\"\n}\n```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tenant atualizado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Tenant não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Nome de tenant já existe",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Tenants"
        ],
        "summary": "Remove um tenant (soft delete)",
        "description": "Remove um tenant do sistema. O tenant é marcado como deletado (soft delete)\ne não poderá mais ser acessado.\n\n**Requer:** Role de Admin.\n\n**Atenção:** Esta operação afetará todos os usuários do tenant.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do tenant",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tenant removido com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Tenant não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tenant-settings": {
      "get": {
        "tags": [
          "TenantSettings"
        ],
        "summary": "Retorna as configurações do tenant corrente",
        "description": "Retorna o snapshot completo de configurações do tenant autenticado,\nincluindo países de atuação, locale padrão e timezone.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Configurações retornadas com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TenantSettingsResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantSettingsResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantSettingsResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/unit-of-measures": {
      "get": {
        "tags": [
          "UnitOfMeasures"
        ],
        "summary": "Lista unidades de medida com paginação e filtros",
        "description": "Retorna uma lista paginada de unidades de medida globais.\n\n**Requer:** Role de User ou superior.\n\n**Parâmetros de ordenação válidos:** Name, Abbreviation, CreatedAt, UpdatedAt",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome, abreviação ou descrição)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de unidades retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfUnitOfMeasureResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfUnitOfMeasureResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfUnitOfMeasureResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/unit-of-measures/{id}": {
      "get": {
        "tags": [
          "UnitOfMeasures"
        ],
        "summary": "Obtém uma unidade de medida por ID",
        "description": "Retorna os detalhes de uma unidade de medida específica.\n\n**Requer:** Role de User ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID da unidade de medida",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Unidade encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UnitOfMeasureResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitOfMeasureResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitOfMeasureResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Unidade não encontrada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/unit-of-measures/active": {
      "get": {
        "tags": [
          "UnitOfMeasures"
        ],
        "summary": "Lista todas as unidades de medida ativas",
        "description": "Retorna uma lista de todas as unidades ativas para uso em seletores.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Lista de unidades ativas retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UnitOfMeasureResponseDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UnitOfMeasureResponseDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UnitOfMeasureResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-navigation/me": {
      "get": {
        "tags": [
          "UserNavigation"
        ],
        "summary": "Obtém as preferências de navegação do usuário atual",
        "description": "Retorna favoritos, telas recentes e estado do menu do usuário autenticado.\nSe o usuário ainda não possui preferências salvas, valores padrão são retornados\n(menu expandido, sem favoritos/recentes) — nenhum registro é criado até o primeiro\n`PUT`.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Preferências retornadas",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserNavigationPreferencesResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserNavigationPreferencesResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserNavigationPreferencesResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "UserNavigation"
        ],
        "summary": "Atualiza as preferências de navegação do usuário atual",
        "description": "Substitui o payload completo (sem `PATCH`) do usuário autenticado.\n\n**Favoritos:** até 20 identificadores de tela (letras, dígitos e hífen, 1 a 100\ncaracteres); duplicatas são removidas preservando a ordem (não rejeitadas).\n\n**Recentes:** até 15 entradas; o servidor ordena por `lastAccessedAt` (mais recente\nprimeiro) e trunca em 15. Um `lastAccessedAt` no futuro além de 5 minutos de\ntolerância de relógio é rejeitado.\n\n**Campos v2 (opcionais — `favoriteFolders`, `shortcuts`, `moduleLayouts`):** ao contrário\ndos campos acima, são **null-preserva** — omitir a chave (ou enviar `null`) mantém o valor\njá salvo; enviar uma lista, mesmo vazia (`[]`), substitui. Isso permite que um cliente v1\nmais antigo continue mandando o payload base sem apagar pastas/atalhos/layouts que ele não\nconhece. `favoriteFolders`: até 10 pastas (nome 1-40 chars, sem duplicata\ncase-insensitive); cada tela referenciada deve existir em `favorites` — tela órfã é\n**filtrada silenciosamente** na escrita; uma mesma tela em mais de uma pasta é\n**rejeitada** (400). `shortcuts`: até 8 identificadores (mesmo charset de tela),\ndeduplicados preservando ordem. `moduleLayouts`: até 20 módulos, `hiddenGroups`/`groupOrder`\naté 12 itens cada, deduplicados. Ver `docs/api/user-navigation.md`.\n\n**Requer:** Role de User ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserNavigationPreferencesDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserNavigationPreferencesDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserNavigationPreferencesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preferências atualizadas",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserNavigationPreferencesResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserNavigationPreferencesResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserNavigationPreferencesResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/me/tenants": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Obtém a lista de tenants do usuário autenticado atual",
        "description": "Este endpoint retorna os tenants aos quais o usuário autenticado pertence.\nPermite consultar as próprias associações de tenant do usuário requisitante, \nnão sendo um endpoint de gerenciamento de usuários.\n\nÚtil para exibir opções de troca de tenant na interface do usuário.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Lista de tenants retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantSelectionDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantSelectionDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantSelectionDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Obtém o perfil do próprio usuário autenticado",
        "description": "Retorna os dados de perfil do usuário logado (os mesmos campos editáveis em `PUT /me`:\nnome, e-mail, telefone, avatar e role no tenant atual).\n\n**Tenant-safe:** o usuário é carregado dentro do escopo do tenant atual (filtro universal ADR-0009).\n\n**Requer:** qualquer usuário autenticado (Role de User ou superior).",
        "responses": {
          "200": {
            "description": "Perfil retornado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Usuário não encontrado no tenant atual",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Atualiza o perfil do próprio usuário autenticado",
        "description": "Permite que o usuário logado edite o PRÓPRIO perfil: nome, telefone e avatar.\n\n**O email NÃO é editável aqui** — alterá-lo re-dispararia a confirmação de e-mail (double opt-in, SH-B15).\n\n**Requer:** qualquer usuário autenticado (Role de User ou superior).\n\n**Exemplo de request:**\n```json\n{\n  \"name\": \"Maria Silva\",\n  \"phone\": \"+55 11 99999-0000\",\n  \"avatarUrl\": \"https://exemplo.com/avatar.png\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMyProfileRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMyProfileRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMyProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Perfil atualizado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Usuário não encontrado no tenant atual",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Lista usuários do tenant com paginação e filtros",
        "description": "Retorna uma lista paginada de usuários do tenant atual.\nSuporta busca por texto, filtro por email e ordenação.\n\n**Requer:** Role de Manager ou superior.\n\n**Parâmetros de ordenação válidos:** Name, Email, CreatedAt",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome ou email)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "Filtro exato por email",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação (padrão: Name)",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de usuários retornada",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfUserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfUserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfUserResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Cria um novo usuário no tenant atual",
        "description": "Cria um usuário diretamente no tenant, sem passar pelo fluxo de convite.\n\n**Requer:** Role de Admin.\n\n**Requisitos de senha:**\n- Mínimo de 8 caracteres\n- Pelo menos uma letra maiúscula\n- Pelo menos uma letra minúscula\n- Pelo menos um número\n- Pelo menos um caractere especial\n\n**Exemplo de request:**\n```json\n{\n  \"name\": \"Novo Usuário\",\n  \"email\": \"novo@exemplo.com\",\n  \"password\": \"SenhaSegura123!\",\n  \"avatarUrl\": \"https://exemplo.com/avatar.png\"\n}\n```",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Usuário criado com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Email já registrado ou senha inválida",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Obtém um usuário por ID",
        "description": "Retorna os detalhes de um usuário específico do tenant atual.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do usuário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usuário encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Usuário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Remove um usuário do tenant (soft delete)",
        "description": "Remove o usuário do tenant atual. O usuário é marcado como deletado (soft delete)\ne não terá mais acesso ao tenant.\n\n**Requer:** Role de Admin.\n\n**Nota:** Um admin não pode remover a si mesmo.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do usuário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Usuário removido com sucesso"
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente ou tentativa de auto-exclusão",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Usuário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/by-email/{email}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Obtém um usuário por email",
        "description": "Busca um usuário pelo email no tenant atual.\n\n**Requer:** Role de Manager ou superior.",
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "description": "Email do usuário",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usuário encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Usuário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{id}/role": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Altera a role de um usuário no tenant atual",
        "description": "Modifica a role (papel) de um usuário no tenant.\n\n**Roles disponíveis:** User, Manager, Admin\n\n**Requer:** Role de Admin.\n\n**Restrições:**\n- Um admin não pode alterar sua própria role\n- Deve haver pelo menos um admin no tenant\n\n**Exemplo de request:**\n```json\n{\n  \"role\": \"Manager\"\n}\n```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID do usuário",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeUserRoleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeUserRoleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeUserRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Role alterada com sucesso",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Role inválida",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Permissão insuficiente ou alteração não permitida",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Usuário não encontrado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Não é possível alterar (ex: último admin)",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-settings/me": {
      "get": {
        "tags": [
          "UserSettings"
        ],
        "summary": "Obtém as configurações do usuário atual",
        "description": "Retorna as configurações de preferência do usuário autenticado.\nSe o usuário ainda não possui configurações, valores padrão serão criados automaticamente.\n\n**Requer:** Role de User ou superior.",
        "responses": {
          "200": {
            "description": "Configurações retornadas",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettingsResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettingsResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettingsResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "UserSettings"
        ],
        "summary": "Atualiza as configurações do usuário atual",
        "description": "Atualiza as preferências do usuário autenticado.\n\n**Idiomas suportados:** pt-BR, en-US, es-ES\n\n**Temas suportados:** Light, Dark, System\n\n**Requer:** Role de User ou superior.",
        "requestBody": {
          "description": "Token de cancelamento",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserSettingsDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserSettingsDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Configurações atualizadas",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettingsResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettingsResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettingsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Dados inválidos",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Não autenticado",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/variation-types": {
      "get": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Lista tipos de variação com paginação e filtros",
        "parameters": [
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Número da página (padrão: 1)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Itens por página (padrão: 10, máx: 100)",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Termo de busca (nome)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filtrar por status ativo/inativo",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Campo para ordenação",
            "schema": {
              "type": "string",
              "default": "Name"
            }
          },
          {
            "name": "sortDescending",
            "in": "query",
            "description": "Ordenação descendente",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfVariationTypeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfVariationTypeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfVariationTypeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Cria um novo tipo de variação",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVariationTypeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVariationTypeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVariationTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/variation-types/all": {
      "get": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Lista todos os tipos de variação ativos (para seleção)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VariationTypeSummaryDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VariationTypeSummaryDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VariationTypeSummaryDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/variation-types/{id}": {
      "get": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Obtém um tipo de variação por ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Atualiza um tipo de variação",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVariationTypeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVariationTypeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVariationTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Remove um tipo de variação (soft delete)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/variation-types/{id}/values": {
      "post": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Adiciona um valor a um tipo de variação",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVariationTypeValueRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVariationTypeValueRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVariationTypeValueRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeValueResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeValueResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeValueResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/variation-types/{id}/values/{valueId}": {
      "put": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Atualiza um valor de tipo de variação",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "valueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVariationTypeValueRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVariationTypeValueRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVariationTypeValueRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeValueResponseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeValueResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariationTypeValueResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Remove um valor de tipo de variação (soft delete)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "valueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/variation-types/{id}/values/reorder": {
      "put": {
        "tags": [
          "VariationTypes"
        ],
        "summary": "Reordena os valores de um tipo de variação",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderValuesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderValuesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderValuesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptInvitationRequest": {
        "required": [
          "name",
          "password"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Nome completo do usuário (obrigatório para novos usuários)"
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "Senha do usuário (obrigatório para novos usuários)"
          }
        },
        "description": "Request para aceitar um convite (usado por novos usuários)"
      },
      "AcceptInvitationResponseDto": {
        "required": [
          "token",
          "user",
          "tenant"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserResponseDto"
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponseDto"
          }
        }
      },
      "AddOrderItemDto": {
        "required": [
          "productId"
        ],
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productVariantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 1
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double",
            "default": 0
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AddressResponseDto": {
        "required": [
          "id",
          "personId",
          "label",
          "type",
          "street",
          "number",
          "complement",
          "neighborhood",
          "cityName",
          "cityCode",
          "cityCodeSystem",
          "stateCode",
          "countryId",
          "postalCode",
          "reference",
          "poBox",
          "isPrimary",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/AddressType"
          },
          "street": {
            "type": "string"
          },
          "number": {
            "type": [
              "null",
              "string"
            ]
          },
          "complement": {
            "type": [
              "null",
              "string"
            ]
          },
          "neighborhood": {
            "type": [
              "null",
              "string"
            ]
          },
          "cityName": {
            "type": "string"
          },
          "cityCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "cityCodeSystem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CityCodeSystem"
              }
            ]
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryId": {
            "type": "string"
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "reference": {
            "type": [
              "null",
              "string"
            ]
          },
          "poBox": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPrimary": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "AddressType": {
        "type": "integer"
      },
      "ApiKeyCreatedDto": {
        "required": [
          "id",
          "name",
          "key",
          "keyPrefix",
          "role",
          "expiresAt",
          "description",
          "createdAt",
          "scopes",
          "allowedIps"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowedIps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ApiKeyResponseDto": {
        "required": [
          "id",
          "name",
          "keyPrefix",
          "role",
          "description",
          "expiresAt",
          "isRevoked",
          "isExpired",
          "lastUsedAt",
          "createdAt",
          "createdByUserId",
          "scopes",
          "allowedIps"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "isRevoked": {
            "type": "boolean"
          },
          "isExpired": {
            "type": "boolean"
          },
          "lastUsedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdByUserId": {
            "type": "string",
            "format": "uuid"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allowedIps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AssignClassificationDto": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ParticipantRole"
          }
        },
        "description": "Request body for assigning a light classification (role) to a person — ADR-0027."
      },
      "AssignLoadOrderUserRequest": {
        "required": [
          "role",
          "userId",
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "userId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AssignLoadOrderVehicleRequest": {
        "required": [
          "vehicleId",
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "vehicleId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AuthenticateForTenantRequest": {
        "required": [
          "email",
          "password"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email do usuário"
          },
          "password": {
            "type": "string",
            "description": "Senha atual do usuário"
          }
        },
        "description": "Request para autenticar usuário existente para criação de tenant"
      },
      "AuthenticateForTenantResponseDto": {
        "required": [
          "token",
          "user",
          "existingTenants",
          "nextStep"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserResponseDto"
          },
          "existingTenants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantSelectionDto"
            }
          },
          "nextStep": {
            "type": "string"
          }
        }
      },
      "BarcodeConversionResponseDto": {
        "required": [
          "id",
          "sourceUnitOfMeasure",
          "targetUnitOfMeasure",
          "conversionType",
          "factor",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sourceUnitOfMeasure": {
            "$ref": "#/components/schemas/UnitOfMeasureSummaryDto"
          },
          "targetUnitOfMeasure": {
            "$ref": "#/components/schemas/UnitOfMeasureSummaryDto"
          },
          "conversionType": {
            "$ref": "#/components/schemas/BarcodeConversionType"
          },
          "factor": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "BarcodeConversionType": {
        "type": "integer"
      },
      "BarcodeMatchType": {
        "type": "integer"
      },
      "BarcodeResponseDto": {
        "required": [
          "id",
          "barcode",
          "conversionId",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "barcode": {
            "type": "string"
          },
          "conversionId": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "BarcodeSearchResultDto": {
        "required": [
          "entityId",
          "productName",
          "variantSku",
          "productId",
          "variantId",
          "matchedCode",
          "matchType",
          "barcode"
        ],
        "type": "object",
        "properties": {
          "entityId": {
            "type": "string",
            "format": "uuid"
          },
          "productName": {
            "type": [
              "null",
              "string"
            ]
          },
          "variantSku": {
            "type": [
              "null",
              "string"
            ]
          },
          "productId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "matchedCode": {
            "type": "string"
          },
          "matchType": {
            "$ref": "#/components/schemas/BarcodeMatchType"
          },
          "barcode": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BarcodeResponseDto"
              }
            ]
          }
        }
      },
      "BrazilProductOrigin": {
        "type": "integer"
      },
      "CancelIntegratedLogisticsDemandRequest": {
        "required": [
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CancelOrderDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CarrierDetailResponseDto": {
        "required": [
          "id",
          "personId",
          "name",
          "tradeName",
          "personType",
          "document",
          "formattedDocument",
          "documentType",
          "documentLabel",
          "birthDate",
          "gender",
          "rgNumber",
          "rgIssuer",
          "rgIssueDate",
          "maritalStatus",
          "birthPlace",
          "carrierCode",
          "status",
          "priority",
          "rntrc",
          "isTacEquivalent",
          "addresses",
          "contacts",
          "fiscalRegistry",
          "secondaryActivities",
          "partners",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentLabel": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "carrierCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/CarrierStatus"
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rntrc": {
            "type": [
              "null",
              "string"
            ]
          },
          "isTacEquivalent": {
            "type": "boolean"
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressResponseDto"
            }
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactResponseDto"
            }
          },
          "fiscalRegistry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PersonFiscalRegistryDto"
              }
            ]
          },
          "secondaryActivities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CarrierResponseDto": {
        "required": [
          "id",
          "personId",
          "name",
          "tradeName",
          "personType",
          "document",
          "formattedDocument",
          "documentType",
          "documentLabel",
          "birthDate",
          "gender",
          "carrierCode",
          "status",
          "priority",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentLabel": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "carrierCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/CarrierStatus"
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CarrierStatus": {
        "type": "integer"
      },
      "ChangePasswordRequest": {
        "required": [
          "currentPassword",
          "newPassword"
        ],
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "description": "Senha atual (re-autenticação)"
          },
          "newPassword": {
            "type": "string",
            "description": "Nova senha (mínimo 8, maiúscula, minúscula e número)"
          }
        },
        "description": "Request para alteração de senha pelo usuário autenticado"
      },
      "ChangeUserRoleRequest": {
        "required": [
          "role"
        ],
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "Nova role do usuário (User, Manager, Admin)"
          }
        },
        "description": "Request para alterar a role de um usuário"
      },
      "CheckEmailRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email a ser verificado"
          }
        },
        "description": "Request para verificar disponibilidade de email"
      },
      "CheckEmailResponseDto": {
        "required": [
          "exists",
          "requiresRegistration",
          "requiresPassword"
        ],
        "type": "object",
        "properties": {
          "exists": {
            "type": "boolean"
          },
          "requiresRegistration": {
            "type": "boolean"
          },
          "requiresPassword": {
            "type": "boolean"
          }
        }
      },
      "CheckTenantNameRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome do tenant a verificar"
          }
        },
        "description": "Request para verificar disponibilidade do nome do tenant"
      },
      "CheckTenantNameResponseDto": {
        "required": [
          "exists"
        ],
        "type": "object",
        "properties": {
          "exists": {
            "type": "boolean"
          }
        }
      },
      "CityCodeSystem": {
        "type": "integer"
      },
      "CityResponseDto": {
        "required": [
          "id",
          "countryId",
          "stateCode",
          "name",
          "code",
          "codeSystem",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "countryId": {
            "type": "string"
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "codeSystem": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "ClassificationResponseDto": {
        "required": [
          "personId",
          "classificationType",
          "isActive",
          "assignedAt",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "classificationType": {
            "$ref": "#/components/schemas/ParticipantRole"
          },
          "isActive": {
            "type": "boolean"
          },
          "assignedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CompanySize": {
        "type": "integer"
      },
      "ConfirmEmailRequest": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Token de confirmação recebido por e-mail"
          }
        },
        "description": "SH-B15: request para confirmar o e-mail (double opt-in)"
      },
      "ConnectionStatus": {
        "enum": [
          "Pending",
          "Active",
          "Inactive",
          "TokenExpired",
          "Error"
        ]
      },
      "ContactResponseDto": {
        "required": [
          "id",
          "personId",
          "type",
          "value",
          "label",
          "isPrimary",
          "isVerified",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "$ref": "#/components/schemas/ContactType"
          },
          "value": {
            "type": "string"
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPrimary": {
            "type": "boolean"
          },
          "isVerified": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ContactType": {
        "type": "integer"
      },
      "CountryResponseDto": {
        "required": [
          "id",
          "name",
          "phoneCode",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phoneCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "CreateAddressDto": {
        "required": [
          "label",
          "type",
          "street",
          "number",
          "complement",
          "neighborhood",
          "cityName",
          "cityCode",
          "cityCodeSystem",
          "stateCode",
          "countryId",
          "postalCode"
        ],
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/AddressType"
          },
          "street": {
            "type": "string"
          },
          "number": {
            "type": [
              "null",
              "string"
            ]
          },
          "complement": {
            "type": [
              "null",
              "string"
            ]
          },
          "neighborhood": {
            "type": [
              "null",
              "string"
            ]
          },
          "cityName": {
            "type": "string"
          },
          "cityCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "cityCodeSystem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CityCodeSystem"
              }
            ]
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryId": {
            "type": "string"
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "reference": {
            "type": [
              "null",
              "string"
            ]
          },
          "poBox": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPrimary": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CreateApiKeyRequest": {
        "required": [
          "name",
          "role"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome da API key (para identificação)"
          },
          "role": {
            "type": "string",
            "description": "Role da API key (User, Manager, Admin)"
          },
          "expiresInDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Dias até expiração (1-365)",
            "format": "int32",
            "default": 90
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Descrição opcional"
          },
          "scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "SH-B13: escopos de endpoint opcionais. Vazio/null = sem restrição (a key funciona em qualquer\nendpoint que a role permita). Cada entrada é `\"*\"`, `\"METODO:/prefixo\"`\n(ex.: `GET:/api/v1/products`) ou `\"/prefixo\"` (qualquer método)."
          },
          "allowedIps": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "SH-B13: allowlist de IP opcional. Vazio/null = sem restrição. Cada entrada é um IP único\n(ex.: `203.0.113.5`) ou um range CIDR (ex.: `203.0.113.0/24`)."
          }
        },
        "description": "Request para criar uma API key"
      },
      "CreateBarcodeConversionRequest": {
        "required": [
          "sourceUnitOfMeasureId",
          "targetUnitOfMeasureId",
          "conversionType",
          "factor"
        ],
        "type": "object",
        "properties": {
          "sourceUnitOfMeasureId": {
            "type": "string",
            "description": "Unidade de medida de origem",
            "format": "uuid"
          },
          "targetUnitOfMeasureId": {
            "type": "string",
            "description": "Unidade de medida de destino",
            "format": "uuid"
          },
          "conversionType": {
            "description": "Tipo de conversão (multiplicação/divisão)",
            "$ref": "#/components/schemas/BarcodeConversionType"
          },
          "factor": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Fator de conversão (maior que zero)",
            "format": "double"
          }
        },
        "description": "Request para criar uma conversão de código de barras comercial."
      },
      "CreateBarcodeDto": {
        "required": [
          "barcode",
          "conversionId"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": "string"
          },
          "conversionId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "CreateCarrierDto": {
        "required": [
          "name",
          "personType"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "carrierCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "rntrc": {
            "type": [
              "null",
              "string"
            ]
          },
          "isTacEquivalent": {
            "type": "boolean",
            "default": false
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "secondaryActivities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          }
        }
      },
      "CreateContactDto": {
        "required": [
          "type",
          "value",
          "label"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ContactType"
          },
          "value": {
            "type": "string"
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPrimary": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CreateCustomerDto": {
        "required": [
          "name",
          "personType"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "customerCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "creditLimit": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isExemptFromTax": {
            "type": "boolean",
            "default": false
          },
          "taxExemptionReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "municipalRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "stateRegistrationIndicator": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StateRegistrationIndicator"
              }
            ]
          },
          "taxRegime": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TaxRegime"
              }
            ]
          },
          "isEndConsumer": {
            "type": "boolean",
            "default": false
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "type": [
              "null",
              "string"
            ]
          },
          "recipientType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecipientType"
              }
            ]
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "secondaryActivities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          }
        }
      },
      "CreateEmployeeDto": {
        "required": [
          "name",
          "personType"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "employeeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "hireDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "terminationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "jobTitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "salary": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "pisPasep": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentDay": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "secondaryActivities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          }
        }
      },
      "CreateInvitationRequest": {
        "required": [
          "email",
          "role"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email do usuário a ser convidado"
          },
          "role": {
            "type": "string",
            "description": "Role que o usuário terá no tenant (User, Manager, Admin)"
          }
        },
        "description": "Request para criar um novo convite"
      },
      "CreateListingDto": {
        "required": [
          "marketplaceConnectionId",
          "productId"
        ],
        "type": "object",
        "properties": {
          "marketplaceConnectionId": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productVariantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "marketplaceData": {
            "type": [
              "null",
              "string"
            ]
          },
          "listingType": {
            "type": [
              "null",
              "string"
            ]
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionalPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionStart": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "promotionEnd": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CreateListingItemDto": {
        "required": [
          "productId",
          "marketplace"
        ],
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "listingType": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "variations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ListingItemVariationInputDto"
            }
          }
        }
      },
      "CreateLoadOrderRequest": {
        "required": [
          "stockLocationId",
          "demandIds"
        ],
        "type": "object",
        "properties": {
          "stockLocationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "demandIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": [
                "null",
                "string"
              ],
              "format": "uuid"
            }
          }
        }
      },
      "CreateLogisticsSetupVehicleRequest": {
        "required": [
          "workspaceRef",
          "stockLocationId",
          "plate",
          "description",
          "weightCapacity",
          "volumeCapacity"
        ],
        "type": "object",
        "properties": {
          "workspaceRef": {
            "type": "string"
          },
          "stockLocationId": {
            "type": "string",
            "format": "uuid"
          },
          "plate": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "weightCapacity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "volumeCapacity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "CreateMarketplaceConnectionDto": {
        "required": [
          "marketplaceType",
          "connectionName",
          "shopId"
        ],
        "type": "object",
        "properties": {
          "marketplaceType": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "connectionName": {
            "type": "string"
          },
          "shopId": {
            "type": [
              "null",
              "string"
            ]
          },
          "priceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "promotionalPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "defaultCustomerId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "listingTypes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/MarketplaceConnectionListingTypeDto"
            }
          }
        }
      },
      "CreateOrderDto": {
        "required": [
          "customerId",
          "items"
        ],
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateOrderItemDto"
            }
          },
          "shippingAddressId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double",
            "default": 0
          }
        }
      },
      "CreateOrderItemDto": {
        "required": [
          "productId"
        ],
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productVariantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 1
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double",
            "default": 0
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreatePriceTableRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome da tabela"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Descrição opcional"
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Data de início de validade",
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Data de expiração",
            "format": "date-time"
          },
          "basePriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID da tabela base para ajuste percentual",
            "format": "uuid"
          },
          "adjustmentPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Percentual de ajuste (positivo=acréscimo, negativo=desconto)",
            "format": "double"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Se é a tabela padrão",
            "default": false
          },
          "isActive": {
            "type": "boolean",
            "description": "Se está ativa",
            "default": true
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Ordem de exibição",
            "format": "int32",
            "default": 0
          }
        },
        "description": "Request para criar uma tabela de preços"
      },
      "CreateProductBrandRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome da marca"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Descrição opcional"
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "URL do logo"
          },
          "website": {
            "type": [
              "null",
              "string"
            ],
            "description": "Website da marca"
          },
          "isActive": {
            "type": "boolean",
            "description": "Se a marca está ativa",
            "default": true
          }
        },
        "description": "Request para criar uma marca de produto"
      },
      "CreateProductCategoryRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome da categoria"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Descrição da categoria (opcional)"
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID da categoria pai (null para categoria raiz)",
            "format": "uuid"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Ordem de exibição (padrão: 0)",
            "format": "int32",
            "default": 0
          }
        },
        "description": "Request para criar uma nova categoria de produto"
      },
      "CreateProductDto": {
        "required": [
          "name",
          "unitOfMeasureId"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "unitOfMeasureId": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "descriptionPlainText": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean",
            "default": true
          },
          "hasVariations": {
            "type": "boolean",
            "default": false
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "productModelId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ncm": {
            "type": [
              "null",
              "string"
            ]
          },
          "origin": {
            "$ref": "#/components/schemas/BrazilProductOrigin"
          },
          "brandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "categoryIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "variationTypeIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "barcodes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateBarcodeDto"
            }
          },
          "variants": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateProductVariantDto"
            }
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProductGender"
              }
            ]
          },
          "warranty": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "anatelCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "anvisaCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "inmetroCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "mapaCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "customFields": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductCustomFieldDto"
            }
          }
        }
      },
      "CreateProductModelRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome do modelo"
          },
          "isActive": {
            "type": "boolean",
            "description": "Se o modelo está ativo",
            "default": true
          }
        },
        "description": "Request para criar um modelo de produto"
      },
      "CreateProductVariantDto": {
        "required": [
          "sku"
        ],
        "type": "object",
        "properties": {
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "costPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "netCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "supplierCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "averageCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isActive": {
            "type": "boolean",
            "default": true
          },
          "variationTypeValueIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "barcodes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateBarcodeDto"
            }
          }
        }
      },
      "CreateStockLocationRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome do local"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Descrição opcional"
          },
          "address": {
            "type": [
              "null",
              "string"
            ],
            "description": "Endereço opcional"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Se é o local padrão",
            "default": false
          },
          "isActive": {
            "type": "boolean",
            "description": "Se está ativo",
            "default": true
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Ordem de exibição",
            "format": "int32",
            "default": 0
          }
        },
        "description": "Request para criar um local de estoque"
      },
      "CreateSupplierDto": {
        "required": [
          "name",
          "personType"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "supplierCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "leadTimeDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "paymentTerms": {
            "type": [
              "null",
              "string"
            ]
          },
          "activitySector": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRuralProducer": {
            "type": "boolean",
            "default": false
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "secondaryActivities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          }
        }
      },
      "CreateTenantFromRegistrationRequest": {
        "required": [
          "companyName"
        ],
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string",
            "description": "Nome da empresa/organização"
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email de contato do tenant (opcional)"
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ],
            "description": "Telefone de contato do tenant (opcional)"
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ],
            "description": "CNPJ da empresa (opcional; validado quando presente)"
          }
        },
        "description": "Request para criar um novo tenant"
      },
      "CreateTenantRequest": {
        "required": [
          "name",
          "contactEmail"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome da empresa/organização"
          },
          "contactEmail": {
            "type": "string",
            "description": "Email de contato do tenant"
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ],
            "description": "Telefone de contato (opcional)"
          }
        },
        "description": "Request para criar um novo tenant"
      },
      "CreateTenantResponseDto": {
        "required": [
          "token",
          "user",
          "tenant"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserResponseDto"
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponseDto"
          }
        }
      },
      "CreateUserRequest": {
        "required": [
          "name",
          "email",
          "password"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome completo do usuário"
          },
          "email": {
            "type": "string",
            "description": "Email do usuário (deve ser único)"
          },
          "password": {
            "type": "string",
            "description": "Senha (mínimo 8 caracteres, deve conter maiúscula, minúscula, número e caractere especial)"
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "URL do avatar do usuário (opcional)"
          }
        },
        "description": "Request para criar um novo usuário"
      },
      "CreateVariationTypeRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 0
          },
          "isActive": {
            "type": "boolean",
            "default": true
          },
          "values": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CreateVariationTypeValueRequest"
            }
          }
        }
      },
      "CreateVariationTypeValueRequest": {
        "required": [
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 0
          },
          "isActive": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "CreateWorkspaceDto": {
        "required": [
          "name",
          "tradeName",
          "cnpj",
          "contactEmail",
          "contactPhone"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CustomerDetailResponseDto": {
        "required": [
          "id",
          "personId",
          "name",
          "tradeName",
          "personType",
          "document",
          "formattedDocument",
          "documentType",
          "documentLabel",
          "birthDate",
          "gender",
          "rgNumber",
          "rgIssuer",
          "rgIssueDate",
          "maritalStatus",
          "birthPlace",
          "department",
          "customerCode",
          "status",
          "creditLimit",
          "isExemptFromTax",
          "taxExemptionReason",
          "stateRegistration",
          "municipalRegistration",
          "stateRegistrationIndicator",
          "taxRegime",
          "isEndConsumer",
          "recipientType",
          "defaultPriceTableId",
          "defaultPriceTableName",
          "totalPurchases",
          "firstPurchaseDate",
          "lastPurchaseDate",
          "registeredAt",
          "addresses",
          "contacts",
          "fiscalRegistry",
          "secondaryActivities",
          "partners",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentLabel": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/CustomerStatus"
          },
          "creditLimit": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isExemptFromTax": {
            "type": "boolean"
          },
          "taxExemptionReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "municipalRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateRegistrationIndicator": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StateRegistrationIndicator"
              }
            ]
          },
          "taxRegime": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TaxRegime"
              }
            ]
          },
          "isEndConsumer": {
            "type": "boolean"
          },
          "recipientType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecipientType"
              }
            ]
          },
          "defaultPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "defaultPriceTableName": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalPurchases": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "firstPurchaseDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastPurchaseDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registeredAt": {
            "type": "string",
            "format": "date-time"
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressResponseDto"
            }
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactResponseDto"
            }
          },
          "fiscalRegistry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PersonFiscalRegistryDto"
              }
            ]
          },
          "secondaryActivities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CustomerResponseDto": {
        "required": [
          "id",
          "personId",
          "name",
          "tradeName",
          "personType",
          "document",
          "formattedDocument",
          "documentType",
          "documentLabel",
          "birthDate",
          "gender",
          "rgNumber",
          "rgIssuer",
          "rgIssueDate",
          "maritalStatus",
          "birthPlace",
          "department",
          "customerCode",
          "status",
          "creditLimit",
          "isExemptFromTax",
          "taxExemptionReason",
          "stateRegistration",
          "municipalRegistration",
          "stateRegistrationIndicator",
          "taxRegime",
          "isEndConsumer",
          "recipientType",
          "defaultPriceTableId",
          "defaultPriceTableName",
          "totalPurchases",
          "firstPurchaseDate",
          "lastPurchaseDate",
          "registeredAt",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentLabel": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/CustomerStatus"
          },
          "creditLimit": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isExemptFromTax": {
            "type": "boolean"
          },
          "taxExemptionReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "municipalRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateRegistrationIndicator": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StateRegistrationIndicator"
              }
            ]
          },
          "taxRegime": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TaxRegime"
              }
            ]
          },
          "isEndConsumer": {
            "type": "boolean"
          },
          "recipientType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecipientType"
              }
            ]
          },
          "defaultPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "defaultPriceTableName": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalPurchases": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "firstPurchaseDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastPurchaseDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registeredAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CustomerStatus": {
        "type": "integer"
      },
      "CustomerSummaryDto": {
        "type": "object",
        "properties": {
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "active": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "suspended": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "blocked": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "DashboardSummaryDto": {
        "required": [
          "products",
          "customers",
          "orders",
          "revenue",
          "recentOrders",
          "topSellingProducts",
          "ordersOverTime"
        ],
        "type": "object",
        "properties": {
          "products": {
            "$ref": "#/components/schemas/ProductSummaryDto"
          },
          "customers": {
            "$ref": "#/components/schemas/CustomerSummaryDto"
          },
          "orders": {
            "$ref": "#/components/schemas/OrderSummaryDto"
          },
          "revenue": {
            "$ref": "#/components/schemas/RevenueSummaryDto"
          },
          "recentOrders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecentOrderDto"
            }
          },
          "topSellingProducts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TopProductDto"
            }
          },
          "ordersOverTime": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrdersPerPeriodDto"
            }
          }
        }
      },
      "DeleteFilesResult": {
        "required": [
          "deletedCount"
        ],
        "type": "object",
        "properties": {
          "deletedCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Quantidade de arquivos excluídos",
            "format": "int32"
          }
        },
        "description": "Resultado de operação de exclusão de arquivos"
      },
      "DeleteLogisticsSetupVehicleRequest": {
        "required": [
          "workspaceRef",
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "workspaceRef": {
            "type": "string"
          },
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "DocumentActivityDto": {
        "required": [
          "code",
          "description"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DocumentAddressDto": {
        "required": [
          "street",
          "number",
          "complement",
          "postalCode",
          "neighborhood",
          "city",
          "state",
          "ibgeCode"
        ],
        "type": "object",
        "properties": {
          "street": {
            "type": [
              "null",
              "string"
            ]
          },
          "number": {
            "type": [
              "null",
              "string"
            ]
          },
          "complement": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "neighborhood": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "ibgeCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DocumentLookupProviderInfoDto": {
        "required": [
          "providerType",
          "order",
          "enabled",
          "requiresToken",
          "hasCredential"
        ],
        "type": "object",
        "properties": {
          "providerType": {
            "type": "string"
          },
          "order": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "enabled": {
            "type": "boolean"
          },
          "requiresToken": {
            "type": "boolean"
          },
          "hasCredential": {
            "type": "boolean"
          }
        }
      },
      "DocumentLookupSettingsDto": {
        "required": [
          "countryId",
          "enabled",
          "cacheTtlDaysOverride",
          "providers"
        ],
        "type": "object",
        "properties": {
          "countryId": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "cacheTtlDaysOverride": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentLookupProviderInfoDto"
            }
          }
        }
      },
      "DocumentPartnerDto": {
        "required": [
          "name",
          "qualification",
          "representativeName",
          "representativeQualification"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "qualification": {
            "type": [
              "null",
              "string"
            ]
          },
          "representativeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "representativeQualification": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DocumentRegistryResponseDto": {
        "required": [
          "countryId",
          "document",
          "legalName",
          "tradeName",
          "openingDate",
          "legalNature",
          "companySize",
          "shareCapital",
          "establishmentType",
          "registrationStatus",
          "registrationStatusDate",
          "registrationStatusReason",
          "specialStatus",
          "specialStatusDate",
          "primaryCnaeCode",
          "primaryCnaeDescription",
          "secondaryActivities",
          "partners",
          "address",
          "email",
          "phone",
          "stateRegistration",
          "optingForSimples",
          "simplesOptInDate",
          "simplesOptOutDate",
          "optingForMei",
          "meiOptInDate",
          "meiOptOutDate",
          "extras",
          "fetchedAt",
          "fromCache"
        ],
        "type": "object",
        "properties": {
          "countryId": {
            "type": "string"
          },
          "document": {
            "type": "string"
          },
          "legalName": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "secondaryActivities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentActivityDto"
            }
          },
          "partners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentPartnerDto"
            }
          },
          "address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DocumentAddressDto"
              }
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "extras": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "fetchedAt": {
            "type": "string",
            "format": "date-time"
          },
          "fromCache": {
            "type": "boolean"
          }
        }
      },
      "DomainType": {
        "type": "integer"
      },
      "EmailConfirmationResponseDto": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "EmailTemplateDetailResponse": {
        "required": [
          "emailType",
          "emailTypeName",
          "locale",
          "subject",
          "mjmlSource",
          "isActive",
          "updatedAt",
          "isOverride"
        ],
        "type": "object",
        "properties": {
          "emailType": {
            "description": "Tipo do e-mail (valor numérico do enum).",
            "$ref": "#/components/schemas/EmailType"
          },
          "emailTypeName": {
            "type": "string",
            "description": "Tipo do e-mail por extenso."
          },
          "locale": {
            "type": "string",
            "description": "Locale consultado."
          },
          "subject": {
            "type": "string",
            "description": "Assunto (pode conter merge-tags)."
          },
          "mjmlSource": {
            "type": "string",
            "description": "Fonte MJML do corpo."
          },
          "isActive": {
            "type": "boolean",
            "description": "Se o OVERRIDE está ativo (sempre `false` quando bool EmailTemplateDetailResponse.IsOverride é falso)."
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Última atualização do override (UTC), se houver.",
            "format": "date-time"
          },
          "isOverride": {
            "type": "boolean",
            "description": "`true` quando o conteúdo é o override do tenant; `false` quando é o default global (base de edição)."
          }
        },
        "description": "Detalhe de um template — override do tenant OU o default global como base de edição."
      },
      "EmailTemplateListItemResponse": {
        "required": [
          "emailType",
          "emailTypeName",
          "locale",
          "hasOverride",
          "isActive",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "emailType": {
            "description": "Tipo do e-mail (valor numérico do enum, contrato estável).",
            "$ref": "#/components/schemas/EmailType"
          },
          "emailTypeName": {
            "type": "string",
            "description": "Tipo do e-mail por extenso (ex.: \"Invitation\")."
          },
          "locale": {
            "type": "string",
            "description": "Locale do override existente, ou o locale-base quando não há override."
          },
          "hasOverride": {
            "type": "boolean",
            "description": "Se o tenant tem um override (ativo ou não) para este tipo."
          },
          "isActive": {
            "type": "boolean",
            "description": "Se o override está ativo (irrelevante quando bool EmailTemplateListItemResponse.HasOverride é falso)."
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Última atualização do override (UTC), se houver.",
            "format": "date-time"
          }
        },
        "description": "Item da listagem de tipos customizáveis + status do override do tenant corrente."
      },
      "EmailTemplatePreviewResponse": {
        "required": [
          "subject",
          "html"
        ],
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "description": "Assunto final (merge-tags de exemplo substituídas)."
          },
          "html": {
            "type": "string",
            "description": "Corpo HTML final (MJML compilado)."
          }
        },
        "description": "Resultado do preview: assunto + HTML renderizados com valores de exemplo."
      },
      "EmailType": {
        "type": "integer"
      },
      "EmployeeDetailResponseDto": {
        "required": [
          "id",
          "personId",
          "name",
          "tradeName",
          "personType",
          "document",
          "formattedDocument",
          "documentType",
          "documentLabel",
          "birthDate",
          "gender",
          "rgNumber",
          "rgIssuer",
          "rgIssueDate",
          "maritalStatus",
          "birthPlace",
          "employeeCode",
          "status",
          "hireDate",
          "terminationDate",
          "jobTitle",
          "salary",
          "hourlyRate",
          "hourlyCost",
          "pisPasep",
          "paymentDay",
          "addresses",
          "contacts",
          "fiscalRegistry",
          "secondaryActivities",
          "partners",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentLabel": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "employeeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/EmployeeStatus"
          },
          "hireDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "terminationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "jobTitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "salary": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "pisPasep": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentDay": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressResponseDto"
            }
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactResponseDto"
            }
          },
          "fiscalRegistry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PersonFiscalRegistryDto"
              }
            ]
          },
          "secondaryActivities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "EmployeeResponseDto": {
        "required": [
          "id",
          "personId",
          "name",
          "tradeName",
          "personType",
          "document",
          "formattedDocument",
          "documentType",
          "documentLabel",
          "birthDate",
          "gender",
          "employeeCode",
          "status",
          "hireDate",
          "terminationDate",
          "jobTitle",
          "salary",
          "hourlyRate",
          "hourlyCost",
          "pisPasep",
          "paymentDay",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentLabel": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "employeeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/EmployeeStatus"
          },
          "hireDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "terminationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "jobTitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "salary": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "pisPasep": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentDay": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "EmployeeStatus": {
        "type": "integer"
      },
      "EnableFractionalSyncResultDto": {
        "required": [
          "enabled",
          "conditions"
        ],
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FractionalGateConditionDto"
            }
          }
        }
      },
      "EntityTagHeaderValue": {
        "type": "object",
        "properties": {
          "tag": {
            "$ref": "#/components/schemas/StringSegment"
          },
          "isWeak": {
            "type": "boolean"
          }
        }
      },
      "ErpSemaphoreDto": {
        "required": [
          "status",
          "ageSeconds",
          "maxSilenceSeconds",
          "policy"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "ageSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxSilenceSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "policy": {
            "type": "string"
          }
        }
      },
      "EstablishmentType": {
        "type": "integer"
      },
      "EvidenceCommitRequest": {
        "required": [
          "commandId",
          "sha256"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "sha256": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "EvidencePackageCoverageEntry": {
        "required": [
          "piece",
          "present",
          "sourceCount",
          "sources"
        ],
        "type": "object",
        "properties": {
          "piece": {
            "type": "string"
          },
          "present": {
            "type": "boolean"
          },
          "sourceCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "EvidencePackageExportResponse": {
        "required": [
          "format",
          "formatVersion",
          "packageId",
          "loadOrderId",
          "routeStopId",
          "executionRevision",
          "validationCode",
          "qrPayload",
          "verification",
          "manifest"
        ],
        "type": "object",
        "properties": {
          "format": {
            "type": "string"
          },
          "formatVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "packageId": {
            "type": "string",
            "format": "uuid"
          },
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "routeStopId": {
            "type": "string",
            "format": "uuid"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "validationCode": {
            "type": "string"
          },
          "qrPayload": {
            "type": "string"
          },
          "verification": {
            "$ref": "#/components/schemas/EvidencePackageVerificationResponse"
          },
          "manifest": {
            "type": "string"
          }
        }
      },
      "EvidencePackageListResponse": {
        "required": [
          "loadOrderId",
          "items"
        ],
        "type": "object",
        "properties": {
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvidencePackageSummaryResponse"
            }
          }
        }
      },
      "EvidencePackageSummaryResponse": {
        "required": [
          "id",
          "loadOrderId",
          "routeStopId",
          "executionRevision",
          "contentHash",
          "validationCode",
          "qrPayload",
          "sealedAt",
          "sealedByUserId",
          "signatureAlgorithm",
          "certificateSubject",
          "certificateThumbprint",
          "certificateNotAfter",
          "level1Complete",
          "level1Coverage"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "routeStopId": {
            "type": "string",
            "format": "uuid"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "contentHash": {
            "type": "string"
          },
          "validationCode": {
            "type": "string"
          },
          "qrPayload": {
            "type": "string"
          },
          "sealedAt": {
            "type": "string",
            "format": "date-time"
          },
          "sealedByUserId": {
            "type": "string",
            "format": "uuid"
          },
          "signatureAlgorithm": {
            "type": "string"
          },
          "certificateSubject": {
            "type": "string"
          },
          "certificateThumbprint": {
            "type": "string"
          },
          "certificateNotAfter": {
            "type": "string",
            "format": "date-time"
          },
          "level1Complete": {
            "type": "boolean"
          },
          "level1Coverage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvidencePackageCoverageEntry"
            }
          }
        }
      },
      "EvidencePackageVerificationResponse": {
        "required": [
          "contentHashAlgorithm",
          "contentHash",
          "signatureAlgorithm",
          "signature",
          "certificate",
          "certificateThumbprint",
          "certificateSubject",
          "certificateSerialNumber",
          "certificateNotBefore",
          "certificateNotAfter",
          "sealedAt",
          "timeSource",
          "qualifiedTimestamp",
          "timeStatement",
          "instructions"
        ],
        "type": "object",
        "properties": {
          "contentHashAlgorithm": {
            "type": "string"
          },
          "contentHash": {
            "type": "string"
          },
          "signatureAlgorithm": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "certificate": {
            "type": "string"
          },
          "certificateThumbprint": {
            "type": "string"
          },
          "certificateSubject": {
            "type": "string"
          },
          "certificateSerialNumber": {
            "type": "string"
          },
          "certificateNotBefore": {
            "type": "string",
            "format": "date-time"
          },
          "certificateNotAfter": {
            "type": "string",
            "format": "date-time"
          },
          "sealedAt": {
            "type": "string",
            "format": "date-time"
          },
          "timeSource": {
            "type": "string"
          },
          "qualifiedTimestamp": {
            "type": "boolean"
          },
          "timeStatement": {
            "type": "string"
          },
          "instructions": {
            "type": "string"
          }
        }
      },
      "EvidenceSignerRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "role": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "EvidenceUploadAuthorizationResponse": {
        "required": [
          "method",
          "url",
          "expiresAt",
          "requiredHeaders"
        ],
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "requiredHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "EvidenceUploadIntentRequest": {
        "required": [
          "commandId",
          "evidenceId",
          "type",
          "stopItemId",
          "fileName",
          "contentType",
          "sizeBytes",
          "sha256",
          "capturedAt"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "evidenceId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "type": {
            "enum": [
              "DRAWN_SIGNATURE",
              "SIGNED_PROOF_PHOTO",
              "ITEM_PHOTO",
              "DAMAGE_PHOTO",
              "DIVERGENCE_PHOTO",
              "LOAD_PHOTO"
            ],
            "type": "string"
          },
          "stopItemId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "fileName": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          },
          "contentType": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "sizeBytes": {
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": "integer",
            "format": "int64"
          },
          "sha256": {
            "maxLength": 64,
            "pattern": "^[a-f0-9]{64}$",
            "type": "string"
          },
          "capturedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "signer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EvidenceSignerRequest"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "EvidenceUploadIntentResponse": {
        "required": [
          "evidenceId",
          "storedFileId",
          "status",
          "upload"
        ],
        "type": "object",
        "properties": {
          "evidenceId": {
            "type": "string",
            "format": "uuid"
          },
          "storedFileId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "upload": {
            "$ref": "#/components/schemas/EvidenceUploadAuthorizationResponse"
          }
        }
      },
      "ExtendLegalHoldRequest": {
        "required": [
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "decisionReference": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "FieldMetadataFormDto": {
        "required": [
          "formKey",
          "roles"
        ],
        "type": "object",
        "properties": {
          "formKey": {
            "type": "string"
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/components/schemas/FieldMetadataItemDto"
              }
            }
          }
        }
      },
      "FieldMetadataItemDto": {
        "required": [
          "hidden",
          "required"
        ],
        "type": "object",
        "properties": {
          "hidden": {
            "type": "boolean"
          },
          "required": {
            "type": "boolean"
          }
        }
      },
      "FileContentResult": {
        "type": "object",
        "properties": {
          "fileContents": {
            "type": "string",
            "format": "byte"
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          }
        }
      },
      "FileResult": {
        "type": "object",
        "properties": {
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          }
        }
      },
      "FileStreamResult": {
        "type": "object",
        "properties": {
          "fileStream": {
            "$ref": "#/components/schemas/Stream"
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          }
        }
      },
      "FileVariationType": {
        "type": "integer"
      },
      "ForgotPasswordRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email do usuário que esqueceu a senha"
          },
          "turnstileToken": {
            "type": [
              "null",
              "string"
            ],
            "description": "SH-B16: Cloudflare Turnstile widget token. Required when the gate is enabled."
          }
        },
        "description": "Request para solicitar redefinição de senha"
      },
      "FractionalGateConditionDto": {
        "required": [
          "code",
          "passed",
          "description"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "passed": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "GameScoreSubmissionResponseDto": {
        "required": [
          "id",
          "gamertag",
          "score",
          "mode",
          "rank",
          "isPersonalBest",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "gamertag": {
            "type": "string"
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "mode": {
            "type": "string"
          },
          "rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isPersonalBest": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "Gender": {
        "type": "integer"
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "IntegratedLogisticsDemandDetailsResponse": {
        "required": [
          "id",
          "type",
          "source",
          "businessCorrelationKey",
          "logisticsCycle",
          "status",
          "version",
          "origin",
          "destination",
          "items",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "businessCorrelationKey": {
            "type": "string"
          },
          "logisticsCycle": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "origin": {
            "$ref": "#/components/schemas/IntegrationDemandOriginResponse"
          },
          "destination": {
            "$ref": "#/components/schemas/IntegrationDemandDestinationResponse"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationDemandItemResponse"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IntegrationDemandDestinationRequest": {
        "required": [
          "recipientName",
          "contactPhone",
          "addressLine1",
          "addressLine2",
          "district",
          "city",
          "state",
          "postalCode",
          "country",
          "latitude",
          "longitude"
        ],
        "type": "object",
        "properties": {
          "recipientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "addressLine1": {
            "type": [
              "null",
              "string"
            ]
          },
          "addressLine2": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "country": {
            "type": [
              "null",
              "string"
            ]
          },
          "latitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "longitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "IntegrationDemandDestinationResponse": {
        "required": [
          "recipientName",
          "contactPhone",
          "addressLine1",
          "addressLine2",
          "district",
          "city",
          "state",
          "postalCode",
          "country",
          "latitude",
          "longitude"
        ],
        "type": "object",
        "properties": {
          "recipientName": {
            "type": "string"
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "addressLine1": {
            "type": "string"
          },
          "addressLine2": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "latitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "longitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "IntegrationDemandItemRequest": {
        "required": [
          "sourceItemId",
          "productId",
          "sku",
          "barcode",
          "description",
          "unit",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "sourceItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "productId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "IntegrationDemandItemResponse": {
        "required": [
          "sourceItemId",
          "productId",
          "sku",
          "barcode",
          "description",
          "unit",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "sourceItemId": {
            "type": "string"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": "string"
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "IntegrationDemandOriginRequest": {
        "required": [
          "documentId",
          "documentNumber",
          "series",
          "finalizedAt"
        ],
        "type": "object",
        "properties": {
          "documentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "series": {
            "type": [
              "null",
              "string"
            ]
          },
          "finalizedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "IntegrationDemandOriginResponse": {
        "required": [
          "documentId",
          "documentNumber",
          "series",
          "finalizedAt"
        ],
        "type": "object",
        "properties": {
          "documentId": {
            "type": "string"
          },
          "documentNumber": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "finalizedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IntegrationListingCreatedDto": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "IntegrationListingCreateDto": {
        "required": [
          "productId",
          "marketplace"
        ],
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "listingType": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "variations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IntegrationListingVariationInputDto"
            }
          }
        }
      },
      "IntegrationListingDto": {
        "required": [
          "id",
          "productId",
          "marketplace",
          "listingType",
          "title",
          "description",
          "syncStatus",
          "lastSyncedAt",
          "externalItemId",
          "createdAt",
          "updatedAt",
          "variations"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "listingType": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "syncStatus": {
            "$ref": "#/components/schemas/SyncStatus"
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "externalItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "variations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationListingVariationDto"
            }
          }
        }
      },
      "IntegrationListingReplaceDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "variations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IntegrationListingVariationInputDto"
            }
          }
        }
      },
      "IntegrationListingVariationDto": {
        "required": [
          "id",
          "variantId",
          "price",
          "promotionalPrice",
          "promotionStart",
          "promotionEnd",
          "priceSource",
          "syncStatus",
          "externalModelId",
          "lastSyncedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionalPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionStart": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "promotionEnd": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "priceSource": {
            "type": "string"
          },
          "syncStatus": {
            "$ref": "#/components/schemas/SyncStatus"
          },
          "externalModelId": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "IntegrationListingVariationInputDto": {
        "type": "object",
        "properties": {
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionalPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionStart": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "promotionEnd": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "IntegrationLogisticsDemandRequest": {
        "required": [
          "type",
          "source",
          "businessCorrelationKey",
          "logisticsCycle",
          "stockLocationId",
          "origin",
          "destination",
          "items"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "businessCorrelationKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "logisticsCycle": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stockLocationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "origin": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IntegrationDemandOriginRequest"
              }
            ]
          },
          "destination": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IntegrationDemandDestinationRequest"
              }
            ]
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IntegrationDemandItemRequest"
            }
          }
        }
      },
      "IntegrationLogisticsDemandResponse": {
        "required": [
          "id",
          "type",
          "source",
          "status",
          "version",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IntegrationMarketplaceCatalogDto": {
        "required": [
          "type",
          "name",
          "cnpj"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "name": {
            "type": "string"
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "IntegrationMarketplaceDto": {
        "required": [
          "marketplaceType",
          "connectionName",
          "shopId",
          "name",
          "cnpj"
        ],
        "type": "object",
        "properties": {
          "marketplaceType": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "connectionName": {
            "type": "string"
          },
          "shopId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "IntegrationProductBatchItemDto": {
        "required": [
          "index",
          "id",
          "variants",
          "success",
          "errorCode",
          "errors"
        ],
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "id": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationVariantRefDto"
            }
          },
          "success": {
            "type": "boolean"
          },
          "errorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IntegrationProductBatchResultDto": {
        "required": [
          "total",
          "created",
          "failed",
          "items"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "created": {
            "type": "integer",
            "format": "int32"
          },
          "failed": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationProductBatchItemDto"
            }
          }
        }
      },
      "IntegrationProductBrandDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "IntegrationProductBrandResultDto": {
        "required": [
          "id",
          "name",
          "description",
          "logoUrl",
          "website",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "IntegrationProductCategoryDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32",
            "default": 0
          }
        }
      },
      "IntegrationProductCategoryResultDto": {
        "required": [
          "id",
          "name",
          "description",
          "parentId",
          "sortOrder",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "IntegrationProductDetailDto": {
        "required": [
          "id",
          "name",
          "description",
          "isActive",
          "hasVariations",
          "width",
          "height",
          "length",
          "weight",
          "packagedWidth",
          "packagedHeight",
          "packagedLength",
          "packagedWeight",
          "productModelId",
          "ncm",
          "origin",
          "brandId",
          "unitOfMeasureId",
          "categoryIds",
          "variants",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "hasVariations": {
            "type": "boolean"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "productModelId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ncm": {
            "type": [
              "null",
              "string"
            ]
          },
          "origin": {
            "$ref": "#/components/schemas/BrazilProductOrigin"
          },
          "brandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "unitOfMeasureId": {
            "type": "string",
            "format": "uuid"
          },
          "categoryIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationVariantDetailDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "IntegrationProductDto": {
        "required": [
          "name",
          "origin",
          "brandId",
          "description",
          "width",
          "height",
          "length",
          "weight",
          "packagedWidth",
          "packagedHeight",
          "packagedLength",
          "packagedWeight",
          "productModelId",
          "ncm",
          "unitOfMeasure",
          "categories",
          "images",
          "variations"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "origin": {
            "$ref": "#/components/schemas/BrazilProductOrigin"
          },
          "brandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "productModelId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ncm": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitOfMeasure": {
            "type": [
              "null",
              "string"
            ]
          },
          "categories": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "images": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductImportImageDto"
            }
          },
          "variations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductImportVariationDto"
            }
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "gender": {
            "type": [
              "null",
              "string"
            ]
          },
          "warranty": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "anatelCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "anvisaCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "inmetroCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "mapaCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "customFields": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductImportCustomFieldDto"
            }
          }
        }
      },
      "IntegrationProductListItemDto": {
        "required": [
          "id",
          "name",
          "isActive",
          "hasVariations",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "hasVariations": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "IntegrationProductModelDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "IntegrationProductModelResultDto": {
        "required": [
          "id",
          "name",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "IntegrationProductUpdateDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "origin": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BrazilProductOrigin"
              }
            ]
          },
          "brandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "productModelId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ncm": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitOfMeasure": {
            "type": [
              "null",
              "string"
            ]
          },
          "categories": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "images": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductImportImageDto"
            }
          },
          "variations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IntegrationProductUpdateVariationDto"
            }
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "gender": {
            "type": [
              "null",
              "string"
            ]
          },
          "warranty": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "anatelCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "anvisaCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "inmetroCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "mapaCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "customFields": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductImportCustomFieldDto"
            }
          }
        }
      },
      "IntegrationProductUpdateVariationDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "active": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "stock": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "values": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductImportVariationValueDto"
            }
          },
          "netCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "supplierCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "averageCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "IntegrationProductWriteResultDto": {
        "required": [
          "id",
          "variants"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationVariantRefDto"
            }
          }
        }
      },
      "IntegrationStockLocationDto": {
        "required": [
          "id",
          "name",
          "isDefault"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          }
        }
      },
      "IntegrationStockPushDto": {
        "required": [
          "variantId",
          "stockLocationId",
          "quantity",
          "occurredAt"
        ],
        "type": "object",
        "properties": {
          "variantId": {
            "type": "string",
            "format": "uuid"
          },
          "stockLocationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IntegrationVariantDetailDto": {
        "required": [
          "id",
          "sku",
          "barcode",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "IntegrationVariantRefDto": {
        "required": [
          "id",
          "sku"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "InvitationDetailsResponseDto": {
        "required": [
          "requiresRegistration",
          "email",
          "role",
          "tenantName",
          "inviterName",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "requiresRegistration": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "tenantName": {
            "type": "string"
          },
          "inviterName": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InvitationLinkResponseDto": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          }
        }
      },
      "InvitationResponseDto": {
        "required": [
          "id",
          "email",
          "role",
          "status",
          "invitedAt",
          "expiresAt",
          "inviterName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "invitedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "inviterName": {
            "type": "string"
          },
          "tenantName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "JsonElement": { },
      "KardexEntryDto": {
        "required": [
          "id",
          "productId",
          "variantId",
          "stockLocationId",
          "delta",
          "quantityBefore",
          "quantityAfter",
          "versionAfter",
          "reasonCode",
          "originOrderId",
          "occurredAt",
          "recordedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "stockLocationId": {
            "type": "string",
            "format": "uuid"
          },
          "delta": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantityBefore": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantityAfter": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "versionAfter": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "reasonCode": {
            "type": "string"
          },
          "originOrderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LeaderboardEntryDto": {
        "required": [
          "rank",
          "gamertag",
          "score",
          "isCurrentUser"
        ],
        "type": "object",
        "properties": {
          "rank": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "gamertag": {
            "type": "string"
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isCurrentUser": {
            "type": "boolean"
          }
        }
      },
      "LeaderboardResponseDto": {
        "required": [
          "mode",
          "top",
          "entries",
          "currentUser"
        ],
        "type": "object",
        "properties": {
          "mode": {
            "type": "string"
          },
          "top": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeaderboardEntryDto"
            }
          },
          "currentUser": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeaderboardEntryDto"
              }
            ]
          }
        }
      },
      "LegalHoldResponse": {
        "required": [
          "id",
          "scope",
          "loadOrderId",
          "routeStopId",
          "reasonCode",
          "decisionReference",
          "placedAt",
          "expiresAt",
          "extensionCount",
          "lastExtendedAt",
          "releasedAt",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "scope": {
            "type": "string"
          },
          "loadOrderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "routeStopId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "reasonCode": {
            "type": "string"
          },
          "decisionReference": {
            "type": [
              "null",
              "string"
            ]
          },
          "placedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "extensionCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastExtendedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "releasedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "ListingItemResponseDto": {
        "required": [
          "id",
          "productId",
          "productName",
          "connectionId",
          "connectionName",
          "marketplace",
          "listingType",
          "title",
          "description",
          "syncStatus",
          "lastSyncedAt",
          "externalItemId",
          "createdAt",
          "updatedAt",
          "variations"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productName": {
            "type": "string"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "connectionName": {
            "type": "string"
          },
          "marketplace": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "listingType": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "syncStatus": {
            "$ref": "#/components/schemas/SyncStatus"
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "externalItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "variations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListingItemVariationResponseDto"
            }
          }
        }
      },
      "ListingItemVariationInputDto": {
        "type": "object",
        "properties": {
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionalPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionStart": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "promotionEnd": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ListingItemVariationResponseDto": {
        "required": [
          "id",
          "variantId",
          "variantLabel",
          "price",
          "promotionalPrice",
          "promotionStart",
          "promotionEnd",
          "priceSource",
          "syncStatus",
          "externalModelId",
          "lastSyncedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "variantLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionalPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionStart": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "promotionEnd": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "priceSource": {
            "type": "string"
          },
          "syncStatus": {
            "$ref": "#/components/schemas/SyncStatus"
          },
          "externalModelId": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ListingResponseDto": {
        "required": [
          "id",
          "marketplaceConnectionId",
          "marketplaceConnectionName",
          "productId",
          "productName",
          "productVariantId",
          "productVariantLabel",
          "externalItemId",
          "externalModelId",
          "syncStatus",
          "lastError",
          "lastSyncedAt",
          "marketplaceData",
          "createdAt",
          "updatedAt",
          "listingType",
          "price",
          "promotionalPrice",
          "promotionStart",
          "promotionEnd",
          "priceSource"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "marketplaceConnectionId": {
            "type": "string",
            "format": "uuid"
          },
          "marketplaceConnectionName": {
            "type": "string"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productName": {
            "type": "string"
          },
          "productVariantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "productVariantLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalItemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalModelId": {
            "type": [
              "null",
              "string"
            ]
          },
          "syncStatus": {
            "$ref": "#/components/schemas/SyncStatus"
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "marketplaceData": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "listingType": {
            "type": [
              "null",
              "string"
            ]
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionalPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionStart": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "promotionEnd": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "priceSource": {
            "type": "string"
          }
        }
      },
      "LoadCheckItemRequest": {
        "required": [
          "demandItemId",
          "quantityLoaded",
          "divergenceReason"
        ],
        "type": "object",
        "properties": {
          "demandItemId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "quantityLoaded": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "divergenceReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "divergenceReasonCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LoadChecksCommandRequest": {
        "required": [
          "commandId",
          "executionSessionId",
          "baseExecutionRevision",
          "clientSequence",
          "capturedAt",
          "payload"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "executionSessionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "baseExecutionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "clientSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "capturedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "payload": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LoadChecksPayloadRequest"
              }
            ]
          }
        }
      },
      "LoadChecksPayloadRequest": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LoadCheckItemRequest"
            }
          }
        }
      },
      "LoadOrderAssignmentResponse": {
        "required": [
          "loadOrderId",
          "status",
          "version"
        ],
        "type": "object",
        "properties": {
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LoadOrderClosureResponse": {
        "required": [
          "loadOrderId",
          "status",
          "version",
          "resultId",
          "closedAt",
          "externalErpDeliveryStatus"
        ],
        "type": "object",
        "properties": {
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "resultId": {
            "type": "string"
          },
          "closedAt": {
            "type": "string",
            "format": "date-time"
          },
          "externalErpDeliveryStatus": {
            "type": "string"
          }
        }
      },
      "LoadOrderCreationResponse": {
        "required": [
          "loadOrderId",
          "status",
          "version",
          "executionRevision"
        ],
        "type": "object",
        "properties": {
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LoadOrderStateResponse": {
        "required": [
          "loadOrderId",
          "status",
          "version",
          "executionRevision"
        ],
        "type": "object",
        "properties": {
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LoginRequest": {
        "required": [
          "email",
          "password"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email do usuário"
          },
          "password": {
            "type": "string",
            "description": "Senha do usuário"
          }
        },
        "description": "Request para autenticação de usuário",
        "example": {
          "email": "usuario@exemplo.com",
          "password": "SenhaSegura123!"
        }
      },
      "LoginResponseDto": {
        "required": [
          "token",
          "user",
          "tenant",
          "requiresTenantSelection"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": [
              "null",
              "string"
            ]
          },
          "user": {
            "$ref": "#/components/schemas/UserResponseDto"
          },
          "tenant": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TenantResponseDto"
              }
            ]
          },
          "requiresTenantSelection": {
            "type": "boolean"
          },
          "availableTenants": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TenantSelectionDto"
            }
          }
        }
      },
      "LogisticsCommandReceiptResponse": {
        "required": [
          "commandId",
          "status",
          "loadOrderId",
          "loadOrderStatus",
          "version",
          "executionRevision",
          "loadingStartedAt"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "loadOrderStatus": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "loadingStartedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "routeStopId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "routeStopStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "distanceFromTargetMeters": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "withinPolicy": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "requiresSupervisorReview": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "policyVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LogisticsOperationsSetupResponse": {
        "required": [
          "organization",
          "companies",
          "users"
        ],
        "type": "object",
        "properties": {
          "organization": {
            "$ref": "#/components/schemas/LogisticsSetupOrganizationResponse"
          },
          "companies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogisticsSetupCompanyResponse"
            }
          },
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogisticsSetupUserResponse"
            }
          }
        }
      },
      "LogisticsPendingCommandListItemResponse": {
        "required": [
          "scopeId",
          "deviceSessionId",
          "receivedAt",
          "receipt"
        ],
        "type": "object",
        "properties": {
          "scopeId": {
            "type": "string"
          },
          "deviceSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          },
          "receipt": {
            "$ref": "#/components/schemas/LogisticsCommandReceiptResponse"
          }
        }
      },
      "LogisticsPendingCommandPageResponse": {
        "required": [
          "items",
          "nextCursor",
          "pageSize"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogisticsPendingCommandListItemResponse"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LogisticsReopenRequest": {
        "required": [
          "reasonCode",
          "reason",
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "reasonCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LogisticsSetupCompanyResponse": {
        "required": [
          "workspaceRef",
          "name",
          "tradeName",
          "cnpj",
          "permissions",
          "locations",
          "vehicles"
        ],
        "type": "object",
        "properties": {
          "workspaceRef": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          },
          "permissions": {
            "$ref": "#/components/schemas/LogisticsSetupWorkspacePermissionsResponse"
          },
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogisticsSetupLocationResponse"
            }
          },
          "vehicles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogisticsSetupVehicleResponse"
            }
          }
        }
      },
      "LogisticsSetupLocationResponse": {
        "required": [
          "id",
          "name",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "LogisticsSetupMembershipResponse": {
        "required": [
          "workspaceRef",
          "role",
          "capabilities",
          "stockLocationIds"
        ],
        "type": "object",
        "properties": {
          "workspaceRef": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stockLocationIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "supervises": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "LogisticsSetupOrganizationResponse": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "LogisticsSetupUserResponse": {
        "required": [
          "id",
          "name",
          "email",
          "memberships",
          "version"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "memberships": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogisticsSetupMembershipResponse"
            }
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LogisticsSetupVehicleResponse": {
        "required": [
          "id",
          "stockLocationId",
          "plate",
          "description",
          "isActive",
          "version"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "stockLocationId": {
            "type": "string",
            "format": "uuid"
          },
          "plate": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "LogisticsSetupWorkspacePermissionsResponse": {
        "required": [
          "role",
          "canManageUserSetup",
          "canManageVehicles"
        ],
        "type": "object",
        "properties": {
          "role": {
            "type": "string"
          },
          "canManageUserSetup": {
            "type": "boolean"
          },
          "canManageVehicles": {
            "type": "boolean"
          },
          "canManageSupervision": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "MaritalStatus": {
        "type": "integer"
      },
      "MarketplaceCatalogResponseDto": {
        "required": [
          "type",
          "name",
          "cnpj",
          "supportedListingTypes"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "name": {
            "type": "string"
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          },
          "supportedListingTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MarketplaceCategoryAttributeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "valueType": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceCategoryAttributeValueDto"
            }
          },
          "allowedUnits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceCategoryAttributeUnitDto"
            }
          },
          "defaultUnit": {
            "type": [
              "null",
              "string"
            ]
          },
          "valueMaxLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "attributeGroupId": {
            "type": [
              "null",
              "string"
            ]
          },
          "attributeGroupName": {
            "type": [
              "null",
              "string"
            ]
          },
          "tooltip": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MarketplaceCategoryAttributeUnitDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "MarketplaceCategoryAttributeValueDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "MarketplaceCategoryDto": {
        "type": "object",
        "properties": {
          "externalCategoryId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "parentExternalCategoryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasChildren": {
            "type": "boolean"
          }
        }
      },
      "MarketplaceCategoryPredictionDto": {
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "string"
          },
          "categoryName": {
            "type": "string"
          },
          "domainId": {
            "type": [
              "null",
              "string"
            ]
          },
          "domainName": {
            "type": [
              "null",
              "string"
            ]
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceCategoryAttributeDto"
            }
          }
        }
      },
      "MarketplaceConnectionListingTypeDto": {
        "required": [
          "listingType",
          "priceTableId"
        ],
        "type": "object",
        "properties": {
          "listingType": {
            "type": [
              "null",
              "string"
            ]
          },
          "priceTableId": {
            "type": "string",
            "format": "uuid"
          },
          "promotionalPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "MarketplaceConnectionListingTypeResponseDto": {
        "required": [
          "listingType",
          "priceTableId",
          "priceTableName",
          "promotionalPriceTableId",
          "promotionalPriceTableName"
        ],
        "type": "object",
        "properties": {
          "listingType": {
            "type": [
              "null",
              "string"
            ]
          },
          "priceTableId": {
            "type": "string",
            "format": "uuid"
          },
          "priceTableName": {
            "type": [
              "null",
              "string"
            ]
          },
          "promotionalPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "promotionalPriceTableName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MarketplaceConnectionResponseDto": {
        "required": [
          "id",
          "marketplaceType",
          "connectionName",
          "shopId",
          "priceTableId",
          "priceTableName",
          "promotionalPriceTableId",
          "promotionalPriceTableName",
          "supportsPromotionalPrice",
          "status",
          "accessTokenExpiresAt",
          "lastSyncAt",
          "createdAt",
          "updatedAt",
          "defaultCustomerId",
          "supportedListingTypes",
          "listingTypes"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "marketplaceType": {
            "$ref": "#/components/schemas/MarketplaceType"
          },
          "connectionName": {
            "type": "string"
          },
          "shopId": {
            "type": "string"
          },
          "priceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priceTableName": {
            "type": [
              "null",
              "string"
            ]
          },
          "promotionalPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "promotionalPriceTableName": {
            "type": [
              "null",
              "string"
            ]
          },
          "supportsPromotionalPrice": {
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/ConnectionStatus"
          },
          "accessTokenExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastSyncAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "defaultCustomerId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "supportedListingTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "listingTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceConnectionListingTypeResponseDto"
            }
          }
        }
      },
      "MarketplaceOAuthCallbackDto": {
        "required": [
          "connectionId",
          "code"
        ],
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "shopId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MarketplaceOAuthUrlResponseDto": {
        "required": [
          "authorizationUrl"
        ],
        "type": "object",
        "properties": {
          "authorizationUrl": {
            "type": "string"
          }
        }
      },
      "MarketplaceOrderMappingResponseDto": {
        "required": [
          "id",
          "marketplaceConnectionId",
          "orderId",
          "externalOrderId",
          "externalOrderStatus",
          "syncStatus",
          "lastError",
          "lastSyncedAt",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "marketplaceConnectionId": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "externalOrderId": {
            "type": "string"
          },
          "externalOrderStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "syncStatus": {
            "$ref": "#/components/schemas/SyncStatus"
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "MarketplaceSyncLogResponseDto": {
        "required": [
          "id",
          "marketplaceConnectionId",
          "direction",
          "entityType",
          "entityId",
          "status",
          "errorMessage",
          "durationMs",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "marketplaceConnectionId": {
            "type": "string",
            "format": "uuid"
          },
          "direction": {
            "$ref": "#/components/schemas/SyncDirection"
          },
          "entityType": {
            "type": "string"
          },
          "entityId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/SyncStatus"
          },
          "errorMessage": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MarketplaceSyncStateDto": {
        "required": [
          "listingId",
          "visibility",
          "desiredQty",
          "desiredVersion",
          "pushedQty",
          "confirmedQty",
          "confirmedAt",
          "driftStreak",
          "lastErrorCode",
          "lastErrorMessage",
          "lastErrorAt",
          "retryAfter",
          "recentEvents"
        ],
        "type": "object",
        "properties": {
          "listingId": {
            "type": "string",
            "format": "uuid"
          },
          "visibility": {
            "type": "string"
          },
          "desiredQty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "desiredVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "pushedQty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "confirmedQty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "confirmedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "driftStreak": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastErrorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastErrorMessage": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastErrorAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "retryAfter": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "recentEvents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncEventLogEntryDto"
            }
          }
        }
      },
      "MarketplaceType": {
        "enum": [
          "Shopee",
          "MercadoLivre",
          "LojaIntegrada"
        ]
      },
      "MobileCompanyAccessResponse": {
        "required": [
          "companyRef",
          "workspaceRef",
          "scopeId",
          "name",
          "role",
          "capabilities",
          "stockLocations"
        ],
        "type": "object",
        "properties": {
          "companyRef": {
            "type": "string"
          },
          "workspaceRef": {
            "type": "string"
          },
          "scopeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stockLocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobileStockLocationResponse"
            }
          }
        }
      },
      "MobileCompanyResponse": {
        "required": [
          "companyName",
          "tradeName",
          "cnpj"
        ],
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MobileDestinationResponse": {
        "required": [
          "recipientName",
          "addressSummary",
          "latitude",
          "longitude"
        ],
        "type": "object",
        "properties": {
          "recipientName": {
            "type": "string"
          },
          "addressSummary": {
            "type": "string"
          },
          "latitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "longitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "MobileExecutionSessionResponse": {
        "required": [
          "id",
          "deviceSessionId",
          "downloadedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "deviceSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "downloadedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MobileLoadCheckResponse": {
        "required": [
          "status",
          "quantityExpected",
          "quantityConfirmed",
          "divergenceReason"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "quantityExpected": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantityConfirmed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "divergenceReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "divergenceReasonCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MobileLoadOrderListItemResponse": {
        "required": [
          "workItemRef",
          "companyRef",
          "workspaceRef",
          "company",
          "status",
          "version",
          "executionRevision",
          "stockLocationId",
          "assignedRoles"
        ],
        "type": "object",
        "properties": {
          "workItemRef": {
            "type": "string"
          },
          "companyRef": {
            "type": "string"
          },
          "workspaceRef": {
            "type": "string"
          },
          "company": {
            "$ref": "#/components/schemas/MobileCompanyResponse"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stockLocationId": {
            "type": "string",
            "format": "uuid"
          },
          "assignedRoles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MobileLoadOrderPageResponse": {
        "required": [
          "items",
          "nextCursor",
          "pageSize"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobileLoadOrderListItemResponse"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "MobileLoginRequest": {
        "required": [
          "email",
          "password",
          "deviceInstallationId",
          "organizationRef",
          "workspaceRef"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "deviceInstallationId": {
            "type": "string",
            "format": "uuid"
          },
          "organizationRef": {
            "type": [
              "null",
              "string"
            ]
          },
          "workspaceRef": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MobileOperationalContextResponse": {
        "required": [
          "userId",
          "name",
          "operationalSessionId",
          "deviceSessionId",
          "organization",
          "companies",
          "navigationCapabilities"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "operationalSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "deviceSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "organization": {
            "$ref": "#/components/schemas/MobileOperationalOrganizationResponse"
          },
          "companies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobileCompanyAccessResponse"
            }
          },
          "navigationCapabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MobileOperationalOrganizationResponse": {
        "required": [
          "organizationRef",
          "name"
        ],
        "type": "object",
        "properties": {
          "organizationRef": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "MobileOperatorCredentialRequest": {
        "required": [
          "userId",
          "badge",
          "pin"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "badge": {
            "type": "string"
          },
          "pin": {
            "type": "string"
          }
        }
      },
      "MobileOperatorCredentialResponse": {
        "required": [
          "id",
          "userId",
          "enabled"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "MobileOrganizationReference": {
        "required": [
          "organizationRef",
          "name",
          "workspaceRef",
          "workspaceName"
        ],
        "type": "object",
        "properties": {
          "organizationRef": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "workspaceRef": {
            "type": "string"
          },
          "workspaceName": {
            "type": "string"
          }
        }
      },
      "MobilePolicyResponse": {
        "required": [
          "version",
          "geofenceRadiusMeters",
          "maxGpsAccuracyMeters",
          "normalDeliveryItemPhoto",
          "pickupItemPhoto",
          "deliveryDrawnSignature",
          "deliverySignedProofPhoto",
          "pickupQuantitySignature",
          "pickupSignedProofPhoto"
        ],
        "type": "object",
        "properties": {
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "geofenceRadiusMeters": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "maxGpsAccuracyMeters": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "normalDeliveryItemPhoto": {
            "type": "string"
          },
          "pickupItemPhoto": {
            "type": "string"
          },
          "deliveryDrawnSignature": {
            "type": "string"
          },
          "deliverySignedProofPhoto": {
            "type": "string"
          },
          "pickupQuantitySignature": {
            "type": "string"
          },
          "pickupSignedProofPhoto": {
            "type": "string"
          }
        }
      },
      "MobileQuickSwitchRequest": {
        "required": [
          "badge",
          "pin",
          "deviceInstallationId",
          "deviceSessionId"
        ],
        "type": "object",
        "properties": {
          "badge": {
            "type": "string"
          },
          "pin": {
            "type": "string"
          },
          "deviceInstallationId": {
            "type": "string",
            "format": "uuid"
          },
          "deviceSessionId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "MobileRefreshRequest": {
        "required": [
          "refreshToken",
          "deviceInstallationId",
          "deviceSessionId"
        ],
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": "string"
          },
          "deviceInstallationId": {
            "type": "string",
            "format": "uuid"
          },
          "deviceSessionId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "MobileRevokeRequest": {
        "required": [
          "deviceInstallationId",
          "deviceSessionId"
        ],
        "type": "object",
        "properties": {
          "deviceInstallationId": {
            "type": "string",
            "format": "uuid"
          },
          "deviceSessionId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "MobileSnapshotResponse": {
        "required": [
          "companyRef",
          "workspaceRef",
          "loadOrderId",
          "status",
          "version",
          "sequenceVersion",
          "executionRevision",
          "company",
          "executionSession",
          "policy",
          "vehicle",
          "stops"
        ],
        "type": "object",
        "properties": {
          "companyRef": {
            "type": "string"
          },
          "workspaceRef": {
            "type": "string"
          },
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sequenceVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "company": {
            "$ref": "#/components/schemas/MobileCompanyResponse"
          },
          "executionSession": {
            "$ref": "#/components/schemas/MobileExecutionSessionResponse"
          },
          "policy": {
            "$ref": "#/components/schemas/MobilePolicyResponse"
          },
          "vehicle": {
            "$ref": "#/components/schemas/MobileVehicleResponse"
          },
          "stops": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobileStopResponse"
            }
          }
        }
      },
      "MobileStockLocationResponse": {
        "required": [
          "id",
          "code",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "MobileStopItemResponse": {
        "required": [
          "id",
          "demandItemId",
          "productId",
          "sku",
          "description",
          "unit",
          "quantityPlanned",
          "loadCheck"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "demandItemId": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "quantityPlanned": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "loadCheck": {
            "$ref": "#/components/schemas/MobileLoadCheckResponse"
          }
        }
      },
      "MobileStopResponse": {
        "required": [
          "id",
          "type",
          "sequence",
          "version",
          "destination",
          "items",
          "requiredRiskLevel"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "destination": {
            "$ref": "#/components/schemas/MobileDestinationResponse"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MobileStopItemResponse"
            }
          },
          "requiredRiskLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "MobileTokenResponse": {
        "required": [
          "accessToken",
          "accessTokenExpiresAt",
          "refreshToken",
          "refreshTokenExpiresAt",
          "operationalSessionId",
          "deviceSessionId",
          "organization"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "accessTokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "refreshToken": {
            "type": "string"
          },
          "refreshTokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "operationalSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "deviceSessionId": {
            "type": "string",
            "format": "uuid"
          },
          "organization": {
            "$ref": "#/components/schemas/MobileOrganizationReference"
          }
        }
      },
      "MobileVehicleResponse": {
        "required": [
          "id",
          "plate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "plate": {
            "type": "string"
          }
        }
      },
      "ModuleInsightDto": {
        "required": [
          "moduleKey",
          "kpis"
        ],
        "type": "object",
        "properties": {
          "moduleKey": {
            "type": "string"
          },
          "kpis": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NavigationKpiDto"
            }
          }
        }
      },
      "MoveProductCategoryRequest": {
        "required": [
          "newParentId"
        ],
        "type": "object",
        "properties": {
          "newParentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID do novo pai (null para mover para raiz)",
            "format": "uuid"
          }
        },
        "description": "Request para mover uma categoria para outro pai"
      },
      "MyOrganizationsDto": {
        "required": [
          "organizations",
          "defaultOrganizationId"
        ],
        "type": "object",
        "properties": {
          "organizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationWithWorkspacesDto"
            }
          },
          "defaultOrganizationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "NavigationBadgeDto": {
        "required": [
          "moduleKey",
          "screen",
          "count",
          "severity"
        ],
        "type": "object",
        "properties": {
          "moduleKey": {
            "type": "string"
          },
          "screen": {
            "type": "string"
          },
          "count": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "severity": {
            "type": "string"
          }
        }
      },
      "NavigationFavoriteFolderDto": {
        "required": [
          "name",
          "screens"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "screens": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "NavigationInsightsDto": {
        "required": [
          "generatedAt",
          "modules",
          "badges"
        ],
        "type": "object",
        "properties": {
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModuleInsightDto"
            }
          },
          "badges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NavigationBadgeDto"
            }
          }
        }
      },
      "NavigationKpiDto": {
        "required": [
          "key",
          "value",
          "previousValue"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "previousValue": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "NavigationModuleLayoutDto": {
        "required": [
          "moduleKey",
          "hiddenGroups",
          "groupOrder"
        ],
        "type": "object",
        "properties": {
          "moduleKey": {
            "type": "string"
          },
          "hiddenGroups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "groupOrder": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "NavigationRecentEntryDto": {
        "required": [
          "screen",
          "lastAccessedAt"
        ],
        "type": "object",
        "properties": {
          "screen": {
            "type": "string"
          },
          "lastAccessedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NeighborhoodResponseDto": {
        "required": [
          "id",
          "cityId",
          "cityName",
          "name",
          "code",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "cityId": {
            "type": "string",
            "format": "uuid"
          },
          "cityName": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "OnlineLoadOrderCommandRequest": {
        "required": [
          "commandId",
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "OrderDetailResponseDto": {
        "required": [
          "id",
          "orderNumber",
          "customerId",
          "customerName",
          "customerDocument",
          "status",
          "priceTableId",
          "priceTableName",
          "notes",
          "subTotal",
          "discountAmount",
          "totalAmount",
          "shippingStreet",
          "shippingNumber",
          "shippingComplement",
          "shippingNeighborhood",
          "shippingCityName",
          "shippingCityCode",
          "shippingStateCode",
          "shippingCountryId",
          "shippingPostalCode",
          "confirmedAt",
          "processingAt",
          "shippedAt",
          "deliveredAt",
          "cancelledAt",
          "cancellationReason",
          "trackingNumber",
          "shippingCarrier",
          "items",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orderNumber": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "customerName": {
            "type": "string"
          },
          "customerDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "priceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priceTableName": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "subTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "shippingStreet": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingComplement": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingNeighborhood": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingCityName": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingCityCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingStateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingCountryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingPostalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "confirmedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "processingAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "shippedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "deliveredAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "cancelledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "cancellationReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackingNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingCarrier": {
            "type": [
              "null",
              "string"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItemResponseDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "OrderItemResponseDto": {
        "required": [
          "id",
          "productId",
          "productVariantId",
          "productName",
          "productSku",
          "variantDescription",
          "unitOfMeasureAbbreviation",
          "quantity",
          "unitPrice",
          "discountAmount",
          "totalPrice",
          "notes",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productVariantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "productName": {
            "type": "string"
          },
          "productSku": {
            "type": [
              "null",
              "string"
            ]
          },
          "variantDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitOfMeasureAbbreviation": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "unitPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "OrderResponseDto": {
        "required": [
          "id",
          "orderNumber",
          "customerId",
          "customerName",
          "status",
          "priceTableId",
          "priceTableName",
          "subTotal",
          "discountAmount",
          "totalAmount",
          "itemCount",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orderNumber": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "customerName": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "priceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priceTableName": {
            "type": [
              "null",
              "string"
            ]
          },
          "subTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "itemCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "OrdersPerPeriodDto": {
        "type": "object",
        "properties": {
          "year": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "month": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "orderCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "revenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "OrderStatus": {
        "type": "integer"
      },
      "OrderSummaryDto": {
        "type": "object",
        "properties": {
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "draft": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "confirmed": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "processing": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "shipped": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "delivered": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cancelled": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "OrganizationDto": {
        "required": [
          "id",
          "name",
          "slug",
          "ownerUserId",
          "status",
          "billingPlan",
          "contactEmail",
          "contactPhone",
          "maxTenants",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "ownerUserId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "billingPlan": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "maxTenants": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "OrganizationWithWorkspacesDto": {
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "workspaces"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "workspaces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspaceDto"
            }
          }
        }
      },
      "PagedResultOfApiKeyResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfCarrierResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CarrierResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfCityResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CityResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfCountryResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CountryResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfCustomerResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfEmployeeResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfIntegrationListingDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationListingDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfIntegrationProductBrandResultDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationProductBrandResultDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfIntegrationProductCategoryResultDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationProductCategoryResultDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfIntegrationProductListItemDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationProductListItemDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfIntegrationProductModelResultDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationProductModelResultDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfKardexEntryDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KardexEntryDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfListingResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListingResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfMarketplaceOrderMappingResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceOrderMappingResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfNeighborhoodResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeighborhoodResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfOrderResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfPostalCodeResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostalCodeResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfPriceKardexEntryDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceKardexEntryDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfPriceTableResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceTableResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfProductBrandResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductBrandResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfProductCategoryResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductCategoryResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfProductListItemDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductListItemDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfProductModelResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductModelResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfStateResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StateResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfStockLocationResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockLocationResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfStoredFileResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoredFileResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfSupplierResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupplierResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfTenantResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfUnitOfMeasureResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitOfMeasureResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfUserResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "PagedResultOfVariationTypeResponseDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VariationTypeResponseDto"
            }
          },
          "pageNumber": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "hasNextPage": {
            "type": "boolean"
          }
        }
      },
      "ParticipantRole": {
        "type": "integer"
      },
      "PasswordResetResponseDto": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "PatchOrganizationDto": {
        "required": [
          "name",
          "contactEmail",
          "contactPhone"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PatchWorkspaceDto": {
        "required": [
          "name",
          "tradeName",
          "cnpj",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PersonActivityDto": {
        "required": [
          "code",
          "description"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PersonFiscalRegistryDto": {
        "required": [
          "openingDate",
          "legalNature",
          "companySize",
          "shareCapital",
          "establishmentType",
          "registrationStatus",
          "registrationStatusDate",
          "registrationStatusReason",
          "specialStatus",
          "specialStatusDate",
          "primaryCnaeCode",
          "primaryCnaeDescription",
          "optingForSimples",
          "simplesOptInDate",
          "simplesOptOutDate",
          "optingForMei",
          "meiOptInDate",
          "meiOptOutDate"
        ],
        "type": "object",
        "properties": {
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "PersonPartnerDto": {
        "required": [
          "name",
          "qualification",
          "representativeName",
          "representativeQualification"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "qualification": {
            "type": "string"
          },
          "representativeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "representativeQualification": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PersonType": {
        "type": "integer"
      },
      "PlaceLegalHoldRequest": {
        "required": [
          "scope",
          "reasonCode",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "scope": {
            "type": "string"
          },
          "reasonCode": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "loadOrderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "routeStopId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "decisionReference": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PostalCodeResponseDto": {
        "required": [
          "id",
          "countryId",
          "code",
          "cityId",
          "cityName",
          "stateCode",
          "stateName",
          "neighborhoodId",
          "neighborhoodName",
          "street",
          "numberRangeStart",
          "numberRangeEnd",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "countryId": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "cityId": {
            "type": "string",
            "format": "uuid"
          },
          "cityName": {
            "type": "string"
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateName": {
            "type": [
              "null",
              "string"
            ]
          },
          "neighborhoodId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "neighborhoodName": {
            "type": [
              "null",
              "string"
            ]
          },
          "street": {
            "type": [
              "null",
              "string"
            ]
          },
          "numberRangeStart": {
            "type": [
              "null",
              "string"
            ]
          },
          "numberRangeEnd": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "PreviewEmailTemplateRequest": {
        "required": [
          "subject",
          "mjmlSource"
        ],
        "type": "object",
        "properties": {
          "subject": {
            "type": [
              "null",
              "string"
            ],
            "description": "Assunto do rascunho (opcional)."
          },
          "mjmlSource": {
            "type": [
              "null",
              "string"
            ],
            "description": "MJML do rascunho (opcional)."
          }
        },
        "description": "Corpo (opcional) do preview: rascunho não salvo. Se ausente, usa o override/default salvo."
      },
      "PriceCurrentDto": {
        "required": [
          "productId",
          "variantId",
          "priceTableId",
          "price",
          "version"
        ],
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priceTableId": {
            "type": "string",
            "format": "uuid"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "PriceKardexEntryDto": {
        "required": [
          "id",
          "productId",
          "variantId",
          "priceTableId",
          "priceBefore",
          "priceAfter",
          "versionAfter",
          "reasonCode",
          "originUserId",
          "externalReference",
          "notes",
          "occurredAt",
          "recordedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priceTableId": {
            "type": "string",
            "format": "uuid"
          },
          "priceBefore": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "priceAfter": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "versionAfter": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "reasonCode": {
            "type": "string"
          },
          "originUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "externalReference": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PriceTableResponseDto": {
        "required": [
          "id",
          "name",
          "description",
          "startDate",
          "endDate",
          "basePriceTableId",
          "basePriceTableName",
          "adjustmentPercent",
          "isDefault",
          "isActive",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "basePriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "basePriceTableName": {
            "type": [
              "null",
              "string"
            ]
          },
          "adjustmentPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isDefault": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductBrandResponseDto": {
        "required": [
          "id",
          "name",
          "description",
          "logoUrl",
          "website",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "website": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ProductBrandSummaryDto": {
        "required": [
          "id",
          "name",
          "logoUrl"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductCategoryResponseDto": {
        "required": [
          "id",
          "name",
          "description",
          "parentId",
          "path",
          "pathNames",
          "level",
          "sortOrder",
          "isActive",
          "hasChildren",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "path": {
            "type": "string"
          },
          "pathNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "level": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "hasChildren": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ProductCategorySummaryDto": {
        "required": [
          "id",
          "name",
          "path",
          "pathNames"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "pathNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ProductCategoryTreeDto": {
        "required": [
          "id",
          "name",
          "description",
          "path",
          "pathNames",
          "level",
          "sortOrder",
          "isActive",
          "children"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "path": {
            "type": "string"
          },
          "pathNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "level": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductCategoryTreeDto"
            }
          }
        }
      },
      "ProductCustomFieldDto": {
        "required": [
          "name",
          "value"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductGender": {
        "type": "integer"
      },
      "ProductImageResponseDto": {
        "required": [
          "id",
          "productId",
          "productVariantId",
          "storedFileId",
          "sortOrder",
          "isPrimary",
          "url",
          "thumbnailUrl",
          "smallUrl",
          "mediumUrl",
          "largeUrl",
          "fileName",
          "sizeBytes",
          "width",
          "height",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "productVariantId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "storedFileId": {
            "type": "string",
            "format": "uuid"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isPrimary": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "smallUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "mediumUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "largeUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileName": {
            "type": "string"
          },
          "sizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProductImportCustomFieldDto": {
        "required": [
          "name",
          "value"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductImportImageDto": {
        "required": [
          "sku",
          "order",
          "base64"
        ],
        "type": "object",
        "properties": {
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "base64": {
            "type": "string"
          }
        }
      },
      "ProductImportVariationDto": {
        "required": [
          "sku",
          "barcode",
          "active",
          "stock",
          "values"
        ],
        "type": "object",
        "properties": {
          "sku": {
            "type": "string"
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "stock": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "values": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductImportVariationValueDto"
            }
          },
          "netCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "supplierCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "averageCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ProductImportVariationValueDto": {
        "required": [
          "id",
          "name",
          "value"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "ProductListItemDto": {
        "required": [
          "id",
          "name",
          "sku",
          "hasVariations",
          "variantCount",
          "isActive",
          "brand",
          "unitOfMeasure",
          "categories",
          "mainImage",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasVariations": {
            "type": "boolean"
          },
          "variantCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "brand": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProductBrandSummaryDto"
              }
            ]
          },
          "unitOfMeasure": {
            "$ref": "#/components/schemas/UnitOfMeasureSummaryDto"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductCategorySummaryDto"
            }
          },
          "mainImage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StoredFileSummaryDto"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ProductModelResponseDto": {
        "required": [
          "id",
          "name",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ProductModelSummaryDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ProductPriceDto": {
        "required": [
          "id",
          "priceTableId",
          "priceTableName",
          "price"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "priceTableId": {
            "type": "string",
            "format": "uuid"
          },
          "priceTableName": {
            "type": "string"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ProductResponseDto": {
        "required": [
          "id",
          "name",
          "sku",
          "description",
          "descriptionPlainText",
          "isActive",
          "hasVariations",
          "width",
          "height",
          "length",
          "weight",
          "packagedWidth",
          "packagedHeight",
          "packagedLength",
          "packagedWeight",
          "model",
          "ncm",
          "barcode",
          "origin",
          "brand",
          "unitOfMeasure",
          "categories",
          "variationTypes",
          "variants",
          "images",
          "stockLocations",
          "prices",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "descriptionPlainText": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "hasVariations": {
            "type": "boolean"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "model": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProductModelSummaryDto"
              }
            ]
          },
          "ncm": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "origin": {
            "$ref": "#/components/schemas/BrazilProductOrigin"
          },
          "brand": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProductBrandSummaryDto"
              }
            ]
          },
          "unitOfMeasure": {
            "$ref": "#/components/schemas/UnitOfMeasureSummaryDto"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductCategorySummaryDto"
            }
          },
          "variationTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VariationTypeSummaryDto"
            }
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductVariantResponseDto"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductImageResponseDto"
            }
          },
          "stockLocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductStockLocationDto"
            }
          },
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductPriceDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ProductStockLocationDto": {
        "required": [
          "id",
          "stockLocationId",
          "stockLocationName",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "stockLocationId": {
            "type": "string",
            "format": "uuid"
          },
          "stockLocationName": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ProductSummaryDto": {
        "type": "object",
        "properties": {
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "active": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inactive": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ProductVariantResponseDto": {
        "required": [
          "id",
          "sku",
          "barcode",
          "costPrice",
          "netCost",
          "supplierCost",
          "averageCost",
          "isActive",
          "values",
          "barcodes",
          "images",
          "stockLocations",
          "prices",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "costPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "netCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "supplierCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "averageCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isActive": {
            "type": "boolean"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VariationTypeValueSummaryDto"
            }
          },
          "barcodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BarcodeResponseDto"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductImageResponseDto"
            }
          },
          "stockLocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductStockLocationDto"
            }
          },
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductPriceDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ProvisionIntegrationCredentialResponseDto": {
        "required": [
          "clientId",
          "refreshToken",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "refreshToken": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "warning": {
            "type": "string"
          }
        }
      },
      "PublishRiskProfileCommand": {
        "required": [
          "effectiveFrom",
          "decisionReference",
          "rules"
        ],
        "type": "object",
        "properties": {
          "effectiveFrom": {
            "type": "string",
            "format": "date-time"
          },
          "decisionReference": {
            "type": "string"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RiskProfileRuleRequest"
            }
          }
        }
      },
      "RecentOrderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orderNumber": {
            "type": "string"
          },
          "customerName": {
            "type": "string"
          },
          "totalAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RecipientType": {
        "type": "integer"
      },
      "ReconcileRequestDto": {
        "required": [
          "scope"
        ],
        "type": "object",
        "properties": {
          "scope": {
            "type": "string"
          },
          "connectionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "productId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "kind": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReconcileResponseDto": {
        "required": [
          "runId"
        ],
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ReconciliationKind": {
        "enum": [
          "Stock",
          "Price"
        ]
      },
      "ReconciliationRunStatus": {
        "enum": [
          "Running",
          "Completed",
          "Failed",
          "Aborted"
        ]
      },
      "ReconciliationRunView": {
        "required": [
          "id",
          "kind",
          "scope",
          "status",
          "startedAt",
          "completedAt",
          "durationMs",
          "skusChecked",
          "driftsFound",
          "driftsCorrected",
          "errorsCount"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "$ref": "#/components/schemas/ReconciliationKind"
          },
          "scope": {
            "$ref": "#/components/schemas/ReconciliationScope"
          },
          "status": {
            "$ref": "#/components/schemas/ReconciliationRunStatus"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "durationMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "skusChecked": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "driftsFound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "driftsCorrected": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "errorsCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ReconciliationScope": {
        "enum": [
          "Full",
          "Connection",
          "Product"
        ]
      },
      "RefreshIntegrationTokenRequestDto": {
        "required": [
          "refreshToken"
        ],
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RefreshIntegrationTokenResponseDto": {
        "required": [
          "accessToken",
          "expiresIn",
          "accessTokenExpiresAt",
          "refreshToken",
          "refreshTokenExpiresAt"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "expiresIn": {
            "type": "integer",
            "format": "int32"
          },
          "accessTokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "refreshToken": {
            "type": "string"
          },
          "refreshTokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "tokenType": {
            "type": "string"
          }
        }
      },
      "RefreshTokenResponseDto": {
        "required": [
          "accessToken",
          "user",
          "tenant"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserResponseDto"
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponseDto"
          }
        }
      },
      "RegisterUserRequest": {
        "required": [
          "email",
          "name",
          "password"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email do usuário"
          },
          "name": {
            "type": "string",
            "description": "Nome completo do usuário"
          },
          "password": {
            "type": "string",
            "description": "Senha (mínimo 8 caracteres, deve conter maiúscula, minúscula, número e caractere especial)"
          },
          "turnstileToken": {
            "type": [
              "null",
              "string"
            ],
            "description": "SH-B16: Cloudflare Turnstile widget token. Required when the gate is enabled."
          }
        },
        "description": "Request para registrar um novo usuário"
      },
      "RegisterUserResponseDto": {
        "required": [
          "token",
          "user",
          "nextStep"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserResponseDto"
          },
          "nextStep": {
            "type": "string"
          }
        }
      },
      "RegistrationStatus": {
        "type": "integer"
      },
      "ReorderProductImagesRequest": {
        "required": [
          "imageIdsInOrder"
        ],
        "type": "object",
        "properties": {
          "imageIdsInOrder": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "description": "Request record for reordering product images"
      },
      "ReorderValuesRequest": {
        "required": [
          "valueIds"
        ],
        "type": "object",
        "properties": {
          "valueIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "ReplaceListingItemDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "variations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ListingItemVariationInputDto"
            }
          }
        }
      },
      "ResendConfirmationRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "E-mail do usuário"
          }
        },
        "description": "SH-B15: request para reenviar o e-mail de confirmação"
      },
      "ResetPasswordRequest": {
        "required": [
          "token",
          "email",
          "newPassword"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Token de redefinição recebido por email"
          },
          "email": {
            "type": "string",
            "description": "Email do usuário"
          },
          "newPassword": {
            "type": "string",
            "description": "Nova senha (mínimo 8 caracteres, deve conter maiúscula, minúscula, número e caractere especial)"
          }
        },
        "description": "Request para redefinir a senha"
      },
      "RetentionPolicyResponse": {
        "required": [
          "effectiveRetentionMonths",
          "effectiveSource",
          "effectiveVersion",
          "effectiveFrom",
          "effectiveDecisionReference",
          "timeline"
        ],
        "type": "object",
        "properties": {
          "effectiveRetentionMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "effectiveSource": {
            "type": "string"
          },
          "effectiveVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDecisionReference": {
            "type": "string"
          },
          "timeline": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetentionTermResponse"
            }
          }
        }
      },
      "RetentionTermResponse": {
        "required": [
          "source",
          "version",
          "retentionMonths",
          "effectiveFrom",
          "effectiveUntil",
          "decisionReference"
        ],
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "retentionMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "decisionReference": {
            "type": "string"
          }
        }
      },
      "RetryFailedResultDto": {
        "required": [
          "requeued"
        ],
        "type": "object",
        "properties": {
          "requeued": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RevenueSummaryDto": {
        "type": "object",
        "properties": {
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "monthly": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "RiskProfilePolicyResponse": {
        "required": [
          "currentVersion",
          "floorLevel",
          "supportedCriteria",
          "versions"
        ],
        "type": "object",
        "properties": {
          "currentVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "floorLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "supportedCriteria": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RiskProfileVersionResponse"
            }
          }
        }
      },
      "RiskProfileRuleRequest": {
        "required": [
          "criterion",
          "matchValue",
          "level"
        ],
        "type": "object",
        "properties": {
          "criterion": {
            "type": "string"
          },
          "matchValue": {
            "type": "string"
          },
          "level": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RiskProfileRuleResponse": {
        "required": [
          "criterion",
          "matchValue",
          "level"
        ],
        "type": "object",
        "properties": {
          "criterion": {
            "type": "string"
          },
          "matchValue": {
            "type": "string"
          },
          "level": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RiskProfileVersionResponse": {
        "required": [
          "version",
          "effectiveFrom",
          "effectiveUntil",
          "decisionReference",
          "createdAt",
          "rules"
        ],
        "type": "object",
        "properties": {
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "decisionReference": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RiskProfileRuleResponse"
            }
          }
        }
      },
      "RotateWebhookTokenResponseDto": {
        "required": [
          "webhookToken"
        ],
        "type": "object",
        "properties": {
          "webhookToken": {
            "type": "string"
          }
        }
      },
      "RouteReorderCommandRequest": {
        "required": [
          "commandId",
          "executionSessionId",
          "baseExecutionRevision",
          "clientSequence",
          "capturedAt",
          "payload"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "executionSessionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "baseExecutionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "clientSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "capturedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "payload": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RouteReorderPayloadRequest"
              }
            ]
          }
        }
      },
      "RouteReorderPayloadRequest": {
        "required": [
          "baseSequenceVersion",
          "stopIds",
          "reason"
        ],
        "type": "object",
        "properties": {
          "baseSequenceVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stopIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": [
                "null",
                "string"
              ],
              "format": "uuid"
            }
          },
          "reason": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          }
        }
      },
      "RouteStopArrivalCommandRequest": {
        "required": [
          "commandId",
          "executionSessionId",
          "baseExecutionRevision",
          "clientSequence",
          "capturedAt",
          "payload"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "executionSessionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "baseExecutionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "clientSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "capturedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "payload": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RouteStopArrivalPayloadRequest"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "RouteStopArrivalLocationRequest": {
        "required": [
          "latitude",
          "longitude",
          "accuracyMeters"
        ],
        "type": "object",
        "properties": {
          "latitude": {
            "maximum": 90,
            "minimum": -90,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": "number",
            "format": "double"
          },
          "longitude": {
            "maximum": 180,
            "minimum": -180,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": "number",
            "format": "double"
          },
          "accuracyMeters": {
            "maximum": 9999999999.9999999999,
            "exclusiveMinimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": "number",
            "format": "double"
          },
          "source": {
            "maxLength": 100,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "maxLength": 100,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ]
          },
          "isMocked": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "additionalProperties": false
      },
      "RouteStopArrivalPayloadRequest": {
        "required": [
          "location"
        ],
        "type": "object",
        "properties": {
          "location": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RouteStopArrivalLocationRequest"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "RouteStopCompletionCommandRequest": {
        "required": [
          "commandId",
          "executionSessionId",
          "baseExecutionRevision",
          "clientSequence",
          "capturedAt",
          "payload"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "executionSessionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "baseExecutionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "clientSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "capturedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "payload": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RouteStopCompletionPayloadRequest"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "RouteStopCompletionLocationRequest": {
        "required": [
          "latitude",
          "longitude",
          "accuracyMeters"
        ],
        "type": "object",
        "properties": {
          "latitude": {
            "maximum": 90,
            "minimum": -90,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": "number",
            "format": "double"
          },
          "longitude": {
            "maximum": 180,
            "minimum": -180,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": "number",
            "format": "double"
          },
          "accuracyMeters": {
            "maximum": 9999999999.9999999999,
            "exclusiveMinimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": "number",
            "format": "double"
          },
          "source": {
            "maxLength": 100,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "maxLength": 100,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ]
          },
          "isMocked": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "additionalProperties": false
      },
      "RouteStopCompletionPayloadRequest": {
        "required": [
          "outcome",
          "location",
          "outsideGeofenceReason",
          "signer",
          "evidenceIds"
        ],
        "type": "object",
        "properties": {
          "outcome": {
            "enum": [
              "COMPLETED",
              "PARTIAL",
              "FAILED"
            ],
            "type": "string",
            "description": "ADR-0071: os tres desfechos sao aceitos e o servidor confere cada um contra as quantidades ja confirmadas. PARTIAL e FAILED exigem outcomeReasonCode."
          },
          "location": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RouteStopCompletionLocationRequest"
              }
            ]
          },
          "outsideGeofenceReason": {
            "maxLength": 500,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ]
          },
          "signer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RouteStopCompletionSignerRequest"
              }
            ]
          },
          "evidenceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "outcomeReasonCode": {
            "maxLength": 64,
            "minLength": 1,
            "type": [
              "null",
              "string"
            ]
          }
        },
        "additionalProperties": false
      },
      "RouteStopCompletionSignerRequest": {
        "required": [
          "name",
          "role"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "role": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "RouteStopItemConfirmationCommandRequest": {
        "required": [
          "commandId",
          "executionSessionId",
          "baseExecutionRevision",
          "clientSequence",
          "capturedAt",
          "payload"
        ],
        "type": "object",
        "properties": {
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "executionSessionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "baseExecutionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "clientSequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "capturedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "payload": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RouteStopItemConfirmationPayloadRequest"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "RouteStopItemConfirmationItemRequest": {
        "required": [
          "stopItemId",
          "quantityCompleted",
          "quantityDamaged",
          "divergenceReason"
        ],
        "type": "object",
        "properties": {
          "stopItemId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "quantityCompleted": {
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": "number",
            "format": "double"
          },
          "quantityDamaged": {
            "minimum": 0,
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": "number",
            "format": "double"
          },
          "divergenceReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "divergenceReasonCode": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "additionalProperties": false
      },
      "RouteStopItemConfirmationPayloadRequest": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "minItems": 1,
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/RouteStopItemConfirmationItemRequest"
            }
          }
        },
        "additionalProperties": false
      },
      "RouteStopStateResponse": {
        "required": [
          "routeStopId",
          "version",
          "executionRevision"
        ],
        "type": "object",
        "properties": {
          "routeStopId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SelectTenantRequest": {
        "required": [
          "tenantId"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "ID do tenant selecionado",
            "format": "uuid"
          }
        },
        "description": "Request para seleção de tenant após login multi-tenant"
      },
      "SelectTenantResponseDto": {
        "required": [
          "token",
          "user",
          "tenant"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserResponseDto"
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponseDto"
          }
        }
      },
      "SelectWorkspaceDto": {
        "required": [
          "tenantId",
          "organizationId"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        },
        "description": "Request DTO for POST /api/v1/auth/select-workspace."
      },
      "SetDefaultOrganizationDto": {
        "required": [
          "organizationId"
        ],
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "SetDefaultWorkspaceDto": {
        "required": [
          "organizationId",
          "tenantId"
        ],
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "SetLogisticsSetupSupervisionRequest": {
        "required": [
          "workspaceRef",
          "granted",
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "workspaceRef": {
            "type": "string"
          },
          "granted": {
            "type": "boolean"
          },
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SetProductPriceDto": {
        "required": [
          "priceTableId",
          "price"
        ],
        "type": "object",
        "properties": {
          "priceTableId": {
            "type": "string",
            "format": "uuid"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SetProductStockLocationDto": {
        "required": [
          "stockLocationId",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "stockLocationId": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SetTenantRetentionRequest": {
        "required": [
          "retentionMonths",
          "effectiveFrom",
          "decisionReference"
        ],
        "type": "object",
        "properties": {
          "retentionMonths": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date-time"
          },
          "decisionReference": {
            "type": "string"
          }
        }
      },
      "ShipOrderDto": {
        "type": "object",
        "properties": {
          "trackingNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingCarrier": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StandalonePickupItemRequest": {
        "required": [
          "productId",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "productId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "StandalonePickupRequest": {
        "required": [
          "stockLocationId",
          "destination",
          "scheduledFor",
          "notes",
          "items"
        ],
        "type": "object",
        "properties": {
          "stockLocationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "destination": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IntegrationDemandDestinationRequest"
              }
            ]
          },
          "scheduledFor": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/StandalonePickupItemRequest"
            }
          }
        }
      },
      "StandalonePickupResponse": {
        "required": [
          "id",
          "type",
          "source",
          "status",
          "version",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StateRegistrationIndicator": {
        "type": "integer"
      },
      "StateResponseDto": {
        "required": [
          "countryId",
          "code",
          "name",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "countryId": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "StockLocationResponseDto": {
        "required": [
          "id",
          "code",
          "name",
          "description",
          "address",
          "isDefault",
          "isActive",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "StoredFileResponseDto": {
        "required": [
          "id",
          "fileName",
          "contentType",
          "sizeBytes",
          "domainType",
          "domainEntityId",
          "variationType",
          "width",
          "height",
          "url",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "sizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "domainType": {
            "$ref": "#/components/schemas/DomainType"
          },
          "domainEntityId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "variationType": {
            "$ref": "#/components/schemas/FileVariationType"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "url": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "variations": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/StoredFileVariationDto"
            }
          }
        }
      },
      "StoredFileSummaryDto": {
        "required": [
          "id",
          "url",
          "thumbnailUrl"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StoredFileVariationDto": {
        "required": [
          "id",
          "variationType",
          "width",
          "height",
          "sizeBytes",
          "url"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "variationType": {
            "$ref": "#/components/schemas/FileVariationType"
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sizeBytes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "Stream": {
        "type": "string",
        "format": "binary"
      },
      "StringSegment": {
        "type": "object",
        "properties": {
          "buffer": {
            "type": [
              "null",
              "string"
            ]
          },
          "offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasValue": {
            "type": "boolean"
          }
        }
      },
      "SubmitGameScoreRequest": {
        "required": [
          "gamertag",
          "score"
        ],
        "type": "object",
        "properties": {
          "gamertag": {
            "type": "string",
            "description": "Apelido público exibido no ranking (1..20 chars, sem quebra de linha)."
          },
          "score": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Pontuação obtida (&gt;= 0, com teto sanitário).",
            "format": "int32"
          },
          "mode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Modo do jogo. Quando omitido, usa \"runner\"."
          }
        },
        "description": "Request de envio de pontuação do minijogo."
      },
      "SupervisedAuditEntryPageResponse": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedAuditEntryResponse"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SupervisedAuditEntryResponse": {
        "required": [
          "id",
          "aggregateType",
          "aggregateId",
          "action",
          "reasonCode",
          "executionRevision",
          "correlationId",
          "commandId",
          "actorUserId",
          "deviceSessionId",
          "metadata",
          "occurredAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "aggregateType": {
            "type": "string"
          },
          "aggregateId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "type": "string"
          },
          "reasonCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "correlationId": {
            "type": "string",
            "format": "uuid"
          },
          "commandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "actorUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "deviceSessionId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SupervisedCancelDemandRequest": {
        "required": [
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SupervisedDemandBalanceEntryResponse": {
        "required": [
          "kind",
          "isCurrent",
          "eventId",
          "supersedesEventId",
          "routeStopId",
          "demandItemId",
          "productId",
          "sku",
          "description",
          "unit",
          "executionRevision",
          "previousExecutionRevision",
          "previousQuantityToSeparate",
          "quantityToSeparate",
          "deltaQuantityToSeparate",
          "generatedDemandId",
          "occurredAt"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "isCurrent": {
            "type": "boolean"
          },
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "supersedesEventId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "routeStopId": {
            "type": "string",
            "format": "uuid"
          },
          "demandItemId": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "previousExecutionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "previousQuantityToSeparate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantityToSeparate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "deltaQuantityToSeparate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "generatedDemandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SupervisedDemandBalanceReconciliationResponse": {
        "required": [
          "sourceDemandId",
          "balanceDemandId",
          "balanceDemandStatus",
          "executionRevision",
          "ledgerQuantityToSeparate",
          "balanceDemandQuantity",
          "divergent"
        ],
        "type": "object",
        "properties": {
          "sourceDemandId": {
            "type": "string",
            "format": "uuid"
          },
          "balanceDemandId": {
            "type": "string",
            "format": "uuid"
          },
          "balanceDemandStatus": {
            "type": "string"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "ledgerQuantityToSeparate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "balanceDemandQuantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "divergent": {
            "type": "boolean"
          }
        }
      },
      "SupervisedDemandBalanceSummaryResponse": {
        "required": [
          "executionRevision",
          "itemCount",
          "quantityToSeparate"
        ],
        "type": "object",
        "properties": {
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "itemCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "quantityToSeparate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SupervisedDemandDestinationResponse": {
        "required": [
          "recipientName",
          "contactPhone",
          "addressLine1",
          "addressLine2",
          "district",
          "city",
          "state",
          "postalCode",
          "country",
          "latitude",
          "longitude"
        ],
        "type": "object",
        "properties": {
          "recipientName": {
            "type": "string"
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "addressLine1": {
            "type": "string"
          },
          "addressLine2": {
            "type": [
              "null",
              "string"
            ]
          },
          "district": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "latitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "longitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SupervisedDemandDetailsResponse": {
        "required": [
          "id",
          "type",
          "source",
          "businessCorrelationKey",
          "logisticsCycle",
          "status",
          "version",
          "origin",
          "destination",
          "items",
          "createdAt",
          "balanceHistory",
          "balanceSummary",
          "balanceReconciliation"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "businessCorrelationKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "logisticsCycle": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "origin": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SupervisedDemandOriginResponse"
              }
            ]
          },
          "destination": {
            "$ref": "#/components/schemas/SupervisedDemandDestinationResponse"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedDemandItemResponse"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "balanceHistory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedDemandBalanceEntryResponse"
            }
          },
          "balanceSummary": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SupervisedDemandBalanceSummaryResponse"
              }
            ]
          },
          "balanceReconciliation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SupervisedDemandBalanceReconciliationResponse"
              }
            ]
          }
        }
      },
      "SupervisedDemandItemResponse": {
        "required": [
          "id",
          "sourceItemId",
          "productId",
          "sku",
          "barcode",
          "description",
          "unit",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sourceItemId": {
            "type": "string"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": "string"
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SupervisedDemandOriginResponse": {
        "required": [
          "documentId",
          "documentNumber",
          "series",
          "finalizedAt"
        ],
        "type": "object",
        "properties": {
          "documentId": {
            "type": "string"
          },
          "documentNumber": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "finalizedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SupervisedDemandPageResponse": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedDemandSummaryResponse"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SupervisedDemandSummaryResponse": {
        "required": [
          "id",
          "type",
          "source",
          "status",
          "version",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SupervisedLoadOrderDetailsResponse": {
        "required": [
          "id",
          "code",
          "status",
          "version",
          "executionRevision",
          "vehicle",
          "stops"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "vehicle": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SupervisedLoadOrderVehicleResponse"
              }
            ]
          },
          "stops": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedRouteStopResponse"
            }
          },
          "stockLocationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "checkerUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "driverUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "SupervisedLoadOrderPageResponse": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedLoadOrderSummaryResponse"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SupervisedLoadOrderSummaryResponse": {
        "required": [
          "id",
          "code",
          "status",
          "version",
          "executionRevision",
          "stockLocationId",
          "loadingStartedAt",
          "routeStartedAt",
          "closedAt",
          "sequenceVersion",
          "demandCount",
          "driverUserId",
          "checkerUserId",
          "vehicleId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "executionRevision": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stockLocationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "loadingStartedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "routeStartedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "closedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "sequenceVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "demandCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "driverUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "checkerUserId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "vehicleId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "SupervisedLoadOrderVehicleResponse": {
        "required": [
          "id",
          "plate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "plate": {
            "type": "string"
          }
        }
      },
      "SupervisedRouteReorderResponse": {
        "required": [
          "loadOrderId",
          "version",
          "sequenceVersion",
          "stops"
        ],
        "type": "object",
        "properties": {
          "loadOrderId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sequenceVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stops": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedStopSequenceEntryResponse"
            }
          }
        }
      },
      "SupervisedRouteStopDestinationResponse": {
        "required": [
          "recipientName",
          "addressSummary",
          "latitude",
          "longitude"
        ],
        "type": "object",
        "properties": {
          "recipientName": {
            "type": "string"
          },
          "addressSummary": {
            "type": "string"
          },
          "latitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "longitude": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SupervisedRouteStopEvidenceResponse": {
        "required": [
          "evidenceId",
          "type",
          "status",
          "committedAt"
        ],
        "type": "object",
        "properties": {
          "evidenceId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "committedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "SupervisedRouteStopItemResponse": {
        "required": [
          "id",
          "demandItemId",
          "productId",
          "sku",
          "description",
          "unit",
          "quantityPlanned",
          "loadCheck"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "demandItemId": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "sku": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "quantityPlanned": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "loadCheck": {
            "$ref": "#/components/schemas/SupervisedRouteStopLoadCheckResponse"
          }
        }
      },
      "SupervisedRouteStopLoadCheckResponse": {
        "required": [
          "status",
          "quantityExpected",
          "quantityConfirmed",
          "divergenceReason"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "quantityExpected": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantityConfirmed": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "divergenceReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "divergenceReasonCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SupervisedRouteStopResponse": {
        "required": [
          "id",
          "type",
          "sequence",
          "version",
          "destination",
          "items",
          "requiresSupervisorReview",
          "supervisorReviewReasons",
          "evidences",
          "requiredRiskLevel"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "destination": {
            "$ref": "#/components/schemas/SupervisedRouteStopDestinationResponse"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedRouteStopItemResponse"
            }
          },
          "requiresSupervisorReview": {
            "type": "boolean"
          },
          "supervisorReviewReasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "evidences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupervisedRouteStopEvidenceResponse"
            }
          },
          "requiredRiskLevel": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SupervisedStopSequenceEntryResponse": {
        "required": [
          "stopId",
          "sequence"
        ],
        "type": "object",
        "properties": {
          "stopId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SupplierDetailResponseDto": {
        "required": [
          "id",
          "personId",
          "name",
          "tradeName",
          "personType",
          "document",
          "formattedDocument",
          "documentType",
          "documentLabel",
          "birthDate",
          "gender",
          "rgNumber",
          "rgIssuer",
          "rgIssueDate",
          "maritalStatus",
          "birthPlace",
          "supplierCode",
          "status",
          "leadTimeDays",
          "minimumOrderAmount",
          "paymentTerms",
          "activitySector",
          "isRuralProducer",
          "addresses",
          "contacts",
          "fiscalRegistry",
          "secondaryActivities",
          "partners",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentLabel": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "supplierCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/SupplierStatus"
          },
          "leadTimeDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "paymentTerms": {
            "type": [
              "null",
              "string"
            ]
          },
          "activitySector": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRuralProducer": {
            "type": "boolean"
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddressResponseDto"
            }
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactResponseDto"
            }
          },
          "fiscalRegistry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PersonFiscalRegistryDto"
              }
            ]
          },
          "secondaryActivities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "SupplierResponseDto": {
        "required": [
          "id",
          "personId",
          "name",
          "tradeName",
          "personType",
          "document",
          "formattedDocument",
          "documentType",
          "documentLabel",
          "birthDate",
          "gender",
          "supplierCode",
          "status",
          "leadTimeDays",
          "minimumOrderAmount",
          "paymentTerms",
          "activitySector",
          "isRuralProducer",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "personId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "personType": {
            "$ref": "#/components/schemas/PersonType"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedDocument": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentLabel": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "supplierCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/SupplierStatus"
          },
          "leadTimeDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "paymentTerms": {
            "type": [
              "null",
              "string"
            ]
          },
          "activitySector": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRuralProducer": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "SupplierStatus": {
        "type": "integer"
      },
      "SwitchTenantRequest": {
        "required": [
          "tenantId"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "ID do novo tenant",
            "format": "uuid"
          }
        },
        "description": "Request para alternar entre tenants"
      },
      "SwitchTenantResponseDto": {
        "required": [
          "token",
          "tenant"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/TenantResponseDto"
          }
        }
      },
      "SyncDirection": {
        "enum": [
          "OutboundToMarketplace",
          "InboundFromMarketplace"
        ]
      },
      "SyncEventLogEntryDto": {
        "required": [
          "id",
          "eventType",
          "marketplaceProductMappingId",
          "status",
          "messageVersion",
          "requestedAt",
          "completedAt",
          "latencyMs",
          "errorCode",
          "errorMessage"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "eventType": {
            "type": "string"
          },
          "marketplaceProductMappingId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "messageVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "latencyMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "errorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "errorMessage": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SyncHealthSummaryDto": {
        "required": [
          "total",
          "visible",
          "paused",
          "deactivated",
          "error",
          "unknown",
          "underBackoff",
          "withDrift",
          "stockInSyncPct",
          "priceInSyncPct",
          "lastRunDriftsFound",
          "lastRunDriftsCorrected",
          "lastRunStatus",
          "lastRunStartedAt",
          "pendingStockOps",
          "pendingPriceOps",
          "erpSemaphore"
        ],
        "type": "object",
        "properties": {
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "visible": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "paused": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "deactivated": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "error": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "unknown": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "underBackoff": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "withDrift": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "stockInSyncPct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "priceInSyncPct": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "lastRunDriftsFound": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastRunDriftsCorrected": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "lastRunStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastRunStartedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "pendingStockOps": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pendingPriceOps": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "erpSemaphore": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ErpSemaphoreDto"
              }
            ]
          }
        }
      },
      "SyncStatus": {
        "enum": [
          "Pending",
          "Synced",
          "Error",
          "Skipped",
          "PartialError"
        ]
      },
      "SyncTimeseriesDto": {
        "required": [
          "period",
          "bucket",
          "points"
        ],
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SyncTimeseriesPointDto"
            }
          }
        }
      },
      "SyncTimeseriesPointDto": {
        "required": [
          "bucketStart",
          "eventCount",
          "avgLatencyMs",
          "p95LatencyMs",
          "p99LatencyMs",
          "failuresCount",
          "driftsCount"
        ],
        "type": "object",
        "properties": {
          "bucketStart": {
            "type": "string",
            "format": "date-time"
          },
          "eventCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "avgLatencyMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "p95LatencyMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "p99LatencyMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "failuresCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "driftsCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "TaxRegime": {
        "type": "integer"
      },
      "TenantResponseDto": {
        "required": [
          "id",
          "name",
          "contactEmail",
          "contactPhone",
          "status",
          "subscriptionStartDate",
          "subscriptionEndDate",
          "maxUsers",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "contactEmail": {
            "type": "string"
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TenantStatus"
          },
          "subscriptionStartDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "subscriptionEndDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maxUsers": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "TenantSelectionDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "TenantSettingsResponseDto": {
        "required": [
          "workingCountries",
          "primaryWorkingCountry",
          "defaultLocale",
          "timezone"
        ],
        "type": "object",
        "properties": {
          "workingCountries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primaryWorkingCountry": {
            "type": "string"
          },
          "defaultLocale": {
            "type": "string"
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TenantStatus": {
        "type": "integer"
      },
      "TopProductDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "totalQuantitySold": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalRevenue": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "TransferOwnershipDto": {
        "required": [
          "newOwnerUserId"
        ],
        "type": "object",
        "properties": {
          "newOwnerUserId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "UnitOfMeasureResponseDto": {
        "required": [
          "id",
          "name",
          "abbreviation",
          "description",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "abbreviation": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "UnitOfMeasureSummaryDto": {
        "required": [
          "id",
          "name",
          "abbreviation"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "abbreviation": {
            "type": "string"
          }
        }
      },
      "UpdateAddressDto": {
        "required": [
          "label",
          "type",
          "street",
          "number",
          "complement",
          "neighborhood",
          "cityName",
          "cityCode",
          "cityCodeSystem",
          "stateCode",
          "countryId",
          "postalCode"
        ],
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/AddressType"
          },
          "street": {
            "type": "string"
          },
          "number": {
            "type": [
              "null",
              "string"
            ]
          },
          "complement": {
            "type": [
              "null",
              "string"
            ]
          },
          "neighborhood": {
            "type": [
              "null",
              "string"
            ]
          },
          "cityName": {
            "type": "string"
          },
          "cityCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "cityCodeSystem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CityCodeSystem"
              }
            ]
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryId": {
            "type": "string"
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "reference": {
            "type": [
              "null",
              "string"
            ]
          },
          "poBox": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "UpdateApiKeyRequest": {
        "type": "object",
        "properties": {
          "scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "SH-B13: nova lista de escopos de endpoint (substitui a atual). Vazio/null = sem restrição.\nCada entrada é `\"*\"`, `\"METODO:/prefixo\"` ou `\"/prefixo\"`."
          },
          "allowedIps": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "SH-B13: nova allowlist de IP (substitui a atual). Vazio/null = sem restrição. Cada entrada é um\nIP único (ex.: `203.0.113.5`) ou um range CIDR (ex.: `203.0.113.0/24`)."
          }
        },
        "description": "Request para atualizar os escopos e IPs permitidos de uma API key existente (SH-B13).\nEdita SOMENTE controle de acesso — não toca no segredo/hash, nome, role nem expiração."
      },
      "UpdateBarcodeConversionRequest": {
        "required": [
          "sourceUnitOfMeasureId",
          "targetUnitOfMeasureId",
          "conversionType",
          "factor"
        ],
        "type": "object",
        "properties": {
          "sourceUnitOfMeasureId": {
            "type": "string",
            "description": "Unidade de medida de origem",
            "format": "uuid"
          },
          "targetUnitOfMeasureId": {
            "type": "string",
            "description": "Unidade de medida de destino",
            "format": "uuid"
          },
          "conversionType": {
            "description": "Tipo de conversão (multiplicação/divisão)",
            "$ref": "#/components/schemas/BarcodeConversionType"
          },
          "factor": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "description": "Fator de conversão (maior que zero)",
            "format": "double"
          }
        },
        "description": "Request para atualizar uma conversão de código de barras comercial (o ID vem da rota)."
      },
      "UpdateBarcodeDto": {
        "required": [
          "id",
          "barcode",
          "conversionId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "barcode": {
            "type": "string"
          },
          "conversionId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "UpdateBarcodeRequest": {
        "required": [
          "barcode",
          "conversionId"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": "string"
          },
          "conversionId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "description": "Request record for updating a commercial barcode"
      },
      "UpdateCarrierDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "carrierCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "priority": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "rntrc": {
            "type": [
              "null",
              "string"
            ]
          },
          "isTacEquivalent": {
            "type": "boolean",
            "default": false
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "secondaryActivities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          }
        }
      },
      "UpdateContactDto": {
        "required": [
          "type",
          "value",
          "label"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ContactType"
          },
          "value": {
            "type": "string"
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "UpdateCustomerDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "customerCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "creditLimit": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isExemptFromTax": {
            "type": "boolean",
            "default": false
          },
          "taxExemptionReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "municipalRegistration": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "stateRegistrationIndicator": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StateRegistrationIndicator"
              }
            ]
          },
          "taxRegime": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TaxRegime"
              }
            ]
          },
          "isEndConsumer": {
            "type": "boolean",
            "default": false
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "type": [
              "null",
              "string"
            ]
          },
          "recipientType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RecipientType"
              }
            ]
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "secondaryActivities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          }
        }
      },
      "UpdateDocumentLookupCredentialDto": {
        "required": [
          "providerType",
          "token"
        ],
        "type": "object",
        "properties": {
          "providerType": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        }
      },
      "UpdateDocumentLookupProviderDto": {
        "required": [
          "providerType",
          "enabled"
        ],
        "type": "object",
        "properties": {
          "providerType": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "UpdateDocumentLookupSettingsDto": {
        "required": [
          "enabled",
          "cacheTtlDaysOverride",
          "providers"
        ],
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "cacheTtlDaysOverride": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateDocumentLookupProviderDto"
            }
          }
        }
      },
      "UpdateEmployeeDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "employeeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "hireDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "terminationDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "jobTitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "salary": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyRate": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hourlyCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "pisPasep": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentDay": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "secondaryActivities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          }
        }
      },
      "UpdateIntegratedLogisticsDemandRequest": {
        "required": [
          "expectedVersion",
          "destination",
          "items"
        ],
        "type": "object",
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "format": "int32"
          },
          "destination": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IntegrationDemandDestinationRequest"
              }
            ]
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/IntegrationDemandItemRequest"
            }
          }
        }
      },
      "UpdateListingMarketplaceDataDto": {
        "required": [
          "listingId",
          "marketplaceData"
        ],
        "type": "object",
        "properties": {
          "listingId": {
            "type": "string",
            "format": "uuid"
          },
          "marketplaceData": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateListingPriceDto": {
        "required": [
          "price"
        ],
        "type": "object",
        "properties": {
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionalPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "promotionStart": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "promotionEnd": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "removePrice": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "UpdateLogisticsSetupUserRequest": {
        "required": [
          "expectedVersion",
          "workspaces"
        ],
        "type": "object",
        "properties": {
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "workspaces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateLogisticsSetupWorkspaceRequest"
            }
          }
        }
      },
      "UpdateLogisticsSetupWorkspaceRequest": {
        "required": [
          "workspaceRef",
          "capabilities",
          "stockLocationIds"
        ],
        "type": "object",
        "properties": {
          "workspaceRef": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stockLocationIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "UpdateMarketplaceConnectionDto": {
        "required": [
          "id",
          "connectionName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "connectionName": {
            "type": "string"
          },
          "priceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "promotionalPriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "defaultCustomerId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "listingTypes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/MarketplaceConnectionListingTypeDto"
            }
          }
        }
      },
      "UpdateMyProfileRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome completo do usuário (2 a 120 caracteres)"
          },
          "phone": {
            "type": [
              "null",
              "string"
            ],
            "description": "Telefone de contato (opcional, até 32 caracteres; vazio limpa)"
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "URL do avatar (opcional; caminho relativo ou URL http(s))"
          }
        },
        "description": "Request para o usuário autenticado editar o próprio perfil (F3-01)"
      },
      "UpdateOrderDto": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "shippingAddressId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priceTableId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "UpdateOrderItemDto": {
        "type": "object",
        "properties": {
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "discountAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdatePriceTableRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome da tabela"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Descrição opcional"
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Data de início de validade",
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Data de expiração",
            "format": "date-time"
          },
          "basePriceTableId": {
            "type": [
              "null",
              "string"
            ],
            "description": "ID da tabela base para ajuste percentual",
            "format": "uuid"
          },
          "adjustmentPercent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "Percentual de ajuste (positivo=acréscimo, negativo=desconto)",
            "format": "double"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Se é a tabela padrão",
            "default": false
          },
          "isActive": {
            "type": "boolean",
            "description": "Se está ativa",
            "default": true
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Ordem de exibição",
            "format": "int32",
            "default": 0
          }
        },
        "description": "Request para atualizar uma tabela de preços"
      },
      "UpdateProductBrandRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome da marca"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Descrição opcional"
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "URL do logo"
          },
          "website": {
            "type": [
              "null",
              "string"
            ],
            "description": "Website da marca"
          },
          "isActive": {
            "type": "boolean",
            "description": "Se a marca está ativa",
            "default": true
          }
        },
        "description": "Request para atualizar uma marca de produto"
      },
      "UpdateProductCategoryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Novo nome da categoria (opcional)"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Nova descrição (opcional)"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "description": "Nova ordem de exibição (opcional)",
            "format": "int32"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Status ativo/inativo (opcional)"
          }
        },
        "description": "Request para atualizar uma categoria de produto"
      },
      "UpdateProductModelRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome do modelo"
          },
          "isActive": {
            "type": "boolean",
            "description": "Se o modelo está ativo",
            "default": true
          }
        },
        "description": "Request para atualizar um modelo de produto"
      },
      "UpdateProductPricesDto": {
        "required": [
          "prices"
        ],
        "type": "object",
        "properties": {
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SetProductPriceDto"
            }
          }
        }
      },
      "UpdateProductRequest": {
        "required": [
          "name",
          "unitOfMeasureId"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "unitOfMeasureId": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean",
            "default": true
          },
          "hasVariations": {
            "type": "boolean",
            "default": false
          },
          "width": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "height": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWidth": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedHeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedLength": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "packagedWeight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "productModelId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "ncm": {
            "type": [
              "null",
              "string"
            ]
          },
          "origin": {
            "$ref": "#/components/schemas/BrazilProductOrigin"
          },
          "brandId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "categoryIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "variationTypeIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "description": "Request record for updating a product (allows partial updates)"
      },
      "UpdateProductStockLocationsDto": {
        "required": [
          "stockLocations"
        ],
        "type": "object",
        "properties": {
          "stockLocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SetProductStockLocationDto"
            }
          }
        }
      },
      "UpdateProductVariantRequest": {
        "type": "object",
        "properties": {
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "costPrice": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "netCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "supplierCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "averageCost": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "isActive": {
            "type": "boolean",
            "default": true
          },
          "variationTypeValueIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "barcodes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UpdateBarcodeDto"
            }
          }
        },
        "description": "Request record for updating a product variant"
      },
      "UpdateStockLocationRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome do local"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Descrição opcional"
          },
          "address": {
            "type": [
              "null",
              "string"
            ],
            "description": "Endereço opcional"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Se é o local padrão",
            "default": false
          },
          "isActive": {
            "type": "boolean",
            "description": "Se está ativo",
            "default": true
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "description": "Ordem de exibição",
            "format": "int32",
            "default": 0
          }
        },
        "description": "Request para atualizar um local de estoque"
      },
      "UpdateSupplierDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "document": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "gender": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Gender"
              }
            ]
          },
          "supplierCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "leadTimeDays": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "minimumOrderAmount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "paymentTerms": {
            "type": [
              "null",
              "string"
            ]
          },
          "activitySector": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRuralProducer": {
            "type": "boolean",
            "default": false
          },
          "rgNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "rgIssueDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "maritalStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaritalStatus"
              }
            ]
          },
          "birthPlace": {
            "type": [
              "null",
              "string"
            ]
          },
          "openingDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "legalNature": {
            "type": [
              "null",
              "string"
            ]
          },
          "companySize": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CompanySize"
              }
            ]
          },
          "shareCapital": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "establishmentType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EstablishmentType"
              }
            ]
          },
          "registrationStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RegistrationStatus"
              }
            ]
          },
          "registrationStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "registrationStatusReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialStatusDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaryCnaeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCnaeDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "optingForSimples": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "simplesOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "simplesOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "optingForMei": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "meiOptInDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "meiOptOutDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "secondaryActivities": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonActivityDto"
            }
          },
          "partners": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PersonPartnerDto"
            }
          }
        }
      },
      "UpdateTenantRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Novo nome do tenant (opcional)"
          },
          "contactEmail": {
            "type": [
              "null",
              "string"
            ],
            "description": "Novo email de contato (opcional)"
          },
          "contactPhone": {
            "type": [
              "null",
              "string"
            ],
            "description": "Novo telefone de contato (opcional)"
          }
        },
        "description": "Request para atualizar um tenant"
      },
      "UpdateUserNavigationPreferencesDto": {
        "required": [
          "menuCollapsed",
          "favorites",
          "recents"
        ],
        "type": "object",
        "properties": {
          "menuCollapsed": {
            "type": "boolean"
          },
          "favorites": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NavigationRecentEntryDto"
            }
          },
          "favoriteFolders": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/NavigationFavoriteFolderDto"
            }
          },
          "shortcuts": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "moduleLayouts": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/NavigationModuleLayoutDto"
            }
          }
        }
      },
      "UpdateUserSettingsDto": {
        "required": [
          "language",
          "theme"
        ],
        "type": "object",
        "properties": {
          "language": {
            "type": "string"
          },
          "theme": {
            "type": "string"
          },
          "density": {
            "type": [
              "null",
              "string"
            ]
          },
          "reduceMotion": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "highContrast": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "fontScale": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateVariationTypeRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 0
          },
          "isActive": {
            "type": "boolean",
            "default": true
          },
          "values": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UpdateVariationTypeValueRequest"
            }
          }
        }
      },
      "UpdateVariationTypeValueRequest": {
        "required": [
          "id",
          "value"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "value": {
            "type": "string"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 0
          },
          "isActive": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "UpsertEmailTemplateRequest": {
        "required": [
          "subject",
          "mjmlSource"
        ],
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "description": "Novo assunto (obrigatório, não vazio, pode conter merge-tags)."
          },
          "mjmlSource": {
            "type": "string",
            "description": "Nova fonte MJML (obrigatória; precisa compilar)."
          }
        },
        "description": "Corpo do PUT: novo assunto + MJML do override."
      },
      "UpsertFieldMetadataDto": {
        "required": [
          "formKey",
          "roles"
        ],
        "type": "object",
        "properties": {
          "formKey": {
            "type": "string"
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/components/schemas/FieldMetadataItemDto"
              }
            }
          }
        }
      },
      "UserNavigationPreferencesResponseDto": {
        "required": [
          "menuCollapsed",
          "favorites",
          "recents",
          "favoriteFolders",
          "shortcuts",
          "moduleLayouts"
        ],
        "type": "object",
        "properties": {
          "menuCollapsed": {
            "type": "boolean"
          },
          "favorites": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NavigationRecentEntryDto"
            }
          },
          "favoriteFolders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NavigationFavoriteFolderDto"
            }
          },
          "shortcuts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "moduleLayouts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NavigationModuleLayoutDto"
            }
          }
        }
      },
      "UserResponseDto": {
        "required": [
          "id",
          "name",
          "email",
          "avatarUrl",
          "role",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UserSettingsResponseDto": {
        "required": [
          "id",
          "userId",
          "language",
          "theme",
          "density",
          "reduceMotion",
          "highContrast",
          "fontScale",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "language": {
            "type": "string"
          },
          "theme": {
            "type": "string"
          },
          "density": {
            "type": "string"
          },
          "reduceMotion": {
            "type": "boolean"
          },
          "highContrast": {
            "type": "boolean"
          },
          "fontScale": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "VariationTypeResponseDto": {
        "required": [
          "id",
          "name",
          "sortOrder",
          "isActive",
          "values",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VariationTypeValueResponseDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "VariationTypeSummaryDto": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "VariationTypeValueResponseDto": {
        "required": [
          "id",
          "value",
          "sortOrder",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "value": {
            "type": "string"
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "VariationTypeValueSummaryDto": {
        "required": [
          "id",
          "variationTypeId",
          "typeName",
          "value"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "variationTypeId": {
            "type": "string",
            "format": "uuid"
          },
          "typeName": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "VersionedLoadOrderCommandRequest": {
        "required": [
          "expectedVersion"
        ],
        "type": "object",
        "properties": {
          "expectedVersion": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "WorkspaceDto": {
        "required": [
          "id",
          "name",
          "tradeName",
          "cnpj",
          "sortOrder",
          "status",
          "organizationId",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "tradeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          },
          "sortOrder": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Insira o token JWT no formato: Bearer {seu_token}\n\nExemplo: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\n\nObtenha o token através do endpoint POST /api/v1/auth/login",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "mobileToken": {
        "type": "http",
        "description": "Sessão operacional móvel com tokenType=mobile_access.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "ApiKey": {
        "type": "apiKey",
        "description": "Insira a API Key gerada pelo sistema.\n\nExemplo: sk_abc12345...\n\nGere uma API Key através do endpoint POST /api/v1/api-keys (requer role Admin)",
        "name": "X-API-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ],
      "ApiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Erp.Api"
    },
    {
      "name": "ApiKeys"
    },
    {
      "name": "Auth"
    },
    {
      "name": "BarcodeConversions"
    },
    {
      "name": "Carriers"
    },
    {
      "name": "Cities"
    },
    {
      "name": "Countries"
    },
    {
      "name": "CspReport"
    },
    {
      "name": "Customers"
    },
    {
      "name": "Dashboard"
    },
    {
      "name": "DocumentLookupSettings"
    },
    {
      "name": "DocumentRegistry"
    },
    {
      "name": "EmailTemplates"
    },
    {
      "name": "Employees"
    },
    {
      "name": "FieldMetadata"
    },
    {
      "name": "Files"
    },
    {
      "name": "GameScores"
    },
    {
      "name": "IntegrationAuth"
    },
    {
      "name": "IntegrationCredentials"
    },
    {
      "name": "IntegrationListings"
    },
    {
      "name": "IntegrationLogisticsDemands"
    },
    {
      "name": "IntegrationMarketplaces"
    },
    {
      "name": "IntegrationProductBrands"
    },
    {
      "name": "IntegrationProductCategories"
    },
    {
      "name": "IntegrationProductModels"
    },
    {
      "name": "IntegrationProducts"
    },
    {
      "name": "IntegrationStockLocations"
    },
    {
      "name": "Invitations"
    },
    {
      "name": "Kardex"
    },
    {
      "name": "LoadOrderReadiness"
    },
    {
      "name": "LoadOrders"
    },
    {
      "name": "LoadOrderSupervision"
    },
    {
      "name": "LogisticsAuditSupervision"
    },
    {
      "name": "LogisticsDemands"
    },
    {
      "name": "LogisticsDemandSupervision"
    },
    {
      "name": "LogisticsEvidencePackages"
    },
    {
      "name": "LogisticsEvidences"
    },
    {
      "name": "LogisticsOperationalContext"
    },
    {
      "name": "LogisticsOperationsSetup"
    },
    {
      "name": "LogisticsReopen"
    },
    {
      "name": "LogisticsRetention"
    },
    {
      "name": "LogisticsRiskProfile"
    },
    {
      "name": "MarketplaceConnections"
    },
    {
      "name": "MarketplaceListings"
    },
    {
      "name": "MarketplaceOrders"
    },
    {
      "name": "Marketplaces"
    },
    {
      "name": "MarketplaceWebhooks"
    },
    {
      "name": "MobileCommandReceipts"
    },
    {
      "name": "MobileLoadOrders"
    },
    {
      "name": "MobileOperationsAuth"
    },
    {
      "name": "MobileRouteCommands"
    },
    {
      "name": "MobileRouteStops"
    },
    {
      "name": "NavigationInsights"
    },
    {
      "name": "Neighborhoods"
    },
    {
      "name": "Orders"
    },
    {
      "name": "Organizations"
    },
    {
      "name": "PersonAddresses"
    },
    {
      "name": "PersonClassifications"
    },
    {
      "name": "PersonContacts"
    },
    {
      "name": "PostalCodes"
    },
    {
      "name": "PriceTables"
    },
    {
      "name": "ProductBrands"
    },
    {
      "name": "ProductCategories"
    },
    {
      "name": "ProductModels"
    },
    {
      "name": "Products"
    },
    {
      "name": "Registration"
    },
    {
      "name": "States"
    },
    {
      "name": "StockLocations"
    },
    {
      "name": "Suppliers"
    },
    {
      "name": "SyncHealth"
    },
    {
      "name": "Tenants"
    },
    {
      "name": "TenantSettings"
    },
    {
      "name": "UnitOfMeasures"
    },
    {
      "name": "UserNavigation"
    },
    {
      "name": "Users"
    },
    {
      "name": "UserSettings"
    },
    {
      "name": "VariationTypes"
    }
  ]
}