openapi: 3.0.3
info:
  title: Plenario InfoAPI
  description: >
    API central de Plenario (InfoPlenarioWCF) que expone padrones (AFIP/ARBA/AGIP),
    Central de Deudores y cheques rechazados del BCRA, listas UIF (RePET),
    geolocalizacion (IPAPI), tickets de soporte de clientes y feedback del Asistente IA.


    **Autenticacion:** todas las operaciones reciben el `{token}` (API Key del cliente) como
    primer segmento del path luego del nombre de la operacion.


    **Envelope de respuesta:** `{ statusCode, statusMessage, content }`. `statusCode` es el
    codigo logico (200 ok, 404 sin datos, 400 error). El payload util viaja en `content`.


    **Fechas:** strings. CUIT con o sin guiones (se normaliza). Importes BCRA en miles de pesos.
  version: 1.0.0
servers:
  - url: https://api.plenario.net.ar/Services.svc/json
    description: Produccion
  - url: https://apiqa.plenario.net.ar/Services.svc/json
    description: QA

tags:
  - name: AFIP
    description: Padrones y catalogos de AFIP/ARCA
  - name: BCRA
    description: Central de Deudores y cheques rechazados/denunciados del BCRA
  - name: ARBA / AGIP
    description: Padrones de regimen general (alicuotas)
  - name: Geo / Servicios
    description: Geolocalizacion IP, estado de servicios, LLM
  - name: RePET / UIF
    description: Listas de personas expuestas (terrorismo) - UIF
  - name: IA - Calificaciones y Sugerencias
    description: Feedback del Asistente IA (multi-cliente)
  - name: IA - Feedback Hub & Tools
    description: Hub unificado de feedback (chat-back soporte<->usuario) y analitica de uso de tools
  - name: IA - Tickets
    description: Tickets de soporte reportados por clientes via Asistente IA
  - name: Tips / Novedades
    description: Novedades post-login por usuario
  - name: Plenario - Cheques Rechazados
    description: Registro propio de cheques rechazados por cliente

