openapi: 3.0.3
info:
    title: 'DValor - Documentação API'
    description: 'Documentação de API'
    version: 1.0.0
servers:
    -
        url: 'https://sandbox.toolconsig.com.br'
paths:
    /api/auth/login:
        post:
            summary: "Login\n\nRealiza login e retorna o token de autenticação JWT."
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: X-Tenant
                    description: ''
                    example: dvalor
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    status: success
                                    token: eyJ0eXAiOiJKV1QiLCJh...
                                properties:
                                    status: { type: string, example: success }
                                    token: { type: string, example: eyJ0eXAiOiJKV1QiLCJh... }
                401:
                    description: '401'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    status: error
                                    message: 'Credenciais inválidas'
                                properties:
                                    status: { type: string, example: error }
                                    message: { type: string, example: 'Credenciais inválidas' }
            tags:
                - Autenticação
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                email:
                                    type: string
                                    description: 'Email do usuário. Exemplo: usuario@teste.com'
                                    example: natus
                                password:
                                    type: string
                                    description: 'Senha do usuário. Exemplo: secret'
                                    example: temporibus
                            required:
                                - email
                                - password
            security: []
    /api/external/servicos/tabelas:
        get:
            summary: 'Listar Tabelas de comissão'
            description: 'Retorna todas as tabelas disponíveis para uso.'
            parameters:
                -
                    in: query
                    name: banco
                    description: Banco
                    example: '9'
                    required: true
                    schema:
                        type: string
                        description: Banco
                        example: '9'
                -
                    in: query
                    name: convenio
                    description: Convênio
                    example: '53'
                    required: true
                    schema:
                        type: string
                        description: Convênio
                        example: '53'
                -
                    in: query
                    name: tipo
                    description: Produto
                    example: '1'
                    required: true
                    schema:
                        type: string
                        description: Produto
                        example: '1'
                -
                    in: query
                    name: tabela
                    description: 'Nome da tabela'
                    example: 'CARTAO BENEFICIO'
                    required: false
                    schema:
                        type: string
                        description: 'Nome da tabela'
                        example: 'CARTAO BENEFICIO'
                -
                    in: query
                    name: prazo
                    description: Prazo
                    example: '96'
                    required: false
                    schema:
                        type: string
                        description: Prazo
                        example: '96'
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: X-Tenant
                    description: ''
                    example: dvalor
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        text/plain:
                            schema:
                                type: string
                                example: "[\n  {\n   \"id\": 447236,\n   \"banco\": \"AMIGOZ\",\n   \"convenio\": \"INSS - INSTITUTO NACIONAL DE SEGURO SOCIAL - BR\",\n   \"tipo\": \"CARTÃO C/ SAQUE AUTORIZADO\",\n   \"tabela\": \"CARTAO BENEFICIO INSS - C/ SEG. DIAMANTE\",\n   \"digital\": \"SIM\",\n   \"taxa\": \"\",\n   \"vigencia\": \"2025-05-30\",\n   \"prazo\": \"96\",\n   \"idade\": \"\",\n   \"vr_ctr_atual\": \"\",\n   \"comissao_agente_moeda\": 0,\n   \"comissao_liquido_agente_percentual\": 15.5,\n   \"comissao_bruto_agente_percentual\": 0,\n   \"codigo_mg\": \"144379\"\n  },\n  {\n   \"id\": 447237,\n   \"banco\": \"AMIGOZ\",\n   \"convenio\": \"INSS - INSTITUTO NACIONAL DE SEGURO SOCIAL - BR\",\n   \"tipo\": \"CARTÃO C/ SAQUE AUTORIZADO\",\n   \"tabela\": \"CARTAO BENEFICIO INSS - C/ SEG. DIAMANTE\",\n   \"digital\": \"SIM\",\n   \"taxa\": \"\",\n   \"vigencia\": \"2025-05-30\",\n   \"prazo\": \"84\",\n   \"idade\": \"\",\n   \"vr_ctr_atual\": \"\",\n   \"comissao_agente_moeda\": 0,\n   \"comissao_liquido_agente_percentual\": 15.5,\n   \"comissao_bruto_agente_percentual\": 0,\n   \"codigo_mg\": \"144380\"\n  },\n]"
            tags:
                - Endpoints
    /api/external/servicos/producoes:
        get:
            summary: 'Listar Produção'
            description: 'Retorna todos os contratos pagos.'
            parameters:
                -
                    in: query
                    name: cpf
                    description: CPF
                    example: 422.581.366-52
                    required: false
                    schema:
                        type: string
                        description: CPF
                        example: 422.581.366-52
                -
                    in: query
                    name: proposta
                    description: Proposta
                    example: '53'
                    required: false
                    schema:
                        type: string
                        description: Proposta
                        example: '53'
                -
                    in: query
                    name: tipo
                    description: 'Data a ser consultada'
                    example: '1 - Data Importação | 2 - Data Crédito Cliente | 3 - Data Operação | 4 - Data Pagamento'
                    required: false
                    schema:
                        type: string
                        description: 'Data a ser consultada'
                        example: '1 - Data Importação | 2 - Data Crédito Cliente | 3 - Data Operação | 4 - Data Pagamento'
                -
                    in: query
                    name: fisico_pendente
                    description: 'Físico Pendente'
                    example: 'S | N'
                    required: false
                    schema:
                        type: string
                        description: 'Físico Pendente'
                        example: 'S | N'
                -
                    in: query
                    name: inicio
                    description: 'Data Início'
                    example: '2024-08-02'
                    required: false
                    schema:
                        type: string
                        description: 'Data Início'
                        example: '2024-08-02'
                -
                    in: query
                    name: fim
                    description: 'Data Final'
                    example: '2024-08-02'
                    required: false
                    schema:
                        type: string
                        description: 'Data Final'
                        example: '2024-08-02'
                -
                    in: query
                    name: page
                    description: Página
                    example: '1'
                    required: false
                    schema:
                        type: string
                        description: Página
                        example: '1'
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: X-Tenant
                    description: ''
                    example: dvalor
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    current_page: 1
                                    data: [{ id: 21185, cpf: '18181252420', cliente: 'LUCIA MARIA DE MEDEIROS SANTOS', banco: 'C6 BANK S.A', proposta: '970717784', contrato: '970717784', prazo: '96', produto: 'Refin / Portabilidade', tabela: 'C6 BANK - INSS - DIGITAL WEB PLUS REFIN PORT FLEX 4 - TX 1,649 A 1,600 (240142)', valor_contrato: 5082.06, data_operacao: '2025-08-13', data_credito_cliente: '2025-08-26', data_ncr: '2025-08-27', corretor_perc_comissao: 1.14, corretor_valor_comissao: 57.94, pago: S, data_recebimento: null, valor_base: 5082.06, corretor: 'ADELMO DA SILVA GOMES' }]
                                    first_page_url: 'http://localhost:8000/api/external/servicos/producoes?page=1'
                                    from: 1
                                    last_page: 1
                                    last_page_url: 'http://localhost:8000/api/external/servicos/producoes?page=1'
                                    next_page_url: null
                                    path: 'http://localhost:8000/api/external/servicos/producoes'
                                    per_page: 10
                                    prev_page_url: null
                                    to: 1
                                    total: 1
                                properties:
                                    current_page: { type: integer, example: 1 }
                                    data: { type: array, example: [{ id: 21185, cpf: '18181252420', cliente: 'LUCIA MARIA DE MEDEIROS SANTOS', banco: 'C6 BANK S.A', proposta: '970717784', contrato: '970717784', prazo: '96', produto: 'Refin / Portabilidade', tabela: 'C6 BANK - INSS - DIGITAL WEB PLUS REFIN PORT FLEX 4 - TX 1,649 A 1,600 (240142)', valor_contrato: 5082.06, data_operacao: '2025-08-13', data_credito_cliente: '2025-08-26', data_ncr: '2025-08-27', corretor_perc_comissao: 1.14, corretor_valor_comissao: 57.94, pago: S, data_recebimento: null, valor_base: 5082.06, corretor: 'ADELMO DA SILVA GOMES' }], items: { type: object } }
                                    first_page_url: { type: string, example: 'http://localhost:8000/api/external/servicos/producoes?page=1' }
                                    from: { type: integer, example: 1 }
                                    last_page: { type: integer, example: 1 }
                                    last_page_url: { type: string, example: 'http://localhost:8000/api/external/servicos/producoes?page=1' }
                                    next_page_url: { type: string, example: null }
                                    path: { type: string, example: 'http://localhost:8000/api/external/servicos/producoes' }
                                    per_page: { type: integer, example: 10 }
                                    prev_page_url: { type: string, example: null }
                                    to: { type: integer, example: 1 }
                                    total: { type: integer, example: 1 }
            tags:
                - Endpoints
    /api/external/servicos/relatorios/comissao:
        get:
            summary: 'Relatório de comissão'
            description: 'Retorna o relatório de comissão dos contratos pagos.'
            parameters:
                -
                    in: query
                    name: inicio
                    description: 'Data Início'
                    example: '2024-08-02'
                    required: true
                    schema:
                        type: string
                        description: 'Data Início'
                        example: '2024-08-02'
                -
                    in: query
                    name: fim
                    description: 'Data Final'
                    example: '2024-08-02'
                    required: true
                    schema:
                        type: string
                        description: 'Data Final'
                        example: '2024-08-02'
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: X-Tenant
                    description: ''
                    example: dvalor
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    content-type: application/pdf
                                    description: 'Retorna um arquivo PDF contendo os dados do relatório.'
                                properties:
                                    content-type: { type: string, example: application/pdf }
                                    description: { type: string, example: 'Retorna um arquivo PDF contendo os dados do relatório.' }
            tags:
                - Endpoints
    /api/external/bancos/listarAll:
        get:
            summary: 'Listar Bancos'
            description: 'Retorna todos os bancos cadastrados.'
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: X-Tenant
                    description: ''
                    example: dvalor
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        text/plain:
                            schema:
                                type: string
                                example: "[\n {\n   \"id\": 53,\n   \"nome\": \"AMIGOZ\",\n   \"ativo\": \"S\"\n },\n {\n   \"id\": 6,\n   \"nome\": \"BANRISUL S.A\",\n   \"ativo\": \"S\"\n  },\n]"
                401:
                    description: '401'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    status: error
                                    message: 'Credenciais inválidas'
                                properties:
                                    status: { type: string, example: error }
                                    message: { type: string, example: 'Credenciais inválidas' }
            tags:
                - Endpoints
    /api/external/convenios/tipos:
        get:
            summary: 'Listar Produtos'
            description: 'Retorna todos os convênios cadastrados para o banco selecionado.'
            parameters:
                -
                    in: query
                    name: banco
                    description: Banco
                    example: '9'
                    required: true
                    schema:
                        type: string
                        description: Banco
                        example: '9'
                -
                    in: query
                    name: convenio
                    description: Convênio
                    example: '53'
                    required: true
                    schema:
                        type: string
                        description: Convênio
                        example: '53'
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: X-Tenant
                    description: ''
                    example: dvalor
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        text/plain:
                            schema:
                                type: string
                                example: "[\n {\n   \"id\": 1,\n   \"nome\": \"CARTÃO C/ SAQUE AUTORIZADO\",\n   \"ativo\": \"S\"\n },\n]"
                401:
                    description: '401'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    status: error
                                    message: 'Credenciais inválidas'
                                properties:
                                    status: { type: string, example: error }
                                    message: { type: string, example: 'Credenciais inválidas' }
            tags:
                - Endpoints
    /api/external/bancos/convenios:
        get:
            summary: 'Listar Convênios do Banco'
            description: 'Retorna todos os convênios cadastrados para o banco selecionado.'
            parameters:
                -
                    in: query
                    name: banco
                    description: Banco
                    example: '9'
                    required: true
                    schema:
                        type: string
                        description: Banco
                        example: '9'
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: X-Tenant
                    description: ''
                    example: dvalor
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        text/plain:
                            schema:
                                type: string
                                example: "[\n {\n   \"id\": 1,\n   \"nome\": \"INSS - INSTITUTO NACIONAL DE SEGURO SOCIAL - BR\",\n   \"ativo\": \"S\"\n },\n {\n   \"id\": 4,\n   \"nome\": \"GOVERNO DO ESTADO DA PARAIBA - PB\",\n   \"ativo\": \"S\"\n  },\n]"
                401:
                    description: '401'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    status: error
                                    message: 'Credenciais inválidas'
                                properties:
                                    status: { type: string, example: error }
                                    message: { type: string, example: 'Credenciais inválidas' }
            tags:
                - Endpoints
components:
    securitySchemes:
        default:
            type: http
            scheme: bearer
            description: ''
security:
    -
        default: []
