evo360-types 1.3.557 → 1.3.562

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,6 +66,8 @@ export declare const zCsqAlertSchema: z.ZodObject<{
66
66
  verification: z.ZodOptional<z.ZodEnum<["pending", "confirmed_ok", "confirmed", "inconclusive"]>>;
67
67
  recheck_after: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
68
68
  resolved_in_ticket: z.ZodOptional<z.ZodString>;
69
+ appointment_id: z.ZodOptional<z.ZodString>;
70
+ calendar_id: z.ZodOptional<z.ZodString>;
69
71
  first_seen_ticket_id: z.ZodString;
70
72
  created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
71
73
  }, "strip", z.ZodTypeAny, {
@@ -85,6 +87,8 @@ export declare const zCsqAlertSchema: z.ZodObject<{
85
87
  }[];
86
88
  first_seen_ticket_id: string;
87
89
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
90
+ calendar_id?: string | undefined;
91
+ appointment_id?: string | undefined;
88
92
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
89
93
  suggested_action?: string | undefined;
90
94
  recheck_after?: Date | undefined;
@@ -106,6 +110,8 @@ export declare const zCsqAlertSchema: z.ZodObject<{
106
110
  first_seen_ticket_id: string;
107
111
  created_at?: unknown;
108
112
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
113
+ calendar_id?: string | undefined;
114
+ appointment_id?: string | undefined;
109
115
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
110
116
  suggested_action?: string | undefined;
111
117
  recheck_after?: unknown;
@@ -1879,12 +1885,16 @@ export declare const zCsqCrossCheckSchema: z.ZodObject<{
1879
1885
  found: z.ZodNullable<z.ZodString>;
1880
1886
  alert_code: z.ZodOptional<z.ZodEnum<["AGENDAMENTO_INFORMADO_NAO_REGISTRADO", "AGENDAMENTO_DIVERGENTE", "AGENDAMENTO_SOBREPOSTO", "CONTRADICAO_PREMISSA_ANTERIOR", "ORIENTACAO_CLINICA_INDEVIDA", "POLITICA_VIOLADA", "ULTIMA_MENSAGEM_SEM_RESPOSTA", "PERGUNTA_NAO_RESPONDIDA", "PROMESSA_NAO_CUMPRIDA", "IDENTIDADE_ERRADA", "DADO_JA_INFORMADO_RECOLETADO", "DADO_OBRIGATORIO_NAO_COLETADO", "FLUXO_VENDA_NAO_SEGUIDO", "MOTIVO_ENCERRAMENTO_INCOMPATIVEL", "SLA_RESPOSTA_ALTO", "LEAD_QUENTE_SEM_FOLLOWUP", "LEAD_ORIGEM_INCONSISTENTE", "LEAD_QUALIFICACAO_INCONSISTENTE", "AUTOMACAO_CONFLITANTE", "DADO_SENSIVEL_SOLICITADO", "URGENCIA_NAO_ENCAMINHADA", "NF_NAO_ENVIADA", "COBRANCA_NAO_ENVIADA"]>>;
1881
1887
  note: z.ZodOptional<z.ZodString>;
1888
+ appointment_id: z.ZodOptional<z.ZodString>;
1889
+ calendar_id: z.ZodOptional<z.ZodString>;
1882
1890
  }, "strip", z.ZodTypeAny, {
1883
1891
  result: "match" | "inconclusive" | "mismatch" | "missing";
1884
1892
  expected: string;
1885
1893
  claim_type: "promise" | "appointment_informed" | "data_collected" | "required_data" | "outcome" | "question_requires_answer" | "first_concrete_offer" | "patient_status" | "price_informed";
1886
1894
  found: string | null;
1887
1895
  note?: string | undefined;
1896
+ calendar_id?: string | undefined;
1897
+ appointment_id?: string | undefined;
1888
1898
  alert_code?: "AGENDAMENTO_INFORMADO_NAO_REGISTRADO" | "AGENDAMENTO_DIVERGENTE" | "AGENDAMENTO_SOBREPOSTO" | "CONTRADICAO_PREMISSA_ANTERIOR" | "ORIENTACAO_CLINICA_INDEVIDA" | "POLITICA_VIOLADA" | "ULTIMA_MENSAGEM_SEM_RESPOSTA" | "PERGUNTA_NAO_RESPONDIDA" | "PROMESSA_NAO_CUMPRIDA" | "IDENTIDADE_ERRADA" | "DADO_JA_INFORMADO_RECOLETADO" | "DADO_OBRIGATORIO_NAO_COLETADO" | "FLUXO_VENDA_NAO_SEGUIDO" | "MOTIVO_ENCERRAMENTO_INCOMPATIVEL" | "SLA_RESPOSTA_ALTO" | "LEAD_QUENTE_SEM_FOLLOWUP" | "LEAD_ORIGEM_INCONSISTENTE" | "LEAD_QUALIFICACAO_INCONSISTENTE" | "AUTOMACAO_CONFLITANTE" | "DADO_SENSIVEL_SOLICITADO" | "URGENCIA_NAO_ENCAMINHADA" | "NF_NAO_ENVIADA" | "COBRANCA_NAO_ENVIADA" | undefined;
1889
1899
  }, {
1890
1900
  result: "match" | "inconclusive" | "mismatch" | "missing";
@@ -1892,6 +1902,8 @@ export declare const zCsqCrossCheckSchema: z.ZodObject<{
1892
1902
  claim_type: "promise" | "appointment_informed" | "data_collected" | "required_data" | "outcome" | "question_requires_answer" | "first_concrete_offer" | "patient_status" | "price_informed";
1893
1903
  found: string | null;
1894
1904
  note?: string | undefined;
1905
+ calendar_id?: string | undefined;
1906
+ appointment_id?: string | undefined;
1895
1907
  alert_code?: "AGENDAMENTO_INFORMADO_NAO_REGISTRADO" | "AGENDAMENTO_DIVERGENTE" | "AGENDAMENTO_SOBREPOSTO" | "CONTRADICAO_PREMISSA_ANTERIOR" | "ORIENTACAO_CLINICA_INDEVIDA" | "POLITICA_VIOLADA" | "ULTIMA_MENSAGEM_SEM_RESPOSTA" | "PERGUNTA_NAO_RESPONDIDA" | "PROMESSA_NAO_CUMPRIDA" | "IDENTIDADE_ERRADA" | "DADO_JA_INFORMADO_RECOLETADO" | "DADO_OBRIGATORIO_NAO_COLETADO" | "FLUXO_VENDA_NAO_SEGUIDO" | "MOTIVO_ENCERRAMENTO_INCOMPATIVEL" | "SLA_RESPOSTA_ALTO" | "LEAD_QUENTE_SEM_FOLLOWUP" | "LEAD_ORIGEM_INCONSISTENTE" | "LEAD_QUALIFICACAO_INCONSISTENTE" | "AUTOMACAO_CONFLITANTE" | "DADO_SENSIVEL_SOLICITADO" | "URGENCIA_NAO_ENCAMINHADA" | "NF_NAO_ENVIADA" | "COBRANCA_NAO_ENVIADA" | undefined;
1896
1908
  }>;
1897
1909
  export declare const zCsqCriterionScoreSchema: z.ZodObject<{
@@ -3317,6 +3329,8 @@ export declare const zCsqJudgeOutputSchema: z.ZodObject<{
3317
3329
  verification: z.ZodOptional<z.ZodEnum<["pending", "confirmed_ok", "confirmed", "inconclusive"]>>;
3318
3330
  recheck_after: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
3319
3331
  resolved_in_ticket: z.ZodOptional<z.ZodString>;
3332
+ appointment_id: z.ZodOptional<z.ZodString>;
3333
+ calendar_id: z.ZodOptional<z.ZodString>;
3320
3334
  first_seen_ticket_id: z.ZodString;
3321
3335
  created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
3322
3336
  }, "strip", z.ZodTypeAny, {
@@ -3336,6 +3350,8 @@ export declare const zCsqJudgeOutputSchema: z.ZodObject<{
3336
3350
  }[];
3337
3351
  first_seen_ticket_id: string;
3338
3352
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
3353
+ calendar_id?: string | undefined;
3354
+ appointment_id?: string | undefined;
3339
3355
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
3340
3356
  suggested_action?: string | undefined;
3341
3357
  recheck_after?: Date | undefined;
@@ -3357,6 +3373,8 @@ export declare const zCsqJudgeOutputSchema: z.ZodObject<{
3357
3373
  first_seen_ticket_id: string;
3358
3374
  created_at?: unknown;
3359
3375
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
3376
+ calendar_id?: string | undefined;
3377
+ appointment_id?: string | undefined;
3360
3378
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
3361
3379
  suggested_action?: string | undefined;
3362
3380
  recheck_after?: unknown;
@@ -3600,6 +3618,8 @@ export declare const zCsqJudgeOutputSchema: z.ZodObject<{
3600
3618
  }[];
3601
3619
  first_seen_ticket_id: string;
3602
3620
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
3621
+ calendar_id?: string | undefined;
3622
+ appointment_id?: string | undefined;
3603
3623
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
3604
3624
  suggested_action?: string | undefined;
3605
3625
  recheck_after?: Date | undefined;
@@ -3842,6 +3862,8 @@ export declare const zCsqJudgeOutputSchema: z.ZodObject<{
3842
3862
  first_seen_ticket_id: string;
3843
3863
  created_at?: unknown;
3844
3864
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
3865
+ calendar_id?: string | undefined;
3866
+ appointment_id?: string | undefined;
3845
3867
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
3846
3868
  suggested_action?: string | undefined;
3847
3869
  recheck_after?: unknown;
@@ -6046,12 +6068,16 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
6046
6068
  found: z.ZodNullable<z.ZodString>;
6047
6069
  alert_code: z.ZodOptional<z.ZodEnum<["AGENDAMENTO_INFORMADO_NAO_REGISTRADO", "AGENDAMENTO_DIVERGENTE", "AGENDAMENTO_SOBREPOSTO", "CONTRADICAO_PREMISSA_ANTERIOR", "ORIENTACAO_CLINICA_INDEVIDA", "POLITICA_VIOLADA", "ULTIMA_MENSAGEM_SEM_RESPOSTA", "PERGUNTA_NAO_RESPONDIDA", "PROMESSA_NAO_CUMPRIDA", "IDENTIDADE_ERRADA", "DADO_JA_INFORMADO_RECOLETADO", "DADO_OBRIGATORIO_NAO_COLETADO", "FLUXO_VENDA_NAO_SEGUIDO", "MOTIVO_ENCERRAMENTO_INCOMPATIVEL", "SLA_RESPOSTA_ALTO", "LEAD_QUENTE_SEM_FOLLOWUP", "LEAD_ORIGEM_INCONSISTENTE", "LEAD_QUALIFICACAO_INCONSISTENTE", "AUTOMACAO_CONFLITANTE", "DADO_SENSIVEL_SOLICITADO", "URGENCIA_NAO_ENCAMINHADA", "NF_NAO_ENVIADA", "COBRANCA_NAO_ENVIADA"]>>;
6048
6070
  note: z.ZodOptional<z.ZodString>;
6071
+ appointment_id: z.ZodOptional<z.ZodString>;
6072
+ calendar_id: z.ZodOptional<z.ZodString>;
6049
6073
  }, "strip", z.ZodTypeAny, {
6050
6074
  result: "match" | "inconclusive" | "mismatch" | "missing";
6051
6075
  expected: string;
6052
6076
  claim_type: "promise" | "appointment_informed" | "data_collected" | "required_data" | "outcome" | "question_requires_answer" | "first_concrete_offer" | "patient_status" | "price_informed";
6053
6077
  found: string | null;
6054
6078
  note?: string | undefined;
6079
+ calendar_id?: string | undefined;
6080
+ appointment_id?: string | undefined;
6055
6081
  alert_code?: "AGENDAMENTO_INFORMADO_NAO_REGISTRADO" | "AGENDAMENTO_DIVERGENTE" | "AGENDAMENTO_SOBREPOSTO" | "CONTRADICAO_PREMISSA_ANTERIOR" | "ORIENTACAO_CLINICA_INDEVIDA" | "POLITICA_VIOLADA" | "ULTIMA_MENSAGEM_SEM_RESPOSTA" | "PERGUNTA_NAO_RESPONDIDA" | "PROMESSA_NAO_CUMPRIDA" | "IDENTIDADE_ERRADA" | "DADO_JA_INFORMADO_RECOLETADO" | "DADO_OBRIGATORIO_NAO_COLETADO" | "FLUXO_VENDA_NAO_SEGUIDO" | "MOTIVO_ENCERRAMENTO_INCOMPATIVEL" | "SLA_RESPOSTA_ALTO" | "LEAD_QUENTE_SEM_FOLLOWUP" | "LEAD_ORIGEM_INCONSISTENTE" | "LEAD_QUALIFICACAO_INCONSISTENTE" | "AUTOMACAO_CONFLITANTE" | "DADO_SENSIVEL_SOLICITADO" | "URGENCIA_NAO_ENCAMINHADA" | "NF_NAO_ENVIADA" | "COBRANCA_NAO_ENVIADA" | undefined;
6056
6082
  }, {
6057
6083
  result: "match" | "inconclusive" | "mismatch" | "missing";
@@ -6059,6 +6085,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
6059
6085
  claim_type: "promise" | "appointment_informed" | "data_collected" | "required_data" | "outcome" | "question_requires_answer" | "first_concrete_offer" | "patient_status" | "price_informed";
6060
6086
  found: string | null;
6061
6087
  note?: string | undefined;
6088
+ calendar_id?: string | undefined;
6089
+ appointment_id?: string | undefined;
6062
6090
  alert_code?: "AGENDAMENTO_INFORMADO_NAO_REGISTRADO" | "AGENDAMENTO_DIVERGENTE" | "AGENDAMENTO_SOBREPOSTO" | "CONTRADICAO_PREMISSA_ANTERIOR" | "ORIENTACAO_CLINICA_INDEVIDA" | "POLITICA_VIOLADA" | "ULTIMA_MENSAGEM_SEM_RESPOSTA" | "PERGUNTA_NAO_RESPONDIDA" | "PROMESSA_NAO_CUMPRIDA" | "IDENTIDADE_ERRADA" | "DADO_JA_INFORMADO_RECOLETADO" | "DADO_OBRIGATORIO_NAO_COLETADO" | "FLUXO_VENDA_NAO_SEGUIDO" | "MOTIVO_ENCERRAMENTO_INCOMPATIVEL" | "SLA_RESPOSTA_ALTO" | "LEAD_QUENTE_SEM_FOLLOWUP" | "LEAD_ORIGEM_INCONSISTENTE" | "LEAD_QUALIFICACAO_INCONSISTENTE" | "AUTOMACAO_CONFLITANTE" | "DADO_SENSIVEL_SOLICITADO" | "URGENCIA_NAO_ENCAMINHADA" | "NF_NAO_ENVIADA" | "COBRANCA_NAO_ENVIADA" | undefined;
6063
6091
  }>, "many">;
6064
6092
  criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -6213,6 +6241,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
6213
6241
  verification: z.ZodOptional<z.ZodEnum<["pending", "confirmed_ok", "confirmed", "inconclusive"]>>;
6214
6242
  recheck_after: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
6215
6243
  resolved_in_ticket: z.ZodOptional<z.ZodString>;
6244
+ appointment_id: z.ZodOptional<z.ZodString>;
6245
+ calendar_id: z.ZodOptional<z.ZodString>;
6216
6246
  first_seen_ticket_id: z.ZodString;
6217
6247
  created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
6218
6248
  }, "strip", z.ZodTypeAny, {
@@ -6232,6 +6262,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
6232
6262
  }[];
6233
6263
  first_seen_ticket_id: string;
6234
6264
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
6265
+ calendar_id?: string | undefined;
6266
+ appointment_id?: string | undefined;
6235
6267
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
6236
6268
  suggested_action?: string | undefined;
6237
6269
  recheck_after?: Date | undefined;
@@ -6253,6 +6285,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
6253
6285
  first_seen_ticket_id: string;
6254
6286
  created_at?: unknown;
6255
6287
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
6288
+ calendar_id?: string | undefined;
6289
+ appointment_id?: string | undefined;
6256
6290
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
6257
6291
  suggested_action?: string | undefined;
6258
6292
  recheck_after?: unknown;
@@ -8045,12 +8079,16 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
8045
8079
  found: z.ZodNullable<z.ZodString>;
8046
8080
  alert_code: z.ZodOptional<z.ZodEnum<["AGENDAMENTO_INFORMADO_NAO_REGISTRADO", "AGENDAMENTO_DIVERGENTE", "AGENDAMENTO_SOBREPOSTO", "CONTRADICAO_PREMISSA_ANTERIOR", "ORIENTACAO_CLINICA_INDEVIDA", "POLITICA_VIOLADA", "ULTIMA_MENSAGEM_SEM_RESPOSTA", "PERGUNTA_NAO_RESPONDIDA", "PROMESSA_NAO_CUMPRIDA", "IDENTIDADE_ERRADA", "DADO_JA_INFORMADO_RECOLETADO", "DADO_OBRIGATORIO_NAO_COLETADO", "FLUXO_VENDA_NAO_SEGUIDO", "MOTIVO_ENCERRAMENTO_INCOMPATIVEL", "SLA_RESPOSTA_ALTO", "LEAD_QUENTE_SEM_FOLLOWUP", "LEAD_ORIGEM_INCONSISTENTE", "LEAD_QUALIFICACAO_INCONSISTENTE", "AUTOMACAO_CONFLITANTE", "DADO_SENSIVEL_SOLICITADO", "URGENCIA_NAO_ENCAMINHADA", "NF_NAO_ENVIADA", "COBRANCA_NAO_ENVIADA"]>>;
8047
8081
  note: z.ZodOptional<z.ZodString>;
8082
+ appointment_id: z.ZodOptional<z.ZodString>;
8083
+ calendar_id: z.ZodOptional<z.ZodString>;
8048
8084
  }, "strip", z.ZodTypeAny, {
8049
8085
  result: "match" | "inconclusive" | "mismatch" | "missing";
8050
8086
  expected: string;
8051
8087
  claim_type: "promise" | "appointment_informed" | "data_collected" | "required_data" | "outcome" | "question_requires_answer" | "first_concrete_offer" | "patient_status" | "price_informed";
8052
8088
  found: string | null;
8053
8089
  note?: string | undefined;
8090
+ calendar_id?: string | undefined;
8091
+ appointment_id?: string | undefined;
8054
8092
  alert_code?: "AGENDAMENTO_INFORMADO_NAO_REGISTRADO" | "AGENDAMENTO_DIVERGENTE" | "AGENDAMENTO_SOBREPOSTO" | "CONTRADICAO_PREMISSA_ANTERIOR" | "ORIENTACAO_CLINICA_INDEVIDA" | "POLITICA_VIOLADA" | "ULTIMA_MENSAGEM_SEM_RESPOSTA" | "PERGUNTA_NAO_RESPONDIDA" | "PROMESSA_NAO_CUMPRIDA" | "IDENTIDADE_ERRADA" | "DADO_JA_INFORMADO_RECOLETADO" | "DADO_OBRIGATORIO_NAO_COLETADO" | "FLUXO_VENDA_NAO_SEGUIDO" | "MOTIVO_ENCERRAMENTO_INCOMPATIVEL" | "SLA_RESPOSTA_ALTO" | "LEAD_QUENTE_SEM_FOLLOWUP" | "LEAD_ORIGEM_INCONSISTENTE" | "LEAD_QUALIFICACAO_INCONSISTENTE" | "AUTOMACAO_CONFLITANTE" | "DADO_SENSIVEL_SOLICITADO" | "URGENCIA_NAO_ENCAMINHADA" | "NF_NAO_ENVIADA" | "COBRANCA_NAO_ENVIADA" | undefined;
8055
8093
  }, {
8056
8094
  result: "match" | "inconclusive" | "mismatch" | "missing";
@@ -8058,6 +8096,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
8058
8096
  claim_type: "promise" | "appointment_informed" | "data_collected" | "required_data" | "outcome" | "question_requires_answer" | "first_concrete_offer" | "patient_status" | "price_informed";
8059
8097
  found: string | null;
8060
8098
  note?: string | undefined;
8099
+ calendar_id?: string | undefined;
8100
+ appointment_id?: string | undefined;
8061
8101
  alert_code?: "AGENDAMENTO_INFORMADO_NAO_REGISTRADO" | "AGENDAMENTO_DIVERGENTE" | "AGENDAMENTO_SOBREPOSTO" | "CONTRADICAO_PREMISSA_ANTERIOR" | "ORIENTACAO_CLINICA_INDEVIDA" | "POLITICA_VIOLADA" | "ULTIMA_MENSAGEM_SEM_RESPOSTA" | "PERGUNTA_NAO_RESPONDIDA" | "PROMESSA_NAO_CUMPRIDA" | "IDENTIDADE_ERRADA" | "DADO_JA_INFORMADO_RECOLETADO" | "DADO_OBRIGATORIO_NAO_COLETADO" | "FLUXO_VENDA_NAO_SEGUIDO" | "MOTIVO_ENCERRAMENTO_INCOMPATIVEL" | "SLA_RESPOSTA_ALTO" | "LEAD_QUENTE_SEM_FOLLOWUP" | "LEAD_ORIGEM_INCONSISTENTE" | "LEAD_QUALIFICACAO_INCONSISTENTE" | "AUTOMACAO_CONFLITANTE" | "DADO_SENSIVEL_SOLICITADO" | "URGENCIA_NAO_ENCAMINHADA" | "NF_NAO_ENVIADA" | "COBRANCA_NAO_ENVIADA" | undefined;
8062
8102
  }>, "many">;
8063
8103
  criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -8212,6 +8252,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
8212
8252
  verification: z.ZodOptional<z.ZodEnum<["pending", "confirmed_ok", "confirmed", "inconclusive"]>>;
8213
8253
  recheck_after: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
8214
8254
  resolved_in_ticket: z.ZodOptional<z.ZodString>;
8255
+ appointment_id: z.ZodOptional<z.ZodString>;
8256
+ calendar_id: z.ZodOptional<z.ZodString>;
8215
8257
  first_seen_ticket_id: z.ZodString;
8216
8258
  created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
8217
8259
  }, "strip", z.ZodTypeAny, {
@@ -8231,6 +8273,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
8231
8273
  }[];
8232
8274
  first_seen_ticket_id: string;
8233
8275
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
8276
+ calendar_id?: string | undefined;
8277
+ appointment_id?: string | undefined;
8234
8278
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
8235
8279
  suggested_action?: string | undefined;
8236
8280
  recheck_after?: Date | undefined;
@@ -8252,6 +8296,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
8252
8296
  first_seen_ticket_id: string;
8253
8297
  created_at?: unknown;
8254
8298
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
8299
+ calendar_id?: string | undefined;
8300
+ appointment_id?: string | undefined;
8255
8301
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
8256
8302
  suggested_action?: string | undefined;
8257
8303
  recheck_after?: unknown;
@@ -10044,12 +10090,16 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10044
10090
  found: z.ZodNullable<z.ZodString>;
10045
10091
  alert_code: z.ZodOptional<z.ZodEnum<["AGENDAMENTO_INFORMADO_NAO_REGISTRADO", "AGENDAMENTO_DIVERGENTE", "AGENDAMENTO_SOBREPOSTO", "CONTRADICAO_PREMISSA_ANTERIOR", "ORIENTACAO_CLINICA_INDEVIDA", "POLITICA_VIOLADA", "ULTIMA_MENSAGEM_SEM_RESPOSTA", "PERGUNTA_NAO_RESPONDIDA", "PROMESSA_NAO_CUMPRIDA", "IDENTIDADE_ERRADA", "DADO_JA_INFORMADO_RECOLETADO", "DADO_OBRIGATORIO_NAO_COLETADO", "FLUXO_VENDA_NAO_SEGUIDO", "MOTIVO_ENCERRAMENTO_INCOMPATIVEL", "SLA_RESPOSTA_ALTO", "LEAD_QUENTE_SEM_FOLLOWUP", "LEAD_ORIGEM_INCONSISTENTE", "LEAD_QUALIFICACAO_INCONSISTENTE", "AUTOMACAO_CONFLITANTE", "DADO_SENSIVEL_SOLICITADO", "URGENCIA_NAO_ENCAMINHADA", "NF_NAO_ENVIADA", "COBRANCA_NAO_ENVIADA"]>>;
10046
10092
  note: z.ZodOptional<z.ZodString>;
10093
+ appointment_id: z.ZodOptional<z.ZodString>;
10094
+ calendar_id: z.ZodOptional<z.ZodString>;
10047
10095
  }, "strip", z.ZodTypeAny, {
10048
10096
  result: "match" | "inconclusive" | "mismatch" | "missing";
10049
10097
  expected: string;
10050
10098
  claim_type: "promise" | "appointment_informed" | "data_collected" | "required_data" | "outcome" | "question_requires_answer" | "first_concrete_offer" | "patient_status" | "price_informed";
10051
10099
  found: string | null;
10052
10100
  note?: string | undefined;
10101
+ calendar_id?: string | undefined;
10102
+ appointment_id?: string | undefined;
10053
10103
  alert_code?: "AGENDAMENTO_INFORMADO_NAO_REGISTRADO" | "AGENDAMENTO_DIVERGENTE" | "AGENDAMENTO_SOBREPOSTO" | "CONTRADICAO_PREMISSA_ANTERIOR" | "ORIENTACAO_CLINICA_INDEVIDA" | "POLITICA_VIOLADA" | "ULTIMA_MENSAGEM_SEM_RESPOSTA" | "PERGUNTA_NAO_RESPONDIDA" | "PROMESSA_NAO_CUMPRIDA" | "IDENTIDADE_ERRADA" | "DADO_JA_INFORMADO_RECOLETADO" | "DADO_OBRIGATORIO_NAO_COLETADO" | "FLUXO_VENDA_NAO_SEGUIDO" | "MOTIVO_ENCERRAMENTO_INCOMPATIVEL" | "SLA_RESPOSTA_ALTO" | "LEAD_QUENTE_SEM_FOLLOWUP" | "LEAD_ORIGEM_INCONSISTENTE" | "LEAD_QUALIFICACAO_INCONSISTENTE" | "AUTOMACAO_CONFLITANTE" | "DADO_SENSIVEL_SOLICITADO" | "URGENCIA_NAO_ENCAMINHADA" | "NF_NAO_ENVIADA" | "COBRANCA_NAO_ENVIADA" | undefined;
10054
10104
  }, {
10055
10105
  result: "match" | "inconclusive" | "mismatch" | "missing";
@@ -10057,6 +10107,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10057
10107
  claim_type: "promise" | "appointment_informed" | "data_collected" | "required_data" | "outcome" | "question_requires_answer" | "first_concrete_offer" | "patient_status" | "price_informed";
10058
10108
  found: string | null;
10059
10109
  note?: string | undefined;
10110
+ calendar_id?: string | undefined;
10111
+ appointment_id?: string | undefined;
10060
10112
  alert_code?: "AGENDAMENTO_INFORMADO_NAO_REGISTRADO" | "AGENDAMENTO_DIVERGENTE" | "AGENDAMENTO_SOBREPOSTO" | "CONTRADICAO_PREMISSA_ANTERIOR" | "ORIENTACAO_CLINICA_INDEVIDA" | "POLITICA_VIOLADA" | "ULTIMA_MENSAGEM_SEM_RESPOSTA" | "PERGUNTA_NAO_RESPONDIDA" | "PROMESSA_NAO_CUMPRIDA" | "IDENTIDADE_ERRADA" | "DADO_JA_INFORMADO_RECOLETADO" | "DADO_OBRIGATORIO_NAO_COLETADO" | "FLUXO_VENDA_NAO_SEGUIDO" | "MOTIVO_ENCERRAMENTO_INCOMPATIVEL" | "SLA_RESPOSTA_ALTO" | "LEAD_QUENTE_SEM_FOLLOWUP" | "LEAD_ORIGEM_INCONSISTENTE" | "LEAD_QUALIFICACAO_INCONSISTENTE" | "AUTOMACAO_CONFLITANTE" | "DADO_SENSIVEL_SOLICITADO" | "URGENCIA_NAO_ENCAMINHADA" | "NF_NAO_ENVIADA" | "COBRANCA_NAO_ENVIADA" | undefined;
10061
10113
  }>, "many">;
10062
10114
  criteria: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -10211,6 +10263,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10211
10263
  verification: z.ZodOptional<z.ZodEnum<["pending", "confirmed_ok", "confirmed", "inconclusive"]>>;
10212
10264
  recheck_after: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
10213
10265
  resolved_in_ticket: z.ZodOptional<z.ZodString>;
10266
+ appointment_id: z.ZodOptional<z.ZodString>;
10267
+ calendar_id: z.ZodOptional<z.ZodString>;
10214
10268
  first_seen_ticket_id: z.ZodString;
10215
10269
  created_at: z.ZodEffects<z.ZodDate, Date, unknown>;
10216
10270
  }, "strip", z.ZodTypeAny, {
@@ -10230,6 +10284,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10230
10284
  }[];
10231
10285
  first_seen_ticket_id: string;
10232
10286
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
10287
+ calendar_id?: string | undefined;
10288
+ appointment_id?: string | undefined;
10233
10289
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
10234
10290
  suggested_action?: string | undefined;
10235
10291
  recheck_after?: Date | undefined;
@@ -10251,6 +10307,8 @@ export declare const zCsqLeadReportSchema: z.ZodObject<{
10251
10307
  first_seen_ticket_id: string;
10252
10308
  created_at?: unknown;
10253
10309
  verification?: "confirmed" | "pending" | "confirmed_ok" | "inconclusive" | undefined;
10310
+ calendar_id?: string | undefined;
10311
+ appointment_id?: string | undefined;
10254
10312
  subtype?: "valor" | "parcelamento" | "convenio" | "dia_horario" | "procedimento" | "modalidade" | "objecao_sem_argumento" | "sem_oferta_concreta" | "preco_antes_da_queixa" | undefined;
10255
10313
  suggested_action?: string | undefined;
10256
10314
  recheck_after?: unknown;
@@ -121,6 +121,8 @@ exports.zCsqAlertSchema = zod_1.z.object({
121
121
  verification: exports.zCsqVerificationStateSchema.optional(),
122
122
  recheck_after: zod_schemas_1.zFirestoreDateSchema.optional(),
123
123
  resolved_in_ticket: zod_1.z.string().optional(),
124
+ appointment_id: zod_1.z.string().optional(),
125
+ calendar_id: zod_1.z.string().optional(),
124
126
  first_seen_ticket_id: zod_1.z.string(),
125
127
  created_at: zod_schemas_1.zFirestoreDateSchema,
126
128
  });
@@ -267,6 +269,8 @@ exports.zCsqCrossCheckSchema = zod_1.z.object({
267
269
  found: zod_1.z.string().nullable(),
268
270
  alert_code: exports.zCsqAlertCodeSchema.optional(),
269
271
  note: zod_1.z.string().optional(),
272
+ appointment_id: zod_1.z.string().optional(),
273
+ calendar_id: zod_1.z.string().optional(),
270
274
  });
271
275
  // ───────── Avaliacao (report-spec §4) ─────────
272
276
  exports.zCsqCriterionScoreSchema = zod_1.z.object({
@@ -139,6 +139,8 @@ export const zCsqAlertSchema = z.object({
139
139
  verification: zCsqVerificationStateSchema.optional(),
140
140
  recheck_after: zFirestoreDateSchema.optional(),
141
141
  resolved_in_ticket: z.string().optional(),
142
+ appointment_id: z.string().optional(),
143
+ calendar_id: z.string().optional(),
142
144
  first_seen_ticket_id: z.string(),
143
145
  created_at: zFirestoreDateSchema,
144
146
  });
@@ -306,6 +308,8 @@ export const zCsqCrossCheckSchema = z.object({
306
308
  found: z.string().nullable(),
307
309
  alert_code: zCsqAlertCodeSchema.optional(),
308
310
  note: z.string().optional(),
311
+ appointment_id: z.string().optional(),
312
+ calendar_id: z.string().optional(),
309
313
  });
310
314
 
311
315
  // ───────── Avaliacao (report-spec §4) ─────────
@@ -12993,3 +12993,88 @@ export declare const zNexVendasJourneyPaymentSchema: z.ZodObject<{
12993
12993
  payment_link_id?: string | null | undefined;
12994
12994
  }[] | null | undefined;
12995
12995
  }>;
12996
+ /**
12997
+ * Franquia de uma métrica no contrato. `included` é número discreto e inteiro
12998
+ * (não fração): 0 = nada incluso.
12999
+ */
13000
+ export declare const zNexFinopsContractAllowanceSchema: z.ZodObject<{
13001
+ included: z.ZodNumber;
13002
+ /** Reservado para a feat-150 cheia (preço do excedente). Não usar ainda. */
13003
+ unit_price_excess: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
13004
+ }, "strip", z.ZodTypeAny, {
13005
+ included: number;
13006
+ unit_price_excess?: number | null | undefined;
13007
+ }, {
13008
+ included: number;
13009
+ unit_price_excess?: number | null | undefined;
13010
+ }>;
13011
+ /**
13012
+ * Mapa de franquias por métrica. A chave é `string` de propósito (ver
13013
+ * `NexFinopsMetricCatalog`): métrica nova é linha de catálogo, não publish do
13014
+ * evo-types. Métrica ausente = não contratada ⇒ não alerta.
13015
+ */
13016
+ export declare const zNexFinopsContractAllowancesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
13017
+ included: z.ZodNumber;
13018
+ /** Reservado para a feat-150 cheia (preço do excedente). Não usar ainda. */
13019
+ unit_price_excess: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
13020
+ }, "strip", z.ZodTypeAny, {
13021
+ included: number;
13022
+ unit_price_excess?: number | null | undefined;
13023
+ }, {
13024
+ included: number;
13025
+ unit_price_excess?: number | null | undefined;
13026
+ }>>;
13027
+ /**
13028
+ * Gatilho de alerta: **fração** da franquia, não percentual — `0.8` é 80%.
13029
+ * `0` é rejeitado porque dispararia em qualquer consumo.
13030
+ */
13031
+ export declare const zNexFinopsAlertThresholdSchema: z.ZodNumber;
13032
+ /** Doc `platform/evo-billing/usage-alerts/config` — default herdado por todos os contratos. */
13033
+ export declare const zNexFinopsUsageAlertDefaultsSchema: z.ZodObject<{
13034
+ enabled: z.ZodBoolean;
13035
+ thresholds: z.ZodArray<z.ZodNumber, "many">;
13036
+ }, "strip", z.ZodTypeAny, {
13037
+ enabled: boolean;
13038
+ thresholds: number[];
13039
+ }, {
13040
+ enabled: boolean;
13041
+ thresholds: number[];
13042
+ }>;
13043
+ /**
13044
+ * Fragmento de escrita dos campos de franquia/alerta do contrato, para compor
13045
+ * (`.merge()`) nos schemas de create/update/upsert de contrato do
13046
+ * `@evo/nex-model`. Campo que não entra no schema de patch é aceito e
13047
+ * descartado em silêncio.
13048
+ *
13049
+ * `alerts_enabled` e `alert_thresholds` ausentes significam **herda o default
13050
+ * global** — nunca `false`/lista vazia.
13051
+ */
13052
+ export declare const zNexFinopsContractAllowancesWriteSchema: z.ZodObject<{
13053
+ allowances: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
13054
+ included: z.ZodNumber;
13055
+ /** Reservado para a feat-150 cheia (preço do excedente). Não usar ainda. */
13056
+ unit_price_excess: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
13057
+ }, "strip", z.ZodTypeAny, {
13058
+ included: number;
13059
+ unit_price_excess?: number | null | undefined;
13060
+ }, {
13061
+ included: number;
13062
+ unit_price_excess?: number | null | undefined;
13063
+ }>>>>;
13064
+ alerts_enabled: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
13065
+ alert_thresholds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
13066
+ }, "strip", z.ZodTypeAny, {
13067
+ allowances?: Record<string, {
13068
+ included: number;
13069
+ unit_price_excess?: number | null | undefined;
13070
+ }> | null | undefined;
13071
+ alerts_enabled?: boolean | null | undefined;
13072
+ alert_thresholds?: number[] | null | undefined;
13073
+ }, {
13074
+ allowances?: Record<string, {
13075
+ included: number;
13076
+ unit_price_excess?: number | null | undefined;
13077
+ }> | null | undefined;
13078
+ alerts_enabled?: boolean | null | undefined;
13079
+ alert_thresholds?: number[] | null | undefined;
13080
+ }>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.zProviderInvoiceLinksSchema = exports.zServiceTaxInfoSchema = exports.zServiceLineItemSchema = exports.zServiceInvoiceStateSchema = exports.zProviderServiceInvoiceStatusSchema = exports.zExternalLinkSchema = exports.zExternalObjectTypeSchema = exports.zInvoiceSourceRefSchema = exports.zInvoiceSourceTypeSchema = exports.zInvoiceTakerRefSchema = exports.zInvoiceTakerSnapshotSchema = exports.zInvoiceTakerSnapshotAddressSchema = exports.zTakerDocumentSchema = exports.zTakerTaxProfileSchema = exports.zTakerProviderRefsSchema = exports.zTakerAddressSchema = exports.zInvoiceTakerTypeSchema = exports.zServiceSchema = exports.zCustomerServiceTaxInfoSchema = exports.zIssuerTaxProfileSchema = exports.zIssuerNfseConfigSchema = exports.zIssuerMunicipalCredentialsRefSchema = exports.zIssuerTaxRegimeSchema = exports.zIssuerCompanyIdentitySchema = exports.zIssuerCompanyAddressSchema = exports.zTaxProfileSyncStateSchema = exports.zAsaasProviderSchema = exports.zAsaasProviderAsaasBlockSchema = exports.zAsaasProviderCapabilitiesSchema = exports.zAsaasPaymentsCapabilitiesSchema = exports.zAsaasNfseCapabilitiesSchema = exports.zAsaasEnvAuthConfigSchema = exports.zAsaasSubaccountInputSchema = exports.zAsaasAccountScopeSchema = exports.zAsaasWebhookConfigSchema = exports.zRetryPolicySchema = exports.zAsaasWebhookEventSchema = exports.zAsaasAccountScopeModeSchema = exports.zProviderRemoteRefsSchema = exports.zProviderFiscalInfoPayloadSchema = exports.zProviderCredentialsInputSchema = exports.zProviderCredentialsSecretRefsSchema = exports.zProviderMunicipalOptionsSnapshotSchema = exports.zProviderOptionItemSchema = exports.zProviderMunicipalAuthTypeSchema = exports.zFinopsProviderBaseSchema = exports.zProviderStatusSchema = exports.zFinopsActionSchema = exports.zFinopsProviderTypeSchema = exports.zProviderEnvSchema = void 0;
4
- exports.zNexVendasJourneyPaymentSchema = exports.zNexVendasJourneyPaymentSupersededSchema = exports.zNexVendasJourneyPaymentWebhookEventSchema = exports.zNexVendasJourneyBoletoSchema = exports.zNexVendasJourneyPaymentChooseSchema = exports.zNexVendasJourneyPaymentStateSchema = exports.zNexVendasJourneyPaymentKindSchema = exports.zNexVendasJourneyPaymentMethodSchema = exports.zNexFinopsContractAsaasInfoSchema = exports.zNexFinopsAsaasSubscriptionStatusSchema = exports.zNexFinopsPaymentMethodSchema = exports.zNexFinopsProposalSchema = exports.zNexFinopsProposalWriteSchema = exports.zNexFinopsProposalPrefillSchema = exports.zNexFinopsProposalLoyaltyPeriodSchema = exports.zNexFinopsProposalPaymentMethodSchema = exports.zNexFinopsProposalStatusSchema = exports.zServiceInvoiceSchema = exports.zPaymentLinkSchema = exports.zPaymentLinkDocumentStateSchema = exports.zAsaasPaymentLinkSubscriptionCycleSchema = exports.zAsaasPaymentLinkChargeTypeSchema = exports.zAsaasPaymentLinkBillingTypeSchema = exports.zProviderPayloadSnapshotSchema = exports.zProviderTraceSchema = exports.zProviderInvoiceErrorSchema = exports.zProviderInvoiceIdentifiersSchema = void 0;
4
+ exports.zNexFinopsContractAllowancesWriteSchema = exports.zNexFinopsUsageAlertDefaultsSchema = exports.zNexFinopsAlertThresholdSchema = exports.zNexFinopsContractAllowancesSchema = exports.zNexFinopsContractAllowanceSchema = exports.zNexVendasJourneyPaymentSchema = exports.zNexVendasJourneyPaymentSupersededSchema = exports.zNexVendasJourneyPaymentWebhookEventSchema = exports.zNexVendasJourneyBoletoSchema = exports.zNexVendasJourneyPaymentChooseSchema = exports.zNexVendasJourneyPaymentStateSchema = exports.zNexVendasJourneyPaymentKindSchema = exports.zNexVendasJourneyPaymentMethodSchema = exports.zNexFinopsContractAsaasInfoSchema = exports.zNexFinopsAsaasSubscriptionStatusSchema = exports.zNexFinopsPaymentMethodSchema = exports.zNexFinopsProposalSchema = exports.zNexFinopsProposalWriteSchema = exports.zNexFinopsProposalPrefillSchema = exports.zNexFinopsProposalLoyaltyPeriodSchema = exports.zNexFinopsProposalPaymentMethodSchema = exports.zNexFinopsProposalStatusSchema = exports.zServiceInvoiceSchema = exports.zPaymentLinkSchema = exports.zPaymentLinkDocumentStateSchema = exports.zAsaasPaymentLinkSubscriptionCycleSchema = exports.zAsaasPaymentLinkChargeTypeSchema = exports.zAsaasPaymentLinkBillingTypeSchema = exports.zProviderPayloadSnapshotSchema = exports.zProviderTraceSchema = exports.zProviderInvoiceErrorSchema = exports.zProviderInvoiceIdentifiersSchema = void 0;
5
5
  const zod_1 = require("zod");
6
6
  const zod_schemas_1 = require("../shared/zod-schemas");
7
7
  // ---- Provider enums and base ----
@@ -853,3 +853,52 @@ exports.zNexVendasJourneyPaymentSchema = zod_1.z
853
853
  last_error: zod_1.z.string().optional().nullable(),
854
854
  })