paths:

  # ===================== AFIP =====================
  /AFIP_Actividades/{token}:
    get:
      tags: [AFIP]
      summary: Catalogo de actividades AFIP
      parameters: [{ $ref: '#/components/parameters/Token' }]
      responses: { '200': { $ref: '#/components/responses/ListAFIP_Actividades' } }
  /AFIP_Comprobantes/{token}:
    get:
      tags: [AFIP]
      summary: Catalogo de tipos de comprobante AFIP
      parameters: [{ $ref: '#/components/parameters/Token' }]
      responses: { '200': { $ref: '#/components/responses/ListAFIP_Comprobantes' } }
  /AFIP_Paises/{token}:
    get:
      tags: [AFIP]
      summary: Catalogo de paises AFIP
      parameters: [{ $ref: '#/components/parameters/Token' }]
      responses: { '200': { $ref: '#/components/responses/ListAFIP_Paises' } }
  /AFIP_Provincias/{token}:
    get:
      tags: [AFIP]
      summary: Catalogo de provincias AFIP
      parameters: [{ $ref: '#/components/parameters/Token' }]
      responses: { '200': { $ref: '#/components/responses/ListAFIP_Provincias' } }
  /AFIP_TipoDocumentos/{token}:
    get:
      tags: [AFIP]
      summary: Catalogo de tipos de documento AFIP
      parameters: [{ $ref: '#/components/parameters/Token' }]
      responses: { '200': { $ref: '#/components/responses/ListAFIP_TipoDocumentos' } }
  /AFIP_Padron/{token}/{cuit}/{sexo}:
    get:
      tags: [AFIP]
      summary: Padron AFIP por CUIT/Nro de documento
      description: Si se consulta por Nro de documento, `sexo` discrimina la persona (0 = no aplica).
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { $ref: '#/components/parameters/Cuit' }
        - name: sexo
          in: path
          required: true
          schema: { type: string, default: '0' }
          description: 'M / F / 0 (por defecto 0)'
      responses: { '200': { $ref: '#/components/responses/ListAFIP_Padron' } }
  /AFIP_Sociedades/{token}/{cuit}:
    get:
      tags: [AFIP]
      summary: Datos societarios AFIP por CUIT
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { $ref: '#/components/parameters/Cuit' }
      responses: { '200': { $ref: '#/components/responses/ListAFIP_Sociedades' } }

  # ===================== BCRA =====================
  /BCRA_Entidades/{token}:
    get:
      tags: [BCRA]
      summary: Maestro de entidades financieras informantes
      parameters: [{ $ref: '#/components/parameters/Token' }]
      responses: { '200': { $ref: '#/components/responses/ListBCRA_Entidades' } }
  /BCRA_Deudores/{token}/{cuit}:
    get:
      tags: [BCRA]
      summary: Central de Deudores por CUIT (detalle por entidad y periodo)
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { $ref: '#/components/parameters/Cuit' }
      responses: { '200': { $ref: '#/components/responses/ListBCRA_Deudores' } }
  /BCRA_Analisis/{token}/{cuit}:
    get:
      tags: [BCRA]
      summary: Analisis consolidado BCRA por CUIT (situaciones vigentes + cheques rechazados)
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { $ref: '#/components/parameters/Cuit' }
      responses: { '200': { $ref: '#/components/responses/BCRA_Analisis' } }
  /BCRA_ChequesRechazados/{token}/{cuit}:
    get:
      tags: [BCRA]
      summary: Cheques rechazados BCRA por CUIT
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { $ref: '#/components/parameters/Cuit' }
      responses: { '200': { $ref: '#/components/responses/ListBCRA_ChequesRechazados' } }
  /BCRA_ChequesRechazados/{token}/{cuit}/{nrocheque}:
    get:
      tags: [BCRA]
      summary: Cheque rechazado BCRA por CUIT y numero de cheque
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { $ref: '#/components/parameters/Cuit' }
        - name: nrocheque
          in: path
          required: true
          schema: { type: string }
      responses: { '200': { $ref: '#/components/responses/ListBCRA_ChequesRechazados' } }

  # ===================== ARBA / AGIP =====================
  /AGIP_PadronRegGral/{token}/{cuit}:
    get:
      tags: [ARBA / AGIP]
      summary: Padron regimen general AGIP (CABA) - alicuotas
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { $ref: '#/components/parameters/Cuit' }
      responses: { '200': { $ref: '#/components/responses/ListAGIP' } }
  /ARBA_PadronRegGral/{token}/{cuit}:
    get:
      tags: [ARBA / AGIP]
      summary: Padron regimen general ARBA (Bs.As.) - alicuotas
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { $ref: '#/components/parameters/Cuit' }
      responses: { '200': { $ref: '#/components/responses/ListARBA' } }

  # ===================== Geo / Servicios =====================
  /IPAPI/{token}:
    get:
      tags: [Geo / Servicios]
      summary: Geolocalizacion de la IP de origen
      parameters: [{ $ref: '#/components/parameters/Token' }]
      responses:
        '200':
          description: OK
          content: { application/json: { schema: { $ref: '#/components/schemas/ipapiResult' } } }
  /GetInfoClienteServicio/{servicename}/{token}:
    get:
      tags: [Geo / Servicios]
      summary: Verifica si el plan/servicio del cliente esta activo
      parameters:
        - name: servicename
          in: path
          required: true
          schema: { type: string }
        - { $ref: '#/components/parameters/Token' }
      responses: { '200': { $ref: '#/components/responses/IA_Log' } }
  /Ollama/chat/{token}:
    post:
      tags: [Geo / Servicios]
      summary: Proxy de chat LLM (Ollama)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        content: { application/json: { schema: { type: object, description: OllamaModelRequest } } }
      responses:
        '200':
          description: OK
          content: { application/json: { schema: { type: object, description: 'Result<OllamaModelResponse>' } } }

  # ===================== RePET / UIF =====================
  /RePET_SearchByName/{token}/{nombre}/{minScore}:
    get:
      tags: [RePET / UIF]
      summary: Busqueda RePET por nombre (similitud)
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: nombre, in: path, required: true, schema: { type: string } }
        - { name: minScore, in: path, required: true, schema: { type: number, default: 0.8 } }
      responses: { '200': { $ref: '#/components/responses/ListRePET_Summary' } }
  /RePET_SearchByDni/{token}/{dni}:
    get:
      tags: [RePET / UIF]
      summary: Busqueda RePET por DNI
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: dni, in: path, required: true, schema: { type: string } }
      responses: { '200': { $ref: '#/components/responses/ListRePET_Summary' } }
  /RePET_GetIndividual/{token}/{dataid}:
    get:
      tags: [RePET / UIF]
      summary: Ficha completa RePET por dataid
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: dataid, in: path, required: true, schema: { type: string } }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResultBase'
                  - type: object
                    properties: { content: { $ref: '#/components/schemas/RePET_IndividualFull' } }
  /RePET_PerfilFinanciero/{token}:
    post:
      tags: [RePET / UIF]
      summary: Perfil financiero RePET (sujeto obligado UIF)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/RePET_PerfilFinancieroRequest' } } }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResultBase'
                  - type: object
                    properties: { content: { $ref: '#/components/schemas/RePET_PerfilFinancieroResponse' } }

  # ===================== IA - Calificaciones y Sugerencias =====================
  /IALogInfo/{token}:
    post:
      tags: [IA - Calificaciones y Sugerencias]
      summary: Registra un log de uso del Asistente IA
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_Log' } } }
      responses: { '200': { $ref: '#/components/responses/IA_Log' } }
  /IA_Calificacion_Registrar/{token}:
    post:
      tags: [IA - Calificaciones y Sugerencias]
      summary: Registra una calificacion (pulgar arriba/abajo) del Asistente IA
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_CalificacionRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }
  /IA_Calificaciones_Negativas/{token}/{max}:
    get:
      tags: [IA - Calificaciones y Sugerencias]
      summary: Lista las calificaciones negativas no revisadas (repaso de calidad)
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: max, in: path, required: true, schema: { type: string } }
      responses: { '200': { $ref: '#/components/responses/ListIA_CalificacionNegativa' } }
  /IA_Calificacion_MarcarRevisada/{token}:
    post:
      tags: [IA - Calificaciones y Sugerencias]
      summary: Marca una calificacion como revisada + resolucion
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_CalificacionRevisarRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }
  /IA_Sugerencia_Registrar/{token}:
    post:
      tags: [IA - Calificaciones y Sugerencias]
      summary: Registra una sugerencia de mejora del Asistente IA
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_SugerenciaRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }
  /IA_Sugerencias_Listar/{token}/{max}:
    get:
      tags: [IA - Calificaciones y Sugerencias]
      summary: Lista las sugerencias no revisadas
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: max, in: path, required: true, schema: { type: string } }
      responses: { '200': { $ref: '#/components/responses/ListIA_Sugerencia' } }
  /IA_Sugerencia_MarcarRevisada/{token}:
    post:
      tags: [IA - Calificaciones y Sugerencias]
      summary: Marca una sugerencia como revisada + resolucion
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_CalificacionRevisarRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }

  # ===================== IA - Feedback Hub & Tools =====================
  /IA_Feedback_Listar/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: Lista UNIFICADA de feedback (calificaciones + sugerencias + mejoras de manuales), normalizado
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_FeedbackListarRequest' } } }
      responses: { '200': { $ref: '#/components/responses/ListIA_FeedbackItem' } }
  /IA_Feedback_MarcarRevisada/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: Marca un item de feedback como revisado/resuelto (routea por Origen) + aviso opcional al usuario
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_FeedbackRevisarRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }
  /IA_Feedback_PreguntarUsuario/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: SOPORTE pregunta al usuario sobre un feedback (requiere AdminClave)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_FeedbackPreguntarRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }
  /IA_Feedback_PendientesUsuario/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: Mensajes de soporte pendientes (no leidos) para un usuario de un cliente
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_FeedbackPendientesRequest' } } }
      responses: { '200': { $ref: '#/components/responses/ListIA_FeedbackMensaje' } }
  /IA_Feedback_ResponderUsuario/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: El usuario responde un mensaje de soporte (marca leidos los del hilo)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_FeedbackResponderRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }
  /IA_Feedback_MarcarLeido/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: El usuario marca leido un mensaje de soporte (sin responder)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_FeedbackResponderRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }
  /IA_Feedback_Hilo/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: SOPORTE lee el hilo completo de un feedback (requiere AdminClave)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_FeedbackHiloRequest' } } }
      responses: { '200': { $ref: '#/components/responses/ListIA_FeedbackMensaje' } }
  /IA_Tools_Registrar/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: Registra el uso de tools del Asistente IA (una fila por tool del turno)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_ToolUsoRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_CalificacionResponse' } }
  /IA_Tools_Analitica/{token}:
    post:
      tags: [IA - Feedback Hub & Tools]
      summary: Analitica de uso de tools (top tools usadas + consultas sin tool)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_ToolsAnaliticaRequest' } } }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResultBase'
                  - type: object
                    properties: { content: { $ref: '#/components/schemas/IA_ToolsAnaliticaDto' } }

  # ===================== IA - Tickets =====================
  /IA_Ticket_Crear/{token}:
    post:
      tags: [IA - Tickets]
      summary: Crea un ticket de soporte (cliente -> Plenario)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_TicketCrearRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_TicketResponse' } }
  /IA_Ticket_AgregarNota/{token}:
    post:
      tags: [IA - Tickets]
      summary: Agrega una nota a un ticket
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_TicketNotaRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_TicketResponse' } }
  /IA_Tickets_Listar/{token}/{idCliente}/{soloAbiertos}/{max}:
    get:
      tags: [IA - Tickets]
      summary: Lista tickets de un cliente
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: idCliente, in: path, required: true, schema: { type: string } }
        - { name: soloAbiertos, in: path, required: true, schema: { type: string, default: '1' } }
        - { name: max, in: path, required: true, schema: { type: string, default: '50' } }
      responses: { '200': { $ref: '#/components/responses/ListIA_TicketDto' } }
  /IA_Ticket_Estado/{token}/{idCliente}/{idTicket}:
    get:
      tags: [IA - Tickets]
      summary: Detalle/estado de un ticket (con notas del cliente)
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: idCliente, in: path, required: true, schema: { type: string } }
        - { name: idTicket, in: path, required: true, schema: { type: string } }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResultBase'
                  - type: object
                    properties: { content: { $ref: '#/components/schemas/IA_TicketDetalle' } }
  /IA_Ticket_Cerrar/{token}:
    post:
      tags: [IA - Tickets]
      summary: Cierra un ticket con conformidad del cliente
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_TicketCerrarRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_TicketResponse' } }
  /IA_Ticket_DetalleInterno/{token}:
    post:
      tags: [IA - Tickets]
      summary: Detalle interno de un ticket (requiere AdminClave)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_TicketDetalleInternoRequest' } } }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResultBase'
                  - type: object
                    properties: { content: { $ref: '#/components/schemas/IA_TicketDetalleInterno' } }
  /IA_Ticket_NotaInterna/{token}:
    post:
      tags: [IA - Tickets]
      summary: Agrega una nota interna a un ticket (requiere AdminClave)
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/IA_TicketNotaInternaRequest' } } }
      responses: { '200': { $ref: '#/components/responses/IA_TicketResponse' } }

  # ===================== Tips / Novedades =====================
  /Tips_GetPendientes/{token}/{empresaId}/{usuarioId}:
    get:
      tags: [Tips / Novedades]
      summary: Tips/novedades pendientes para un usuario
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: empresaId, in: path, required: true, schema: { type: string } }
        - { name: usuarioId, in: path, required: true, schema: { type: string } }
      responses: { '200': { $ref: '#/components/responses/ListTipDto' } }
  /Tips_Descartar/{token}:
    post:
      tags: [Tips / Novedades]
      summary: Marca un tip como visto/descartado por el usuario
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/TipDescartarRequest' } } }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResultBase'
                  - type: object
                    properties: { content: { $ref: '#/components/schemas/TipDescartarResponse' } }

  # ===================== Plenario - Cheques Rechazados =====================
  /Plenario_ChequesRechazados_Search/{token}/{idCliente}/{cuit}:
    get:
      tags: [Plenario - Cheques Rechazados]
      summary: Busca cheques rechazados propios de un cliente por CUIT firmante
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: idCliente, in: path, required: true, schema: { type: string } }
        - { $ref: '#/components/parameters/Cuit' }
      responses: { '200': { $ref: '#/components/responses/ListPlenarioCheque' } }
  /Plenario_ChequesRechazados_CheckHasRejects/{token}/{idCliente}/{cuit}:
    get:
      tags: [Plenario - Cheques Rechazados]
      summary: Indica si un firmante tiene cheques rechazados registrados
      parameters:
        - { $ref: '#/components/parameters/Token' }
        - { name: idCliente, in: path, required: true, schema: { type: string } }
        - { $ref: '#/components/parameters/Cuit' }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResultBase'
                  - type: object
                    properties: { content: { $ref: '#/components/schemas/Plenario_ChequeRechazadoCheckResponse' } }
  /Plenario_ChequesRechazados_Add/{token}:
    post:
      tags: [Plenario - Cheques Rechazados]
      summary: Registra un cheque rechazado propio del cliente
      parameters: [{ $ref: '#/components/parameters/Token' }]
      requestBody:
        required: true
        content: { application/json: { schema: { $ref: '#/components/schemas/Plenario_ChequeRechazadoAddRequest' } } }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResultBase'
                  - type: object
                    properties: { content: { $ref: '#/components/schemas/Plenario_ChequeRechazadoAddResponse' } }

