swagger: '2.0'
info:
  title: Projeto Digital de Relacionamento - Documents
  description: API permite a consulta de documentos enviados por corretores e/ou segurados, vinculados a algum processo dentro da Sompo.
  version: '1.0.0'
host: api.sompo.com.br
basePath: /documents/v1
tags:
  - name: "Documentos de Sinistros"
schemes:
  - https
paths:
  /sinistro/v1/acompanhamento/docs/documentos_outbound/{numeroSinistro}/{numeroSubSinistro}/{numeroApolice}/{funcaoParceiro}/{codigoParceiro}/{numeroSucursal}:
    get:
      summary: Consulta de Documentos de Sinistros
      operationId: ConsultaDocumentoSinistro
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - "Documentos de Sinistros"
      parameters:
        - in: path
          name: funcaoParceiro
          required: true
          type: string
        - in: path
          name: numeroSinistro
          required: true
          type: string
        - in: path
          name: numeroSubSinistro
          required: true
          type: string
        - in: header
          name: companyCode
          required: true
          type: string
        - in: path
          name: numeroApolice
          required: true
          type: string
        - in: path
          name: codigoParceiro
          required: true
          type: string
        - in: path
          name: numeroSucursal
          required: true
          type: string          
      responses:
        200:
          description: Successful response
          schema:
            $ref: '#/definitions/ClaimDocumentResponse'         
  /sinistro/v1/acompanhamento/docs/download_outbound/{resource}/{numeroSinistro}/{numeroSubSinistro}/{numeroDocumento}:
    get:
      summary: Donwload de Documentos de Sinistros
      operationId: DownloadDocumentoSinistro
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - "Documentos de Sinistros"
      parameters:
        - in: path
          name: numeroSinistro
          required: true
          type: string
        - in: path
          name: numeroSubSinistro
          required: true
          type: string
        - in: header
          name: companyCode
          required: true
          type: string
        - in: path
          name: resource
          required: true
          type: string
        - in: path
          name: numeroDocumento
          required: true
          type: string
      responses:
        200:
          description: Successful response
          schema:
            $ref: '#/definitions/ClaimDownloadResourceResponse'           
  /sinistros/v1/acompanhamento/docs/cartas_enviadas_outbound/{numeroSinistro}/{numeroSubSinistro}/{codigoParceiro}/{status}:
   get:
      summary: Cartas enviadas de Sinistros
      operationId: CartaDocumentoSinistro
      consumes:
        - application/json
      produces:
        - application/json
      tags:
        - "Documentos de Sinistros"
      parameters:
        - in: path
          name: numeroSinistro
          required: true
          type: string
        - in: path
          name: numeroSubSinistro
          required: true
          type: string
        - in: header
          name: companyCode
          required: true
          type: string
        - in: path
          name: codigoParceiro
          required: true
          type: string
        - in: path
          name: status
          required: true
          type: string
      responses:
        200:
          description: Successful response
          schema:
            $ref: '#/definitions/ClaimMailResponse'