855
855
  .strip();
856
+ // ---- Nexus FinOps / Franquias e alertas de consumo (feat-150 F0) ----
857
+ /**
858
+ * Franquia de uma métrica no contrato. `included` é número discreto e inteiro
859
+ * (não fração): 0 = nada incluso.
860
+ */
861
+ exports.zNexFinopsContractAllowanceSchema = zod_1.z
862
+ .object({
863
+ included: zod_1.z.number().int().nonnegative(),
864
+ /** Reservado para a feat-150 cheia (preço do excedente). Não usar ainda. */
865
+ unit_price_excess: zod_1.z.number().nonnegative().optional().nullable(),
866
+ })
867
+ .strip();
868
+ /**
869
+ * Mapa de franquias por métrica. A chave é `string` de propósito (ver
870
+ * `NexFinopsMetricCatalog`): métrica nova é linha de catálogo, não publish do
871
+ * evo-types. Métrica ausente = não contratada ⇒ não alerta.
872
+ */
873
+ exports.zNexFinopsContractAllowancesSchema = zod_1.z.record(zod_1.z.string().min(1).max(64), exports.zNexFinopsContractAllowanceSchema);
874
+ /**
875
+ * Gatilho de alerta: **fração** da franquia, não percentual — `0.8` é 80%.
876
+ * `0` é rejeitado porque dispararia em qualquer consumo.
877
+ */
878
+ exports.zNexFinopsAlertThresholdSchema = zod_1.z
879
+ .number()
880
+ .gt(0, "threshold must be a fraction greater than 0 (0.8 = 80%)")
881
+ .lte(1, "threshold must be a fraction less than or equal to 1 (1 = 100%)");
882
+ /** Doc `platform/evo-billing/usage-alerts/config` — default herdado por todos os contratos. */
883
+ exports.zNexFinopsUsageAlertDefaultsSchema = zod_1.z
884
+ .object({
885
+ enabled: zod_1.z.boolean(),
886
+ thresholds: zod_1.z.array(exports.zNexFinopsAlertThresholdSchema),
887
+ })
888
+ .strip();
889
+ /**
890
+ * Fragmento de escrita dos campos de franquia/alerta do contrato, para compor
891
+ * (`.merge()`) nos schemas de create/update/upsert de contrato do
892
+ * `@evo/nex-model`. Campo que não entra no schema de patch é aceito e
893
+ * descartado em silêncio.
894
+ *
895
+ * `alerts_enabled` e `alert_thresholds` ausentes significam **herda o default
896
+ * global** — nunca `false`/lista vazia.
897
+ */
898
+ exports.zNexFinopsContractAllowancesWriteSchema = zod_1.z
899
+ .object({
900
+ allowances: exports.zNexFinopsContractAllowancesSchema.optional().nullable(),
901
+ alerts_enabled: zod_1.z.boolean().optional().nullable(),
902
+ alert_thresholds: zod_1.z.array(exports.zNexFinopsAlertThresholdSchema).optional().nullable(),
903
+ })
904
+ .strip();
@@ -932,3 +932,61 @@ export const zNexVendasJourneyPaymentSchema = z
932
932
  last_error: z.string().optional().nullable(),
