{
  "openapi": "3.0.0",
  "info": {
    "title": "API Lista Parcelas",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://sauto.dsv.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
      "description": "Desenvolvimento"
    },
    {
      "url": "https://sauto.hml.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
      "description": "Homologação"
    },
    {
      "url": "https://sauto.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
      "description": "Produção"
    }
  ],
  "paths": {
    "/parcelas-abertas": {
      "post": {
        "tags": [
          "Parcelas"
        ],
        "summary": "Listar Parcelas em Aberto",
        "operationId": "listarParcelasAbertas",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListarParcelasAbertasDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operação bem-sucedida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DadosRetornoBoletoSegundaViaDto"
                }
              }
            }
          },
          "400": {
            "description": "Requisição inválida",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MensagemErroVo"
                }
              }
            }
          },
          "404": {
            "description": "Não encontrado",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MensagemErroVo"
                }
              }
            }
          },
          "500": {
            "description": "Erro interno no servidor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MensagemErroVo"
                }
              }
            }
          },
          "503": {
            "description": "Serviço indisponível",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MensagemErroVo"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "ListarParcelasAbertasDto": {
        "type": "object",
        "properties": {
          "autenticacao": {
            "$ref": "#/components/schemas/Autenticacao"
          },
          "chaveApolice": {
            "$ref": "#/components/schemas/ChaveApoliceVo"
          }
        },
        "required": [
          "autenticacao"
        ]
      },
      "Autenticacao": {
        "type": "object",
        "properties": {
          "provedor": {
            "type": "integer",
            "format": "int64",
            "description": "Provedor de autenticação",
            "example": 1
          },
          "usuario": {
            "type": "string",
            "description": "Nome de usuário",
            "example": "usuario123"
          },
          "senha": {
            "type": "string",
            "description": "Senha do usuário",
            "example": "senhaSegura123"
          }
        },
        "required": [
          "provedor",
          "usuario",
          "senha"
        ]
      },
      "ChaveApoliceVo": {
        "type": "object",
        "properties": {
          "sucursalApolice": {
            "type": "integer",
            "description": "Sucursal da apólice",
            "example": 1
          },
          "numeroApolice": {
            "type": "integer",
            "description": "Número da apólice",
            "example": 123456
          },
          "itemApolice": {
            "type": "integer",
            "description": "Item da apólice",
            "example": 1234
          }
        },
        "required": [
          "sucursalApolice",
          "numeroApolice",
          "itemApolice"
        ]
      },
      "DadosRetornoBoletoSegundaViaDto": {
        "type": "object",
        "properties": {
          "segurado": {
            "$ref": "#/components/schemas/BoletoSeguradoDto",
            "description": "Informações do segurado"
          },
          "corretor": {
            "$ref": "#/components/schemas/BoletoCorretorDto",
            "description": "Informações do corretor"
          },
          "apolice": {
            "$ref": "#/components/schemas/BoletoApoliceDto",
            "description": "Informações da apólice"
          },
          "boletoParcelasAbertas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoletoParcelasAbertasDto"
            },
            "description": "Lista de parcelas abertas do boleto"
          }
        }
      },
      "BoletoSeguradoDto": {
        "type": "object",
        "properties": {
          "nomeSegurado": {
            "type": "string",
            "description": "Nome do segurado",
            "example": "João da Silva"
          },
          "cpfCnpjSegurado": {
            "type": "integer",
            "description": "CPF ou CNPJ do segurado",
            "example": 12345678901
          },
          "email": {
            "type": "string",
            "description": "Email do segurado",
            "example": "joao.silva@example.com"
          },
          "telefones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TelefoneDto"
            },
            "description": "Lista de telefones do segurado"
          }
        }
      },
      "BoletoCorretorDto": {
        "type": "object",
        "properties": {
          "cpdCorretor": {
            "type": "integer",
            "format": "int64",
            "description": "Código do corretor",
            "example": 123456
          },
          "nomeCorretor": {
            "type": "string",
            "description": "Nome do corretor",
            "example": "João da Silva"
          },
          "cpfCnpjCorretor": {
            "type": "string",
            "description": "CPF ou CNPJ do corretor",
            "example": "123.456.789-00"
          },
          "email": {
            "type": "string",
            "description": "Email do corretor",
            "example": "joao.silva@example.com"
          },
          "telefones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TelefoneDto"
            },
            "description": "Lista de telefones do corretor"
          }
        }
      },
      "BoletoApoliceDto": {
        "type": "object",
        "properties": {
          "numeroProposta": {
            "type": "integer",
            "format": "int64",
            "description": "Número da proposta",
            "example": 1234567890
          },
          "codigoSucursal": {
            "type": "integer",
            "description": "Código da sucursal",
            "example": 123
          },
          "cia": {
            "type": "integer",
            "description": "Companhia",
            "example": 456
          },
          "ramo": {
            "type": "integer",
            "description": "Ramo",
            "example": 789
          },
          "numeroApolice": {
            "type": "integer",
            "description": "Número da apólice",
            "example": 101112
          },
          "numeroItem": {
            "type": "integer",
            "description": "Número do item",
            "example": 131415
          },
          "especie": {
            "type": "string",
            "description": "Espécie",
            "example": "Automóvel"
          },
          "placaVeiculo": {
            "type": "string",
            "description": "Placa do veículo",
            "example": "ABC-1234"
          }
        }
      },
      "BoletoParcelasAbertasDto": {
        "type": "object",
        "properties": {
          "numeroDaParcela": {
            "type": "integer",
            "description": "Número da parcela",
            "example": 1
          },
          "valorTotalParcela": {
            "type": "number",
            "format": "double",
            "description": "Valor total da parcela",
            "example": 150.75
          },
          "dataGeracao": {
            "type": "string",
            "format": "date-time",
            "description": "Data de geração",
            "example": "2023-10-01T00:00:00.000Z"
          },
          "dataVencimento": {
            "type": "string",
            "format": "date-time",
            "description": "Data de vencimento",
            "example": "2023-11-01T00:00:00.000Z"
          },
          "dgRef": {
            "type": "string",
            "description": "Referência do documento",
            "example": "ABC123"
          }
        }
      },
      "TelefoneDto": {
        "type": "object",
        "properties": {
          "tipo": {
            "type": "string",
            "description": "Tipo de telefone",
            "example": "Celular"
          },
          "ddd": {
            "type": "integer",
            "description": "Código de área (DDD)",
            "example": 11
          },
          "numero": {
            "type": "integer",
            "description": "Número de telefone",
            "example": 987654321
          }
        }
      },
      "MensagemErroVo": {
        "type": "object",
        "properties": {
          "cdErro": {
            "type": "integer"
          },
          "dsErro": {
            "type": "string"
          }
        }
      }
    }
  }
}