{
    "openapi": "3.0.0",
    "info": {
        "title": "CCEF API",
        "description": "API para gestão de crédito consignado, leads, benefícios INSS e propostas",
        "contact": {
            "name": "Suporte CCEF",
            "email": "contato@ccef.com.br"
        },
        "version": "1.0"
    },
    "servers": [
        {
            "url": "/api",
            "description": "Servidor da API"
        }
    ],
    "paths": {
        "/auth/me": {
            "get": {
                "tags": [
                    "Autenticação"
                ],
                "summary": "Retorna informações do usuário autenticado",
                "description": "Retorna os dados do usuário atualmente autenticado no sistema",
                "operationId": "getAuthenticatedUser",
                "responses": {
                    "200": {
                        "description": "Dados do usuário retornados com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "João Silva"
                                        },
                                        "email": {
                                            "type": "string",
                                            "format": "email",
                                            "example": "joao@email.com"
                                        },
                                        "admin": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Não autenticado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/auth/login": {
            "post": {
                "tags": [
                    "Autenticação"
                ],
                "summary": "Realiza login do usuário",
                "description": "Autentica o usuário e retorna um token de acesso (Laravel Sanctum)",
                "operationId": "loginUser",
                "requestBody": {
                    "description": "Credenciais do usuário",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "password"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "usuario@email.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "senha123"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Login realizado com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "token": {
                                                    "type": "string",
                                                    "example": "1|abc123xyz..."
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "João Silva"
                                                },
                                                "email": {
                                                    "type": "string",
                                                    "example": "joao@email.com"
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "admin": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "id_user_crypt": {
                                                    "type": "string",
                                                    "example": "MQ=="
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "User signed in"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Credenciais inválidas",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthorised."
                                        },
                                        "data": {
                                            "properties": {
                                                "error": {
                                                    "type": "string",
                                                    "example": "Unauthorised"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/register": {
            "post": {
                "tags": [
                    "Autenticação"
                ],
                "summary": "Registra um novo usuário",
                "description": "Cria uma nova conta de usuário no sistema",
                "operationId": "registerUser",
                "requestBody": {
                    "description": "Dados do novo usuário",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email",
                                    "password",
                                    "confirm_password"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "João Silva"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "joao@email.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "senha123"
                                    },
                                    "confirm_password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "senha123"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Usuário criado com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "token": {
                                                    "type": "string",
                                                    "example": "1|abc123xyz..."
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "João Silva"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "User created successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Erro de validação ou usuário já existe",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Usuário já cadastrado."
                                        },
                                        "data": {
                                            "properties": {
                                                "error": {
                                                    "type": "string",
                                                    "example": "E-mail já cadastrado."
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/data/v1/beneficios": {
            "get": {
                "tags": [
                    "Benefícios"
                ],
                "summary": "Lista benefícios INSS",
                "description": "Retorna uma lista paginada de benefícios INSS consultados",
                "operationId": "getBeneficios",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "Termo de busca (nome ou CPF)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "startDate",
                        "in": "query",
                        "description": "Data inicial do filtro (formato: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "endDate",
                        "in": "query",
                        "description": "Data final do filtro (formato: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista de benefícios retornada com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PaginatedResponse"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro na consulta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "error"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/historicoInssMargem/{id}/{parcelas}": {
            "get": {
                "tags": [
                    "Benefícios"
                ],
                "summary": "Consulta margem INSS",
                "description": "Retorna o histórico de margem consignável do benefício INSS com cálculos de valores disponíveis",
                "operationId": "getHistoricoInssMargem",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID do benefício",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "parcelas",
                        "in": "path",
                        "description": "Número de parcelas para cálculo",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dados de margem retornados com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "data": {
                                            "properties": {
                                                "margem_disponivel_emprestimo": {
                                                    "type": "number"
                                                },
                                                "calc_margem_disponivel_emprestimo": {
                                                    "type": "number"
                                                },
                                                "calc_margem_disponivel_cartao": {
                                                    "type": "number"
                                                },
                                                "calc_saque_margem_disponivel_cartao": {
                                                    "type": "number"
                                                },
                                                "valor_total_disponivel": {
                                                    "type": "number"
                                                },
                                                "valor_total_disponivel_saque": {
                                                    "type": "number"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro na consulta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "error"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/historicoInssBanco/{id}": {
            "get": {
                "tags": [
                    "Benefícios"
                ],
                "summary": "Consulta dados bancários INSS",
                "description": "Retorna os dados bancários associados ao benefício INSS",
                "operationId": "getHistoricoInssBanco",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID do benefício",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dados bancários retornados com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "data": {
                                            "properties": {
                                                "banco_codigo": {
                                                    "type": "string"
                                                },
                                                "banco_nome": {
                                                    "type": "string"
                                                },
                                                "agencia": {
                                                    "type": "string"
                                                },
                                                "conta": {
                                                    "type": "string"
                                                },
                                                "meio_pagamento_tipo": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro na consulta"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/historicoInssContrato/{id}": {
            "get": {
                "tags": [
                    "Benefícios"
                ],
                "summary": "Lista contratos de empréstimo INSS",
                "description": "Retorna o histórico de contratos de empréstimo consignado do benefício",
                "operationId": "getHistoricoInssContratosEmprestimo",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID do benefício",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contratos retornados com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "contrato": {
                                                        "type": "string"
                                                    },
                                                    "banco": {
                                                        "type": "string"
                                                    },
                                                    "valor_emprestado": {
                                                        "type": "number"
                                                    },
                                                    "valor_parcela": {
                                                        "type": "number"
                                                    },
                                                    "quantidade_parcelas": {
                                                        "type": "integer"
                                                    },
                                                    "quantidade_parcelas_emaberto": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro na consulta"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/simulacoes-realizadas/{id_beneficio}": {
            "get": {
                "tags": [
                    "Propostas"
                ],
                "summary": "Lista simulações realizadas",
                "description": "Retorna todas as simulações de crédito realizadas para um benefício",
                "operationId": "getSimulacoesRealizadas",
                "parameters": [
                    {
                        "name": "id_beneficio",
                        "in": "path",
                        "description": "ID do benefício",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Simulações retornadas com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "id_beneficio": {
                                                        "type": "integer"
                                                    },
                                                    "id_tabela": {
                                                        "type": "integer"
                                                    },
                                                    "nome": {
                                                        "type": "string"
                                                    },
                                                    "params": {
                                                        "type": "string"
                                                    },
                                                    "validacao": {
                                                        "type": "string"
                                                    },
                                                    "simulacoes": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/motivo-bloqueios/{id_beneficio}": {
            "get": {
                "tags": [
                    "Propostas"
                ],
                "summary": "Lista motivos de bloqueio",
                "description": "Retorna os motivos pelos quais um benefício foi bloqueado em determinadas tabelas",
                "operationId": "getMotivosBloqueios",
                "parameters": [
                    {
                        "name": "id_beneficio",
                        "in": "path",
                        "description": "ID do benefício",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Motivos de bloqueio retornados com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "id_beneficio": {
                                                        "type": "integer"
                                                    },
                                                    "id_tabela": {
                                                        "type": "integer"
                                                    },
                                                    "nome": {
                                                        "type": "string"
                                                    },
                                                    "motivo": {
                                                        "type": "string"
                                                    },
                                                    "params": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/esteiraPropostas": {
            "get": {
                "tags": [
                    "Propostas"
                ],
                "summary": "Lista propostas na esteira",
                "description": "Retorna uma lista paginada de propostas na esteira de crédito",
                "operationId": "getEsteiraPropostas",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "Termo de busca (nome ou CPF)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "startDate",
                        "in": "query",
                        "description": "Data inicial (formato: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "endDate",
                        "in": "query",
                        "description": "Data final (formato: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status da proposta",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista de propostas retornada com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PaginatedResponse"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro na consulta"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Propostas"
                ],
                "summary": "Cria uma nova proposta",
                "description": "Cadastra uma nova proposta na esteira de crédito",
                "operationId": "storeEsteiraProposta",
                "requestBody": {
                    "description": "Dados da proposta",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id_beneficio",
                                    "id_banco",
                                    "id_tabela",
                                    "id_coeficiente",
                                    "qtde_parcelas",
                                    "coeficiente",
                                    "valor_margem",
                                    "valor_parcela",
                                    "credito",
                                    "valor_comissao",
                                    "data_coeficiente"
                                ],
                                "properties": {
                                    "id_beneficio": {
                                        "description": "ID do benefício",
                                        "type": "integer"
                                    },
                                    "id_banco": {
                                        "description": "ID do banco",
                                        "type": "integer"
                                    },
                                    "id_tabela": {
                                        "description": "ID da tabela",
                                        "type": "integer"
                                    },
                                    "id_coeficiente": {
                                        "description": "ID do coeficiente",
                                        "type": "integer"
                                    },
                                    "qtde_parcelas": {
                                        "description": "Quantidade de parcelas",
                                        "type": "integer"
                                    },
                                    "coeficiente": {
                                        "description": "Valor do coeficiente",
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "valor_margem": {
                                        "description": "Valor da margem",
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "valor_parcela": {
                                        "description": "Valor da parcela",
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "credito": {
                                        "description": "Valor do crédito",
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "valor_comissao": {
                                        "description": "Valor da comissão",
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "data_coeficiente": {
                                        "description": "Data do coeficiente",
                                        "type": "string",
                                        "format": "date"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Proposta criada com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro ao criar proposta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "error"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/simulacoes/{id_beneficio}/{data}/{valor}/{valor_parcela}": {
            "get": {
                "tags": [
                    "Propostas"
                ],
                "summary": "Realiza simulações de crédito",
                "description": "Calcula e retorna simulações de crédito consignado para um benefício específico",
                "operationId": "getSimulacoes",
                "parameters": [
                    {
                        "name": "id_beneficio",
                        "in": "path",
                        "description": "ID do benefício",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "data",
                        "in": "path",
                        "description": "Data para cálculo dos coeficientes (formato: Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "valor",
                        "in": "path",
                        "description": "Valor desejado para simulação",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float",
                            "default": 0
                        }
                    },
                    {
                        "name": "valor_parcela",
                        "in": "path",
                        "description": "Valor da parcela desejada",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Simulações calculadas com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "simulacoes": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id_tabela": {
                                                        "type": "integer"
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "id_banco": {
                                                        "type": "integer"
                                                    },
                                                    "nome_banco": {
                                                        "type": "string"
                                                    },
                                                    "coeficientes": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "coeficiente": {
                                                                    "type": "number"
                                                                },
                                                                "qtde_parcela": {
                                                                    "type": "integer"
                                                                },
                                                                "valor_parcela": {
                                                                    "type": "number"
                                                                },
                                                                "margem_calculada": {
                                                                    "type": "number"
                                                                },
                                                                "comissao": {
                                                                    "type": "number"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "tabelas_bloqueadas": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/leads": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Lista todos os leads",
                "description": "Retorna uma lista paginada de leads com filtros opcionais por data, produto, categoria e busca",
                "operationId": "getLeads",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "Termo de busca (CPF ou nome)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "categoria",
                        "in": "query",
                        "description": "Categoria do lead (todos, quente, frio, etc)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "todos"
                        }
                    },
                    {
                        "name": "startDate",
                        "in": "query",
                        "description": "Data inicial do filtro (formato: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "endDate",
                        "in": "query",
                        "description": "Data final do filtro (formato: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "produto",
                        "in": "query",
                        "description": "Produto(s) separados por vírgula",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista de leads retornada com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "json": {
                                            "properties": {
                                                "leads": {
                                                    "$ref": "#/components/schemas/PaginatedResponse"
                                                },
                                                "produtos": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro na consulta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "error"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Cria um novo lead",
                "description": "Cadastra um novo lead no sistema",
                "operationId": "storeLead",
                "requestBody": {
                    "description": "Dados do lead",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "nome",
                                    "cpf"
                                ],
                                "properties": {
                                    "nome": {
                                        "type": "string",
                                        "example": "Maria Silva"
                                    },
                                    "cpf": {
                                        "type": "string",
                                        "example": "12345678900"
                                    },
                                    "celular": {
                                        "type": "string",
                                        "example": "11999999999"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "maria@email.com"
                                    },
                                    "cidade": {
                                        "type": "string",
                                        "example": "São Paulo"
                                    },
                                    "uf": {
                                        "type": "string",
                                        "example": "SP"
                                    },
                                    "valor": {
                                        "type": "number",
                                        "format": "float",
                                        "example": 5000
                                    },
                                    "produto": {
                                        "type": "string",
                                        "example": "consignado"
                                    },
                                    "canal": {
                                        "type": "string",
                                        "example": "site"
                                    },
                                    "categoria": {
                                        "type": "string",
                                        "example": "quente"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Lead cadastrado com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead cadastrado com sucesso."
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "203": {
                        "description": "Erro de validação",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "object"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "error"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro ao cadastrar",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "error"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/leads/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Exibe um lead específico",
                "description": "Retorna os dados de um lead pelo ID",
                "operationId": "showLead",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID do lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead encontrado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Consulta realizada com sucesso."
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "data": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "nome": {
                                                    "type": "string"
                                                },
                                                "cpf": {
                                                    "type": "string"
                                                },
                                                "celular": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "cidade": {
                                                    "type": "string"
                                                },
                                                "uf": {
                                                    "type": "string"
                                                },
                                                "valor": {
                                                    "type": "number"
                                                },
                                                "status": {
                                                    "type": "integer"
                                                },
                                                "status_board": {
                                                    "type": "integer"
                                                },
                                                "produto": {
                                                    "type": "string"
                                                },
                                                "canal": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro na consulta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "error"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Leads"
                ],
                "summary": "Atualiza um lead",
                "description": "Atualiza os dados de um lead existente",
                "operationId": "updateLead",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID do lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Dados do lead a serem atualizados",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "nome",
                                    "cpf"
                                ],
                                "properties": {
                                    "nome": {
                                        "type": "string",
                                        "example": "Maria Silva"
                                    },
                                    "cpf": {
                                        "type": "string",
                                        "example": "12345678900"
                                    },
                                    "celular": {
                                        "type": "string",
                                        "example": "11999999999"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "cidade": {
                                        "type": "string"
                                    },
                                    "uf": {
                                        "type": "string"
                                    },
                                    "valor": {
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "produto": {
                                        "type": "string"
                                    },
                                    "canal": {
                                        "type": "string"
                                    },
                                    "categoria": {
                                        "type": "string"
                                    },
                                    "status": {
                                        "type": "integer"
                                    },
                                    "status_board": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Lead atualizado com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead alterado com sucesso."
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Erro ao atualizar",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "error"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/v1/changeLeadBoard": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Move lead entre boards",
                "description": "Altera o status do board de um lead (Kanban)",
                "operationId": "changeLeadBoard",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id",
                                    "to_status"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "ID do lead",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "from_status": {
                                        "description": "Status atual",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "to_status": {
                                        "description": "Novo status",
                                        "type": "integer",
                                        "example": 2
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Status alterado com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "boolean"
                                },
                                "example": true
                            }
                        }
                    },
                    "400": {
                        "description": "Erro ao alterar status"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/data/user": {
            "get": {
                "tags": [
                    "Usuários"
                ],
                "summary": "Lista todos os usuários",
                "description": "Retorna uma lista de todos os usuários do sistema",
                "operationId": "getUsers",
                "responses": {
                    "200": {
                        "description": "Lista de usuários retornada com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "João Silva"
                                            },
                                            "email": {
                                                "type": "string",
                                                "format": "email",
                                                "example": "joao@email.com"
                                            },
                                            "admin": {
                                                "type": "boolean",
                                                "example": false
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Não autenticado"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "SuccessResponse": {
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": true
                    },
                    "data": {
                        "type": "object"
                    },
                    "message": {
                        "type": "string",
                        "example": "Operação realizada com sucesso"
                    }
                },
                "type": "object"
            },
            "ErrorResponse": {
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "message": {
                        "type": "string",
                        "example": "Erro na operação"
                    },
                    "data": {
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "PaginatedResponse": {
                "properties": {
                    "current_page": {
                        "type": "integer",
                        "example": 1
                    },
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "first_page_url": {
                        "type": "string"
                    },
                    "from": {
                        "type": "integer"
                    },
                    "last_page": {
                        "type": "integer"
                    },
                    "last_page_url": {
                        "type": "string"
                    },
                    "next_page_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "path": {
                        "type": "string"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "prev_page_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "to": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "description": "Token de autenticação obtido via login",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Autenticação",
            "description": "Endpoints de autenticação e registro de usuários"
        },
        {
            "name": "Leads",
            "description": "Gerenciamento de leads"
        },
        {
            "name": "Benefícios",
            "description": "Consulta e gerenciamento de benefícios INSS"
        },
        {
            "name": "Propostas",
            "description": "Esteira de propostas e simulações"
        },
        {
            "name": "Usuários",
            "description": "Gerenciamento de usuários do sistema"
        }
    ]
}