933
933
  })
934
934
  .strip();
935
+
936
+ // ---- Nexus FinOps / Franquias e alertas de consumo (feat-150 F0) ----
937
+
938
+ /**
939
+ * Franquia de uma métrica no contrato. `included` é número discreto e inteiro
940
+ * (não fração): 0 = nada incluso.
941
+ */
942
+ export const zNexFinopsContractAllowanceSchema = z
943
+ .object({
944
+ included: z.number().int().nonnegative(),
945
+ /** Reservado para a feat-150 cheia (preço do excedente). Não usar ainda. */
946
+ unit_price_excess: z.number().nonnegative().optional().nullable(),
947
+ })
948
+ .strip();
949
+
950
+ /**
951
+ * Mapa de franquias por métrica. A chave é `string` de propósito (ver
952
+ * `NexFinopsMetricCatalog`): métrica nova é linha de catálogo, não publish do
953
+ * evo-types. Métrica ausente = não contratada ⇒ não alerta.
954
+ */
955
+ export const zNexFinopsContractAllowancesSchema = z.record(
956
+ z.string().min(1).max(64),
957
+ zNexFinopsContractAllowanceSchema,
958
+ );
959
+
960
+ /**
961
+ * Gatilho de alerta: **fração** da franquia, não percentual — `0.8` é 80%.
962
+ * `0` é rejeitado porque dispararia em qualquer consumo.
963
+ */
964
+ export const zNexFinopsAlertThresholdSchema = z
965
+ .number()
966
+ .gt(0, "threshold must be a fraction greater than 0 (0.8 = 80%)")
967
+ .lte(1, "threshold must be a fraction less than or equal to 1 (1 = 100%)");
968
+
969
+ /** Doc `platform/evo-billing/usage-alerts/config` — default herdado por todos os contratos. */
970
+ export const zNexFinopsUsageAlertDefaultsSchema = z
971
+ .object({
972
+ enabled: z.boolean(),
973
+ thresholds: z.array(zNexFinopsAlertThresholdSchema),
974
+ })
975
+ .strip();
976
+
977
+ /**
978
+ * Fragmento de escrita dos campos de franquia/alerta do contrato, para compor
979
+ * (`.merge()`) nos schemas de create/update/upsert de contrato do
980
+ * `@evo/nex-model`. Campo que não entra no schema de patch é aceito e
981
+ * descartado em silêncio.
982
+ *
983
+ * `alerts_enabled` e `alert_thresholds` ausentes significam **herda o default
984
+ * global** — nunca `false`/lista vazia.
985
+ */
986
+ export const zNexFinopsContractAllowancesWriteSchema = z
987
+ .object({
988
+ allowances: zNexFinopsContractAllowancesSchema.optional().nullable(),
989
+ alerts_enabled: z.boolean().optional().nullable(),
990
+ alert_thresholds: z.array(zNexFinopsAlertThresholdSchema).optional().nullable(),
991
+ })
992
+ .strip();
@@ -132,5 +132,32 @@ export interface ILead extends IProfile {
132
132
  } | null;
