defaults:
  context:
    msisdn: '22981290045'
    invoice_id: '3000135031'
    customer_id: '1000220870'
scenarios:
- id: cy0001_explicacao_de_fatura_planos_pos
  title: cy0001_explicacao_de_fatura_planos_pos
  objective: 'TODO: revisar objetivo. O trace indica fluxo com tools=[''buscar_informacao'', ''cancelar_vas_avulso'',
    ''finalizar_atendimento'', ''invoice_explanation''] e eventos IC.'
  tags:
  - langfuse_import
  - draft
  replay_fixtures:
    api_calls:
    - method: GET
      endpoint_hint: divergencia
      status_code: 200
      response:
        invoiceExplanation: 'Na fatura analisada, identifiquei cobrancas de servicos avulsos: VOD + Canais
          Abertos, Aluguel de Filme 2.'
      source: langfuse_trace_synthetic_divergencia
    - method: POST
      endpoint_hint: invoice_context
      workflow_step: prefetch.invoice_context
      status_code: 200
      response:
        customer:
          paymentMethod: '2'
        paymentItems:
        - barCode: '846900000023158701090116003000134985910002208700'
          cardCreditpayment: 'True'
          chargeAmount: '215.87'
          customerId: '1000220870'
          cutDate: '2026-02-14'
          dueDate: '2026-03-10'
          id: '3000134989'
          issueDate: '2026-02-14'
          status: Pago
          terminal: '22981290045'
          txtId: B013000134989
          type: '01'
        - barCode: '846800000032992901090116003000135032110002208707'
          cardCreditpayment: 'True'
          chargeAmount: '399.29'
          customerId: '1000220870'
          cutDate: '2026-03-14'
          dueDate: '2026-04-07'
          id: '3000135031'
          issueDate: '2026-03-14'
          status: Em Atraso
          terminal: '22981290045'
          txtId: B013000135031
          type: '01'
          urlPix: 00020126940014br.gov.bcb.pix013686b26441-94eb-4523-9e8a-79120d007b940232VENC. 07/04/26
            | FAT. 300013503152040000530398654100000399.295802BR5915TIM BRASIL S.A.6009Sao Paulo62170513B01300013503163047048
      source: langfuse_trace
      url: http://127.0.0.1:51184/customers/v1/completeInvoices
      payload:
        msisdn: '22981290045'
    - method: GET
      endpoint_hint: invoice_context
      workflow_step: prefetch.invoice_context
      status_code: 200
      response:
        status: 200
        raw_content: '<binary content: 102974 bytes>'
        content_type: application/pdf
      response_file: fixtures/invoice3000135031.pdf
      source: langfuse_trace
      url: http://127.0.0.1:51184/invoices/v1/invoiceRecover?invoiceId=3000135031&msisdn=22981290045&customerId=1000220870
    - method: GET
      endpoint_hint: invoice_context
      workflow_step: prefetch.invoice_context
      status_code: 200
      response:
        currentInvoice:
        - desc: Plano
          items:
          - contestable: false
            days: '28'
            desc: TIM Black Premium 2 0
            type: plano
            value: '239.99'
          nItems: '1'
          type: plano
          value: '239.99'
        - desc: Serviços de valor adicionado
          items:
          - contestable: false
            date: '0000-12-31T20:53:32.000Z'
            desc: VOD + Canais Abertos
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - contestable: true
            date: '0000-12-31T20:53:32.000Z'
            desc: Aluguel de Filme 1
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - contestable: false
            date: '0000-12-31T20:53:32.000Z'
            desc: VOD +Canais
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - contestable: true
            date: '0000-12-31T20:53:32.000Z'
            desc: Aluguel de Filme 2
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - contestable: true
            date: '0000-12-31T20:53:32.000Z'
            desc: Aluguel de Filme 3
            type: servicos_contratados_de_parceiros
            value: '19.9'
          nItems: '5'
          type: servicos_contratados_de_parceiros
          value: '99.5'
        - desc: Streamings
          items:
          - contestable: false
            desc: Max Mensal
            type: streaming
            value: '34.9'
          - contestable: false
            desc: YouTube Premium Mensal
            type: streaming
            value: '24.9'
          - contestable: false
            desc: HBO Max Standard
            type: streaming
            value: '34.9'
          nItems: '3'
          type: streaming
          value: '94.7'
        invoiceExplanation: 'Analisando a sua fatura atual em relação a passada, o valor variou em R$
          183.42.


          Na fatura anterior foi cobrado o valor de R$ 111.37 proporcional a 13 dias de utilização e,
          na fatura atual a cobrança é proporcional a 28 dias do seu plano no valor de R$ 239.99


          Foram cobrados os seguintes serviços de terceiros: Max Mensal no valor de R$ 34.90, YouTube
          Premium Mensal no valor de R$ 24.90.


          Houve a variação dos seguintes serviços de valor adicionado:

          * Cobrança VOD + Canais Abertos no valor de R$ 19.90 no dia 15/02/26.

          * Cobrança Aluguel de Filme 1 no valor de R$ 19.90 no dia 15/02/26.

          * Cobrança VOD +Canais no valor de R$ 19.90 no dia 15/02/26.

          * Cobrança Aluguel de Filme 2 no valor de R$ 19.90 no dia 15/02/26.

          * Cobrança Aluguel de Filme 3 no valor de R$ 19.90 no dia 15/02/26.

          * Cobrança YouTube Premium Mensal no valor de R$ 24.90 no dia 15/02/26.

          * Cobrança HBO Max Standard no valor de R$ 34.90 no dia 15/02/26.'
        invoiceVariation:
        - desc: Nenhuma Mudança
          items:
          - days: '13'
            desc: TIM Black Premium 2 0
            invoice: '2026-03-10T00:00:00.000Z'
            type: plano
            value: '111.37'
          - days: '28'
            desc: TIM Black Premium 2 0
            invoice: '2026-04-07T00:00:00.000Z'
            type: plano
            value: '239.99'
          nItems: '2'
          type: plano
          value: '128.62'
        - desc: Serviços de valor adicionado
          items:
          - date: '0000-12-31T20:53:32.000Z'
            desc: VOD + Canais Abertos
            invoice: '2026-03-10T00:00:00.000Z'
            status: Ativo
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - date: '0000-12-31T20:53:32.000Z'
            desc: Aluguel de Filme 1
            invoice: '2026-03-10T00:00:00.000Z'
            status: Ativo
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - date: '0000-12-31T20:53:32.000Z'
            desc: VOD +Canais
            invoice: '2026-03-10T00:00:00.000Z'
            status: Ativo
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - date: '0000-12-31T20:53:32.000Z'
            desc: Aluguel de Filme 2
            invoice: '2026-03-10T00:00:00.000Z'
            status: Ativo
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - date: '0000-12-31T20:53:32.000Z'
            desc: VOD + Canais Abertos
            invoice: '2026-04-07T00:00:00.000Z'
            status: Ativo
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - date: '0000-12-31T20:53:32.000Z'
            desc: Aluguel de Filme 1
            invoice: '2026-04-07T00:00:00.000Z'
            status: Ativo
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - date: '0000-12-31T20:53:32.000Z'
            desc: VOD +Canais
            invoice: '2026-04-07T00:00:00.000Z'
            status: Ativo
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - date: '0000-12-31T20:53:32.000Z'
            desc: Aluguel de Filme 2
            invoice: '2026-04-07T00:00:00.000Z'
            status: Ativo
            type: servicos_contratados_de_parceiros
            value: '19.9'
          - date: '0000-12-31T20:53:32.000Z'
            desc: Aluguel de Filme 3
            invoice: '2026-04-07T00:00:00.000Z'
            status: Cancelado
            type: servicos_contratados_de_parceiros
            value: '19.9'
          nItems: '9'
          type: servicos_contratados_de_parceiros
          value: '19.9'
        - desc: Streamings
          items:
          - desc: YouTube Premium Mensal
            invoice: '2026-03-10T00:00:00.000Z'
            type: streaming
            value: '24.9'
          - desc: YouTube Premium Mensal
            invoice: '2026-04-07T00:00:00.000Z'
            type: streaming
            value: '24.9'
          - desc: Max Mensal
            invoice: '2026-04-07T00:00:00.000Z'
            type: streaming
            value: '34.9'
          - desc: HBO Max Standard
            invoice: '2026-04-07T00:00:00.000Z'
            type: streaming
            value: '34.9'
          nItems: '4'
          type: streaming
          value: '69.8'
        messageId: 38614921-5758-4f40-8a1f-96e7cf40de39
      source: langfuse_trace
      url: http://127.0.0.1:51184/customers/v1/billingAnalysis/22981290045?channel=AIAGENTCR
    - method: GET
      endpoint_hint: contrato
      workflow_step: prefetch.contrato
      status_code: 200
      response:
        billingProfile:
          csLevel: '40'
          customer:
            document: '89760129680'
            email: hpacheco@example.org
            hasBadDebts: 'false'
            name: Dra Elisa Cunha
            suspectedFraud: 'false'
          date:
            billCycle: '1'
            cutoffDay: '14'
            dueDay: '7'
          detailLevel: Resumida
          detailLevelId: '1'
          paymentResp: 'true'
          paymentType: Fatura
          paymentTypeId: '2'
          uf: RJ_22
        contract:
          activationDate: '2026-02-26T21:00:00.000Z'
          bank:
            id: 0
          billingProfileId: '1000220870'
          imsi: '724022005024662'
          msisdn: '22981290045'
          numPid: 0
          oiMigrationDate: '1969-12-31T21:00:00.000Z'
          plan:
            commercialCode: PLN647
            commercialName: TIM Black Premium 2 0
            license: Móvel
            licenseId: '1'
            segment: Consumer
            segmentId: '1'
            technicalCode: '10321'
            technicalParam: '2645'
            type: Pós-pago
            typeId: '2'
          services:
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV029
            commercialName: Chamada em Espera
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '7'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV031
            commercialName: Conferência
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '14'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV052
            commercialName: Identificador de Chamadas
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '8'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV097
            commercialName: Roam Int e Nac (TIM e outras operadoras)
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '54'
            technicalParam: '3'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV111
            commercialName: Siga-me
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '9'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV117
            commercialName: Te Ligou
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '205'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV157
            commercialName: TIM Torpedo Originado
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '3'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV158
            commercialName: TIM Connect / TIM Wap
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '5'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV159
            commercialName: tim.br
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '152'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV160
            commercialName: wap.tim.br
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '153'
            technicalParam: '2'
          status:
            description: Primeira ativação
            type: Ativo
            typeId: '1'
          typeQuiz: false
      source: langfuse_trace
      url: http://127.0.0.1:51184/access/v1/contractInformation/22981290045
    - method: GET
      endpoint_hint: cancelar_vas_avulso
      workflow_step: workflow.step.cancelar_vas_avulso
      status_code: 200
      response:
        servicesTypes:
        - name: OCSG
          services:
          - activation:
              channel: APP
              date: '2026-05-13T03:09:08.000Z'
            appId: '14396'
            billDescription: Youtube Premium Mensal
            can:
              cancel: true
              resendEvent: false
            csp:
              desc: Youtube
              id: '826'
            description: YouTube Premium mensal fatura
            event:
              date: '2026-05-13T16:09:08-03:00'
              type: activation
            externalCall:
              id: OCSG
              name: OCSG
              type: OCSG
            id: 0254c3c8-5f6c-47a7-b506-88e515e5a562
            largeAccount: '323'
            lastEventDate: '2026-05-13T16:09:08-03:00'
            name: YouTube Premium mensal fatura
            paymentMethod: Fatura
            price: 24.9
            provider: Youtube
            providerContact: Missing - Missing
            subscriptionType: MENSAL
          - activation:
              channel: APP
              date: '2026-05-13T03:09:37.000Z'
            appId: '14395'
            billDescription: HBO Max Standard
            can:
              cancel: true
              resendEvent: false
            csp:
              desc: HBO
              id: '825'
            description: Max mensal fatura
            event:
              date: '2026-05-13T16:09:37-03:00'
              type: activation
            externalCall:
              id: OCSG
              name: OCSG
              type: OCSG
            id: aeb57931-5199-4a5d-b8b5-c1037a5a9953
            largeAccount: '323'
            lastEventDate: '2026-05-13T16:09:37-03:00'
            name: Max mensal fatura
            paymentMethod: Fatura
            price: 44.9
            provider: HBO
            providerContact: Missing - Missing
            subscriptionType: MENSAL
      source: langfuse_trace
      url: http://127.0.0.1:51184/access/v1/5522981290045/partnerServices
    - method: POST
      endpoint_hint: protocol
      workflow_step: workflow.step.registrar_protocolo
      status_code: 200
      response:
        interactionProtocol: '2026000079918'
      source: langfuse_trace
      url: http://127.0.0.1:51184/customers/v1/backOfficeSRopening
      payload: &id001
        socialSecNo: '89760129680'
        channel: AIAGENTCR
        customerId: ''
        assetId: '22981290045'
        customerName: ''
        customerEmail: ''
        customerPhone1: ''
        accessType: Controle
        serviceRequest:
          userId: ''
          reason1: Informação
          reason2: Conta
          reason3: Serviço
          status: Aberto
          notes: Solicitação via chat
          type: CLIENTE
        interaction:
          protocol: ''
          flagSms: true
          source: AIAGENTCR
          callId: ''
          crmSource: ''
          reasonId: ''
          amount: ''
          directionContact: FROM-CLIENT
          requestFlag: false
          requestSla: ''
          status: OPENED
    - method: POST
      endpoint_hint: profile_bill
      workflow_step: workflow.step.consultar_perfil_fatura
      status_code: 200
      response:
        customer:
          paymentMethod: '2'
        paymentItems:
        - barCode: '846900000023158701090116003000134985910002208700'
          cardCreditpayment: 'True'
          chargeAmount: '215.87'
          customerId: '1000220870'
          cutDate: '2026-02-14'
          dueDate: '2026-03-10'
          id: '3000134989'
          issueDate: '2026-02-14'
          status: Pago
          terminal: '22981290045'
          txtId: B013000134989
          type: '01'
        - barCode: '846800000032992901090116003000135032110002208707'
          cardCreditpayment: 'True'
          chargeAmount: '399.29'
          customerId: '1000220870'
          cutDate: '2026-03-14'
          dueDate: '2026-04-07'
          id: '3000135031'
          issueDate: '2026-03-14'
          status: Em Atraso
          terminal: '22981290045'
          txtId: B013000135031
          type: '01'
          urlPix: 00020126940014br.gov.bcb.pix013686b26441-94eb-4523-9e8a-79120d007b940232VENC. 07/04/26
            | FAT. 300013503152040000530398654100000399.295802BR5915TIM BRASIL S.A.6009Sao Paulo62170513B01300013503163047048
      source: langfuse_trace
      url: http://127.0.0.1:51184/customers/v1/completeInvoices
      payload: &id002
        msisdn: '22981290045'
    - method: POST
      endpoint_hint: customer_contestation
      workflow_step: workflow.step.abrir_contestacao_cliente
      status_code: 200
      response:
        contestationId: '20330'
        itemsResponse:
        - correctAccountStatus: CRIAR
          itemName: VOD + Canais Abertos
          message: Contestação criada/atualizada com sucesso
          status: INICIADA
        - correctAccountStatus: CRIAR
          itemName: Aluguel de Filme 2
          message: Contestação criada/atualizada com sucesso
          status: INICIADA
        sr: '2026000079918'
      source: langfuse_trace
      url: http://127.0.0.1:51184/interactions/v1/customerContestation
      payload: &id003
        userId: AIAGENTCR
        sr: '2026000079918'
        msisdn: '22981290045'
        socialSecNo: '89760129680'
        customerId: '1000220870'
        customerIdCurrent: '1000220870'
        customerType: '2'
        customerStatus: '1'
        invoiceStatus: '1'
        invoiceNumber: '3000135031'
        invoiceAmountOpen: '399.29'
        invoiceAmount: '399.29'
        invoiceDueDate: '20260407'
        contestationType: '0'
        adjustReason: SERVICO_NAO_SOLICITADO
        observation: Cancelamento VAS avulso solicitado.
        refundOption: '1'
        doubleRefund: false
        manualContaCertaIndicator: true
        items:
        - itemName: VOD + Canais Abertos
          itemType: VAS_AVULSO
          claimedAmount: 19.9
          validatedAmount: 19.9
        - itemName: Aluguel de Filme 2
          itemType: VAS_AVULSO
          claimedAmount: 19.9
          validatedAmount: 19.9
    - method: GET
      endpoint_hint: contrato
      workflow_step: workflow.step.consultar_contrato_corte
      status_code: 200
      response:
        billingProfile:
          csLevel: '40'
          customer:
            document: '89760129680'
            email: hpacheco@example.org
            hasBadDebts: 'false'
            name: Dra Elisa Cunha
            suspectedFraud: 'false'
          date:
            billCycle: '1'
            cutoffDay: '14'
            dueDay: '7'
          detailLevel: Resumida
          detailLevelId: '1'
          paymentResp: 'true'
          paymentType: Fatura
          paymentTypeId: '2'
          uf: RJ_22
        contract:
          activationDate: '2026-02-26T21:00:00.000Z'
          bank:
            id: 0
          billingProfileId: '1000220870'
          imsi: '724022005024662'
          msisdn: '22981290045'
          numPid: 0
          oiMigrationDate: '1969-12-31T21:00:00.000Z'
          plan:
            commercialCode: PLN647
            commercialName: TIM Black Premium 2 0
            license: Móvel
            licenseId: '1'
            segment: Consumer
            segmentId: '1'
            technicalCode: '10321'
            technicalParam: '2645'
            type: Pós-pago
            typeId: '2'
          services:
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV029
            commercialName: Chamada em Espera
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '7'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV031
            commercialName: Conferência
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '14'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV052
            commercialName: Identificador de Chamadas
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '8'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV097
            commercialName: Roam Int e Nac (TIM e outras operadoras)
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '54'
            technicalParam: '3'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV111
            commercialName: Siga-me
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '9'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV117
            commercialName: Te Ligou
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '205'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV157
            commercialName: TIM Torpedo Originado
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '3'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV158
            commercialName: TIM Connect / TIM Wap
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '5'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV159
            commercialName: tim.br
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '152'
          - activationTimestamp: '1772150400000'
            category: Serviço
            categoryId: '2'
            commercialCode: SRV160
            commercialName: wap.tim.br
            priority: Sem prioridade
            priorityId: '1'
            technicalCode: '153'
            technicalParam: '2'
          status:
            description: Primeira ativação
            type: Ativo
            typeId: '1'
          typeQuiz: false
      source: langfuse_trace
      url: http://127.0.0.1:51184/access/v1/contractInformation/22981290045
    - method: POST
      endpoint_hint: service_request
      workflow_step: workflow.step.abrir_sr_conta_certa_manual
      status_code: 200
      response:
        interactionProtocol: '2026000079919'
      source: langfuse_trace
      url: http://127.0.0.1:51184/customers/v1/backOfficeSRopening
      payload: &id004
        socialSecNo: '89760129680'
        channel: AIAGENTCR
        customerId: ''
        assetId: '22981290045'
        customerName: ''
        customerEmail: ''
        customerPhone1: ''
        accessType: ''
        serviceRequest:
          userId: ''
          reason1: Processo Interno
          reason2: Conta
          reason3: Conta Certa - Venc 07
          status: Encaminhado
          notes: 'Solicitação via chat | Serviços contestados: VOD + Canais Abertos | Aluguel de Filme
            2'
          type: CLIENTE
        interaction:
          protocol: ''
          flagSms: true
          source: AIAGENTCR
          callId: ''
          crmSource: ''
          reasonId: ''
          amount: ''
          directionContact: FROM-CLIENT
          requestFlag: false
          requestSla: ''
          status: Encaminhado
    - method: POST
      endpoint_hint: service_request_status
      workflow_step: workflow.step.atualizar_status_sr_registro
      status_code: 200
      response:
        activityId: 1-10ZFDQE8
        result:
          code: '1'
          desc: Sucesso
      source: langfuse_trace
      url: http://127.0.0.1:51184/customers/v1/trackingActivities
      payload: &id005
        channel: AIAGENTCR
        customer:
          socialSecNo: '89760129680'
          msisdn: '22981290045'
        protocolNumber: '2026000079918'
        invoice:
          emissionDate: '2026-03-14T00:00:00.00Z'
          expirationDate: '2026-04-07T00:00:00.00Z'
          number: '3000135031'
          status: Aberto
          openAmount: '39.8'
          totalAmount: '39.8'
        activity:
          type: Contestação
          status: Aberto
          id: ''
        user:
          login: SIEBELPOS_INBOUND
    - method: POST
      endpoint_hint: service_request_status
      workflow_step: workflow.step.atualizar_status_sr_registro
      status_code: 204
      response:
        status: 204
        message: OK
      source: langfuse_trace
      url: http://127.0.0.1:51184/interactions/v1/statusServiceRequest
      payload: &id006
        channel: AIAGENTCR
        serviceRequest:
          status: Fechado
          notes: Solicitação via chat Fechado
          protocolNumber: '2026000079918'
          auditResult: ''
          auditReasonResult: ''
          auditConvenienceTime: ''
          auditSubStatus: ''
          reason1: Reclamação
          reason2: Conta
          reason3: Valor
        msisdn: '22981290045'
        date: 12/06/2026 09:22:30
  turns:
  - user: minha fatura tá mais cara esse mês, quero entender o motivo.
    expect:
      events:
        required_tags:
        - NOC.007
      response:
        expected_sse: 'Analisando a sua fatura atual em relação à passada, o valor variou em R$ 183,42.
          Na fatura anterior foi cobrado o valor de R$ 111,37 proporcional a 13 dias de utilização e,
          na fatura atual a cobrança é proporcional a 28 dias do seu plano no valor de R$ 239,99. Foram
          cobrados os seguintes serviços de terceiros: Max Mensal no valor de R$ 34,90 e YouTube Premium
          Mensal no valor de R$ 24,90. Foi adicionada a cobrança do VOD + Canais Abertos no valor de R$
          19,90 no dia 15/02/26, do Aluguel de Filme 1 no valor de R$ 19,90 no dia 15/02/26, do VOD +Canais
          no valor de R$ 19,90 no dia 15/02/26, do Aluguel de Filme 2 no valor de R$ 19,90 no dia 15/02/26,
          do Aluguel de Filme 3 no valor de R$ 19,90 no dia 15/02/26, do YouTube Premium Mensal no valor
          de R$ 24,90 no dia 15/02/26 e do HBO Max Standard no valor de R$ 34,90 no dia 15/02/26. Com
          essa explicação, sanei sua dúvida?'
        source: langfuse_turn_output
  - user: Não há entendi, me explica.
    expect:
      response:
        expected_sse: ''
        source: langfuse_turn_output
  - user: Não sanou
    expect:
      response:
        expected_sse: Parte, clara, claro, fatura ou entender.
        expected_behavior:
          kind: ask_for_specific_invoice_item
        source: langfuse_turn_output
  - user: O que são os serviços VOD mais Canais abertos, aluguel de Filme dois?
    expect:
      required_tools:
      - buscar_informacao
      events:
        required_tags:
        - NOC.003
        - NOC.003
      response:
        expected_sse: Busquei mas não encontrei informações sobre vod + canais abertos e aluguel de filme
          2 no momento. Mais alguma dúvida?
        source: langfuse_turn_output
  - user: não fui eu que contratei esses serviços.
    expect:
      events:
        required_tags:
      response:
        expected_sse: Vamos seguir com o cancelamento dos serviços VOD + Canais Abertos, no valor de R$
          19,90 e Aluguel de Filme 2, no valor de R$ 19,90, vinculados ao número final zero zero quatro
          cinco e providenciar a retirada dos valores da fatura. Você confirma?
        line_identifier_required: false
        source: langfuse_turn_output
  - user: sim
    expect:
      required_tools:
      - cancelar_vas_avulso
      - finalizar_atendimento
      events:
        required_tags:
        - MPI.011
        - VAA.001
        - RCT.007
        - VAA.010
        - VAA.016
        - SAD.001
      api_validation:
        mode: contains_in_order
        payload_match: subset
        allow_extra_calls: true
        url_match: none
      api_calls:
      - method: GET
        endpoint_hint: cancelar_vas_avulso
        workflow_step: workflow.step.cancelar_vas_avulso
        url: http://127.0.0.1:51184/access/v1/5522981290045/partnerServices
        endpoint: TIM_API
      - method: POST
        endpoint_hint: protocol
        workflow_step: workflow.step.registrar_protocolo
        url: http://127.0.0.1:51184/customers/v1/backOfficeSRopening
        payload: *id001
      - method: POST
        endpoint_hint: profile_bill
        workflow_step: workflow.step.consultar_perfil_fatura
        url: http://127.0.0.1:51184/customers/v1/completeInvoices
        payload: *id002
      - method: POST
        endpoint_hint: customer_contestation
        workflow_step: workflow.step.abrir_contestacao_cliente
        url: http://127.0.0.1:51184/interactions/v1/customerContestation
        payload: *id003
      - method: GET
        endpoint_hint: contrato
        workflow_step: workflow.step.consultar_contrato_corte
        url: http://127.0.0.1:51184/access/v1/contractInformation/22981290045
        endpoint: TIM_API
      - method: POST
        endpoint_hint: service_request
        workflow_step: workflow.step.abrir_sr_conta_certa_manual
        url: http://127.0.0.1:51184/customers/v1/backOfficeSRopening
        payload: *id004
      - method: POST
        endpoint_hint: service_request_status
        workflow_step: workflow.step.atualizar_status_sr_registro
        url: http://127.0.0.1:51184/customers/v1/trackingActivities
        payload: *id005
      - method: POST
        endpoint_hint: service_request_status
        workflow_step: workflow.step.atualizar_status_sr_registro
        url: http://127.0.0.1:51184/interactions/v1/statusServiceRequest
        payload: *id006
      response:
        expected_sse: O cancelamento dos itens foi feito com sucesso. O crédito no valor total de R$ 39,80
          ficou registrado como crédito para sua próxima fatura. Seu número de protocolo é 2026000079918.
          Por aqui finalizamos o tratamento da sua solicitação. Aguarde um instante na linha.
        source: langfuse_turn_output
        expected_status: resolvido
  checks:
    required_tools:
    - buscar_informacao
    - cancelar_vas_avulso
    - finalizar_atendimento
    - invoice_explanation
    required_tool_order:
    - invoice_explanation
    - invoice_explanation
    - buscar_informacao
    - cancelar_vas_avulso
    - finalizar_atendimento
    required_event_tags:
    - CVN.001
    - CVN.002
    - CVN.006
    - CVN.009
    - MPI.005
    - MPI.011
    - NOC.003
    - NOC.007
    - RCT.007
    - RCT.079
    - SAD.001
    - VAA.001
    - VAA.010
    - VAA.016
    - VEB.004
  judge_focus: Comparar semanticamente as respostas SSE observadas no replay com as respostas esperadas
    importadas do trace Langfuse.
  trace_reference:
    trace_id: c432f1505796c009d8d790aab58936fd
    session_id: convtest-46cc2f151a0e4475bf2d26dbf7f52a24
    expected_final_response: ''
    final_response_preview: ''