components:
  parameters:
    Token:
      name: token
      in: path
      required: true
      schema: { type: string }
      description: API Key del cliente (autenticacion).
    Cuit:
      name: cuit
      in: path
      required: true
      schema: { type: string }
      description: CUIT/CUIL/CDI (con o sin guiones).

  responses:
    ListAFIP_Actividades: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/AFIP_Actividades' } } } } ] } } } }
    ListAFIP_Comprobantes: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/AFIP_Comprobantes' } } } } ] } } } }
    ListAFIP_Paises: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/AFIP_Paises' } } } } ] } } } }
    ListAFIP_Provincias: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/AFIP_Provincias' } } } } ] } } } }
    ListAFIP_TipoDocumentos: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/AFIP_TipoDocumentos' } } } } ] } } } }
    ListAFIP_Padron: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/AFIP_Padron' } } } } ] } } } }
    ListAFIP_Sociedades: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/AFIP_Sociedades' } } } } ] } } } }
    ListBCRA_Entidades: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/BCRA_Entidades' } } } } ] } } } }
    ListBCRA_Deudores: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/BCRA_Deudores' } } } } ] } } } }
    BCRA_Analisis: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { $ref: '#/components/schemas/BCRA_AnalisisResultado' } } } ] } } } }
    ListBCRA_ChequesRechazados: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/BCRA_ChequesRechazados' } } } } ] } } } }
    ListAGIP: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/AGIP_PadronRegGral' } } } } ] } } } }
    ListARBA: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/ARBA_PadronRegGral' } } } } ] } } } }
    IA_Log: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { $ref: '#/components/schemas/IA_Log' } } } ] } } } }
    ListRePET_Summary: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/RePET_IndividualSummary' } } } } ] } } } }
    IA_CalificacionResponse: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { $ref: '#/components/schemas/IA_CalificacionResponse' } } } ] } } } }
    ListIA_CalificacionNegativa: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/IA_CalificacionNegativaDto' } } } } ] } } } }
    ListIA_Sugerencia: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/IA_SugerenciaDto' } } } } ] } } } }
    ListIA_FeedbackMensaje: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/IA_FeedbackMensajeDto' } } } } ] } } } }
    ListIA_FeedbackItem: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/IA_FeedbackItemDto' } } } } ] } } } }
    IA_TicketResponse: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { $ref: '#/components/schemas/IA_TicketResponse' } } } ] } } } }
    ListIA_TicketDto: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/IA_TicketDto' } } } } ] } } } }
    ListTipDto: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/TipDto' } } } } ] } } } }
    ListPlenarioCheque: { description: OK, content: { application/json: { schema: { allOf: [ { $ref: '#/components/schemas/ResultBase' }, { type: object, properties: { content: { type: array, items: { $ref: '#/components/schemas/Plenario_ChequeRechazado' } } } } ] } } } }

  schemas:
    ResultBase:
      type: object
      properties:
        statusCode: { type: integer, example: 200, description: '200 ok / 404 sin datos / 400 error' }
        statusMessage: { type: string, example: OK }

    AFIP_Actividades:
      type: object
      properties: { Id: { type: integer }, Codigo: { type: integer }, Descripcion: { type: string } }
    AFIP_Comprobantes:
      type: object
      properties: { Id: { type: integer }, Codigo: { type: string }, Descripcion: { type: string } }
    AFIP_Paises:
      type: object
      properties: { Id: { type: integer }, Codigo: { type: string }, Descripcion: { type: string } }
    AFIP_Provincias:
      type: object
      properties: { Id: { type: integer }, Codigo: { type: string }, Descripcion: { type: string } }
    AFIP_TipoDocumentos:
      type: object
      properties: { Id: { type: integer }, Codigo: { type: string }, Descripcion: { type: string } }
    AFIP_Padron:
      type: object
      properties:
        Id: { type: integer, format: int64 }
        CUIT: { type: string }
        Denominacion: { type: string }
        Actividad: { type: integer }
        Baja: { type: string }
        CUIT_Reemplazo: { type: integer, format: int64 }
        Fallecimiento: { type: integer }
        NroDoc: { type: integer, nullable: true }
        TipoPersona: { type: string }
        Sexo: { type: string }
    AFIP_Sociedades:
      type: object
      properties:
        Id: { type: integer, format: int64 }
        cuit: { type: string }
        razon_social: { type: string }
        fecha_hora_contrato_social: { type: string }
        tipo_societario: { type: string }
        fecha_hora_actualizacion: { type: string }
        numero_inscripcion: { type: string }
        dom_fiscal_provincia: { type: string }
        dom_fiscal_localidad: { type: string }
        dom_fiscal_calle: { type: string }
        dom_fiscal_numero: { type: string }
        dom_fiscal_cp: { type: string }
        dom_legal_provincia: { type: string }
        dom_legal_localidad: { type: string }
        dom_legal_calle: { type: string }
        dom_legal_numero: { type: string }
        dom_legal_cp: { type: string }

    BCRA_Entidades:
      type: object
      properties:
        Id: { type: integer }
        Codigo: { type: integer, description: Codigo de entidad financiera }
        Descripcion: { type: string, description: Nombre de la entidad }
    BCRA_Deudores:
      type: object
      description: Una fila por entidad y periodo. Importes en miles de pesos.
      properties:
        Id: { type: integer, format: int64 }
        Codigo_Entidad: { type: integer }
        Entidad_Nombre: { type: string }
        Fecha_Inf: { type: string, description: Periodo AAAAMM }
        Tipo: { type: integer, description: '11 = CUIT/CUIL/CDI' }
        Ident: { type: string, description: CUIT del deudor }
        Actividad: { type: string }
        Situacion: { type: integer, description: '1..5 (11=irrecuperable disp. tecnica mapeado a 6)' }
        Prestamos: { type: integer, format: int64 }
        Participaciones: { type: integer, format: int64 }
        GaranOtorg: { type: integer, format: int64 }
        OtrosConcep: { type: integer, format: int64 }
        GaranPrefA: { type: integer, format: int64 }
        GaranPrefB: { type: integer, format: int64 }
        SinGaranPref: { type: integer, format: int64 }
        ContraGaranPrefA: { type: integer, format: int64 }
        ContraGaranPrefB: { type: integer, format: int64 }
        SinContraGaranPref: { type: integer, format: int64 }
        Previsiones: { type: integer, format: int64 }
        DeudaCubierta: { type: string }
        ProcesoJudicialRev: { type: string }
        Refinanciaciones: { type: string }
        RecategObligatoria: { type: string }
        SituJuridica: { type: string }
        IrrecuperablesTecnica: { type: string }
        DiasAtraso: { type: string }
    BCRA_ChequesRechazados:
      type: object
      properties:
        Id: { type: integer }
        CUIT: { type: string }
        NroCheque: { type: string }
        FechaRechazo: { type: string }
        Monto: { type: number }
        Causal: { type: string }
        FechaLevantamiento: { type: string }
        Ley25326_1: { type: string }
        Ley25326_2: { type: string }
        CUIT_Relacionada: { type: string }
        PagoMulta: { type: string }
    BCRA_AnalisisResultado:
      type: object
      description: Consolidado BCRA por CUIT (situaciones vigentes + ventanas de cheques rechazados).
      properties:
        BCRA_Fecha_Inf: { type: string }
        BCRA_Vig_PeorSit: { type: integer }
        BCRA_Vig_PeorSit_Porc: { type: number }
        BCRA_Vig_Total_Monto: { type: number }
        BCRA_Vig_Sit1_CantBcos: { type: integer }
        BCRA_Vig_Sit1_Monto: { type: number }
        BCRA_Vig_Sit2_CantBcos: { type: integer }
        BCRA_Vig_Sit2_Monto: { type: number }
        BCRA_Vig_Sit3_CantBcos: { type: integer }
        BCRA_Vig_Sit3_Monto: { type: number }
        BCRA_Vig_Sit4_CantBcos: { type: integer }
        BCRA_Vig_Sit4_Monto: { type: number }
        BCRA_Vig_Sit5_CantBcos: { type: integer }
        BCRA_Vig_Sit5_Monto: { type: number }
        BCRA_Vig_Sit6_CantBcos: { type: integer }
        BCRA_Vig_Sit6_Monto: { type: number }
        BCRA_CH_Rechazados_Cant: { type: integer }
        BCRA_CH_Rechazados_Monto: { type: number }
        BCRA_CH_Rechazados_3m_Cant: { type: integer }
        BCRA_CH_Rechazados_3m_Monto: { type: number }
        BCRA_CH_Rechazados_6m_Cant: { type: integer }
        BCRA_CH_Rechazados_6m_Monto: { type: number }
        BCRA_CH_Rechazados_12m_Cant: { type: integer }
        BCRA_CH_Rechazados_12m_Monto: { type: number }
        BCRA_CH_Rechazados_24m_Cant: { type: integer }
        BCRA_CH_Rechazados_24m_Monto: { type: number }
        BCRA_CH_Rechazados_60m_Cant: { type: integer }
        BCRA_CH_Rechazados_60m_Monto: { type: number }
        BCRA_CH_Rechazados_3m_SinFondos_Cant: { type: integer }
        BCRA_CH_Rechazados_3m_SinFondos_Monto: { type: number }
        BCRA_CH_Rechazados_6m_SinFondos_Cant: { type: integer }
        BCRA_CH_Rechazados_6m_SinFondos_Monto: { type: number }
        BCRA_CH_Rechazados_12m_SinFondos_Cant: { type: integer }
        BCRA_CH_Rechazados_12m_SinFondos_Monto: { type: number }
        BCRA_CH_Rechazados_24m_SinFondos_Cant: { type: integer }
        BCRA_CH_Rechazados_24m_SinFondos_Monto: { type: number }
        BCRA_CH_Rechazados_60m_SinFondos_Cant: { type: integer }
        BCRA_CH_Rechazados_60m_SinFondos_Monto: { type: number }
        BCRA_API_Status: { type: integer }

    AGIP_PadronRegGral:
      type: object
      properties:
        Id: { type: integer }
        Fecha_Public: { type: string }
        Fecha_VigDesde: { type: string }
        Fecha_VigHasta: { type: string }
        CUIT: { type: string }
        Tipo_Contr_Insc: { type: string }
        Marca_Alta_Sujeto: { type: string }
        Marca_Alicuota: { type: string }
        Alicuota_Percepcion: { type: number }
        Alicuota_Retencion: { type: number }
        Nro_Grupo_Percepcion: { type: string }
        Nro_Grupo_Retencion: { type: string }
        Razon_Social: { type: string }
    ARBA_PadronRegGral:
      type: object
      properties:
        Id: { type: integer, format: int64 }
        Regimen: { type: string, description: 'P = Percepcion, R = Retencion' }
        Fecha_Public: { type: string }
        Fecha_VigDesde: { type: string }
        Fecha_VigHasta: { type: string }
        CUIT: { type: string }
        Tipo_Contr_Insc: { type: string }
        Marca_Alta_Sujeto: { type: string }
        Marca_Alicuota: { type: string }
        Alicuota: { type: number }
        Nro_Grupo: { type: string }

    ipapiResult:
      type: object
      properties:
        ip: { type: string }
        type: { type: string }
        continent_code: { type: string }
        continent_name: { type: string }
        country_code: { type: string }
        country_name: { type: string }
        region_code: { type: string }
        region_name: { type: string }
        city: { type: string }
        zip: { type: string }
        latitude: { type: number }
        longitude: { type: number }

    IA_Log:
      type: object
      properties:
        Id: { type: integer }
        Id_Cliente: { type: integer }
        IA_NameService: { type: string }
        Prompt: { type: string }
        ResponseTXT: { type: string }
        JSONResquest: { type: string }
        JSONResponse: { type: string }
        Endpoint: { type: string }
        APIKey: { type: string }
        Id_Manual: { type: integer }
        FechaAdd: { type: string, format: date-time }

    RePET_IndividualSummary:
      type: object
      properties:
        DataId: { type: integer, format: int64 }
        FirstName: { type: string }
        SecondName: { type: string }
        ThirdName: { type: string }
        FourthName: { type: string }
        UnListType: { type: string }
        ReferenceNumber: { type: string }
        ListType: { type: string }
        MatchScore: { type: number }
    RePET_IndividualFull:
      type: object
      properties:
        Individual: { $ref: '#/components/schemas/RePET_individuals' }
        Documents: { type: array, items: { $ref: '#/components/schemas/RePET_individual_document' } }
        Addresses: { type: array, items: { $ref: '#/components/schemas/RePET_individual_address' } }
        Aliases: { type: array, items: { $ref: '#/components/schemas/RePET_individual_alias' } }
        BirthDates: { type: array, items: { type: object } }
        BirthPlaces: { type: array, items: { type: object } }
    RePET_individuals:
      type: object
      properties:
        dataid: { type: integer, format: int64 }
        first_name: { type: string }
        second_name: { type: string }
        third_name: { type: string }
        fourth_name: { type: string }
        un_list_type: { type: string }
        reference_number: { type: string }
        listed_on: { type: string, format: date-time, nullable: true }
        gender: { type: string }
        nationality2: { type: string }
        list_type: { type: string }
    RePET_individual_document:
      type: object
      properties:
        type_of_document: { type: string }
        number: { type: string }
        issuing_country: { type: string }
    RePET_individual_address:
      type: object
      properties:
        street: { type: string }
        city: { type: string }
        state_province: { type: string }
        country: { type: string }
    RePET_individual_alias:
      type: object
      properties:
        quality: { type: string }
        alias_name: { type: string }
    RePET_PerfilFinancieroRequest:
      type: object
      properties:
        TipoDocumento: { type: string, example: DNI }
        NumeroDocumento: { type: string }
        Nombre: { type: string }
        MinScore: { type: number, nullable: true, default: 0.8 }
    RePET_PerfilFinancieroResponse:
      type: object
      properties:
        EsSujetoRePET: { type: boolean }
        MejorCoincidencia: { $ref: '#/components/schemas/RePET_IndividualSummary' }
        Coincidencias: { type: array, items: { $ref: '#/components/schemas/RePET_IndividualSummary' } }

    IA_CalificacionRequest:
      type: object
      properties:
        Id_Conversacion: { type: integer, nullable: true }
        Id_Usuario: { type: integer }
        Calificacion: { type: integer, description: '1 = pulgar arriba, -1 = pulgar abajo' }
        Pregunta: { type: string }
        Respuesta: { type: string }
        Proveedor: { type: string }
        Modelo: { type: string }
        Id_Cliente: { type: integer, description: Empresa del install }
        Conversacion: { type: string }
    IA_CalificacionResponse:
      type: object
      properties:
        Registrado: { type: boolean }
        Mensaje: { type: string }
        Id: { type: integer }
    IA_CalificacionRevisarRequest:
      type: object
      properties:
        Id: { type: integer }
        Resolucion: { type: string }
    IA_CalificacionNegativaDto:
      type: object
      properties:
        Id: { type: integer }
        Id_Cliente: { type: integer }
        Id_Conversacion: { type: integer, nullable: true }
        Id_Usuario: { type: integer }
        Pregunta: { type: string }
        Respuesta: { type: string }
        Conversacion: { type: string }
        Proveedor: { type: string }
        Modelo: { type: string }
        Fecha: { type: string, format: date-time, nullable: true }
    IA_SugerenciaRequest:
      type: object
      properties:
        Id_Cliente: { type: integer }
        Id_Usuario: { type: integer }
        Sugerencia: { type: string }
        Conversacion: { type: string }
        Proveedor: { type: string }
        Modelo: { type: string }
    IA_SugerenciaDto:
      type: object
      properties:
        Id: { type: integer }
        Id_Cliente: { type: integer }
        Id_Usuario: { type: integer }
        Sugerencia: { type: string }
        Conversacion: { type: string }
        Proveedor: { type: string }
        Modelo: { type: string }
        Fecha: { type: string, format: date-time, nullable: true }

    IA_TicketCrearRequest:
      type: object
      properties:
        Id_Cliente: { type: integer }
        Id_ClienteUsuario: { type: integer }
        NombreUsuario: { type: string }
        MailUsuario: { type: string }
        TelefonoUsuario: { type: string }
        Asunto: { type: string }
        Descripcion: { type: string }
        Bloqueante: { type: boolean }
    IA_TicketNotaRequest:
      type: object
      properties:
        Id_Cliente: { type: integer }
        Id_Ticket: { type: integer }
        Id_ClienteUsuario: { type: integer }
        NombreUsuario: { type: string }
        Texto: { type: string }
    IA_TicketCerrarRequest:
      type: object
      properties:
        Id_Cliente: { type: integer }
        Id_Ticket: { type: integer }
        Id_ClienteUsuario: { type: integer }
        NombreUsuario: { type: string }
        Conformidad: { type: string }
    IA_TicketResponse:
      type: object
      properties:
        Ok: { type: boolean }
        Id: { type: integer }
        Mensaje: { type: string }
        FechaReportado: { type: string, format: date-time, nullable: true }
    IA_TicketDto:
      type: object
      properties:
        Id: { type: integer }
        Asunto: { type: string }
        Estado: { type: string }
        Cerrado: { type: boolean }
        FechaReportado: { type: string, format: date-time }
        FechaCerrado: { type: string, format: date-time, nullable: true }
        ReportadoPor: { type: string }
    IA_TicketNotaDto:
      type: object
      properties:
        Fecha: { type: string, format: date-time }
        Autor: { type: string }
        EsCliente: { type: boolean }
        Texto: { type: string }
    IA_TicketDetalle:
      type: object
      properties:
        Id: { type: integer }
        Asunto: { type: string }
        Estado: { type: string }
        Cerrado: { type: boolean }
        FechaReportado: { type: string, format: date-time }
        FechaCerrado: { type: string, format: date-time, nullable: true }
        ReportadoPor: { type: string }
        Descripcion: { type: string }
        Notas: { type: array, items: { $ref: '#/components/schemas/IA_TicketNotaDto' } }
    IA_TicketDetalleInternoRequest:
      type: object
      properties:
        IdTicket: { type: integer }
        AdminClave: { type: string }
    IA_TicketNotaInternaRequest:
      type: object
      properties:
        IdTicket: { type: integer }
        Texto: { type: string }
        Autor: { type: string }
        AdminClave: { type: string }
    IA_TicketNotaInternaDto:
      type: object
      properties:
        Fecha: { type: string, format: date-time }
        Autor: { type: string }
        TipoUsuario: { type: integer }
        EsInterno: { type: boolean }
        Texto: { type: string }
    IA_TicketDetalleInterno:
      type: object
      properties:
        Id: { type: integer }
        IdCliente: { type: integer }
        Asunto: { type: string }
        Estado: { type: string }
        Cerrado: { type: boolean }
        FechaReportado: { type: string, format: date-time }
        FechaCerrado: { type: string, format: date-time, nullable: true }
        ReportadoPor: { type: string }
        Asignado: { type: string }
        IdGravedad: { type: integer }
        IdIncidente: { type: integer }
        PorcentajeAvance: { type: integer }
        Descripcion: { type: string }
        Notas: { type: array, items: { $ref: '#/components/schemas/IA_TicketNotaInternaDto' } }

    TipDto:
      type: object
      properties:
        TipId: { type: integer }
        Codigo: { type: string }
        HtmlContent: { type: string }
        FechaDesde: { type: string, format: date-time }
        FechaHasta: { type: string, format: date-time, nullable: true }
        SiempreVisible: { type: boolean }
    TipDescartarRequest:
      type: object
      properties:
        Codigo: { type: string }
        EmpresaId: { type: integer }
        UsuarioId: { type: integer }
        UserFingerPrint: { type: string }
    TipDescartarResponse:
      type: object
      properties:
        Registrado: { type: boolean }
        Mensaje: { type: string }

    Plenario_ChequeRechazado:
      type: object
      properties:
        Id: { type: integer }
        Id_Cliente: { type: integer }
        Firmante_CUIT: { type: number }
        Firmante_RazonSocial: { type: string }
        Banco: { type: integer }
        Sucursal: { type: integer }
        Cuenta: { type: string }
        Numero: { type: string }
        CodPos: { type: string }
        Fecha_Emision: { type: string, format: date-time }
        Fecha_Deposito: { type: string, format: date-time }
        Fecha_Rechazado: { type: string, format: date-time }
        Importe: { type: number }
        Rechazo_Motivo: { type: string }
        IP: { type: string }
    Plenario_ChequeRechazadoAddRequest:
      type: object
      properties:
        Id_Cliente: { type: integer }
        Firmante_CUIT: { type: number }
        Firmante_RazonSocial: { type: string }
        Banco: { type: integer }
        Sucursal: { type: integer }
        Cuenta: { type: string }
        Numero: { type: string }
        CodPos: { type: string }
        Fecha_Emision: { type: string, format: date-time }
        Fecha_Deposito: { type: string, format: date-time }
        Fecha_Rechazado: { type: string, format: date-time }
        Importe: { type: number }
        Rechazo_Motivo: { type: string }
    Plenario_ChequeRechazadoAddResponse:
      type: object
      properties:
        Saved: { type: boolean }
        Mensaje: { type: string }
    Plenario_ChequeRechazadoCheckResponse:
      type: object
      properties:
        HasRejects: { type: boolean }
        NombreFirmante: { type: string }

    # ---- IA - Feedback Hub & Tools ----
    IA_FeedbackListarRequest:
      type: object
      properties:
        Origen: { type: string, description: '"" = todos | Calificacion | Sugerencia | ManualMejora' }
        SoloPendientes: { type: boolean }
        Max: { type: integer }
    IA_FeedbackRevisarRequest:
      type: object
      properties:
        Origen: { type: string, description: 'Calificacion | Sugerencia | ManualMejora' }
        Id: { type: integer }
        Resolucion: { type: string }
        Revisor: { type: string }
        Version: { type: string, description: 'Version donde quedo resuelto (ej. 1.0.47)' }
        ComoProbar: { type: string }
        Notificar: { type: boolean, nullable: true, description: 'null/true = genera aviso al usuario' }
    IA_FeedbackItemDto:
      type: object
      description: Item de feedback NORMALIZADO (cualquiera de las fuentes).
      properties:
        Origen: { type: string, description: 'Calificacion | Sugerencia | ManualMejora' }
        Id: { type: integer }
        Id_Cliente: { type: integer }
        Id_Usuario: { type: integer }
        Autor: { type: string }
        Sentimiento: { type: string, description: 'Positivo | Negativo | Sugerencia | Mejora' }
        Asunto: { type: string }
        Texto: { type: string }
        Contexto: { type: string, description: 'Conversacion (JSON) | "Manual: <id> / <seccion>"' }
        Proveedor: { type: string }
        Modelo: { type: string }
        Fecha: { type: string, format: date-time, nullable: true }
        Revisado: { type: boolean }
        Resolucion: { type: string }
        Revisor: { type: string }
        BaseDatos: { type: string }
        Maquina: { type: string }
        Fingerprint: { type: string }
    IA_FeedbackPreguntarRequest:
      type: object
      properties:
        AdminClave: { type: string }
        Tipo: { type: string, description: 'Calificacion | Sugerencia' }
        Id_Origen: { type: integer, description: Id de la calificacion/sugerencia }
        Id_Cliente: { type: integer }
        Id_Usuario: { type: integer }
        Texto: { type: string }
        Fingerprint: { type: string, description: 'Opcional: dirige la pregunta a esa sesion (estacion+base)' }
    IA_FeedbackPendientesRequest:
      type: object
      properties:
        Id_Cliente: { type: integer }
        Id_Usuario: { type: integer }
        Fingerprint: { type: string }
    IA_FeedbackResponderRequest:
      type: object
      properties:
        Id_Mensaje: { type: integer, description: Id del mensaje de soporte que se responde (define el hilo) }
        Id_Cliente: { type: integer }
        Id_Usuario: { type: integer }
        Texto: { type: string }
    IA_FeedbackHiloRequest:
      type: object
      properties:
        AdminClave: { type: string }
        Tipo: { type: string, description: 'Calificacion | Sugerencia' }
        Id_Origen: { type: integer }
    IA_FeedbackMensajeDto:
      type: object
      properties:
        Id: { type: integer }
        Tipo: { type: string }
        Id_Origen: { type: integer }
        Id_Cliente: { type: integer }
        Id_Usuario: { type: integer }
        Emisor: { type: string }
        Texto: { type: string }
        Fecha: { type: string, format: date-time }
        Leido: { type: boolean }
    IA_ToolUsoRequest:
      type: object
      properties:
        Id_Cliente: { type: integer }
        Id_Usuario: { type: integer }
        NombreUsuario: { type: string }
        MensajeTXT: { type: string, description: Mensaje del usuario del turno }
        Proveedor: { type: string }
        Modelo: { type: string }
        Tools: { type: array, items: { type: string }, description: Tools ejecutadas en el turno }
        BaseDatos: { type: string }
        Maquina: { type: string }
        UsuarioWindows: { type: string }
        Fingerprint: { type: string }
    IA_ToolsAnaliticaRequest:
      type: object
      properties:
        Dias: { type: integer, description: 'Ventana (default 30)' }
        Max: { type: integer, description: 'Tope por lista (default 20)' }
    IA_ToolConteoDto:
      type: object
      properties:
        Clave: { type: string, description: Nombre de tool o texto de la consulta sin tool }
        Usos: { type: integer }
    IA_ToolsAnaliticaDto:
      type: object
      properties:
        TotalUsos: { type: integer }
        TopTools: { type: array, items: { $ref: '#/components/schemas/IA_ToolConteoDto' }, description: Tools mas usadas }
        SinTool: { type: array, items: { $ref: '#/components/schemas/IA_ToolConteoDto' }, description: Consultas que NO dispararon tool (huecos) }