133
133
  acquisition_sources?: ILeadReferral[] | null;
134
134
  reactivation?: ILeadReactivation | null;
135
+ /**
136
+ * Provider que originou o lead: `chatbee`, `hub-waba`, `hub-instagram`,
137
+ * `waba-history`, `campaign`... Escrito desde sempre pelos dois criadores de
138
+ * lead do chat; só agora declarado (a index signature já o cobria em runtime).
139
+ */
140
+ origin?: string | null;
141
+ /**
142
+ * feat-157 — CANAL por onde o contato entrou (o número de WhatsApp / conta IG),
143
+ * não o provider. First-touch-wins: gravado uma única vez, na criação do lead, e
144
+ * nunca reescrito por um inbound posterior em outro canal.
145
+ *
146
+ * `contact.channel_ids` NÃO substitui isto: é array e acumula (31% dos contatos
147
+ * de um tenant de dois números já falaram nos dois).
148
+ *
149
+ * No espaço de id do `evo-chat/channels` quando o lead nasce no hub-omni; no id
150
+ * numérico do Chatbee quando nasce no pipeline legado. Filtre por
151
+ * `origin_channel_name`, que é coerente entre as duas eras.
152
+ */
153
+ origin_channel_id?: string | null;
154
+ origin_channel_name?: string | null;
155
+ /**
156
+ * feat-157 — último departamento que atendeu o lead, denormalizado do ticket na
157
+ * criação e na transferência (id do espaço `evo-people`). Alimenta o
158
+ * `ultimo_setor` do prompt da HubIA e a faceta de departamento da listagem.
159
+ */
160
+ last_department_id?: string | null;
161
+ last_department_name?: string | null;
135
162
  [key: string]: unknown;
