{
  "openapi": "3.1.1",
  "info": {
    "title": "Ukuvi.Projects.Api",
    "description": "API .NET 10 (Hexagonal) para recepción y procesamiento de pólizas en PDF. Recibe archivos del UkuviConector u otros consumidores, los pasa por OCR (py.ukuvi.com) y persiste pólizas en SQL Server vía Stored Procedures.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api-conector.ukuvi.ai/"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health/ready": {
      "get": {
        "tags": [
          "Health"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/polizas/extract": {
      "post": {
        "tags": [
          "Polizas"
        ],
        "summary": "OCR-only: extrae datos del PDF sin persistir.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OcrPolizaDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/polizas/from-pdf": {
      "post": {
        "tags": [
          "Polizas"
        ],
        "summary": "OCR + persistencia: extrae el PDF, guarda el archivo y la póliza. Si la póliza ya existía (llave Aseguradora+Ramo+SubRamo+NumeroPoliza) NO recrea póliza ni contacto; solo adjunta el archivo a la póliza existente cuando aún no tenía uno (flags YaExistia / ArchivoGuardado en la respuesta 201).",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CreatePolizaFromPdfFormRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolizaResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/polizas/from-data": {
      "post": {
        "tags": [
          "Polizas"
        ],
        "summary": "Alta de póliza solo con datos (sin PDF). Para pólizas que el conector ya tiene en su BD pero no logró bajar la carátula.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePolizaFromDataRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolizaResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/polizas/from-data-with-pdf": {
      "post": {
        "tags": [
          "Polizas"
        ],
        "summary": "Alta de póliza con DATOS del conector + PDF (sin OCR). La API persiste la póliza usando el JSON 'data' (mismo shape que from-data) y guarda el 'file' como carátula. Si la póliza ya existía, NO recrea póliza ni contacto: solo adjunta el archivo a la póliza existente cuando aún no tenía uno (flags YaExistia / ArchivoGuardado en la respuesta 201).",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CreatePolizaFromDataWithPdfFormRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolizaResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/polizas/{id}": {
      "get": {
        "tags": [
          "Polizas"
        ],
        "summary": "Obtiene la metadata de una póliza por su Id.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolizaResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/polizas/{id}/archivo": {
      "get": {
        "tags": [
          "Polizas"
        ],
        "summary": "Descarga el PDF asociado a la póliza.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/polizas-colectivas/from-data-with-pdf": {
      "post": {
        "tags": [
          "PolizasColectivas"
        ],
        "summary": "Alta de póliza COLECTIVA (flotilla/grupal) con DATOS del conector. PDF madre OPCIONAL: si viene se asocia a la raíz, si no, la raíz se persiste sin archivo y un re-envío posterior con PDF lo adjunta. Persiste raíz + N incisos en el esquema [poliza] sin OCR. Idempotente por llave (Aseguradora+Ramo+SubRamo+Producto+Numero+TipoPoliza): si la raíz ya existía, NO duplica incisos y solo adjunta el PDF si faltaba.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CreatePolizaColectivaWithPdfFormRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolizaColectivaResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cobranza/polizasnotificar": {
      "get": {
        "tags": [
          "Cobranza"
        ],
        "summary": "Obtiene recibos pendientes de cobranza para notificar.",
        "parameters": [
          {
            "name": "clienteId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "usuarioId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReciboParaNotificar"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cobranza/recibosactuales": {
      "get": {
        "tags": [
          "Cobranza"
        ],
        "summary": "Obtiene recibos actuales de cobranza por usuario y cliente.",
        "parameters": [
          {
            "name": "usuarioId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "clienteId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReciboActual"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/catalogos/ramos": {
      "get": {
        "tags": [
          "Catalogos"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/catalogos/subramos/{ramoId}": {
      "get": {
        "tags": [
          "Catalogos"
        ],
        "parameters": [
          {
            "name": "ramoId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/catalogos/aseguradoras": {
      "get": {
        "tags": [
          "Catalogos"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/catalogos/productos/{aseguradoraId}/{ramoId}": {
      "get": {
        "tags": [
          "Catalogos"
        ],
        "parameters": [
          {
            "name": "aseguradoraId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "ramoId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/catalogos/formas-pago": {
      "get": {
        "tags": [
          "Catalogos"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/catalogos/metodos-pago": {
      "get": {
        "tags": [
          "Catalogos"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgenteNotificacion": {
        "required": [
          "idCrm",
          "nombreCompleto",
          "correo",
          "telefonoE164"
        ],
        "type": "object",
        "properties": {
          "idCrm": {
            "type": "string"
          },
          "nombreCompleto": {
            "type": "string"
          },
          "correo": {
            "type": "string"
          },
          "telefonoE164": {
            "type": "string"
          }
        }
      },
      "AseguradoDataRequest": {
        "required": [
          "nombre",
          "apellidoPaterno",
          "apellidoMaterno"
        ],
        "type": "object",
        "properties": {
          "nombre": {
            "type": "string"
          },
          "apellidoPaterno": {
            "type": "string"
          },
          "apellidoMaterno": {
            "type": "string"
          },
          "fechaNacimiento": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "parentesco": {
            "type": [
              "null",
              "string"
            ]
          },
          "sexo": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BeneficiarioDataRequest": {
        "required": [
          "nombre",
          "apellidoPaterno",
          "apellidoMaterno",
          "porcentaje"
        ],
        "type": "object",
        "properties": {
          "nombre": {
            "type": "string"
          },
          "apellidoPaterno": {
            "type": "string"
          },
          "apellidoMaterno": {
            "type": "string"
          },
          "porcentaje": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "parentesco": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CoberturaDataRequest": {
        "required": [
          "descripcion"
        ],
        "type": "object",
        "properties": {
          "descripcion": {
            "type": "string"
          },
          "sumaAsegurada": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "deducible": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "notas": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CobranzaNotificacion": {
        "required": [
          "reciboIdCrm",
          "fechaLimite",
          "moneda",
          "primaNeta",
          "derecho",
          "recargo",
          "descuento",
          "iva",
          "primaTotal"
        ],
        "type": "object",
        "properties": {
          "reciboIdCrm": {
            "type": "string"
          },
          "fechaLimite": {
            "type": "string",
            "format": "date-time"
          },
          "moneda": {
            "type": "string"
          },
          "primaNeta": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "derecho": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "recargo": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "descuento": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "iva": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "primaTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "ConsentimientoWhatsapp": {
        "required": [
          "otorgado",
          "fecha",
          "referencia"
        ],
        "type": "object",
        "properties": {
          "otorgado": {
            "type": "boolean"
          },
          "fecha": {
            "type": "string",
            "format": "date-time"
          },
          "referencia": {
            "type": "string"
          }
        }
      },
      "ContratanteDataRequest": {
        "required": [
          "nombre",
          "apellidoPaterno",
          "apellidoMaterno"
        ],
        "type": "object",
        "properties": {
          "nombre": {
            "type": "string"
          },
          "apellidoPaterno": {
            "type": "string"
          },
          "apellidoMaterno": {
            "type": "string"
          },
          "rfc": {
            "type": [
              "null",
              "string"
            ]
          },
          "telefono": {
            "type": [
              "null",
              "string"
            ]
          },
          "correo": {
            "type": [
              "null",
              "string"
            ]
          },
          "razonSocial": {
            "type": [
              "null",
              "string"
            ]
          },
          "direccion": {
            "type": [
              "null",
              "string"
            ]
          },
          "colonia": {
            "type": [
              "null",
              "string"
            ]
          },
          "ciudad": {
            "type": [
              "null",
              "string"
            ]
          },
          "estado": {
            "type": [
              "null",
              "string"
            ]
          },
          "codigoPostal": {
            "type": [
              "null",
              "string"
            ]
          },
          "genero": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ContratanteNotificacion": {
        "required": [
          "idCrm",
          "nombreCompleto",
          "correo",
          "telefonoE164"
        ],
        "type": "object",
        "properties": {
          "idCrm": {
            "type": "string"
          },
          "nombreCompleto": {
            "type": "string"
          },
          "correo": {
            "type": [
              "null",
              "string"
            ]
          },
          "telefonoE164": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreatePolizaColectivaWithPdfFormRequest": {
        "type": "object",
        "properties": {
          "file": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IFormFile"
              }
            ]
          },
          "data": {
            "type": "string"
          }
        }
      },
      "CreatePolizaFromDataRequest": {
        "required": [
          "metadata",
          "poliza",
          "contratante",
          "plan"
        ],
        "type": "object",
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/PolizaMetadataRequest"
          },
          "poliza": {
            "$ref": "#/components/schemas/PolizaDataRequest"
          },
          "contratante": {
            "$ref": "#/components/schemas/ContratanteDataRequest"
          },
          "plan": {
            "$ref": "#/components/schemas/PlanDataRequest"
          },
          "detalleAuto": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DetalleAutoDataRequest"
              }
            ]
          },
          "asegurados": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/AseguradoDataRequest"
            }
          },
          "beneficiarios": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/BeneficiarioDataRequest"
            }
          },
          "coberturas": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CoberturaDataRequest"
            }
          }
        }
      },
      "CreatePolizaFromDataWithPdfFormRequest": {
        "type": "object",
        "properties": {
          "file": {
            "$ref": "#/components/schemas/IFormFile"
          },
          "data": {
            "type": "string"
          }
        }
      },
      "CreatePolizaFromPdfFormRequest": {
        "type": "object",
        "properties": {
          "file": {
            "$ref": "#/components/schemas/IFormFile"
          },
          "clienteId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "usuarioId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "idUsuarioTitular": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "agenteId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "grupoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "DestinatarioWhatsapp": {
        "required": [
          "rol",
          "telefonoE164",
          "nombreDisplay",
          "consentimientoWhatsapp"
        ],
        "type": "object",
        "properties": {
          "rol": {
            "type": "string"
          },
          "telefonoE164": {
            "type": "string"
          },
          "nombreDisplay": {
            "type": "string"
          },
          "consentimientoWhatsapp": {
            "$ref": "#/components/schemas/ConsentimientoWhatsapp"
          }
        }
      },
      "DetalleAutoDataRequest": {
        "required": [
          "marca",
          "modelo",
          "version",
          "descripcion",
          "numeroSerie",
          "placa",
          "motor",
          "uso"
        ],
        "type": "object",
        "properties": {
          "marca": {
            "type": "string"
          },
          "modelo": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "descripcion": {
            "type": "string"
          },
          "numeroSerie": {
            "type": "string"
          },
          "placa": {
            "type": "string"
          },
          "motor": {
            "type": "string"
          },
          "uso": {
            "type": "string"
          }
        }
      },
      "EntityTagHeaderValue": {
        "type": "object",
        "properties": {
          "tag": {
            "$ref": "#/components/schemas/StringSegment"
          },
          "isWeak": {
            "type": "boolean"
          }
        }
      },
      "FileContentResult": {
        "type": "object",
        "properties": {
          "fileContents": {
            "type": "string",
            "format": "byte"
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "OcrAseguradoDto": {
        "required": [
          "nombre",
          "apellidoPaterno",
          "apellidoMaterno",
          "fechaNacimiento",
          "parentesco",
          "sexo"
        ],
        "type": "object",
        "properties": {
          "nombre": {
            "type": [
              "null",
              "string"
            ]
          },
          "apellidoPaterno": {
            "type": [
              "null",
              "string"
            ]
          },
          "apellidoMaterno": {
            "type": [
              "null",
              "string"
            ]
          },
          "fechaNacimiento": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "parentesco": {
            "type": [
              "null",
              "string"
            ]
          },
          "sexo": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OcrBeneficiarioDto": {
        "required": [
          "nombre",
          "apellidoPaterno",
          "apellidoMaterno",
          "porcentaje",
          "parentesco"
        ],
        "type": "object",
        "properties": {
          "nombre": {
            "type": [
              "null",
              "string"
            ]
          },
          "apellidoPaterno": {
            "type": [
              "null",
              "string"
            ]
          },
          "apellidoMaterno": {
            "type": [
              "null",
              "string"
            ]
          },
          "porcentaje": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "parentesco": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OcrCoberturaDto": {
        "required": [
          "descripcion",
          "sumaAsegurada",
          "deducible",
          "notas"
        ],
        "type": "object",
        "properties": {
          "descripcion": {
            "type": [
              "null",
              "string"
            ]
          },
          "sumaAsegurada": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "deducible": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "notas": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OcrContratanteDto": {
        "required": [
          "rfc",
          "nombre",
          "apellidoPaterno",
          "apellidoMaterno",
          "razonSocial",
          "direccion",
          "colonia",
          "ciudad",
          "estado",
          "codigoPostal",
          "telefono",
          "correo"
        ],
        "type": "object",
        "properties": {
          "rfc": {
            "type": [
              "null",
              "string"
            ]
          },
          "nombre": {
            "type": [
              "null",
              "string"
            ]
          },
          "apellidoPaterno": {
            "type": [
              "null",
              "string"
            ]
          },
          "apellidoMaterno": {
            "type": [
              "null",
              "string"
            ]
          },
          "razonSocial": {
            "type": [
              "null",
              "string"
            ]
          },
          "direccion": {
            "type": [
              "null",
              "string"
            ]
          },
          "colonia": {
            "type": [
              "null",
              "string"
            ]
          },
          "ciudad": {
            "type": [
              "null",
              "string"
            ]
          },
          "estado": {
            "type": [
              "null",
              "string"
            ]
          },
          "codigoPostal": {
            "type": [
              "null",
              "string"
            ]
          },
          "telefono": {
            "type": [
              "null",
              "string"
            ]
          },
          "correo": {
            "type": [
              "null",
              "string"
            ]
          },
          "genero": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OcrDetalleAutoDto": {
        "required": [
          "marca",
          "modelo",
          "version",
          "descripcion",
          "numeroSerie",
          "placa",
          "motor",
          "uso"
        ],
        "type": "object",
        "properties": {
          "marca": {
            "type": [
              "null",
              "string"
            ]
          },
          "modelo": {
            "type": [
              "null",
              "string"
            ]
          },
          "version": {
            "type": [
              "null",
              "string"
            ]
          },
          "descripcion": {
            "type": [
              "null",
              "string"
            ]
          },
          "numeroSerie": {
            "type": [
              "null",
              "string"
            ]
          },
          "placa": {
            "type": [
              "null",
              "string"
            ]
          },
          "motor": {
            "type": [
              "null",
              "string"
            ]
          },
          "uso": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OcrPlanDto": {
        "required": [
          "inicioVigencia",
          "finVigencia",
          "fechaEmision",
          "primaNeta",
          "primaTotal",
          "iva",
          "recargo",
          "gastosExpedicion",
          "sumaAsegurada",
          "plan",
          "plazo"
        ],
        "type": "object",
        "properties": {
          "inicioVigencia": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "finVigencia": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "fechaEmision": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaNeta": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "primaTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "iva": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "recargo": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "gastosExpedicion": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "sumaAsegurada": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "plan": {
            "type": [
              "null",
              "string"
            ]
          },
          "plazo": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OcrPolizaDto": {
        "required": [
          "ramo",
          "aseguradoraNombre",
          "numeroPoliza",
          "formaPagoTexto",
          "moneda",
          "descuento",
          "contratante",
          "plan",
          "detalleAuto",
          "asegurados",
          "beneficiarios",
          "coberturas"
        ],
        "type": "object",
        "properties": {
          "ramo": {
            "$ref": "#/components/schemas/RamoId"
          },
          "aseguradoraNombre": {
            "type": [
              "null",
              "string"
            ]
          },
          "numeroPoliza": {
            "type": [
              "null",
              "string"
            ]
          },
          "formaPagoTexto": {
            "type": [
              "null",
              "string"
            ]
          },
          "moneda": {
            "type": [
              "null",
              "string"
            ]
          },
          "descuento": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "contratante": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OcrContratanteDto"
              }
            ]
          },
          "plan": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OcrPlanDto"
              }
            ]
          },
          "detalleAuto": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OcrDetalleAutoDto"
              }
            ]
          },
          "asegurados": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OcrAseguradoDto"
            }
          },
          "beneficiarios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OcrBeneficiarioDto"
            }
          },
          "coberturas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OcrCoberturaDto"
            }
          }
        }
      },
      "PlanDataRequest": {
        "required": [
          "inicioVigencia",
          "finVigencia",
          "fechaEmision",
          "primaNeta",
          "primaTotal"
        ],
        "type": "object",
        "properties": {
          "inicioVigencia": {
            "type": "string",
            "format": "date-time"
          },
          "finVigencia": {
            "type": "string",
            "format": "date-time"
          },
          "fechaEmision": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaNeta": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "primaTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "iva": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "recargo": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "gastosExpedicion": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "sumaAsegurada": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "plan": {
            "type": [
              "null",
              "string"
            ]
          },
          "plazo": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PolizaColectivaResponse": {
        "required": [
          "polizaGuidRaiz",
          "polizaIdNumerico",
          "numeroPoliza",
          "ramo",
          "tipoPoliza",
          "aseguradoraId",
          "contactoId",
          "embudoId",
          "inicioVigencia",
          "finVigencia",
          "primaTotal",
          "moneda",
          "incisosCreados",
          "rutaArchivo"
        ],
        "type": "object",
        "properties": {
          "polizaGuidRaiz": {
            "type": "string",
            "format": "uuid"
          },
          "polizaIdNumerico": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "numeroPoliza": {
            "type": "string"
          },
          "ramo": {
            "$ref": "#/components/schemas/RamoId"
          },
          "tipoPoliza": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "aseguradoraId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "contactoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "embudoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inicioVigencia": {
            "type": "string",
            "format": "date-time"
          },
          "finVigencia": {
            "type": "string",
            "format": "date-time"
          },
          "primaTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "moneda": {
            "type": "string"
          },
          "incisosCreados": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "rutaArchivo": {
            "type": [
              "null",
              "string"
            ]
          },
          "yaExistia": {
            "type": "boolean",
            "default": false
          },
          "archivoGuardado": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "PolizaDataRequest": {
        "required": [
          "numeroPoliza",
          "ramo"
        ],
        "type": "object",
        "properties": {
          "numeroPoliza": {
            "type": "string"
          },
          "ramo": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "aseguradoraId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "aseguradoraNombre": {
            "type": [
              "null",
              "string"
            ]
          },
          "subRamoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "productoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "subRamoTexto": {
            "type": [
              "null",
              "string"
            ]
          },
          "productoTexto": {
            "type": [
              "null",
              "string"
            ]
          },
          "formaPagoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "metodoPagoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "formaPagoTexto": {
            "type": [
              "null",
              "string"
            ]
          },
          "moneda": {
            "type": [
              "null",
              "string"
            ]
          },
          "descuento": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "PolizaMetadataRequest": {
        "required": [
          "clienteId",
          "usuarioId",
          "idUsuarioTitular",
          "agenteId"
        ],
        "type": "object",
        "properties": {
          "clienteId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "usuarioId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "idUsuarioTitular": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "agenteId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "grupoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 0
          }
        }
      },
      "PolizaNotificacion": {
        "required": [
          "idCrm",
          "numero",
          "aseguradoraClave",
          "aseguradoraEtiqueta",
          "ramo",
          "subramo",
          "plan",
          "formaPago"
        ],
        "type": "object",
        "properties": {
          "idCrm": {
            "type": "string"
          },
          "numero": {
            "type": "string"
          },
          "aseguradoraClave": {
            "type": "string"
          },
          "aseguradoraEtiqueta": {
            "type": "string"
          },
          "ramo": {
            "type": "string"
          },
          "subramo": {
            "type": "string"
          },
          "plan": {
            "type": [
              "null",
              "string"
            ]
          },
          "formaPago": {
            "type": "string"
          }
        }
      },
      "PolizaResponse": {
        "required": [
          "id",
          "numeroPoliza",
          "ramo",
          "aseguradoraId",
          "contactoId",
          "embudoId",
          "inicioVigencia",
          "finVigencia",
          "primaTotal",
          "moneda",
          "rutaArchivo"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "numeroPoliza": {
            "type": "string"
          },
          "ramo": {
            "$ref": "#/components/schemas/RamoId"
          },
          "aseguradoraId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "contactoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "embudoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inicioVigencia": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "finVigencia": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "primaTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "moneda": {
            "type": "string"
          },
          "rutaArchivo": {
            "type": [
              "null",
              "string"
            ]
          },
          "yaExistia": {
            "type": "boolean",
            "default": false
          },
          "archivoGuardado": {
            "type": "boolean",
            "default": false
          },
          "montosActualizados": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RamoId": {
        "type": "integer"
      },
      "ReciboActual": {
        "required": [
          "polizaId",
          "reciboId",
          "fechaEmision",
          "nombre",
          "apellidoPaterno",
          "apellidoMaterno",
          "numeroPoliza",
          "ramo",
          "subramo",
          "aseguradoraId",
          "aseguradora",
          "metodoPago",
          "formaPago",
          "status",
          "inicioVigencia",
          "finVigencia",
          "vencimientoPago",
          "proximoPago",
          "primaTotal",
          "fechaPago",
          "ramoId",
          "productoId",
          "producto",
          "plan",
          "correo",
          "contactoId",
          "diaCompromisoPago",
          "inicioVigenciaPoliza",
          "finVigenciaPoliza",
          "diasAtraso",
          "motivoRechazo",
          "numeroRecibo",
          "tipoPoliza",
          "numeroSubGrupo",
          "subGrupoGuid",
          "totalRegistros"
        ],
        "type": "object",
        "properties": {
          "polizaId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reciboId": {
            "type": [
              "null",
              "string"
            ]
          },
          "fechaEmision": {
            "type": [
              "null",
              "string"
            ]
          },
          "nombre": {
            "type": [
              "null",
              "string"
            ]
          },
          "apellidoPaterno": {
            "type": [
              "null",
              "string"
            ]
          },
          "apellidoMaterno": {
            "type": [
              "null",
              "string"
            ]
          },
          "numeroPoliza": {
            "type": [
              "null",
              "string"
            ]
          },
          "ramo": {
            "type": [
              "null",
              "string"
            ]
          },
          "subramo": {
            "type": [
              "null",
              "string"
            ]
          },
          "aseguradoraId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "aseguradora": {
            "type": [
              "null",
              "string"
            ]
          },
          "metodoPago": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "formaPago": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inicioVigencia": {
            "type": [
              "null",
              "string"
            ]
          },
          "finVigencia": {
            "type": [
              "null",
              "string"
            ]
          },
          "vencimientoPago": {
            "type": [
              "null",
              "string"
            ]
          },
          "proximoPago": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaTotal": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "fechaPago": {
            "type": [
              "null",
              "string"
            ]
          },
          "ramoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "productoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "producto": {
            "type": [
              "null",
              "string"
            ]
          },
          "plan": {
            "type": [
              "null",
              "string"
            ]
          },
          "correo": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactoId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "diaCompromisoPago": {
            "type": [
              "null",
              "string"
            ]
          },
          "inicioVigenciaPoliza": {
            "type": [
              "null",
              "string"
            ]
          },
          "finVigenciaPoliza": {
            "type": [
              "null",
              "string"
            ]
          },
          "diasAtraso": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "motivoRechazo": {
            "type": [
              "null",
              "string"
            ]
          },
          "numeroRecibo": {
            "type": [
              "null",
              "string"
            ]
          },
          "tipoPoliza": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "numeroSubGrupo": {
            "type": [
              "null",
              "string"
            ]
          },
          "subGrupoGuid": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "totalRegistros": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ReciboParaNotificar": {
        "required": [
          "eventId",
          "tipoEvento",
          "tenantClienteIdCrm",
          "emitidoEn",
          "secuenciaAviso",
          "poliza",
          "vigencia",
          "cobranza",
          "agente",
          "contratante",
          "destinatariosWhatsapp"
        ],
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string"
          },
          "tipoEvento": {
            "type": "string"
          },
          "tenantClienteIdCrm": {
            "type": "string"
          },
          "emitidoEn": {
            "type": "string",
            "format": "date-time"
          },
          "secuenciaAviso": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "poliza": {
            "$ref": "#/components/schemas/PolizaNotificacion"
          },
          "vigencia": {
            "$ref": "#/components/schemas/VigenciaNotificacion"
          },
          "cobranza": {
            "$ref": "#/components/schemas/CobranzaNotificacion"
          },
          "agente": {
            "$ref": "#/components/schemas/AgenteNotificacion"
          },
          "contratante": {
            "$ref": "#/components/schemas/ContratanteNotificacion"
          },
          "destinatariosWhatsapp": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinatarioWhatsapp"
            }
          }
        }
      },
      "StringSegment": {
        "type": "object",
        "properties": {
          "buffer": {
            "type": [
              "null",
              "string"
            ]
          },
          "offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasValue": {
            "type": "boolean"
          }
        }
      },
      "VigenciaNotificacion": {
        "required": [
          "inicio",
          "fin"
        ],
        "type": "object",
        "properties": {
          "inicio": {
            "type": "string",
            "format": "date-time"
          },
          "fin": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Health"
    },
    {
      "name": "Polizas"
    },
    {
      "name": "PolizasColectivas"
    },
    {
      "name": "Cobranza"
    },
    {
      "name": "Catalogos"
    }
  ]
}