{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "API para gerenciamento de dados de cidadãos do Rio de Janeiro, incluindo autodeclaração de informações e verificação de contato.", "title": "API RMI", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "Suporte RMI", "url": "http://www.rio.rj.gov.br", "email": "suporte@rio.rj.gov.br" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "host": "localhost:8080", "basePath": "/v1", "paths": { "/admin/beta/groups": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Lista todos os grupos beta com paginação (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Listar grupos beta", "parameters": [ { "type": "integer", "description": "Página (padrão: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Itens por página (padrão: 10)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "Lista de grupos beta obtida com sucesso", "schema": { "$ref": "#/definitions/models.BetaGroupListResponse" } }, "400": { "description": "Parâmetros de paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Cria um novo grupo beta para o chatbot (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Criar grupo beta", "parameters": [ { "description": "Dados do grupo", "name": "group", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaGroupRequest" } } ], "responses": { "201": { "description": "Grupo beta criado com sucesso", "schema": { "$ref": "#/definitions/models.BetaGroupResponse" } }, "400": { "description": "Dados inválidos ou nome de grupo inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito - nome de grupo já existe", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/groups/{group_id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Obtém um grupo beta por ID (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Obter grupo beta", "parameters": [ { "type": "string", "description": "ID do grupo", "name": "group_id", "in": "path", "required": true } ], "responses": { "200": { "description": "Grupo beta obtido com sucesso", "schema": { "$ref": "#/definitions/models.BetaGroupResponse" } }, "400": { "description": "ID do grupo é obrigatório ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Grupo beta não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza um grupo beta existente (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Atualizar grupo beta", "parameters": [ { "type": "string", "description": "ID do grupo", "name": "group_id", "in": "path", "required": true }, { "description": "Dados do grupo", "name": "group", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaGroupRequest" } } ], "responses": { "200": { "description": "Grupo beta atualizado com sucesso", "schema": { "$ref": "#/definitions/models.BetaGroupResponse" } }, "400": { "description": "ID do grupo ou dados inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Grupo beta não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito - nome de grupo já existe", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Exclui um grupo beta e remove todas as associações de telefones (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Groups" ], "summary": "Excluir grupo beta", "parameters": [ { "type": "string", "description": "ID do grupo", "name": "group_id", "in": "path", "required": true } ], "responses": { "204": { "description": "Grupo excluído com sucesso" }, "400": { "description": "ID do grupo é obrigatório ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Grupo beta não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Lista telefones na whitelist beta com paginação (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Listar telefones na whitelist", "parameters": [ { "type": "integer", "description": "Página (padrão: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Itens por página (padrão: 10)", "name": "per_page", "in": "query" }, { "type": "string", "description": "Filtrar por ID do grupo", "name": "group_id", "in": "query" } ], "responses": { "200": { "description": "Lista de telefones na whitelist obtida com sucesso", "schema": { "$ref": "#/definitions/models.BetaWhitelistListResponse" } }, "400": { "description": "Parâmetros de paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist/bulk-add": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Adiciona múltiplos números de telefone a um grupo beta (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Adicionar múltiplos telefones à whitelist", "parameters": [ { "description": "Dados da operação em lote", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaWhitelistBulkRequest" } } ], "responses": { "200": { "description": "Telefones adicionados à whitelist em lote com sucesso", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.BetaWhitelistResponse" } } }, "400": { "description": "Dados inválidos ou lista de telefones vazia", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Grupo beta não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist/bulk-move": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Move múltiplos números de telefone de um grupo beta para outro (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Mover múltiplos telefones entre grupos", "parameters": [ { "description": "Dados da operação de movimentação", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaWhitelistMoveRequest" } } ], "responses": { "200": { "description": "Telefones movidos entre grupos com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Dados inválidos ou IDs de grupos iguais", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Grupo beta de origem ou destino não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist/bulk-remove": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Remove múltiplos números de telefone da whitelist beta (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Remover múltiplos telefones da whitelist", "parameters": [ { "description": "Dados da operação em lote", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaWhitelistBulkRemoveRequest" } } ], "responses": { "200": { "description": "Telefones removidos da whitelist em lote com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Dados inválidos ou lista de telefones vazia", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/beta/whitelist/{phone_number}": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Adiciona um número de telefone a um grupo beta (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Adicionar telefone à whitelist", "parameters": [ { "type": "string", "description": "Número de telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados da whitelist", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BetaWhitelistRequest" } } ], "responses": { "200": { "description": "Telefone adicionado à whitelist com sucesso", "schema": { "$ref": "#/definitions/models.BetaWhitelistResponse" } }, "400": { "description": "Número de telefone ou dados inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Grupo beta não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito - telefone já está na whitelist", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Remove um número de telefone da whitelist beta (apenas administradores)", "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Remover telefone da whitelist", "parameters": [ { "type": "string", "description": "Número de telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "Telefone removido da whitelist com sucesso", "schema": { "$ref": "#/definitions/models.BetaWhitelistResponse" } }, "400": { "description": "Número de telefone é obrigatório ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Telefone não encontrado na whitelist", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/cache/read": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Permite aos administradores ler qualquer chave do cache Redis para debug e monitoramento", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Ler chave arbitrária do cache Redis", "parameters": [ { "description": "Chave do cache para ler", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CacheReadRequest" } } ], "responses": { "200": { "description": "Dados da chave do cache", "schema": { "$ref": "#/definitions/handlers.CacheReadResponse" } }, "400": { "description": "Parâmetros inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/cpf-secretaria/{cpf}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retorna todos os vínculos de secretaria associados a um CPF na base de apoio.", "produces": [ "application/json" ], "tags": [ "admin", "cpf-secretaria" ], "summary": "Listar vínculos CPF-Secretaria", "parameters": [ { "type": "string", "description": "CPF do usuário (11 dígitos)", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.CPFSecretariaListResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Vincula um CPF a uma secretaria (cd_ua SICI) na base de apoio. Um CPF pode ter múltiplos vínculos.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin", "cpf-secretaria" ], "summary": "Adicionar vínculo CPF-Secretaria", "parameters": [ { "type": "string", "description": "CPF do usuário (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "description": "cd_ua da secretaria", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.AddCPFSecretariaRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/models.CPFSecretariaResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/cpf-secretaria/{cpf}/{cd_ua}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Remove o vínculo entre um CPF e uma secretaria específica.", "produces": [ "application/json" ], "tags": [ "admin", "cpf-secretaria" ], "summary": "Remover vínculo CPF-Secretaria", "parameters": [ { "type": "string", "description": "CPF do usuário (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "Código da UA (SICI)", "name": "cd_ua", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/mobilidade/vehicle-brands": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Lista completa de marcas do catálogo, incluindo soft-deleted (admin).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Listar marcas (admin)", "responses": { "200": { "description": "Lista tipada de marcas em data", "schema": { "$ref": "#/definitions/models.VehicleBrandsResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Cadastra uma marca no catálogo. ID gerado no backend (brand_\u0026lt;slug\u0026gt;); is_other=false.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Criar marca (admin)", "parameters": [ { "description": "Nome da marca", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.VehicleBrandCreateRequest" } } ], "responses": { "201": { "description": "Marca criada", "schema": { "$ref": "#/definitions/models.VehicleBrand" } }, "400": { "description": "Validação inválida", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Nome ou ID já existente", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/mobilidade/vehicle-brands/{brand_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Soft-delete de marca. 409 se houver modelos ativos ou veículos referenciando. Sentinel brand_outro não pode ser excluída.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Excluir marca (admin, soft-delete)", "parameters": [ { "type": "string", "description": "ID da marca", "name": "brand_id", "in": "path", "required": true } ], "responses": { "204": { "description": "Marca excluída" }, "400": { "description": "Sentinel ou validação", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Marca não encontrada", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Modelos ativos ou veículos referenciando", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "patch": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza o nome de uma marca ativa. Sentinel brand_outro não pode ser alterada. 409 se referenciada por veículo.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Atualizar marca (admin)", "parameters": [ { "type": "string", "description": "ID da marca", "name": "brand_id", "in": "path", "required": true }, { "description": "Campos a atualizar", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.VehicleBrandUpdateRequest" } } ], "responses": { "200": { "description": "Marca atualizada", "schema": { "$ref": "#/definitions/models.VehicleBrand" } }, "400": { "description": "Validação inválida ou sentinel", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Marca não encontrada", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito (nome duplicado ou veículo referenciando)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/mobilidade/vehicle-models": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Lista completa de modelos, incluindo soft-deleted. Filtro opcional por brand_id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Listar modelos (admin)", "parameters": [ { "type": "string", "description": "Filtrar por ID da marca", "name": "brand_id", "in": "query" } ], "responses": { "200": { "description": "Lista tipada de modelos em data", "schema": { "$ref": "#/definitions/models.VehicleModelsResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Cadastra um modelo vinculado a brand_id com vehicle_type. ID gerado no backend; is_other=false.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Criar modelo (admin)", "parameters": [ { "description": "Dados do modelo", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.VehicleModelCreateRequest" } } ], "responses": { "201": { "description": "Modelo criado", "schema": { "$ref": "#/definitions/models.VehicleModel" } }, "400": { "description": "Validação inválida", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Marca não encontrada", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Nome ou ID já existente", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/mobilidade/vehicle-models/{model_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Soft-delete de modelo. 409 se veículos referenciarem. Sentinel model_outro não pode ser excluído.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Excluir modelo (admin, soft-delete)", "parameters": [ { "type": "string", "description": "ID do modelo", "name": "model_id", "in": "path", "required": true } ], "responses": { "204": { "description": "Modelo excluído" }, "400": { "description": "Sentinel ou validação", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Modelo não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Veículos referenciando", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "patch": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza nome, vehicle_type e/ou brand_id de um modelo ativo. Sentinel model_outro não pode ser alterado. 409 se referenciado por veículo.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Atualizar modelo (admin)", "parameters": [ { "type": "string", "description": "ID do modelo", "name": "model_id", "in": "path", "required": true }, { "description": "Campos a atualizar", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.VehicleModelUpdateRequest" } } ], "responses": { "200": { "description": "Modelo atualizado", "schema": { "$ref": "#/definitions/models.VehicleModel" } }, "400": { "description": "Validação inválida ou sentinel", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Modelo ou marca não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito (nome duplicado ou veículo referenciando)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/notification-categories": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new notification category (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-categories" ], "summary": "Create notification category", "parameters": [ { "description": "Category data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.CreateNotificationCategoryRequest" } } ], "responses": { "201": { "description": "Category created successfully", "schema": { "$ref": "#/definitions/models.NotificationCategory" } }, "400": { "description": "Invalid request body", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Category already exists", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/notification-categories/{category_id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing notification category (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-categories" ], "summary": "Update notification category", "parameters": [ { "type": "string", "description": "Category ID", "name": "category_id", "in": "path", "required": true }, { "description": "Updated category data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UpdateNotificationCategoryRequest" } } ], "responses": { "200": { "description": "Category updated successfully", "schema": { "$ref": "#/definitions/models.NotificationCategory" } }, "400": { "description": "Invalid request body", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Category not found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Soft-delete a notification category by setting active=false (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-categories" ], "summary": "Delete notification category", "parameters": [ { "type": "string", "description": "Category ID", "name": "category_id", "in": "path", "required": true } ], "responses": { "204": { "description": "Category deleted successfully" }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Category not found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/phone/quarantine/stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Obtém estatísticas sobre telefones em quarentena (apenas administradores)", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Obter estatísticas de quarentena", "responses": { "200": { "description": "Estatísticas de quarentena obtidas com sucesso", "schema": { "$ref": "#/definitions/models.QuarantineStats" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores podem obter estatísticas de quarentena", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/admin/phone/quarantined": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Lista todos os telefones em quarentena com paginação (apenas administradores)", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Listar telefones em quarentena", "parameters": [ { "type": "integer", "description": "Página (padrão: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Itens por página (padrão: 10)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "Lista de telefones em quarentena obtida com sucesso", "schema": { "$ref": "#/definitions/models.QuarantinedListResponse" } }, "400": { "description": "Parâmetros de paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores podem listar telefones em quarentena", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/auth/validate": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Orquestra o Person Account no Salesforce: GET → match / PATCH silencioso de email / POST create em 404 (contaOrigem Portal Pref.Rio). Usa CPF, nome e email do JWT. Não persiste dados do SF no Mongo do RMI.", "produces": [ "application/json" ], "tags": [ "salesforce" ], "summary": "Sincronizar Person Account no login", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.AuthValidateResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "502": { "description": "Falha ao chamar Salesforce", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "503": { "description": "SALESFORCE_BASE_URL não configurado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/avatars": { "get": { "description": "Obtém lista paginada de avatares de foto de perfil disponíveis", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars" ], "summary": "Listar avatares disponíveis", "parameters": [ { "type": "integer", "description": "Número da página (padrão: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Itens por página (padrão: 20, máximo: 100)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "Lista de avatares obtida com sucesso", "schema": { "$ref": "#/definitions/models.AvatarsListResponse" } }, "400": { "description": "Parâmetros de paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Cria um novo avatar de foto de perfil (somente administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars" ], "summary": "Criar novo avatar", "parameters": [ { "description": "Dados do avatar", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.AvatarRequest" } } ], "responses": { "201": { "description": "Avatar criado com sucesso", "schema": { "$ref": "#/definitions/models.AvatarResponse" } }, "400": { "description": "Dados de avatar inválidos ou formato incorreto", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/avatars/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Exclui um avatar de foto de perfil (exclusão suave, somente administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars" ], "summary": "Excluir avatar", "parameters": [ { "type": "string", "description": "ID do avatar", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Avatar excluído com sucesso" }, "400": { "description": "ID do avatar é obrigatório ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Avatar não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/disability/options": { "get": { "description": "Retorna a lista de opções válidas de condições de deficiência para autodeclaração.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Listar opções de deficiência", "responses": { "200": { "description": "Lista de opções de deficiência válidas obtida com sucesso", "schema": { "type": "array", "items": { "type": "string" } } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/education/options": { "get": { "description": "Retorna a lista de opções válidas de níveis de escolaridade para autodeclaração.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Listar opções de escolaridade", "responses": { "200": { "description": "Lista de opções de escolaridade válidas obtida com sucesso", "schema": { "type": "array", "items": { "type": "string" } } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/ethnicity/options": { "get": { "description": "Retorna a lista de opções válidas de etnia para autodeclaração. Esta lista é usada para validar as atualizações de etnia autodeclarada.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Listar opções de etnia", "responses": { "200": { "description": "Lista de opções de etnia válidas obtida com sucesso", "schema": { "type": "array", "items": { "type": "string" } } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/family-income/options": { "get": { "description": "Retorna a lista de opções válidas de faixas de renda familiar mensal para autodeclaração.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Listar opções de renda familiar", "responses": { "200": { "description": "Lista de opções de renda familiar válidas obtida com sucesso", "schema": { "type": "array", "items": { "type": "string" } } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/gender/options": { "get": { "description": "Retorna a lista de opções sugeridas de gênero para autodeclaração. Nota: Este campo aceita qualquer texto livre para a opção \"Outro\".", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Listar opções de gênero", "responses": { "200": { "description": "Lista de opções de gênero sugeridas obtida com sucesso", "schema": { "type": "array", "items": { "type": "string" } } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera os dados do cidadão por CPF, incluindo informações básicas e dados autodeclarados.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter dados do cidadão", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Dados do cidadão obtidos com sucesso", "schema": { "$ref": "#/definitions/models.Citizen" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Cidadão não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/address": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o endereço autodeclarado de um cidadão por CPF. Apenas o campo de endereço é atualizado.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar endereço autodeclarado", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Endereço autodeclarado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredAddressInput" } } ], "responses": { "200": { "description": "Endereço autodeclarado atualizado com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou dados de endereço incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito - endereço não alterado (dados idênticos aos atuais)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - informações de endereço inválidas", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/avatar": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Obtém o avatar de foto de perfil atual de um usuário", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars", "citizen" ], "summary": "Obter avatar atual do usuário", "parameters": [ { "type": "string", "description": "CPF do usuário", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Avatar do usuário obtido com sucesso", "schema": { "$ref": "#/definitions/models.UserAvatarResponse" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Usuário não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Define ou altera o avatar de foto de perfil de um usuário", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "avatars", "citizen" ], "summary": "Atualizar avatar do usuário", "parameters": [ { "type": "string", "description": "CPF do usuário", "name": "cpf", "in": "path", "required": true }, { "description": "Seleção de avatar", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UserAvatarRequest" } } ], "responses": { "200": { "description": "Avatar do usuário atualizado com sucesso", "schema": { "$ref": "#/definitions/models.UserAvatarResponse" } }, "400": { "description": "Formato de CPF inválido ou ID de avatar inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Usuário ou avatar não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - avatar inexistente ou inativo", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/birth-date": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou define a data de nascimento autodeclarada do cidadão. Bloqueado se já houver data oficial.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar data de nascimento autodeclarada", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "description": "Data de nascimento autodeclarada (YYYY-MM-DD)", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredBirthDateInput" } } ], "responses": { "200": { "description": "Data de nascimento atualizada com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF ou data inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Data de nascimento oficial não pode ser alterada por autodeclaração", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/disability": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria a condição de deficiência autodeclarada de um cidadão por CPF. O valor deve ser uma das opções válidas retornadas pelo endpoint /citizen/disability/options.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar deficiência autodeclarada", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Deficiência autodeclarada", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredDeficienciaInput" } } ], "responses": { "200": { "description": "Deficiência atualizada com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou valor de deficiência inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - valor de deficiência não é válido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/education": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o nível de escolaridade autodeclarado de um cidadão por CPF. O valor deve ser uma das opções válidas retornadas pelo endpoint /citizen/education/options.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar escolaridade autodeclarada", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Escolaridade autodeclarada", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredEscolaridadeInput" } } ], "responses": { "200": { "description": "Escolaridade atualizada com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou valor de escolaridade inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - valor de escolaridade não é válido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/email": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o email autodeclarado de um cidadão por CPF. Apenas o campo de email é atualizado.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar email autodeclarado", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Email autodeclarado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredEmailInput" } } ], "responses": { "200": { "description": "Email autodeclarado atualizado com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou dados de email incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Cidadão não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito - email não alterado (email corresponde aos dados atuais)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - formato de email inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/ethnicity": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria a etnia autodeclarada de um cidadão por CPF. Apenas o campo de etnia é atualizado. O valor deve ser uma das opções válidas retornadas pelo endpoint /citizen/ethnicity/options.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar etnia autodeclarada", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Etnia autodeclarada", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredRacaInput" } } ], "responses": { "200": { "description": "Etnia atualizada com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou valor de etnia inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Cidadão não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - valor de etnia não é válido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/exhibition-name": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o nome de exibição autodeclarado de um cidadão por CPF. Apenas o campo de nome de exibição é atualizado. O nome de exibição é o nome que aparece na interface do usuário, permitindo ao cidadão controlar como seu nome é exibido no aplicativo.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar nome de exibição autodeclarado", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Nome de exibição autodeclarado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredNomeExibicaoInput" } } ], "responses": { "200": { "description": "Nome de exibição atualizado com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou valor de nome de exibição inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Cidadão não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - nome de exibição muito longo ou vazio", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/family-income": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria a renda familiar mensal autodeclarada de um cidadão por CPF. O valor deve ser uma das opções válidas retornadas pelo endpoint /citizen/family-income/options.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar renda familiar autodeclarada", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Renda familiar autodeclarada", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredRendaFamiliarInput" } } ], "responses": { "200": { "description": "Renda familiar atualizada com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou valor de renda familiar inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - valor de renda familiar não é válido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/firstlogin": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Verifica se este é o primeiro login do usuário", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter status do primeiro login", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Status do primeiro login obtido com sucesso", "schema": { "$ref": "#/definitions/models.UserConfigResponse" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Define o status do primeiro login como falso para um usuário", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar status do primeiro login", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Status do primeiro login atualizado com sucesso", "schema": { "$ref": "#/definitions/models.UserConfigResponse" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/gender": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o gênero autodeclarado de um cidadão por CPF. Aceita qualquer valor de texto livre, mas as opções sugeridas estão disponíveis no endpoint /citizen/gender/options.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar gênero autodeclarado", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Gênero autodeclarado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredGeneroInput" } } ], "responses": { "200": { "description": "Gênero atualizado com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou valor de gênero vazio", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/legal-entities": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera a lista paginada de entidades jurídicas (pessoas jurídicas) associadas ao CPF do cidadão. A busca é feita através do campo 'cpf_socio' no array 'socios' de cada entidade.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter entidades jurídicas associadas ao CPF", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "minimum": 1, "type": "integer", "description": "Número da página (padrão: 1)", "name": "page", "in": "query" }, { "maximum": 100, "minimum": 1, "type": "integer", "description": "Itens por página (padrão: 10, máximo: 100)", "name": "per_page", "in": "query" }, { "type": "string", "description": "Filtro opcional por ID da natureza jurídica", "name": "natureza_juridica_id", "in": "query" } ], "responses": { "200": { "description": "Lista paginada de entidades jurídicas obtida com sucesso", "schema": { "$ref": "#/definitions/models.PaginatedLegalEntities" } }, "400": { "description": "Formato de CPF inválido ou parâmetros de paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/maintenance-request": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera os chamados do 1746 de um cidadão por CPF com paginação. Cada documento representa um chamado individual.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter chamados do 1746 do cidadão", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "minimum": 1, "type": "integer", "description": "Número da página (padrão: 1)", "name": "page", "in": "query" }, { "maximum": 100, "minimum": 1, "type": "integer", "description": "Itens por página (padrão: 10, máximo: 100)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "Lista paginada de chamados do 1746 obtida com sucesso", "schema": { "$ref": "#/definitions/models.PaginatedMaintenanceRequests" } }, "400": { "description": "Formato de CPF inválido ou parâmetros de paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/notification-preferences": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get notification preferences for a citizen including global and category opt-ins", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-preferences" ], "summary": "Get citizen notification preferences", "parameters": [ { "type": "string", "description": "CPF number", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Notification preferences", "schema": { "$ref": "#/definitions/models.NotificationPreferencesResponse" } }, "400": { "description": "Invalid CPF format", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Access denied", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update notification preferences for a citizen (global and/or category opt-ins)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-preferences" ], "summary": "Update citizen notification preferences", "parameters": [ { "type": "string", "description": "CPF number", "name": "cpf", "in": "path", "required": true }, { "description": "Updated preferences", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UpdateNotificationPreferencesRequest" } } ], "responses": { "200": { "description": "Preferences updated successfully", "schema": { "$ref": "#/definitions/models.NotificationPreferencesResponse" } }, "400": { "description": "Invalid CPF format or request body", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Access denied", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Invalid category ID", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/notification-preferences/categories/{category_id}": { "patch": { "security": [ { "BearerAuth": [] } ], "description": "Update opt-in preference for a single notification category", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-preferences" ], "summary": "Update single category preference", "parameters": [ { "type": "string", "description": "CPF number", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "Category ID", "name": "category_id", "in": "path", "required": true }, { "description": "Category preference", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UpdateCategoryPreferenceRequest" } } ], "responses": { "200": { "description": "Preference updated successfully", "schema": { "$ref": "#/definitions/models.NotificationPreferencesResponse" } }, "400": { "description": "Invalid CPF format or request body", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Access denied", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Invalid category ID", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/optin": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Verifica se o usuário optou por receber notificações", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter status de opt-in", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Status do opt-in obtido com sucesso", "schema": { "$ref": "#/definitions/models.UserConfigOptInResponse" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza o status de opt-in do usuário para notificações", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar status de opt-in", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Status de opt-in", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UserConfigOptInResponse" } } ], "responses": { "200": { "description": "Status do opt-in atualizado com sucesso", "schema": { "$ref": "#/definitions/models.UserConfigOptInResponse" } }, "400": { "description": "Formato de CPF inválido ou dados de opt-in incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - valor de opt-in inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/pets": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera a lista paginada de pets associados ao CPF do cidadão.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter pets associados ao CPF", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "minimum": 1, "type": "integer", "description": "Número da página (padrão: 1)", "name": "page", "in": "query" }, { "maximum": 100, "minimum": 1, "type": "integer", "description": "Itens por página (padrão: 10, máximo: 100)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "Lista paginada de pets obtida com sucesso", "schema": { "$ref": "#/definitions/models.PaginatedPets" } }, "400": { "description": "Formato de CPF inválido ou parâmetros de paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Registra um novo pet para o CPF do cidadão (auto-declarado).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Registrar novo pet", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "description": "Dados do pet para registro", "name": "pet", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.PetRegistrationRequest" } } ], "responses": { "201": { "description": "Pet registrado com sucesso", "schema": { "$ref": "#/definitions/models.Pet" } }, "400": { "description": "Formato de CPF inválido ou dados do pet inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/pets/stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera as estatísticas de quantidade de pets por tipo associadas ao CPF do cidadão.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter estatísticas de pets do CPF", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Estatísticas obtidas com sucesso", "schema": { "$ref": "#/definitions/models.PetStatsResponse" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/pets/{pet_id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera um pet específico associado ao CPF do cidadão pelo ID do pet.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter pet específico por ID", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "integer", "description": "ID do pet", "name": "pet_id", "in": "path", "required": true } ], "responses": { "200": { "description": "Pet obtido com sucesso", "schema": { "$ref": "#/definitions/models.Pet" } }, "400": { "description": "Formato de CPF inválido ou ID do pet inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Pet não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/phone": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza ou cria o telefone autodeclarado de um cidadão por CPF. Apenas o campo de telefone é atualizado (armazenado como pendente até verificado).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Atualizar telefone autodeclarado", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Telefone autodeclarado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.SelfDeclaredPhoneInput" } } ], "responses": { "200": { "description": "Telefone autodeclarado submetido para validação com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou dados de telefone incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Cidadão não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito - telefone não alterado (telefone corresponde aos dados atuais verificados)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - formato de telefone inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/phone/validate": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Valida o código de verificação enviado para o número de telefone", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Validar verificação de telefone", "parameters": [ { "type": "string", "description": "Número do CPF", "name": "cpf", "in": "path", "required": true }, { "description": "Código de verificação e telefone", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.PhoneVerificationValidateRequest" } } ], "responses": { "200": { "description": "Código de verificação validado com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Formato de CPF inválido ou dados de verificação incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Código de verificação não encontrado ou expirado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - código inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/vehicle-invitations": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Lista convites pending em que o CPF é o convidado.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Listar convites pendentes de veículo", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Convites pendentes", "schema": { "$ref": "#/definitions/models.VehicleInvitationsResponse" } }, "400": { "description": "CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/vehicle-invitations/{conductor_id}": { "patch": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza status do convite para accepted ou rejected (somente o convidado).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Aceitar ou recusar convite de veículo", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "ID do vínculo/convite", "name": "conductor_id", "in": "path", "required": true }, { "description": "Novo status", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.RespondInvitationRequest" } } ], "responses": { "200": { "description": "Convite respondido", "schema": { "$ref": "#/definitions/models.VehicleConductor" } }, "400": { "description": "Validação inválida", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Convite não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/vehicles": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retorna veículos em que o CPF é proprietário ou condutor aceito, com role em cada item. Quando role=conductor, inclui conductor_id (id do vínculo aceito). brand_name/model_name são resolvidos do catálogo quando há brand_id/model_id e não há brand_other/model_other.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Listar veículos da carteira (mobilidade)", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "minimum": 1, "type": "integer", "description": "Número da página (padrão: 1)", "name": "page", "in": "query" }, { "maximum": 100, "minimum": 1, "type": "integer", "description": "Itens por página (padrão: 10, máximo: 100)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "Lista paginada de veículos", "schema": { "$ref": "#/definitions/models.PaginatedVehicles" } }, "400": { "description": "CPF ou paginação inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Cadastra um veículo para o CPF autenticado. Fluxo catálogo (brand_id+model_id), híbrido (brand_id + model_other sem model_id) ou Outro livre (brand_other/model_other+vehicle_type). URLs de foto devem ser HTTPS GCS. Se has_invoice=true, invoice_photo_url é obrigatória. Contato do dono (nome/telefone/e-mail) é enriquecido ao vivo via RMI a partir do owner_cpf — não enviar owner_* no body. registration_number é gerado pelo backend (formato RJ-E-XXXXXX).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Cadastrar veículo", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "description": "Dados do veículo", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.VehicleCreateRequest" } } ], "responses": { "201": { "description": "Veículo criado", "schema": { "$ref": "#/definitions/models.VehicleDetail" } }, "400": { "description": "Validação inválida", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/vehicles/{vehicle_id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retorna o detalhe do veículo para proprietário ou condutor aceito (inclui invoice_photo_url, metadados de arquivos e registration_number). Quando role=conductor, inclui conductor_id (id do vínculo aceito). owner_name/owner_phone/owner_email são enriquecidos ao vivo via RMI a partir de owner_cpf. brand_name/model_name vêm do catálogo quando há brand_id/model_id e não há texto livre (*_other).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Obter detalhe do veículo", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "ID do veículo", "name": "vehicle_id", "in": "path", "required": true } ], "responses": { "200": { "description": "Detalhe do veículo", "schema": { "$ref": "#/definitions/models.VehicleDetail" } }, "400": { "description": "CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Veículo não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Soft-delete do veículo e revoga vínculos pending/accepted (somente proprietário).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Excluir veículo (soft delete)", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "ID do veículo", "name": "vehicle_id", "in": "path", "required": true } ], "responses": { "204": { "description": "Veículo excluído" }, "400": { "description": "CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Veículo não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "patch": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza campos do veículo (somente proprietário). Em mudança de marca/modelo do catálogo, vehicle_type é rederivado do modelo. Para trocar para fluxo Outro (texto livre), envie brand_id/model_id como null (ou \"\") junto com brand_other/model_other e vehicle_type; campo omitido não altera o valor atual.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Atualizar veículo", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "ID do veículo", "name": "vehicle_id", "in": "path", "required": true }, { "description": "Campos a atualizar", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.VehicleUpdateRequest" } } ], "responses": { "200": { "description": "Veículo atualizado", "schema": { "$ref": "#/definitions/models.VehicleDetail" } }, "400": { "description": "Validação inválida", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado (não é o proprietário)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Veículo não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/vehicles/{vehicle_id}/conductors": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Lista vínculos pending e accepted (somente proprietário). Pending devolve snapshot do convite; accepted enriquece nome/e-mail/celular ao vivo via RMI.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Listar condutores do veículo", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "ID do veículo", "name": "vehicle_id", "in": "path", "required": true } ], "responses": { "200": { "description": "Lista de condutores", "schema": { "$ref": "#/definitions/models.ConductorsListResponse" } }, "400": { "description": "CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Veículo não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Cria vínculo pending e enfileira e-mail de convite via notify_email do body (somente proprietário). name/phone são hints opcionais enquanto pending. Duplicata pending/accepted retorna 409.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Convidar condutor", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "ID do veículo", "name": "vehicle_id", "in": "path", "required": true }, { "description": "CPF + e-mail do convidado (name/phone opcionais)", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.InviteConductorRequest" } } ], "responses": { "201": { "description": "Convite criado", "schema": { "$ref": "#/definitions/models.VehicleConductor" } }, "400": { "description": "Validação inválida", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Veículo não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Já existe vínculo pending/accepted", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/vehicles/{vehicle_id}/conductors/{conductor_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Proprietário revoga pending/accepted; condutor aceito pode sair (self-leave).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Remover / revogar condutor", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true }, { "type": "string", "description": "ID do veículo", "name": "vehicle_id", "in": "path", "required": true }, { "type": "string", "description": "ID do vínculo", "name": "conductor_id", "in": "path", "required": true } ], "responses": { "204": { "description": "Vínculo revogado" }, "400": { "description": "Validação inválida", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/citizen/{cpf}/wallet": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera os dados da carteira do cidadão por CPF, incluindo informações de saúde e outros dados da carteira.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "citizen" ], "summary": "Obter dados da carteira do cidadão", "parameters": [ { "maxLength": 11, "minLength": 11, "type": "string", "description": "CPF do cidadão (11 dígitos)", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "Dados da carteira do cidadão obtidos com sucesso", "schema": { "$ref": "#/definitions/models.CitizenWallet" } }, "400": { "description": "Formato de CPF inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Cidadão não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/cnaes": { "get": { "description": "Recupera a lista paginada de CNAEs (Classificação Nacional de Atividades Econômicas) com filtros opcionais", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "cnaes" ], "summary": "Listar CNAEs", "parameters": [ { "minimum": 1, "type": "integer", "description": "Número da página (padrão: 1)", "name": "page", "in": "query" }, { "maximum": 100, "minimum": 1, "type": "integer", "description": "Itens por página (padrão: 10, máximo: 100)", "name": "per_page", "in": "query" }, { "type": "string", "description": "Texto para busca na denominação", "name": "search", "in": "query" }, { "type": "string", "description": "Filtro por seção (ex: A)", "name": "secao", "in": "query" }, { "type": "string", "description": "Filtro por divisão (ex: 1)", "name": "divisao", "in": "query" }, { "type": "string", "description": "Filtro por grupo (ex: 1.1)", "name": "grupo", "in": "query" }, { "type": "string", "description": "Filtro por classe (ex: 01.12-1)", "name": "classe", "in": "query" }, { "type": "string", "description": "Filtro por subclasse", "name": "subclasse", "in": "query" } ], "responses": { "200": { "description": "Lista paginada de CNAEs obtida com sucesso", "schema": { "$ref": "#/definitions/models.CNAEListResponse" } }, "400": { "description": "Parâmetros inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/config/channels": { "get": { "description": "Obtém a lista de canais disponíveis para comunicação", "produces": [ "application/json" ], "tags": [ "config" ], "summary": "Obter canais disponíveis", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/config/opt-out-reasons": { "get": { "description": "Obtém a lista de motivos válidos para opt-out", "produces": [ "application/json" ], "tags": [ "config" ], "summary": "Obter motivos de opt-out", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/cpf-secretaria/{cpf}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retorna a lista de cd_uas vinculados ao CPF na base de apoio. Usado por outras APIs (app-go-api) via service account.", "produces": [ "application/json" ], "tags": [ "cpf-secretaria" ], "summary": "Consultar secretarias de um CPF", "parameters": [ { "type": "string", "description": "CPF do usuário (11 dígitos)", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.CPFSecretariaQueryResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/departments": { "get": { "description": "Recupera a lista paginada de departamentos com filtros opcionais (hierarquia, nível, busca).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "departments" ], "summary": "Listar departamentos/unidades administrativas", "parameters": [ { "type": "string", "description": "Código da UA pai para filtrar departamentos filhos", "name": "parent_id", "in": "query" }, { "minimum": 1, "type": "integer", "description": "Nível mínimo do departamento", "name": "min_level", "in": "query" }, { "minimum": 1, "type": "integer", "description": "Nível máximo do departamento", "name": "max_level", "in": "query" }, { "minimum": 1, "type": "integer", "description": "Nível exato do departamento (sobrescreve min/max)", "name": "exact_level", "in": "query" }, { "type": "string", "description": "Sigla da UA para filtro exato", "name": "sigla_ua", "in": "query" }, { "type": "string", "description": "Texto para busca textual em nome_ua", "name": "search", "in": "query" }, { "minimum": 1, "type": "integer", "description": "Número da página (padrão: 1)", "name": "page", "in": "query" }, { "maximum": 100, "minimum": 1, "type": "integer", "description": "Itens por página (padrão: 10, máximo: 100)", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "Lista paginada de departamentos obtida com sucesso", "schema": { "$ref": "#/definitions/models.DepartmentListResponse" } }, "400": { "description": "Parâmetros inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/departments/{cd_ua}": { "get": { "description": "Recupera um departamento específico pelo código da UA (cd_ua).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "departments" ], "summary": "Obter departamento/unidade administrativa por ID", "parameters": [ { "type": "string", "description": "Código da Unidade Administrativa", "name": "cd_ua", "in": "path", "required": true } ], "responses": { "200": { "description": "Departamento obtido com sucesso", "schema": { "$ref": "#/definitions/models.DepartmentResponse" } }, "400": { "description": "Código da UA inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Departamento não encontrado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/health": { "get": { "description": "Verifica a saúde da API e suas dependências (MongoDB e Redis). Retorna status detalhado para cada serviço.", "produces": [ "application/json" ], "tags": [ "health" ], "summary": "Verificação de saúde", "responses": { "200": { "description": "Todos os serviços estão saudáveis", "schema": { "$ref": "#/definitions/handlers.HealthResponse" } }, "500": { "description": "Um ou mais serviços não estão saudáveis", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/legal-entity/{cnpj}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera informações detalhadas de uma entidade jurídica (pessoa jurídica) pelo CNPJ. O acesso é permitido para administradores ou se o CPF do JWT estiver como responsável ou sócio da entidade.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "legal-entity" ], "summary": "Obter informações de uma entidade jurídica por CNPJ", "parameters": [ { "maxLength": 14, "minLength": 14, "type": "string", "description": "CNPJ da entidade (14 dígitos)", "name": "cnpj", "in": "path", "required": true } ], "responses": { "200": { "description": "Informações da entidade jurídica obtidas com sucesso", "schema": { "$ref": "#/definitions/models.LegalEntity" } }, "400": { "description": "Formato de CNPJ inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - sem permissão para visualizar esta entidade", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Entidade jurídica não encontrada", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/memory/{phone_number}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera a lista de memórias associadas ao telefone do cidadão.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "memory" ], "summary": "Obter memórias associadas ao número de telefone.", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "Lista de memórias obtida com sucesso", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.MemoryModel" } } }, "400": { "description": "Número de telefone inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Atualiza uma única memória associada ao telefone do cidadão.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "memory" ], "summary": "Atualiza memória associada ao número de telefone.", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados da memória a ser atualizada (memory_name identifica qual memória atualizar)", "name": "memory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.MemoryModel" } } ], "responses": { "200": { "description": "Memória atualizada com sucesso", "schema": { "$ref": "#/definitions/handlers.SuccessResponse" } }, "400": { "description": "Número de telefone ou nome da memória inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Memória não encontrada", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Cria uma única memória associada ao telefone do cidadão.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "memory" ], "summary": "Cria memória associada ao número de telefone.", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados da memória a ser criada", "name": "memory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.MemoryModel" } } ], "responses": { "201": { "description": "Memória criada com sucesso", "schema": { "$ref": "#/definitions/handlers.MemoryModel" } }, "400": { "description": "Número de telefone ou dados da memória inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Memória com esse nome já existe para este número de telefone", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/memory/{phone_number}/{memory_name}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Recupera uma única memória associada ao telefone do cidadão.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "memory" ], "summary": "Obter memória associada ao número de telefone pelo nome.", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "type": "string", "description": "Nome da memória", "name": "memory_name", "in": "path", "required": true } ], "responses": { "200": { "description": "Memória obtida com sucesso", "schema": { "$ref": "#/definitions/handlers.MemoryModel" } }, "400": { "description": "Número de telefone ou nome da memória inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Memória não encontrada", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Deleta uma única memória associada ao telefone do cidadão.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "memory" ], "summary": "Deleta memória associada ao número de telefone.", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "type": "string", "description": "Nome da memória a ser deletada", "name": "memory_name", "in": "path", "required": true } ], "responses": { "204": { "description": "Memória deletada com sucesso" }, "400": { "description": "Número de telefone ou nome da memória inválidos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Memória não encontrada", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/metrics": { "get": { "description": "Expõe métricas Prometheus para monitoramento do sistema", "produces": [ "text/plain" ], "tags": [ "metrics" ], "summary": "Métricas Prometheus", "responses": { "200": { "description": "Métricas Prometheus obtidas com sucesso", "schema": { "type": "string" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/mobilidade/vehicle-brands": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Catálogo de marcas para o formulário de mobilidade (seed Mongo). Sentinel \"Outro\" usa id estável brand_outro com is_other=true.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Listar marcas de veículos", "responses": { "200": { "description": "Lista tipada de marcas em data", "schema": { "$ref": "#/definitions/models.VehicleBrandsResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/mobilidade/vehicle-colors": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Lista fixa de cores permitidas no formulário de mobilidade (fora do CSV de marcas/modelos).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Listar cores de veículos", "responses": { "200": { "description": "Lista tipada de cores em data", "schema": { "$ref": "#/definitions/models.VehicleColorsResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/mobilidade/vehicle-models": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Modelos do catálogo filtrados por brand_id (obrigatório), incluindo vehicle_type. Sentinel \"Outro\" usa id estável model_outro com is_other=true.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mobilidade" ], "summary": "Listar modelos de veículos por marca", "parameters": [ { "type": "string", "description": "ID da marca", "name": "brand_id", "in": "query", "required": true } ], "responses": { "200": { "description": "Lista tipada de modelos em data", "schema": { "$ref": "#/definitions/models.VehicleModelsResponse" } }, "400": { "description": "brand_id ausente", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Não autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/notification-categories": { "get": { "description": "List all active notification categories", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-categories" ], "summary": "List notification categories", "responses": { "200": { "description": "List of active categories", "schema": { "$ref": "#/definitions/models.NotificationCategoriesResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/beta-status": { "get": { "description": "Verifica se um número de telefone está na whitelist beta (com cache)", "produces": [ "application/json" ], "tags": [ "Beta Whitelist" ], "summary": "Verificar status beta", "parameters": [ { "type": "string", "description": "Número de telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "Status beta verificado com sucesso", "schema": { "$ref": "#/definitions/models.BetaStatusResponse" } }, "400": { "description": "Número de telefone é obrigatório ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/bind": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Vincula um número de telefone a um CPF sem definir opt-in", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Vincular telefone a CPF", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados da vinculação", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BindRequest" } } ], "responses": { "200": { "description": "Telefone vinculado ao CPF com sucesso", "schema": { "$ref": "#/definitions/models.BindResponse" } }, "400": { "description": "Formato de telefone inválido ou dados de vinculação incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito - telefone já está vinculado a outro CPF", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - CPF ou telefone inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/citizen": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Obtém informações do cidadão associado a um número de telefone", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Obter cidadão por telefone", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "Informações do cidadão obtidas com sucesso", "schema": { "$ref": "#/definitions/models.PhoneCitizenResponse" } }, "400": { "description": "Formato de telefone inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Nenhum cidadão encontrado para este telefone", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/notification-preferences": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get notification preferences for a phone number including global and category opt-ins (synced with CPF). Admin only.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-preferences" ], "summary": "Get phone notification preferences (admin only)", "parameters": [ { "type": "string", "description": "Phone number", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "Notification preferences", "schema": { "$ref": "#/definitions/models.PhoneNotificationPreferencesResponse" } }, "400": { "description": "Invalid phone format", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Admin access required", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Phone not found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update notification preferences for a phone number (synced with CPF preferences). Admin only.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-preferences" ], "summary": "Update phone notification preferences (admin only)", "parameters": [ { "type": "string", "description": "Phone number", "name": "phone_number", "in": "path", "required": true }, { "description": "Updated preferences", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UpdateNotificationPreferencesRequest" } } ], "responses": { "200": { "description": "Preferences updated successfully", "schema": { "$ref": "#/definitions/models.PhoneNotificationPreferencesResponse" } }, "400": { "description": "Invalid phone format or request body", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Admin access required", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Phone not found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Invalid category ID", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/notification-preferences/categories/{category_id}": { "patch": { "security": [ { "BearerAuth": [] } ], "description": "Update opt-in preference for a single notification category for a phone number. Admin only.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notification-preferences" ], "summary": "Update single category preference for phone (admin only)", "parameters": [ { "type": "string", "description": "Phone number", "name": "phone_number", "in": "path", "required": true }, { "type": "string", "description": "Category ID", "name": "category_id", "in": "path", "required": true }, { "description": "Category preference", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.UpdateCategoryPreferenceRequest" } } ], "responses": { "200": { "description": "Preference updated successfully", "schema": { "$ref": "#/definitions/models.PhoneNotificationPreferencesResponse" } }, "400": { "description": "Invalid phone format or request body", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Admin access required", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Phone not found", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Invalid category ID", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/opt-in": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Realiza opt-in para receber notificações do chatbot", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Realizar opt-in", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados do opt-in", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.OptInRequest" } } ], "responses": { "200": { "description": "Opt-in realizado com sucesso", "schema": { "$ref": "#/definitions/models.OptInResponse" } }, "400": { "description": "Formato de telefone inválido ou dados de opt-in incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Conflito - telefone já possui opt-in ativo", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - telefone em quarentena ou bloqueado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/opt-out": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Realiza opt-out para parar de receber notificações do chatbot", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Realizar opt-out", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados do opt-out", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.OptOutRequest" } } ], "responses": { "200": { "description": "Opt-out realizado com sucesso", "schema": { "$ref": "#/definitions/models.OptOutResponse" } }, "400": { "description": "Formato de telefone inválido ou dados de opt-out incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Telefone não encontrado ou sem opt-in ativo", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - opt-out já realizado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/quarantine": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Coloca um número de telefone em quarentena (apenas administradores)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Colocar telefone em quarentena", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "Telefone colocado em quarentena com sucesso", "schema": { "$ref": "#/definitions/models.QuarantineResponse" } }, "400": { "description": "Formato de telefone inválido ou parâmetros incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores podem colocar telefones em quarentena", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - telefone já em quarentena ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Libera um número de telefone da quarentena (apenas administradores)", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Liberar telefone da quarentena", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "Telefone liberado da quarentena com sucesso", "schema": { "$ref": "#/definitions/models.QuarantineResponse" } }, "400": { "description": "Formato de telefone inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - somente administradores podem liberar telefones da quarentena", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Telefone não encontrado em quarentena", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - telefone não está em quarentena", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/reject-registration": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Rejeita um registro e bloqueia o mapeamento telefone-CPF", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Rejeitar registro", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados da rejeição", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.RejectRegistrationRequest" } } ], "responses": { "200": { "description": "Registro rejeitado com sucesso", "schema": { "$ref": "#/definitions/models.RejectRegistrationResponse" } }, "400": { "description": "Formato de telefone inválido ou dados de rejeição incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - registro não pode ser rejeitado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/status": { "get": { "description": "Obtém o status de um número de telefone (quarentena, CPF vinculado, opt-in/opt-out, etc.)", "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Obter status do telefone", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true } ], "responses": { "200": { "description": "Status do telefone obtido com sucesso", "schema": { "$ref": "#/definitions/models.PhoneStatusResponse" } }, "400": { "description": "Formato de telefone inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Telefone não encontrado no sistema", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/phone/{phone_number}/validate-registration": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Valida um registro de usuário contra dados base do governo", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "phone" ], "summary": "Validar registro", "parameters": [ { "type": "string", "description": "Número do telefone", "name": "phone_number", "in": "path", "required": true }, { "description": "Dados do registro", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.ValidateRegistrationRequest" } } ], "responses": { "200": { "description": "Registro validado com sucesso", "schema": { "$ref": "#/definitions/models.ValidateRegistrationResponse" } }, "400": { "description": "Formato de telefone inválido ou dados de registro incorretos", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Token de autenticação não fornecido ou inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Acesso negado - permissões insuficientes", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "422": { "description": "Dados não processáveis - informações não conferem com a base", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/salesforce/anonimizacao/{numeroSolicitacao}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Proxy GET /api/private/anonimizacao/{numeroSolicitacao}. 403 se não houver prova de posse: CPF no payload do Salesforce deve ser o do caller; se o upstream omitir CPF, só quem criou a solicitação neste API (POST anonimizar) consegue ler.", "produces": [ "application/json" ], "tags": [ "salesforce" ], "summary": "Consultar status de anonimização", "parameters": [ { "type": "string", "description": "Número da solicitação", "name": "numeroSolicitacao", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/clients.SalesforceAnonimizacaoStatus" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Solicitação não pertence ao usuário autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/clients.SalesforceErrorBody" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/salesforce/chamados": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Proxy para GET /api/private/chamados usando o JWT do usuário (Community User).", "produces": [ "application/json" ], "tags": [ "salesforce" ], "summary": "Listar chamados do cidadão", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/clients.SalesforceChamadosList" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/salesforce/chamados/{protocolo}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Proxy para GET /api/private/chamados/{protocolo}.", "produces": [ "application/json" ], "tags": [ "salesforce" ], "summary": "Detalhar chamado por protocolo", "parameters": [ { "type": "string", "description": "Protocolo do chamado", "name": "protocolo", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/clients.SalesforceProtocolo" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/clients.SalesforceErrorBody" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/salesforce/cidadao/{cpf}/anonimizar": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Proxy POST /api/private/cidadao/{cpf}/anonimizar (assíncrono). 202 enfileirado; 409 se já houver solicitação aberta. Em 202 e 409 o RMI associa numeroSolicitacao ao CPF autenticado para o polling.", "produces": [ "application/json" ], "tags": [ "salesforce" ], "summary": "Solicitar anonimização no Salesforce", "parameters": [ { "type": "string", "description": "CPF do cidadão", "name": "cpf", "in": "path", "required": true } ], "responses": { "202": { "description": "Accepted", "schema": { "$ref": "#/definitions/clients.SalesforceAnonimizacaoStatus" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "409": { "description": "Solicitação já em aberto", "schema": { "$ref": "#/definitions/clients.SalesforceAnonimizacaoStatus" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/salesforce/cidadao/{cpf}/consentimento": { "patch": { "security": [ { "BearerAuth": [] } ], "description": "Proxy PATCH /api/private/cidadao/{cpf}/consentimento com o JWT do usuário. categoria é picklist SF (ex. PREF_Lembrete_Pagamento). motivo obrigatório se acao=optout. Espelho no RMI grava só salesforce_consentimentos; não altera opt_in nem category_opt_ins.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "salesforce" ], "summary": "Atualizar consentimento no Salesforce", "parameters": [ { "type": "string", "description": "CPF do cidadão", "name": "cpf", "in": "path", "required": true }, { "description": "Consentimento", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/clients.SalesforceConsentimentoPatchRequest" } } ], "responses": { "200": { "description": "Consentimento atualizado (sem corpo). 409 do Salesforce (já no status) é tratado como 200." }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "CPF não pertence ao usuário autenticado", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/clients.SalesforceErrorBody" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/salesforce/cidadao/{cpf}/exportar": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Proxy síncrono para GET /api/private/cidadao/{cpf}/exportar.", "produces": [ "application/json" ], "tags": [ "salesforce" ], "summary": "Exportar dados pessoais (LGPD) do Salesforce", "parameters": [ { "type": "string", "description": "CPF do cidadão", "name": "cpf", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/clients.SalesforceExportacao" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/clients.SalesforceErrorBody" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/validate/email": { "post": { "description": "Valida formato e estrutura de endereços de email, retornando informações detalhadas sobre o endereço quando válido.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "validation" ], "summary": "Valida endereço de email", "parameters": [ { "description": "Email a ser validado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.EmailValidationRequest" } } ], "responses": { "200": { "description": "Email validado com sucesso", "schema": { "$ref": "#/definitions/handlers.EmailValidationResponse" } }, "400": { "description": "Campo email é obrigatório ou formato inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/validate/phone": { "post": { "description": "Valida DDI, DDD e número para qualquer telefone internacional.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "validation" ], "summary": "Valida número de telefone", "parameters": [ { "description": "Telefone a ser validado", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.PhoneValidationRequest" } } ], "responses": { "200": { "description": "Telefone validado com sucesso", "schema": { "$ref": "#/definitions/handlers.PhoneValidationResponse" } }, "400": { "description": "Campo telefone é obrigatório ou formato inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "429": { "description": "Muitas requisições - limite de taxa excedido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Erro interno do servidor", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } }, "/webhooks/salesforce/cidadao": { "post": { "security": [ { "BearerAuth": [] } ], "description": "JWT Keycloak com azp em SALESFORCE_WEBHOOK_CLIENTS. Body: cpf + evento (atualizacao default ou anonimizacao) + updatedAt opcional. Para atualizacao, dados é delta obrigatório (ausente=não alterar; null=limpar; \\\"\\\"=vazio). Para anonimizacao, dados é opcional e ignorado — o RMI limpa o espelho SF por inteiro (self_declared PII + salesforce_consentimentos; não altera citizens nem opt_in/category_opt_ins do RMI). nome/nomeSocial/dataNascimento no delta de atualizacao são ignorados. 202 com CPF mascarado; retry idempotente via updatedAt.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "salesforce" ], "summary": "Webhook Salesforce cidadão", "parameters": [ { "description": "CPF, evento; dados obrigatório só em atualizacao", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.SalesforceWebhookRequestSwagger" } } ], "responses": { "202": { "description": "Job enfileirado", "schema": { "$ref": "#/definitions/handlers.SalesforceWebhookResponse" } }, "400": { "description": "CPF inválido, dados ausentes/grandes (atualizacao), updatedAt longo ou evento inválido", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "401": { "description": "JWT inválido ou ausente", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "403": { "description": "azp do JWT não está em SALESFORCE_WEBHOOK_CLIENTS", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "500": { "description": "Falha ao enfileirar salesforce_sync (Redis)", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } }, "503": { "description": "Integração Salesforce não configurada", "schema": { "$ref": "#/definitions/handlers.ErrorResponse" } } } } } }, "definitions": { "clients.SalesforceAndamento": { "type": "object", "properties": { "dataInsercao": { "type": "string" }, "descricao": { "type": "string" }, "evento": { "type": "string" }, "status": { "type": "string" }, "tipoEvento": { "type": "string" } } }, "clients.SalesforceAnonimizacaoStatus": { "type": "object", "properties": { "cpf": { "type": "string" }, "dataConclusao": { "type": "string" }, "dataSolicitacao": { "type": "string" }, "numeroSolicitacao": { "type": "string" }, "status": { "type": "string" } } }, "clients.SalesforceCanOpen": { "type": "object", "properties": { "elogio": { "$ref": "#/definitions/clients.SalesforceCanOpenAction" }, "reclamacao": { "$ref": "#/definitions/clients.SalesforceCanOpenAction" }, "sugestao": { "$ref": "#/definitions/clients.SalesforceCanOpenAction" } } }, "clients.SalesforceCanOpenAction": { "type": "object", "properties": { "available": { "type": "boolean" }, "categoryId": { "type": "string" } } }, "clients.SalesforceChamadosList": { "type": "object", "properties": { "ouvidoriaWindow": { "$ref": "#/definitions/clients.SalesforceOuvidoriaWindow" }, "protocolos": { "type": "array", "items": { "$ref": "#/definitions/clients.SalesforceProtocolo" } } } }, "clients.SalesforceCidadao": { "type": "object", "properties": { "accountId": { "type": "string" }, "canalOrigem": { "type": "string" }, "canalUltimaModificacao": { "type": "string" }, "complemento": { "type": "string" }, "consentimento": { "type": "array", "items": { "$ref": "#/definitions/clients.SalesforceConsentimento" } }, "cpf": { "type": "string" }, "dataNascimento": { "type": "string" }, "deficiencia": { "type": "string" }, "email": { "type": "string" }, "endereco": { "$ref": "#/definitions/clients.SalesforceEndereco" }, "escolaridade": { "type": "string" }, "genero": { "type": "string" }, "idioma": { "type": "array", "items": { "type": "string" } }, "isTourist": { "type": "boolean" }, "nacionalidade": { "type": "string" }, "nome": { "type": "string" }, "nomeExibicao": { "type": "string" }, "nomeSocial": { "type": "string" }, "passaporte": { "type": "string" }, "raca": { "type": "string" }, "rendaFamiliar": { "type": "string" }, "telefone1": { "type": "string" }, "telefone2": { "type": "string" }, "telefone3": { "type": "string" }, "telefoneInternacional": { "type": "string" }, "telefonePrincipal": { "type": "string" }, "tipoTelefone1": { "type": "string" }, "tipoTelefone2": { "type": "string" }, "tipoTelefone3": { "type": "string" } } }, "clients.SalesforceConsentimento": { "type": "object", "properties": { "acao": { "description": "legacy: optin | optout", "type": "string" }, "canal": { "type": "string" }, "categoria": { "type": "string" }, "data": { "type": "string" }, "finalidade": { "type": "string" }, "motivo": { "description": "required when status=OUT / acao=optout", "type": "string" }, "status": { "description": "IN | OUT", "type": "string" } } }, "clients.SalesforceConsentimentoPatchRequest": { "type": "object", "properties": { "acao": { "type": "string" }, "categoria": { "type": "string" }, "motivo": { "type": "string" }, "origem": { "type": "string" } } }, "clients.SalesforceEndereco": { "type": "object", "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "cidade": { "type": "string" }, "complemento": { "type": "string" }, "estado": { "type": "string" }, "logradouro": { "type": "string" }, "pais": { "type": "string" } } }, "clients.SalesforceEnderecoChamado": { "type": "object", "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "complemento": { "type": "string" }, "coordenadaX": { "type": "number" }, "coordenadaY": { "type": "number" }, "logradouro": { "type": "string" }, "numero": { "type": "string" }, "pontoReferencia": { "type": "string" }, "tipoEndereco": { "type": "string" } } }, "clients.SalesforceErrorBody": { "type": "object", "properties": { "errors": { "type": "array", "items": { "$ref": "#/definitions/clients.SalesforceFieldError" } } } }, "clients.SalesforceExportConsentimento": { "type": "object", "properties": { "canais": { "type": "array", "items": { "$ref": "#/definitions/clients.SalesforceExportConsentimentoCanal" } }, "codigo": { "type": "string" }, "descricao": { "type": "string" } } }, "clients.SalesforceExportConsentimentoCanal": { "type": "object", "properties": { "canal": { "type": "string" }, "motivo": { "type": "string" }, "status": { "type": "string" }, "tipo": { "type": "string" } } }, "clients.SalesforceExportacao": { "type": "object", "properties": { "consentimento": { "type": "array", "items": { "$ref": "#/definitions/clients.SalesforceExportConsentimento" } }, "cpf": { "type": "string" }, "dadosPessoais": { "type": "object", "additionalProperties": true }, "dataExportacao": { "type": "string" }, "relacionados": { "type": "object", "additionalProperties": true } } }, "clients.SalesforceFieldError": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } }, "clients.SalesforceOrdemServico": { "type": "object", "properties": { "andamentos": { "type": "array", "items": { "$ref": "#/definitions/clients.SalesforceAndamento" } }, "bairro": { "type": "string" }, "canOpen": { "$ref": "#/definitions/clients.SalesforceCanOpen" }, "categoria": { "type": "string" }, "codigoOs": { "type": "string" }, "dataAbertura": { "type": "string" }, "dataFechamento": { "type": "string" }, "dataTermino": { "type": "string" }, "descricao": { "type": "string" }, "endereco": { "$ref": "#/definitions/clients.SalesforceEnderecoChamado" }, "id": { "type": "string" }, "idCatalogoServico": { "type": "string" }, "isClosed": { "type": "boolean" }, "isOverdue": { "type": "boolean" }, "orgaoResponsavel": { "$ref": "#/definitions/clients.SalesforceOrgao" }, "orgaoResponsavelPai": { "$ref": "#/definitions/clients.SalesforceOrgao" }, "ouvidoriaUrl": { "type": "string" }, "ouvidoriaWindow": { "$ref": "#/definitions/clients.SalesforceOuvidoriaWindow" }, "previsaoSLA": { "type": "string" }, "prioridade": { "type": "string" }, "servico": { "type": "string" }, "status": { "type": "string" }, "subtema": { "type": "string" }, "tema": { "type": "string" } } }, "clients.SalesforceOrgao": { "type": "object", "properties": { "id": { "type": "string" }, "nome": { "type": "string" }, "sigla": { "type": "string" } } }, "clients.SalesforceOuvidoriaWindow": { "type": "object", "properties": { "days": { "type": "integer" }, "label": { "type": "string" } } }, "clients.SalesforceProtocolo": { "type": "object", "properties": { "categoria": { "type": "string" }, "dataAbertura": { "type": "string" }, "dataFechamento": { "type": "string" }, "dataUltimaAtualizacao": { "type": "string" }, "ordens_de_servico": { "type": "array", "items": { "$ref": "#/definitions/clients.SalesforceOrdemServico" } }, "origem": { "type": "string" }, "protocolo": { "type": "string" }, "status": { "type": "string" }, "subcategoria": { "type": "string" } } }, "handlers.AuthValidateResponse": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "matched", "updated", "created" ], "example": "matched" }, "cidadao": { "$ref": "#/definitions/clients.SalesforceCidadao" } } }, "handlers.CacheReadRequest": { "type": "object", "required": [ "key" ], "properties": { "key": { "type": "string", "example": "citizen:12345678901" } } }, "handlers.CacheReadResponse": { "type": "object", "properties": { "exists": { "type": "boolean" }, "key": { "type": "string" }, "ttl_seconds": { "type": "integer" }, "value": {} } }, "handlers.EmailValidationRequest": { "description": "Estrutura de entrada contendo o endereço de email a ser validado.", "type": "object", "required": [ "email" ], "properties": { "email": { "description": "Endereço de email a ser validado.\nexample: \"usuario@exemplo.com\"", "type": "string" } } }, "handlers.EmailValidationResponse": { "description": "Resultado da validação, contendo informações sobre o endereço de email quando válido.", "type": "object", "properties": { "domain": { "description": "Domínio do email (após o @)", "type": "string" }, "local_part": { "description": "Parte local do email (antes do @)", "type": "string" }, "message": { "description": "Mensagem de retorno.", "type": "string" }, "normalized": { "description": "Email normalizado (lowercase)", "type": "string" }, "valid": { "description": "Indica se o email é válido.", "type": "boolean" }, "validation_type": { "description": "Tipo de validação aplicada", "type": "string" } } }, "handlers.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "handlers.HealthResponse": { "type": "object", "properties": { "services": { "type": "object", "additionalProperties": { "$ref": "#/definitions/handlers.ServiceHealth" } }, "status": { "type": "boolean" }, "timestamp": { "type": "string" }, "version": { "type": "string" } } }, "handlers.MemoryModel": { "type": "object", "required": [ "description", "memory_name", "memory_type", "relevance", "value" ], "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "memory_id": { "type": "string" }, "memory_name": { "type": "string" }, "memory_type": { "type": "string", "enum": [ "base", "appended" ] }, "relevance": { "type": "string", "enum": [ "low", "medium", "high" ] }, "updated_at": { "type": "string" }, "value": { "type": "string" } } }, "handlers.PhoneValidationRequest": { "description": "Estrutura de entrada contendo o número de telefone a ser validado.", "type": "object", "required": [ "phone" ], "properties": { "phone": { "description": "Número de telefone em formato internacional ou nacional.\nexample: \"+55 11 99988-7766\"", "type": "string" } } }, "handlers.PhoneValidationResponse": { "description": "Resultado da validação, contendo a decomposição (DDI, DDD, número) quando válida.", "type": "object", "properties": { "ddd": { "description": "DDD (código de área)", "type": "string" }, "ddi": { "description": "DDI (código do país)", "type": "string" }, "e164": { "description": "Representação E.164 do número", "type": "string" }, "message": { "description": "Mensagem de retorno.", "type": "string" }, "numero": { "description": "Número do assinante", "type": "string" }, "region": { "description": "Região ISO 3166-1 alpha-2", "type": "string" }, "valid": { "description": "Indica se o número é válido.", "type": "boolean" } } }, "handlers.SalesforceWebhookDados": { "type": "object", "properties": { "accountId": { "type": "string" }, "canalOrigem": { "type": "string" }, "canalUltimaModificacao": { "type": "string" }, "cidade": { "type": "string" }, "complemento": { "type": "string" }, "consentimento": { "description": "Só salesforce_consentimentos; null limpa o mapa SF (não mexe no opt-in RMI)", "type": "array", "items": { "$ref": "#/definitions/clients.SalesforceConsentimento" } }, "dataNascimento": { "description": "Ignorado: não altera a coleção citizens", "type": "string" }, "deficiencia": { "type": "string" }, "email": { "type": "string" }, "endereco": { "$ref": "#/definitions/clients.SalesforceEndereco" }, "escolaridade": { "type": "string" }, "genero": { "type": "string" }, "idioma": { "type": "array", "items": { "type": "string" } }, "isTourist": { "type": "boolean" }, "nacionalidade": { "type": "string" }, "nome": { "description": "Ignorado: não altera a coleção citizens", "type": "string" }, "nomeExibicao": { "type": "string" }, "nomeSocial": { "description": "Ignorado: não altera a coleção citizens", "type": "string" }, "passaporte": { "type": "string" }, "raca": { "type": "string" }, "rendaFamiliar": { "type": "string" }, "telefone1": { "type": "string" }, "telefone2": { "type": "string" }, "telefone3": { "type": "string" }, "telefoneInternacional": { "type": "string" }, "telefonePrincipal": { "type": "string" }, "tipoTelefone1": { "type": "string" }, "tipoTelefone2": { "type": "string" }, "tipoTelefone3": { "type": "string" } } }, "handlers.SalesforceWebhookRequestSwagger": { "type": "object", "properties": { "cpf": { "type": "string", "example": "52998224725" }, "dados": { "$ref": "#/definitions/handlers.SalesforceWebhookDados" }, "evento": { "type": "string", "enum": [ "atualizacao", "anonimizacao" ], "example": "atualizacao" }, "updatedAt": { "type": "string", "example": "2026-08-31T17:33:49Z" } } }, "handlers.SalesforceWebhookResponse": { "type": "object", "properties": { "cpf": { "type": "string" }, "evento": { "type": "string" }, "message": { "type": "string" }, "status": { "type": "string" } } }, "handlers.ServiceHealth": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "boolean" }, "timestamp": { "type": "string" } } }, "handlers.SuccessResponse": { "type": "object", "properties": { "message": { "type": "string" } } }, "models.Accountant": { "type": "object", "properties": { "pf": { "$ref": "#/definitions/models.AccountantIndividual" }, "pj": { "$ref": "#/definitions/models.AccountantCorporate" } } }, "models.AccountantCorporate": { "type": "object", "properties": { "classificacao_crc": { "type": "string" }, "id": { "type": "string" }, "sequencial_crc": { "type": "string" }, "tipo_crc": { "type": "string" } } }, "models.AccountantIndividual": { "type": "object", "properties": { "classificacao_crc": { "type": "string" }, "id": { "type": "string" }, "sequencial_crc": { "type": "string" }, "tipo_crc": { "type": "string" } } }, "models.AccreditedClinic": { "type": "object", "properties": { "celular": { "type": "string" }, "email": { "type": "string" }, "endereco": { "$ref": "#/definitions/models.ClinicAddress" }, "nome": { "type": "string" }, "telefone": { "type": "string" } } }, "models.AddCPFSecretariaRequest": { "type": "object", "required": [ "cd_ua" ], "properties": { "cd_ua": { "type": "string" } } }, "models.Aluno": { "type": "object", "properties": { "conceito": { "type": "string" }, "frequencia": { "type": "number" }, "indicador": { "type": "boolean" } } }, "models.AssistenciaSocial": { "type": "object", "properties": { "cadunico": { "$ref": "#/definitions/models.CadUnico" }, "cras": { "$ref": "#/definitions/models.CRAS" } } }, "models.AvatarRequest": { "type": "object", "required": [ "name", "url" ], "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 1 }, "url": { "type": "string" } } }, "models.AvatarResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "url": { "type": "string" } } }, "models.AvatarsListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.AvatarResponse" } }, "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }, "models.BetaGroupListResponse": { "type": "object", "properties": { "groups": { "type": "array", "items": { "$ref": "#/definitions/models.BetaGroupResponse" } }, "pagination": { "$ref": "#/definitions/models.PaginationInfo" }, "total_groups": { "type": "integer" } } }, "models.BetaGroupRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } }, "models.BetaGroupResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.BetaStatusResponse": { "type": "object", "properties": { "beta_whitelisted": { "type": "boolean" }, "group_id": { "type": "string" }, "group_name": { "type": "string" }, "phone_number": { "type": "string" } } }, "models.BetaWhitelistBulkRemoveRequest": { "type": "object", "required": [ "phone_numbers" ], "properties": { "phone_numbers": { "type": "array", "items": { "type": "string" } } } }, "models.BetaWhitelistBulkRequest": { "type": "object", "required": [ "group_id", "phone_numbers" ], "properties": { "group_id": { "type": "string" }, "phone_numbers": { "type": "array", "items": { "type": "string" } } } }, "models.BetaWhitelistListResponse": { "type": "object", "properties": { "pagination": { "$ref": "#/definitions/models.PaginationInfo" }, "total_count": { "type": "integer" }, "whitelisted": { "type": "array", "items": { "$ref": "#/definitions/models.BetaWhitelistResponse" } } } }, "models.BetaWhitelistMoveRequest": { "type": "object", "required": [ "from_group_id", "phone_numbers", "to_group_id" ], "properties": { "from_group_id": { "type": "string" }, "phone_numbers": { "type": "array", "items": { "type": "string" } }, "to_group_id": { "type": "string" } } }, "models.BetaWhitelistRequest": { "type": "object", "required": [ "group_id" ], "properties": { "group_id": { "type": "string" } } }, "models.BetaWhitelistResponse": { "type": "object", "properties": { "added_at": { "type": "string" }, "group_id": { "type": "string" }, "group_name": { "type": "string" }, "phone_number": { "type": "string" } } }, "models.BindRequest": { "type": "object", "required": [ "channel", "cpf" ], "properties": { "channel": { "type": "string" }, "cpf": { "type": "string" } } }, "models.BindResponse": { "type": "object", "properties": { "cpf": { "type": "string" }, "message": { "type": "string" }, "opt_in": { "type": "boolean" }, "phone_number": { "type": "string" }, "status": { "type": "string" } } }, "models.CNAE": { "type": "object", "properties": { "classe": { "type": "string" }, "denominacao": { "type": "string" }, "divisao": { "type": "string" }, "grupo": { "type": "string" }, "id": { "type": "string" }, "secao": { "type": "string" }, "subclasse": { "type": "string" } } }, "models.CNAEListResponse": { "type": "object", "properties": { "cnaes": { "type": "array", "items": { "$ref": "#/definitions/models.CNAE" } }, "pagination": { "$ref": "#/definitions/models.PaginationInfo" } } }, "models.CPFSecretariaListResponse": { "type": "object", "properties": { "cpf": { "type": "string" }, "mappings": { "type": "array", "items": { "$ref": "#/definitions/models.CPFSecretariaResponse" } } } }, "models.CPFSecretariaQueryResponse": { "type": "object", "properties": { "cd_uas": { "type": "array", "items": { "type": "string" } }, "cpf": { "type": "string" } } }, "models.CPFSecretariaResponse": { "type": "object", "properties": { "cd_ua": { "type": "string" }, "cpf": { "type": "string" }, "created_at": { "type": "string" }, "created_by": { "type": "string" }, "id": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.CRAS": { "type": "object", "properties": { "endereco": { "type": "string" }, "nome": { "type": "string" }, "telefone": { "type": "string" } } }, "models.CadUnico": { "type": "object", "properties": { "data_cadastro": { "type": "string" }, "data_limite_cadastro_atual": { "type": "string" }, "data_ultima_atualizacao": { "type": "string" }, "indicador": { "type": "boolean" }, "status_cadastral": { "type": "string" } } }, "models.Citizen": { "type": "object", "properties": { "_id": { "type": "string" }, "assistencia_social": { "$ref": "#/definitions/models.AssistenciaSocial" }, "cpf": { "type": "string" }, "deficiencia": { "description": "Self-declared, not stored in base collection", "type": "string" }, "documentos": { "description": "Wallet and internal fields", "allOf": [ { "$ref": "#/definitions/models.Documentos" } ] }, "educacao": { "$ref": "#/definitions/models.Educacao" }, "email": { "$ref": "#/definitions/models.Email" }, "endereco": { "$ref": "#/definitions/models.Endereco" }, "escolaridade": { "description": "Self-declared, not stored in base collection", "type": "string" }, "genero": { "description": "Self-declared, not stored in base collection", "type": "string" }, "mae": { "$ref": "#/definitions/models.Mae" }, "menor_idade": { "type": "boolean" }, "nascimento": { "$ref": "#/definitions/models.Nascimento" }, "nome": { "type": "string" }, "nome_exibicao": { "description": "Self-declared, not stored in base collection", "type": "string" }, "nome_social": { "type": "string" }, "obito": { "$ref": "#/definitions/models.Obito" }, "raca": { "type": "string" }, "renda_familiar": { "description": "Self-declared, not stored in base collection", "type": "string" }, "saude": { "$ref": "#/definitions/models.Saude" }, "sexo": { "type": "string" }, "telefone": { "$ref": "#/definitions/models.Telefone" } } }, "models.CitizenWallet": { "type": "object", "properties": { "assistencia_social": { "$ref": "#/definitions/models.AssistenciaSocial" }, "cpf": { "type": "string" }, "documentos": { "$ref": "#/definitions/models.Documentos" }, "educacao": { "$ref": "#/definitions/models.Educacao" }, "saude": { "$ref": "#/definitions/models.Saude" } } }, "models.ClinicAddress": { "type": "object", "properties": { "bairro": { "type": "string" }, "cidade": { "type": "string" }, "complemento": { "type": "string" }, "logradouro": { "type": "string" }, "numero": { "type": "string" } } }, "models.ClinicaFamilia": { "type": "object", "properties": { "email": { "type": "string" }, "endereco": { "type": "string" }, "fonte": { "description": "\"bigquery\" or \"mcp\" - not stored in DB, populated at response time", "type": "string" }, "horario_atendimento": { "type": "string" }, "id_cnes": { "type": "string" }, "indicador": { "type": "boolean" }, "nome": { "type": "string" }, "telefone": { "type": "string" } } }, "models.CompanySize": { "type": "object", "properties": { "descricao": { "type": "string" }, "id": { "type": "string" } } }, "models.ConductorStatus": { "type": "string", "enum": [ "pending", "accepted", "rejected", "revoked" ], "x-enum-varnames": [ "ConductorStatusPending", "ConductorStatusAccepted", "ConductorStatusRejected", "ConductorStatusRevoked" ] }, "models.ConductorsListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.VehicleConductor" } } } }, "models.CreateNotificationCategoryRequest": { "type": "object", "required": [ "description", "id", "name" ], "properties": { "active": { "type": "boolean" }, "default_opt_in": { "type": "boolean" }, "description": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "order": { "type": "integer" } } }, "models.DepartmentListResponse": { "type": "object", "properties": { "departments": { "type": "array", "items": { "$ref": "#/definitions/models.DepartmentResponse" } }, "pagination": { "$ref": "#/definitions/models.PaginationInfo" }, "total_count": { "type": "integer" } } }, "models.DepartmentResponse": { "type": "object", "properties": { "cd_ua": { "type": "string" }, "cd_ua_pai": { "type": "string" }, "id": { "type": "string" }, "msg": { "type": "string" }, "nivel": { "type": "integer" }, "nome_ua": { "type": "string" }, "ordem_absoluta": { "type": "string" }, "ordem_relativa": { "type": "string" }, "ordem_ua_basica": { "type": "string" }, "sigla_ua": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.Documentos": { "type": "object", "properties": { "cns": { "type": "array", "items": { "type": "string" } } } }, "models.Educacao": { "type": "object", "properties": { "aluno": { "$ref": "#/definitions/models.Aluno" }, "escola": { "$ref": "#/definitions/models.Escola" } } }, "models.Email": { "type": "object", "properties": { "alternativo": { "type": "array", "items": { "$ref": "#/definitions/models.EmailAlternativo" } }, "indicador": { "type": "boolean" }, "principal": { "$ref": "#/definitions/models.EmailPrincipal" } } }, "models.EmailAlternativo": { "type": "object", "properties": { "origem": { "type": "string" }, "sistema": { "type": "string" }, "valor": { "type": "string" } } }, "models.EmailPrincipal": { "type": "object", "properties": { "origem": { "type": "string" }, "sistema": { "type": "string" }, "updated_at": { "type": "string" }, "valor": { "type": "string" } } }, "models.Endereco": { "type": "object", "properties": { "alternativo": { "type": "array", "items": { "$ref": "#/definitions/models.EnderecoAlternativo" } }, "indicador": { "type": "boolean" }, "principal": { "$ref": "#/definitions/models.EnderecoPrincipal" } } }, "models.EnderecoAlternativo": { "type": "object", "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "complemento": { "type": "string" }, "estado": { "type": "string" }, "latitude": { "type": "string" }, "logradouro": { "type": "string" }, "longitude": { "type": "string" }, "municipio": { "type": "string" }, "numero": { "type": "string" }, "origem": { "type": "string" }, "pluscode": { "type": "string" }, "sistema": { "type": "string" }, "tipo_logradouro": { "type": "string" } } }, "models.EnderecoPrincipal": { "type": "object", "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "complemento": { "type": "string" }, "estado": { "type": "string" }, "logradouro": { "type": "string" }, "municipio": { "type": "string" }, "numero": { "type": "string" }, "origem": { "type": "string" }, "sistema": { "type": "string" }, "tipo_logradouro": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.EquipeSaudeFamilia": { "type": "object", "properties": { "enfermeiros": { "type": "array", "items": { "$ref": "#/definitions/models.ProfissionalSaude" } }, "id_ine": { "type": "string" }, "indicador": { "type": "boolean" }, "medicos": { "type": "array", "items": { "$ref": "#/definitions/models.ProfissionalSaude" } }, "nome": { "type": "string" }, "telefone": { "type": "string" } } }, "models.Escola": { "type": "object", "properties": { "email": { "type": "string" }, "endereco": { "type": "string" }, "horario_funcionamento": { "type": "string" }, "nome": { "type": "string" }, "telefone": { "type": "string" }, "whatsapp": { "type": "string" } } }, "models.FederativeEntity": { "type": "object", "properties": { "id": { "type": "string" }, "tipo": { "type": "string" } } }, "models.HeadquartersBranch": { "type": "object", "properties": { "descricao": { "type": "string" }, "id": { "type": "string" } } }, "models.InvitationResponseStatus": { "type": "string", "enum": [ "accepted", "rejected" ], "x-enum-varnames": [ "InvitationResponseAccepted", "InvitationResponseRejected" ] }, "models.InviteConductorRequest": { "type": "object", "required": [ "cpf", "email" ], "properties": { "cpf": { "description": "CPF must be exactly 11 digits (no punctuation), matching RMI/JWT form.", "type": "string", "example": "11144477735" }, "email": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": "string" } } }, "models.InviteEmailStatus": { "type": "string", "enum": [ "pending", "queued", "sent", "failed", "skipped" ], "x-enum-varnames": [ "InviteEmailStatusPending", "InviteEmailStatusQueued", "InviteEmailStatusSent", "InviteEmailStatusFailed", "InviteEmailStatusSkipped" ] }, "models.LegalEntity": { "type": "object", "properties": { "_id": {}, "capital_social": { "type": "number" }, "cnae_fiscal": { "type": "string" }, "cnae_secundarias": { "type": "array", "items": { "type": "string" } }, "cnpj": { "type": "string" }, "contador": { "$ref": "#/definitions/models.Accountant" }, "contato": { "$ref": "#/definitions/models.LegalEntityContact" }, "endereco": { "$ref": "#/definitions/models.LegalEntityAddress" }, "ente_federativo": { "$ref": "#/definitions/models.FederativeEntity" }, "formas_atuacao": { "type": "array", "items": { "type": "string" } }, "inicio_atividade_data": { "type": "string" }, "language": { "type": "string" }, "matriz_filial": { "$ref": "#/definitions/models.HeadquartersBranch" }, "natureza_juridica": { "$ref": "#/definitions/models.LegalNature" }, "nire": { "type": "string" }, "nome_fantasia": { "type": "string" }, "orgao_registro": { "$ref": "#/definitions/models.RegistrationAuthority" }, "porte": { "$ref": "#/definitions/models.CompanySize" }, "razao_social": { "type": "string" }, "responsavel": { "$ref": "#/definitions/models.ResponsiblePerson" }, "situacao_cadastral": { "$ref": "#/definitions/models.RegistrationStatus" }, "situacao_especial": { "$ref": "#/definitions/models.SpecialStatus" }, "socios": { "type": "array", "items": { "$ref": "#/definitions/models.Partner" } }, "socios_quantidade": { "type": "integer" }, "sucessoes": { "type": "array", "items": {} }, "tipos_unidade": { "type": "array", "items": { "type": "string" } } } }, "models.LegalEntityAddress": { "type": "object", "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "complemento": { "type": "string" }, "id_municipio": { "type": "string" }, "id_pais": { "type": "string" }, "logradouro": { "type": "string" }, "municipio_exterior_nome": { "type": "string" }, "municipio_nome": { "type": "string" }, "numero": { "type": "string" }, "tipo_logradouro": { "type": "string" }, "uf": { "type": "string" } } }, "models.LegalEntityContact": { "type": "object", "properties": { "email": { "type": "string" }, "telefone": { "type": "array", "items": { "$ref": "#/definitions/models.LegalEntityPhone" } } } }, "models.LegalEntityPhone": { "type": "object", "properties": { "ddd": { "type": "string" }, "telefone": { "type": "string" } } }, "models.LegalNature": { "type": "object", "properties": { "descricao": { "type": "string" }, "id": { "type": "string" } } }, "models.Mae": { "type": "object", "properties": { "cpf": { "type": "string" }, "nome": { "type": "string" } } }, "models.MaintenanceRequest": { "type": "object", "properties": { "categoria": { "type": "string" }, "cpf": { "type": "string" }, "data_alvo_finalizacao": { "type": "string" }, "data_fim": { "type": "string" }, "data_inicio": { "type": "string" }, "descricao": { "type": "string" }, "endereco": { "description": "Pre-built address string", "type": "string" }, "id": { "type": "string" }, "id_chamado": { "description": "Maps from MongoDB \"id\" field", "type": "string" }, "indicador": { "type": "boolean" }, "nome_unidade_organizacional": { "type": "string" }, "origem_ocorrencia": { "type": "string" }, "status": { "type": "string" }, "subtipo": { "type": "string" }, "tipo": { "type": "string" }, "total_chamados": { "type": "integer" }, "total_fechados": { "type": "integer" } } }, "models.Nascimento": { "type": "object", "properties": { "data": { "type": "string" }, "municipio": { "type": "string" }, "municipio_id": { "type": "string" }, "origem": { "type": "string" }, "pais": { "type": "string" }, "pais_id": { "type": "string" }, "sistema": { "type": "string" }, "uf": { "type": "string" } } }, "models.NotificationCategoriesResponse": { "type": "object", "properties": { "categories": { "type": "array", "items": { "$ref": "#/definitions/models.NotificationCategory" } } } }, "models.NotificationCategory": { "type": "object", "properties": { "active": { "type": "boolean" }, "created_at": { "type": "string" }, "default_opt_in": { "type": "boolean" }, "description": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "order": { "type": "integer" }, "updated_at": { "type": "string" } } }, "models.NotificationPreferencesResponse": { "type": "object", "properties": { "category_opt_ins": { "type": "object", "additionalProperties": { "type": "boolean" } }, "cpf": { "type": "string" }, "opt_in": { "type": "boolean" }, "updated_at": { "type": "string" } } }, "models.Obito": { "type": "object", "properties": { "ano": { "type": "integer" }, "indicador": { "type": "boolean" } } }, "models.OptInRequest": { "type": "object", "required": [ "channel", "cpf" ], "properties": { "channel": { "type": "string" }, "cpf": { "type": "string" }, "validation_result": { "$ref": "#/definitions/models.ValidationResult" } } }, "models.OptInResponse": { "type": "object", "properties": { "phone_mapping_id": { "type": "string" }, "status": { "type": "string" } } }, "models.OptOutRequest": { "type": "object", "required": [ "channel", "reason" ], "properties": { "channel": { "type": "string" }, "reason": { "type": "string" } } }, "models.OptOutResponse": { "type": "object", "properties": { "status": { "type": "string" } } }, "models.OtherTutor": { "type": "object", "properties": { "cpf": { "type": "string" }, "email": { "type": "string" }, "nome": { "type": "string" }, "telefone": { "type": "string" } } }, "models.PaginatedLegalEntities": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.LegalEntity" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } } } }, "models.PaginatedMaintenanceRequests": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.MaintenanceRequest" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } } } }, "models.PaginatedPets": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.Pet" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } } } }, "models.PaginatedVehicles": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.VehicleListItem" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } } } }, "models.PaginationInfo": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }, "models.Partner": { "type": "object", "properties": { "cnpj_socio": { "type": "string" }, "codigo_pais": { "type": "string" }, "cpf_representante_legal": { "type": "string" }, "cpf_socio": { "type": "string" }, "data_situacao_especial": { "type": "string" }, "nome_socio_estrangeiro": { "type": "string" }, "qualificacao_representante_legal": { "type": "string" }, "qualificacao_socio": { "type": "string" }, "tipo": { "type": "string" } } }, "models.Pet": { "type": "object", "properties": { "animal_nome": { "type": "string" }, "antirrabica_data": { "type": "string" }, "antirrabica_validade_data": { "type": "string" }, "clinica_credenciada": { "$ref": "#/definitions/models.AccreditedClinic" }, "especie_nome": { "type": "string" }, "fase_vida_nome": { "type": "string" }, "foto_url": { "type": "string" }, "id_animal": { "type": "integer" }, "indicador": { "type": "boolean" }, "indicador_ativo": { "type": "boolean" }, "indicador_castrado": { "type": "boolean" }, "microchip_numero": { "type": "string" }, "nascimento_data": { "type": "string" }, "outros_tutores": { "type": "array", "items": { "$ref": "#/definitions/models.OtherTutor" } }, "pedigree_indicador": { "type": "boolean" }, "pedigree_origem_nome": { "type": "string" }, "porte_nome": { "type": "string" }, "qrcode_payload": { "type": "string" }, "raca_nome": { "type": "string" }, "registro_data": { "type": "string" }, "sexo_sigla": { "type": "string" }, "source": { "description": "\"curated\" or \"self_registered\"", "type": "string" }, "vermifugacao_data": { "type": "string" }, "vermifugacao_validade_data": { "type": "string" } } }, "models.PetRegistrationRequest": { "type": "object", "required": [ "animal_nome", "especie_nome", "indicador_castrado", "nascimento_data", "porte_nome", "raca_nome", "sexo_sigla" ], "properties": { "animal_nome": { "type": "string" }, "especie_nome": { "type": "string" }, "foto_url": { "type": "string" }, "indicador_castrado": { "type": "boolean" }, "microchip_numero": { "type": "string" }, "nascimento_data": { "type": "string" }, "pedigree_indicador": { "type": "boolean" }, "pedigree_origem_nome": { "type": "string" }, "porte_nome": { "type": "string" }, "raca_nome": { "type": "string" }, "sexo_sigla": { "type": "string", "enum": [ "M", "F" ] } } }, "models.PetStatsResponse": { "type": "object", "properties": { "cpf": { "type": "string" }, "self_registered_pets_count": { "description": "Count of non-curated self-registered pets", "type": "integer" }, "statistics": { "description": "Curated pets statistics from governo", "allOf": [ { "$ref": "#/definitions/models.Statistics" } ] } } }, "models.PhoneCitizenResponse": { "type": "object", "properties": { "cpf": { "type": "string" }, "first_name": { "type": "string" }, "found": { "type": "boolean" }, "name": { "type": "string" } } }, "models.PhoneNotificationPreferencesResponse": { "type": "object", "properties": { "category_opt_ins": { "type": "object", "additionalProperties": { "type": "boolean" } }, "opt_in": { "type": "boolean" }, "phone_number": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.PhoneStatusResponse": { "type": "object", "properties": { "beta_group_id": { "type": "string" }, "beta_group_name": { "type": "string" }, "beta_whitelisted": { "type": "boolean" }, "category_opt_ins": { "type": "object", "additionalProperties": { "type": "boolean" } }, "cpf": { "type": "string" }, "found": { "type": "boolean" }, "name": { "type": "string" }, "opt_in": { "type": "boolean" }, "opted_out": { "type": "boolean" }, "phone_number": { "type": "string" }, "quarantine_until": { "type": "string" }, "quarantined": { "type": "boolean" } } }, "models.PhoneVerificationValidateRequest": { "type": "object", "required": [ "code", "ddd", "ddi", "valor" ], "properties": { "code": { "type": "string" }, "ddd": { "type": "string" }, "ddi": { "type": "string" }, "valor": { "type": "string" } } }, "models.ProfissionalSaude": { "type": "object", "properties": { "id_profissional_sus": { "type": "string" }, "nome": { "type": "string" } } }, "models.QuarantineResponse": { "type": "object", "properties": { "message": { "type": "string" }, "phone_number": { "type": "string" }, "quarantine_until": { "type": "string" }, "status": { "type": "string" } } }, "models.QuarantineStats": { "type": "object", "properties": { "active_quarantines": { "type": "integer" }, "expired_quarantines": { "type": "integer" }, "quarantine_history_total": { "type": "integer" }, "quarantines_with_cpf": { "type": "integer" }, "quarantines_without_cpf": { "type": "integer" }, "total_quarantined": { "type": "integer" } } }, "models.QuarantinedListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.QuarantinedPhone" } }, "pagination": { "$ref": "#/definitions/models.PaginationInfo" } } }, "models.QuarantinedPhone": { "type": "object", "properties": { "cpf": { "type": "string" }, "expired": { "type": "boolean" }, "phone_number": { "type": "string" }, "quarantine_until": { "type": "string" } } }, "models.RegistrationAuthority": { "type": "object", "properties": { "descricao": { "type": "string" }, "id": { "type": "string" } } }, "models.RegistrationStatus": { "type": "object", "properties": { "data": { "type": "string" }, "descricao": { "type": "string" }, "id": { "type": "string" }, "motivo_descricao": { "type": "string" }, "motivo_id": { "type": "string" } } }, "models.RejectRegistrationRequest": { "type": "object", "required": [ "channel", "cpf", "reason" ], "properties": { "channel": { "type": "string" }, "cpf": { "type": "string" }, "reason": { "type": "string" } } }, "models.RejectRegistrationResponse": { "type": "object", "properties": { "status": { "type": "string" } } }, "models.RespondInvitationRequest": { "type": "object", "required": [ "status" ], "properties": { "status": { "description": "Status must be accepted or rejected (pending/revoked are rejected with 400).", "allOf": [ { "$ref": "#/definitions/models.InvitationResponseStatus" } ] } } }, "models.ResponsiblePerson": { "type": "object", "properties": { "cpf": { "type": "string" }, "inclusao_data": { "type": "string" }, "qualificacao_descricao": { "type": "string" }, "qualificacao_id": { "type": "string" } } }, "models.Saude": { "type": "object", "properties": { "clinica_familia": { "$ref": "#/definitions/models.ClinicaFamilia" }, "equipe_saude_familia": { "$ref": "#/definitions/models.EquipeSaudeFamilia" } } }, "models.SelfDeclaredAddressInput": { "type": "object", "required": [ "bairro", "cep", "estado", "logradouro", "municipio", "numero" ], "properties": { "bairro": { "type": "string" }, "cep": { "type": "string" }, "complemento": { "type": "string" }, "estado": { "type": "string" }, "logradouro": { "type": "string" }, "municipio": { "type": "string" }, "numero": { "type": "string" }, "tipo_logradouro": { "type": "string" } } }, "models.SelfDeclaredBirthDateInput": { "type": "object", "properties": { "data": { "type": "string" }, "valor": { "type": "string" } } }, "models.SelfDeclaredDeficienciaInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.SelfDeclaredEmailInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.SelfDeclaredEscolaridadeInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.SelfDeclaredGeneroInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.SelfDeclaredNomeExibicaoInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.SelfDeclaredPhoneInput": { "type": "object", "required": [ "ddi", "valor" ], "properties": { "ddd": { "description": "DDD é obrigatório somente quando o DDI é 55 (Brasil)", "type": "string" }, "ddi": { "type": "string" }, "valor": { "type": "string" } } }, "models.SelfDeclaredRacaInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.SelfDeclaredRendaFamiliarInput": { "type": "object", "required": [ "valor" ], "properties": { "valor": { "type": "string" } } }, "models.SpecialStatus": { "type": "object", "properties": { "data": { "type": "string" }, "descricao": { "type": "string" } } }, "models.Statistics": { "type": "object", "properties": { "quantidade_cachorro": { "type": "integer" }, "quantidade_gato": { "type": "integer" }, "quantidade_outro": { "type": "integer" } } }, "models.Telefone": { "type": "object", "properties": { "alternativo": { "type": "array", "items": { "$ref": "#/definitions/models.TelefoneAlternativo" } }, "indicador": { "type": "boolean" }, "principal": { "$ref": "#/definitions/models.TelefonePrincipal" } } }, "models.TelefoneAlternativo": { "type": "object", "properties": { "ddd": { "type": "string" }, "ddi": { "type": "string" }, "origem": { "type": "string" }, "sistema": { "type": "string" }, "valor": { "type": "string" } } }, "models.TelefonePrincipal": { "type": "object", "properties": { "ddd": { "type": "string" }, "ddi": { "type": "string" }, "origem": { "type": "string" }, "sistema": { "type": "string" }, "updated_at": { "type": "string" }, "valor": { "type": "string" } } }, "models.UpdateCategoryPreferenceRequest": { "type": "object", "required": [ "channel" ], "properties": { "channel": { "type": "string" }, "opt_in": { "type": "boolean" }, "reason": { "type": "string" } } }, "models.UpdateNotificationCategoryRequest": { "type": "object", "properties": { "active": { "type": "boolean" }, "default_opt_in": { "type": "boolean" }, "description": { "type": "string" }, "name": { "type": "string" }, "order": { "type": "integer" } } }, "models.UpdateNotificationPreferencesRequest": { "type": "object", "required": [ "channel" ], "properties": { "category_opt_ins": { "type": "object", "additionalProperties": { "type": "boolean" } }, "channel": { "type": "string" }, "opt_in": { "type": "boolean" }, "reason": { "type": "string" } } }, "models.UserAvatarRequest": { "type": "object", "properties": { "avatar_id": { "type": "string" } } }, "models.UserAvatarResponse": { "type": "object", "properties": { "avatar": { "$ref": "#/definitions/models.AvatarResponse" }, "avatar_id": { "type": "string" } } }, "models.UserConfigOptInResponse": { "type": "object", "required": [ "opt_in" ], "properties": { "category_opt_ins": { "type": "object", "additionalProperties": { "type": "boolean" } }, "opt_in": { "type": "boolean" } } }, "models.UserConfigResponse": { "type": "object", "properties": { "firstlogin": { "type": "boolean" } } }, "models.ValidateRegistrationRequest": { "type": "object", "required": [ "birth_date", "channel", "cpf", "name" ], "properties": { "birth_date": { "type": "string" }, "channel": { "type": "string" }, "cpf": { "type": "string" }, "name": { "type": "string" } } }, "models.ValidateRegistrationResponse": { "type": "object", "properties": { "matched_cpf": { "type": "string" }, "matched_name": { "type": "string" }, "valid": { "type": "boolean" } } }, "models.ValidationResult": { "type": "object", "properties": { "valid": { "type": "boolean" } } }, "models.VehicleBrand": { "type": "object", "properties": { "deleted_at": { "type": "string" }, "id": { "type": "string", "example": "brand_caloi" }, "is_other": { "type": "boolean", "example": false }, "name": { "type": "string", "example": "Caloi" } } }, "models.VehicleBrandCreateRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "example": "Caloi" } } }, "models.VehicleBrandUpdateRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "example": "Caloi" } } }, "models.VehicleBrandsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.VehicleBrand" } } } }, "models.VehicleColorsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" }, "example": [ "Amarelo", "Azul", "Preto" ] } } }, "models.VehicleConductor": { "type": "object", "properties": { "conductor_cpf": { "type": "string" }, "conductor_name": { "description": "Invite snapshot (persisted). For accepted links, GET overlays live RMI contact on these JSON fields.", "type": "string" }, "created_at": { "type": "string" }, "email_attempted_at": { "type": "string" }, "email_status": { "description": "Invite email delivery (handoff: register attempt/status on the link).", "allOf": [ { "$ref": "#/definitions/models.InviteEmailStatus" } ] }, "id": { "type": "string" }, "invited_by_cpf": { "type": "string" }, "notify_email": { "type": "string" }, "phone": { "type": "string" }, "responded_at": { "type": "string" }, "status": { "$ref": "#/definitions/models.ConductorStatus" }, "updated_at": { "type": "string" }, "vehicle_id": { "type": "string" } } }, "models.VehicleCreateRequest": { "type": "object", "required": [ "color", "display_name", "has_invoice", "self_declaration", "serial_number", "serial_number_photo_url", "vehicle_photo_url" ], "properties": { "brand_id": { "type": "string", "x-nullable": true }, "brand_other": { "type": "string", "x-nullable": true }, "color": { "type": "string" }, "display_name": { "type": "string" }, "has_invoice": { "type": "boolean" }, "invoice_photo_file_name": { "type": "string" }, "invoice_photo_file_size": { "type": "integer" }, "invoice_photo_url": { "type": "string", "x-nullable": true }, "model_id": { "type": "string", "x-nullable": true }, "model_other": { "type": "string", "x-nullable": true }, "self_declaration": { "type": "boolean" }, "serial_number": { "type": "string" }, "serial_number_photo_file_name": { "type": "string" }, "serial_number_photo_file_size": { "type": "integer" }, "serial_number_photo_url": { "type": "string" }, "vehicle_photo_file_name": { "type": "string" }, "vehicle_photo_file_size": { "type": "integer" }, "vehicle_photo_url": { "type": "string" }, "vehicle_type": { "$ref": "#/definitions/models.VehicleType" } } }, "models.VehicleDetail": { "type": "object", "properties": { "brand_id": { "type": "string", "x-nullable": true }, "brand_name": { "description": "BrandName is response-only: catalog brand name when brand_id is set and brand_other is empty.", "type": "string", "x-nullable": true }, "brand_other": { "type": "string", "x-nullable": true }, "color": { "type": "string" }, "conductor_id": { "type": "string" }, "created_at": { "type": "string" }, "deleted_at": { "type": "string" }, "display_name": { "type": "string" }, "has_invoice": { "type": "boolean" }, "id": { "type": "string" }, "invoice_photo_file_name": { "type": "string" }, "invoice_photo_file_size": { "type": "integer" }, "invoice_photo_url": { "type": "string", "x-nullable": true }, "model_id": { "type": "string", "x-nullable": true }, "model_name": { "description": "ModelName is response-only: catalog model name when model_id is set and model_other is empty.", "type": "string", "x-nullable": true }, "model_other": { "type": "string", "x-nullable": true }, "owner_cpf": { "type": "string" }, "owner_email": { "type": "string" }, "owner_name": { "type": "string" }, "owner_phone": { "type": "string" }, "registration_number": { "description": "RegistrationNumber is a short wallet identifier generated on create (format RJ-E-XXXXXX). Not accepted in POST/PATCH.", "type": "string", "example": "RJ-E-000001" }, "role": { "$ref": "#/definitions/models.VehicleRole" }, "self_declaration": { "type": "boolean" }, "serial_number": { "type": "string" }, "serial_number_photo_file_name": { "description": "Optional file metadata for UI detail (Apêndice A.4).", "type": "string" }, "serial_number_photo_file_size": { "type": "integer" }, "serial_number_photo_url": { "type": "string" }, "updated_at": { "type": "string" }, "vehicle_photo_file_name": { "type": "string" }, "vehicle_photo_file_size": { "type": "integer" }, "vehicle_photo_url": { "type": "string" }, "vehicle_type": { "$ref": "#/definitions/models.VehicleType" } } }, "models.VehicleInvitationItem": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "invited_by_cpf": { "type": "string" }, "owner_name": { "type": "string" }, "status": { "$ref": "#/definitions/models.ConductorStatus" }, "vehicle": { "$ref": "#/definitions/models.VehicleInvitationSummary" }, "vehicle_id": { "type": "string" } } }, "models.VehicleInvitationSummary": { "type": "object", "properties": { "brand_label": { "type": "string" }, "color": { "type": "string" }, "display_name": { "type": "string" }, "model_label": { "type": "string" }, "vehicle_photo_url": { "type": "string" }, "vehicle_type": { "$ref": "#/definitions/models.VehicleType" } } }, "models.VehicleInvitationsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.VehicleInvitationItem" } } } }, "models.VehicleListItem": { "type": "object", "properties": { "brand_id": { "type": "string", "x-nullable": true }, "brand_name": { "type": "string", "x-nullable": true }, "brand_other": { "type": "string", "x-nullable": true }, "color": { "type": "string" }, "conductor_id": { "type": "string" }, "display_name": { "type": "string" }, "id": { "type": "string" }, "model_id": { "type": "string", "x-nullable": true }, "model_name": { "type": "string", "x-nullable": true }, "model_other": { "type": "string", "x-nullable": true }, "registration_number": { "type": "string", "example": "RJ-E-000001" }, "role": { "$ref": "#/definitions/models.VehicleRole" }, "vehicle_photo_url": { "type": "string" }, "vehicle_type": { "$ref": "#/definitions/models.VehicleType" } } }, "models.VehicleModel": { "type": "object", "properties": { "brand_id": { "type": "string", "example": "brand_caloi" }, "deleted_at": { "type": "string" }, "id": { "type": "string", "example": "model_e-vibe" }, "is_other": { "type": "boolean", "example": false }, "name": { "type": "string", "example": "E-Vibe" }, "vehicle_type": { "$ref": "#/definitions/models.VehicleType" } } }, "models.VehicleModelCreateRequest": { "type": "object", "required": [ "brand_id", "name", "vehicle_type" ], "properties": { "brand_id": { "type": "string", "example": "brand_caloi" }, "name": { "type": "string", "example": "E-Vibe" }, "vehicle_type": { "allOf": [ { "$ref": "#/definitions/models.VehicleType" } ], "example": "bicicleta_eletrica" } } }, "models.VehicleModelUpdateRequest": { "type": "object", "properties": { "brand_id": { "type": "string" }, "name": { "type": "string" }, "vehicle_type": { "$ref": "#/definitions/models.VehicleType" } } }, "models.VehicleModelsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/models.VehicleModel" } } } }, "models.VehicleRole": { "type": "string", "enum": [ "owner", "conductor" ], "x-enum-varnames": [ "VehicleRoleOwner", "VehicleRoleConductor" ] }, "models.VehicleType": { "type": "string", "enum": [ "bicicleta_eletrica", "autopropelido", "ciclomotor" ], "x-enum-varnames": [ "VehicleTypeBicicletaEletrica", "VehicleTypeAutopropelido", "VehicleTypeCiclomotor" ] }, "models.VehicleUpdateRequest": { "type": "object", "properties": { "brand_id": { "type": "string", "x-nullable": true }, "brand_other": { "type": "string", "x-nullable": true }, "color": { "type": "string" }, "display_name": { "type": "string" }, "has_invoice": { "type": "boolean" }, "invoice_photo_file_name": { "type": "string" }, "invoice_photo_file_size": { "type": "integer" }, "invoice_photo_url": { "type": "string", "x-nullable": true }, "model_id": { "type": "string", "x-nullable": true }, "model_other": { "type": "string", "x-nullable": true }, "serial_number": { "type": "string" }, "serial_number_photo_file_name": { "type": "string" }, "serial_number_photo_file_size": { "type": "integer" }, "serial_number_photo_url": { "type": "string" }, "vehicle_photo_file_name": { "type": "string" }, "vehicle_photo_file_size": { "type": "integer" }, "vehicle_photo_url": { "type": "string" }, "vehicle_type": { "$ref": "#/definitions/models.VehicleType" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Tipo: Bearer token. Exemplo: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "type": "apiKey", "name": "Authorization", "in": "header" } }, "tags": [ { "description": "Operações relacionadas a cidadãos, incluindo consulta e atualização de dados autodeclarados", "name": "citizen" }, { "description": "Carteira de veículos (bicicleta elétrica, autopropelido, ciclomotor), condutores e catálogo", "name": "mobilidade" }, { "description": "Operações relacionadas a departamentos/unidades administrativas (UA)", "name": "departments" }, { "description": "Gerenciamento de categorias de notificação (admin) e listagem pública", "name": "notification-categories" }, { "description": "Gerenciamento de preferências de notificação por CPF e telefone", "name": "notification-preferences" }, { "description": "Operações de verificação de saúde da API", "name": "health" }, { "description": "Integração Salesforce Person Account: login sync, webhook inbound (delta em self_declared, sem gravar citizens), proxies CRM e push assíncrono RMI→SF via sync worker", "name": "salesforce" } ] }