136
163
  }
@@ -178,5 +178,32 @@ export interface ILead extends IProfile {
178
178
  acquisition_sources?: ILeadReferral[] | null;
179
179
  // Régua de reativação (feat-037) — mantida pelo subscriber ticket_closed + task lead_reactivation.
180
180
  reactivation?: ILeadReactivation | null;
181
+ /**
182
+ * Provider que originou o lead: `chatbee`, `hub-waba`, `hub-instagram`,
183
+ * `waba-history`, `campaign`... Escrito desde sempre pelos dois criadores de
184
+ * lead do chat; só agora declarado (a index signature já o cobria em runtime).
185
+ */
186
+ origin?: string | null;
187
+ /**
188
+ * feat-157 — CANAL por onde o contato entrou (o número de WhatsApp / conta IG),
189
+ * não o provider. First-touch-wins: gravado uma única vez, na criação do lead, e
190
+ * nunca reescrito por um inbound posterior em outro canal.
191
+ *
192
+ * `contact.channel_ids` NÃO substitui isto: é array e acumula (31% dos contatos
193
+ * de um tenant de dois números já falaram nos dois).
194
+ *
195
+ * No espaço de id do `evo-chat/channels` quando o lead nasce no hub-omni; no id
196
+ * numérico do Chatbee quando nasce no pipeline legado. Filtre por
197
+ * `origin_channel_name`, que é coerente entre as duas eras.
198
+ */
199
+ origin_channel_id?: string | null;
200
+ origin_channel_name?: string | null;
201
+ /**
202
+ * feat-157 — último departamento que atendeu o lead, denormalizado do ticket na
203
+ * criação e na transferência (id do espaço `evo-people`). Alimenta o
204
+ * `ultimo_setor` do prompt da HubIA e a faceta de departamento da listagem.
205
+ */
206
+ last_department_id?: string | null;
207
+ last_department_name?: string | null;
181
208
  [key: string]: unknown; // index signature
182
209
  }