definitions:
  ClaimMailResponse:
    type: object
    properties:
      DT_Cartas_Resp:
          type: "object"
          properties:
            SINISTRO:
              type: "string"
            LISTA_CARTAS:
              type: "array"
              items:
                type: "object"
                properties:
                  SUBSINISTRO:
                    type: "string"
                  DATA_ENV:
                    type: "string"
                  HORA_ENV:
                    type: "string"
                  NOME_DEST:
                    type: "string"
                  ASSUNTO:
                    type: "string"
                  ARQUIVO:
                    type: "string"
                  BP_DEST:
                    type: "string"
                  TP_ENV:
                    type: "string"
                  EMAIL_ENV:
                    type: "string"
            MSG:
              type: "array"
              items:
                type: "object"
                properties:
                  MSG_TIPO:
                    type: "string"
                  MSG_RETORNO:
                    type: "string"
            MSG_ERRO:
              type: "string"
            MSG_ID:
              type: "string"
  ClaimDocumentResponse:
    type: object
    properties:
      MT_Consultar_Resp:
        type: object
        properties:
          SINISTRO:
            type: "string"
          SUBSINISTRO:
            type: "string"
          PRODUTO:
            type: "string"
          RAMO:
            type: "string"
          APOLICE:
            type: "string"
          NR_ITEM:
            type: "string"
          CD_CORRETOR:
            type: "string"
          CD_COLABORADOR:
            type: "string"
          NR_CPF_CNPJ_Segurado:
            type: "string"
          NOME_SEG:
            type: "string"
          NR_CPF_CNPJ_ESTIPULANTE:
            type: "string"
          NR_CPF_CNPJ_BENEFICIARIO:
            type: "array"
            items:
              type: "object"
              properties:
                LST_CPF_CNPJ_BENEFICIARIO:
                  type: "string"
          NR_CPF_CNPJ_TERCEIRO:
            type: "string"
          NOME_CORRETOR:
            type: "string"
          EMAIL_CORRETOR:
            type: "string"
          CLASSE_OFICINAS:
            type: "array"
            items:
              type: "object"
              properties:
                CLASSES:
                  type: "string"
          CD_PERITO:
            type: "string"
          CD_SINDICANTE:
            type: "string"
          CD_REGULADORA:
            type: "string"
          DOCUMENTO_PEND:
            type: "array"
            items:
              type: "object"
              properties:
                CD_DOC_PEND:
                  type: "string"
                TP_DOC_PEND:
                  type: "string"
                DSC_DOC_PEND:
                  type: "string"
                DT_ULTIMA_SOL_DOC:
                  type: "string"
                EXT_DOC_PEND:
                  type: "string"
                E_TICKET:
                  type: "string"
          DOCUMENTO_DISP:
            type: "array"
            items:
              type: "object"
              properties:
                CD_DOC_DISP:
                  type: "string"
                TP_DOC_DISP:
                  type: "string"
                ARC_DOC_ID:
                  type: "string"
                DSC_DOC_DISP:
                  type: "string"
                DATA_ENVIO:
                  type: "string"
                TIPODOC:
                  type: "string"
                EXT_DOC_DISP:
                  type: "string"
                DT_HR_VALIDACAO:
                  type: "string"
                STATUS:
                  type: "string"
                TD_DOC_COPIA:
                  type: "string"
                QTD_TD_DOC_COPIA:
                  type: "string"
                E_TICKET:
                  type: "string"
                DOC_DIVER:
                  type: "string"
          DOCUMENTO_DIVER:
            type: "array"
            items:
              type: "object"
              properties:
                CD_DOC_DISP:
                  type: "string"
                TP_DOC_DISP:
                  type: "string"
                ARC_DOC_ID:
                  type: "string"
                DSC_DOC_DISP:
                  type: "string"
                DATA_ENVIO:
                  type: "string"
                TIPODOC:
                  type: "string"
                EXT_DOC_DISP:
                  type: "string"
          QTDE_DOC_DIVER:
            type: "string"
          MSG:
            type: "array"
            items:
              type: "object"
              properties:
                MSG_TIPO:
                  type: "string"
                MSG_RETORNO:
                  type: "string"
          MSG_ERRO:
            type: "string"
          MSG_ID:
            type: "string"
          listaStatus:
            type: "object"
            properties:
              httpStatus:
                type: string
              msgErro:
                type: string
              sucesso:
                type: string
              statusCode:
                type: string
              listaStatusDocumentos:
                type: object
                properties:
                  dtEnvTrans:
                    type: string
                  hrEnvTrans:
                    type: string
                  cdStatusTrans:
                    type: string
                  protocolo:
                    type: string                    
                  codDocumentoSap:
                    type: string
                  descStatus:
                    type: string
                  ehDiversos:
                    type: string
  ClaimDownloadResourceResponse:
    type: object
    properties:
      DT_Download_Resp:
        type: "object"
        properties:
          DSC_DOC_SINISTRO:
            type: "string"
          EXT_DOC_SINISTRO:
            type: "string"
          ARQ_CODIFICADO:
            type: "string"
          TIPODOC:
            type: "string"
          MSG:
            type: "array"
            items:
              type: "object"
              properties:
                MSG_TIPO:
                  type: "string"
                MSG_RETORNO:
                  type: "string"
          MSG_ERRO:
            type: "string"
      MSG_ID:
        type: "string"