@@ -132,6 +132,10 @@ export interface ICsqAlert {
132
132
  recheck_after?: Date;
133
133
  /** Ticket em que o alerta foi constatado como resolvido. */
134
134
  resolved_in_ticket?: string;
135
+ /** So em alertas de agenda: agendamento com que o claim foi cruzado, para o
136
+ * Nexus linkar `/{tenant}/evo-med/calendar/{calendar_id}/appointment/{appointment_id}`. */
137
+ appointment_id?: string;
138
+ calendar_id?: string;
135
139
  /** Ticket em que o alerta apareceu pela primeira vez (herdado x novo). */
136
140
  first_seen_ticket_id: string;
137
141
  created_at: Date;
@@ -305,6 +309,9 @@ export interface ICsqCrossCheck {
305
309
  /** Alerta gerado por esta verificacao, quando houve. */
306
310
  alert_code?: CsqAlertCode;
307
311
  note?: string;
312
+ /** So em cruzamentos de agenda: agendamento encontrado (link no Nexus). */
313
+ appointment_id?: string;
314
+ calendar_id?: string;
308
315
  }
309
316
  /** Nota de um criterio. Todo criterio < 100 exige evidencia valida; sem ela o
310
317
  * codigo zera para `null` e tira do denominador. */
@@ -314,6 +314,10 @@ export interface ICsqAlert {
314
314
  recheck_after?: Date;
315
315
  /** Ticket em que o alerta foi constatado como resolvido. */
316
316
  resolved_in_ticket?: string;
317
+ /** So em alertas de agenda: agendamento com que o claim foi cruzado, para o
318
+ * Nexus linkar `/{tenant}/evo-med/calendar/{calendar_id}/appointment/{appointment_id}`. */
319
+ appointment_id?: string;
320
+ calendar_id?: string;
317
321
  /** Ticket em que o alerta apareceu pela primeira vez (herdado x novo). */
318
322
  first_seen_ticket_id: string;
319
323
  created_at: Date;
@@ -519,6 +523,9 @@ export interface ICsqCrossCheck {
519
523
  /** Alerta gerado por esta verificacao, quando houve. */
520
524
  alert_code?: CsqAlertCode;
521
525
  note?: string;
526
+ /** So em cruzamentos de agenda: agendamento encontrado (link no Nexus). */
527
+ appointment_id?: string;
528
+ calendar_id?: string;
522
529
  }
523
530
 
524
531
  // ───────── Avaliacao (report-spec §4) ─────────
@@ -44,6 +44,66 @@ export interface INexFinopsContractServiceItem {
44
44
  /** Valor unitário (decimal, BRL). */
45
45
  amount: number;
46
46
  }
47
+ /**
48
+ * Franquia de uma métrica dentro do contrato.
49
+ *
50
+ * Franquia é **número discreto** e **não tem default global**: é o que foi
51
+ * vendido àquele cliente. Só o gatilho (percentual) e o liga/desliga têm
52
+ * default de plataforma — ver `INexFinopsUsageAlertDefaults`.
53
+ */
54
+ export interface INexFinopsContractAllowance {
55
+ /** Quantidade incluída no ciclo. 0 = nada incluso; ausente = não contratado. */
56
+ included: number;
57
+ /** Reservado para a feat-150 cheia (preço do excedente). Não usar ainda. */
58
+ unit_price_excess?: number | null;
59
+ }
60
+ /**
61
+ * Catálogo de métricas com franquia. É o que a tela do Nexus renderiza (`v-for`)
62
+ * e o que o motor de alerta itera.
63
+ *
64
+ * Métrica nova = **uma linha aqui**. Nenhuma migração, nenhum campo novo.
65
+ */
66
+ export declare const NexFinopsMetricCatalog: {
67
+ readonly attendances: {
68
+ readonly label: "Atendimentos";
69
+ readonly unit: "contatos";
70
+ };
71
+ readonly sms: {
72
+ readonly label: "SMS enviados";
73
+ readonly unit: "mensagens";
74
+ };
75
+ readonly email: {
76
+ readonly label: "E-mails enviados";
77
+ readonly unit: "mensagens";
78
+ };
79
+ };
80
+ /**
81
+ * Chaves conhecidas do catálogo — para iterar e para tipar escolha de métrica
82
+ * na UI.
83
+ *
84
+ * ⚠️ NÃO usar para tipar a chave de `INexFinopsContract.allowances`: o mapa é
85
+ * deliberadamente aberto (`string`) para que uma métrica nova seja só uma linha
86
+ * de catálogo, sem publish do evo-types antes de o dado poder existir.
87
+ */
88
+ export type NexFinopsMetricKey = keyof typeof NexFinopsMetricCatalog;
89
+ /** Doc de config global dos alertas de consumo (convenção `/platform/<app>`). */
90
+ export declare const EVO_BILLING_USAGE_ALERTS_CONFIG_PATH = "platform/evo-billing/usage-alerts/config";
91
+ /**
92
+ * Default de plataforma dos alertas de consumo, herdado por todos os contratos.
93
+ * Vive em `EVO_BILLING_USAGE_ALERTS_CONFIG_PATH`.
94
+ *
95
+ * O contrato pode sobrescrever os dois campos (`alerts_enabled`,
96
+ * `alert_thresholds`); franquia nunca tem default aqui.
97
+ */
98
+ export interface INexFinopsUsageAlertDefaults {
99
+ /** Alertas ligados para todos os contratos, salvo override. Nasce `true`. */
100
+ enabled: boolean;
101
+ /**
102
+ * Frações da franquia que disparam aviso — **frações, não percentuais**:
103
+ * `0.8` = 80%. Nasce `[0.8, 1.0]`.
104
+ */
105
+ thresholds: number[];
106
+ }
47
107
  export interface INexFinopsContract extends IFireGlobalDoc {
48
108
  customer_id: string;
49
109
  customer_ref?: string | null;
@@ -71,6 +131,38 @@ export interface INexFinopsContract extends IFireGlobalDoc {
71
131
  /** Método com que o primeiro pagamento foi feito. `accepted_payment_methods` é a oferta; este é o fato. */
72
132
  payment_method?: NexFinopsPaymentMethod | null;
73
133
  asaas?: INexFinopsContractAsaasInfo | null;
134
+ /**
135
+ * Franquia incluída no ciclo, por métrica. A CHAVE é o id da métrica (ver
136
+ * `NexFinopsMetricCatalog`) e é deliberadamente `string`: métrica nova é um
137
+ * item de catálogo, não uma mudança de schema.
138
+ *
139
+ * Métrica ausente do mapa = **não contratada** ⇒ não gera alerta. Alertar em
140
+ * qualquer consumo sem franquia produziria alarme falso em massa.
141
+ *
142
+ * Vigência: a franquia herda `starts_at`/`ends_at` do contrato — mudar
143
+ * franquia é alterar o contrato.
144
+ *
145
+ * ⚠️ NÃO existe congelamento por competência ainda. Enquanto a feat-150 cheia
146
+ * não resolver isso, `allowances` **não pode** ser usado para recalcular
147
+ * competência fechada: reabrir junho leria a franquia de hoje, não a de junho.
148
+ */
149
+ allowances?: Record<string, INexFinopsContractAllowance> | null;
150
+ /**
151
+ * Override do liga/desliga global de alertas de consumo.
152
+ *
153
+ * ⚠️ **Ausente ≠ `false`.** Ausente = HERDA o default global
154
+ * (`INexFinopsUsageAlertDefaults.enabled`); `false` explícito é o kill-switch
155
+ * por cliente. Ler ausente como `false` desliga alerta de todo mundo.
156
+ */
157
+ alerts_enabled?: boolean | null;
158
+ /**
159
+ * Override dos gatilhos globais. Frações da franquia (`0.8` = 80%), válidas
160
+ * para todas as métricas do contrato.
161
+ *
162
+ * ⚠️ **Ausente ≠ lista vazia.** Ausente = HERDA
163
+ * `INexFinopsUsageAlertDefaults.thresholds`.
164
+ */
165
+ alert_thresholds?: number[] | null;
74
166
  }
75
167
  export declare const NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS: Record<NexFinopsContractStatus, NexFinopsContractStatus[]>;
76
168
  /**
@@ -1,6 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NEX_FINOPS_BILLABLE_CONTRACT_STATUSES = exports.NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS = void 0;
3
+ exports.NEX_FINOPS_BILLABLE_CONTRACT_STATUSES = exports.NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS = exports.EVO_BILLING_USAGE_ALERTS_CONFIG_PATH = exports.NexFinopsMetricCatalog = void 0;
4
+ /**
5
+ * Catálogo de métricas com franquia. É o que a tela do Nexus renderiza (`v-for`)
6
+ * e o que o motor de alerta itera.
7
+ *
8
+ * Métrica nova = **uma linha aqui**. Nenhuma migração, nenhum campo novo.
9
+ */
10
+ exports.NexFinopsMetricCatalog = {
11
+ attendances: { label: 'Atendimentos', unit: 'contatos' },
12
+ sms: { label: 'SMS enviados', unit: 'mensagens' },
13
+ email: { label: 'E-mails enviados', unit: 'mensagens' },
14
+ };
15
+ /** Doc de config global dos alertas de consumo (convenção `/platform/<app>`). */
16
+ exports.EVO_BILLING_USAGE_ALERTS_CONFIG_PATH = 'platform/evo-billing/usage-alerts/config';
4
17
  // ── Status transitions ──
5
18
  exports.NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS = {
6
19
  draft: ['active', 'canceled'],
@@ -54,6 +54,64 @@ export interface INexFinopsContractServiceItem {
54
54
  amount: number;
55
55
  }
56
56
 
57
+ // ── Franquias e alertas de consumo (feat-150 F0) ──
58
+
59
+ /**
60
+ * Franquia de uma métrica dentro do contrato.
61
+ *
62
+ * Franquia é **número discreto** e **não tem default global**: é o que foi
63
+ * vendido àquele cliente. Só o gatilho (percentual) e o liga/desliga têm
64
+ * default de plataforma — ver `INexFinopsUsageAlertDefaults`.
65
+ */
66
+ export interface INexFinopsContractAllowance {
67
+ /** Quantidade incluída no ciclo. 0 = nada incluso; ausente = não contratado. */
68
+ included: number;
69
+ /** Reservado para a feat-150 cheia (preço do excedente). Não usar ainda. */
70
+ unit_price_excess?: number | null;
71
+ }
72
+
73
+ /**
74
+ * Catálogo de métricas com franquia. É o que a tela do Nexus renderiza (`v-for`)
75
+ * e o que o motor de alerta itera.
76
+ *
77
+ * Métrica nova = **uma linha aqui**. Nenhuma migração, nenhum campo novo.
78
+ */
79
+ export const NexFinopsMetricCatalog = {
80
+ attendances: { label: 'Atendimentos', unit: 'contatos' },
81
+ sms: { label: 'SMS enviados', unit: 'mensagens' },
82
+ email: { label: 'E-mails enviados', unit: 'mensagens' },
83
+ } as const;
84
+
85
+ /**
86
+ * Chaves conhecidas do catálogo — para iterar e para tipar escolha de métrica
87
+ * na UI.
88
+ *
89
+ * ⚠️ NÃO usar para tipar a chave de `INexFinopsContract.allowances`: o mapa é
90
+ * deliberadamente aberto (`string`) para que uma métrica nova seja só uma linha
91
+ * de catálogo, sem publish do evo-types antes de o dado poder existir.
92
+ */
93
+ export type NexFinopsMetricKey = keyof typeof NexFinopsMetricCatalog;
94
+
95
+ /** Doc de config global dos alertas de consumo (convenção `/platform/<app>`). */
96
+ export const EVO_BILLING_USAGE_ALERTS_CONFIG_PATH = 'platform/evo-billing/usage-alerts/config';
97
+
98
+ /**
99
+ * Default de plataforma dos alertas de consumo, herdado por todos os contratos.
100
+ * Vive em `EVO_BILLING_USAGE_ALERTS_CONFIG_PATH`.
101
+ *
102
+ * O contrato pode sobrescrever os dois campos (`alerts_enabled`,
103
+ * `alert_thresholds`); franquia nunca tem default aqui.
104
+ */
105
+ export interface INexFinopsUsageAlertDefaults {
106
+ /** Alertas ligados para todos os contratos, salvo override. Nasce `true`. */
107
+ enabled: boolean;
108
+ /**
109
+ * Frações da franquia que disparam aviso — **frações, não percentuais**:
110
+ * `0.8` = 80%. Nasce `[0.8, 1.0]`.
111
+ */
112
+ thresholds: number[];
113
+ }
114
+
57
115
  // ── Main Document ──
58
116
 
59
117
  export interface INexFinopsContract extends IFireGlobalDoc {
@@ -106,6 +164,43 @@ export interface INexFinopsContract extends IFireGlobalDoc {
106
164
  /** Método com que o primeiro pagamento foi feito. `accepted_payment_methods` é a oferta; este é o fato. */
107
165
  payment_method?: NexFinopsPaymentMethod | null;
108
166
  asaas?: INexFinopsContractAsaasInfo | null;
167
+
168
+ // ── Franquias e alertas de consumo (feat-150 F0) ──
169
+
170
+ /**
171
+ * Franquia incluída no ciclo, por métrica. A CHAVE é o id da métrica (ver
172
+ * `NexFinopsMetricCatalog`) e é deliberadamente `string`: métrica nova é um
173
+ * item de catálogo, não uma mudança de schema.
174
+ *
175
+ * Métrica ausente do mapa = **não contratada** ⇒ não gera alerta. Alertar em
176
+ * qualquer consumo sem franquia produziria alarme falso em massa.
177
+ *
178
+ * Vigência: a franquia herda `starts_at`/`ends_at` do contrato — mudar
179
+ * franquia é alterar o contrato.
180
+ *
181
+ * ⚠️ NÃO existe congelamento por competência ainda. Enquanto a feat-150 cheia
182
+ * não resolver isso, `allowances` **não pode** ser usado para recalcular
183
+ * competência fechada: reabrir junho leria a franquia de hoje, não a de junho.
184
+ */
185
+ allowances?: Record<string, INexFinopsContractAllowance> | null;
186
+
187
+ /**
188
+ * Override do liga/desliga global de alertas de consumo.
189
+ *
190
+ * ⚠️ **Ausente ≠ `false`.** Ausente = HERDA o default global
191
+ * (`INexFinopsUsageAlertDefaults.enabled`); `false` explícito é o kill-switch
192
+ * por cliente. Ler ausente como `false` desliga alerta de todo mundo.
193
+ */
194
+ alerts_enabled?: boolean | null;
195
+
196
+ /**
197
+ * Override dos gatilhos globais. Frações da franquia (`0.8` = 80%), válidas
198
+ * para todas as métricas do contrato.
199
+ *
200
+ * ⚠️ **Ausente ≠ lista vazia.** Ausente = HERDA
201
+ * `INexFinopsUsageAlertDefaults.thresholds`.
202
+ */
203
+ alert_thresholds?: number[] | null;
109
204
  }
110
205
 
111
206
  // ── Status transitions ──
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.557",
3
+ "version": "1.3.562",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",