evo360-types 1.3.651 → 1.3.656
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.
- package/dist/apps/evo-csq/zod-schemas.d.ts +894 -12
- package/dist/apps/evo-csq/zod-schemas.js +54 -2
- package/dist/apps/evo-csq/zod-schemas.ts +58 -0
- package/dist/apps/evo-finops/zod-schemas.d.ts +15 -0
- package/dist/apps/evo-finops/zod-schemas.js +12 -1
- package/dist/apps/evo-finops/zod-schemas.ts +12 -0
- package/dist/apps/hub-automation/zod-schemas.d.ts +66 -0
- package/dist/apps/hub-automation/zod-schemas.js +3 -0
- package/dist/apps/hub-automation/zod-schemas.ts +3 -0
- package/dist/types/evo-billing/index.d.ts +42 -0
- package/dist/types/evo-billing/index.ts +61 -0
- package/dist/types/evo-csq/index.d.ts +77 -0
- package/dist/types/evo-csq/index.ts +92 -0
- package/dist/types/evo-finops/common/billing.d.ts +6 -0
- package/dist/types/evo-finops/common/billing.ts +6 -0
- package/dist/types/hub-automation/index.d.ts +2 -0
- package/dist/types/hub-automation/index.ts +6 -0
- package/package.json +1 -1
|
@@ -8,3 +8,64 @@ export const EvoBillingPermissions = {
|
|
|
8
8
|
|
|
9
9
|
export type EvoBillingPermissions =
|
|
10
10
|
(typeof EvoBillingPermissions)[keyof typeof EvoBillingPermissions];
|
|
11
|
+
|
|
12
|
+
// ── Métodos de pagamento no portal (feat-253 fatia 9) ──
|
|
13
|
+
//
|
|
14
|
+
// Projeção do `payment_methods` para o cliente. PCI/escopo: só bandeira + últimos 4.
|
|
15
|
+
// Sem id do método, `cus_`, `pay_`/`sub_` ou token.
|
|
16
|
+
|
|
17
|
+
export type EvoBillingPortalPaymentMethodKind = 'asaas_card_token' | 'asaas_subscription';
|
|
18
|
+
export type EvoBillingPortalPaymentMethodStatus = 'active' | 'failing' | 'inactive' | 'revoked';
|
|
19
|
+
|
|
20
|
+
export interface IEvoBillingPortalPaymentMethodContract {
|
|
21
|
+
contract_id: string;
|
|
22
|
+
name: string | null;
|
|
23
|
+
/** O contrato cobra neste método por padrão. */
|
|
24
|
+
is_default: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IEvoBillingPortalPaymentMethod {
|
|
28
|
+
/** Chave opaca só para a lista (não é o id do método). */
|
|
29
|
+
key: string;
|
|
30
|
+
kind: EvoBillingPortalPaymentMethodKind;
|
|
31
|
+
status: EvoBillingPortalPaymentMethodStatus;
|
|
32
|
+
brand: string | null;
|
|
33
|
+
last4: string | null;
|
|
34
|
+
/** Contratos do cliente que usam este método. */
|
|
35
|
+
contracts: IEvoBillingPortalPaymentMethodContract[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Cobrança que o "Cadastrar/trocar cartão" usaria agora (ou null: aguarda a próxima). */
|
|
39
|
+
export interface IEvoBillingPortalCardCaptureTarget {
|
|
40
|
+
billing_id: string;
|
|
41
|
+
contract_id: string | null;
|
|
42
|
+
competency_key: string | null;
|
|
43
|
+
value: number;
|
|
44
|
+
due_date: string | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface IEvoBillingPortalPaymentMethodsResponse {
|
|
48
|
+
ok: true;
|
|
49
|
+
items: IEvoBillingPortalPaymentMethod[];
|
|
50
|
+
/** O cadastro de cartão pelo portal está ligado no ambiente atual. */
|
|
51
|
+
capture_enabled: boolean;
|
|
52
|
+
capture_target: IEvoBillingPortalCardCaptureTarget | null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface IEvoBillingPortalCardCaptureResponse {
|
|
56
|
+
ok: true;
|
|
57
|
+
billing_id: string;
|
|
58
|
+
invoice_url: string;
|
|
59
|
+
value: number;
|
|
60
|
+
due_date: string;
|
|
61
|
+
reused: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type EvoBillingPortalCardCaptureErrorCode =
|
|
65
|
+
| 'no_open_billing'
|
|
66
|
+
| 'card_capture_unavailable'
|
|
67
|
+
| 'customer_document_missing'
|
|
68
|
+
| 'taker_without_remote_customer'
|
|
69
|
+
| 'preview_changed'
|
|
70
|
+
| 'already_paid'
|
|
71
|
+
| 'internal';
|
|
@@ -288,8 +288,17 @@ export interface ICsqClaimAppointmentInformed {
|
|
|
288
288
|
* jornada (o lead cancelou/desistiu, ou foi trocado por outro horario). O
|
|
289
289
|
* codigo nao exige registro na agenda de um claim assim. */
|
|
290
290
|
superseded?: boolean;
|
|
291
|
+
/** feat-206 F3: quem extraiu o claim. Ausente = o juiz (laudos anteriores a
|
|
292
|
+
* F3 e claim so do juiz). `detector` = so o detector de agenda; `both` = os
|
|
293
|
+
* dois (mesma data/hora; a evidencia e a uniao). */
|
|
294
|
+
source?: CsqClaimSource;
|
|
295
|
+
/** feat-206 F3: `YYYY-MM-DD|HH:mm` do horario que substituiu este (o
|
|
296
|
+
* detector viu um horario confirmado depois). */
|
|
297
|
+
superseded_by?: string;
|
|
291
298
|
evidence: ICsqEvidence[];
|
|
292
299
|
}
|
|
300
|
+
/** feat-206 F3: origem de um claim `appointment_informed`. */
|
|
301
|
+
export type CsqClaimSource = "judge" | "detector" | "both";
|
|
293
302
|
/** "Prometi X ate quando". */
|
|
294
303
|
export interface ICsqClaimPromise {
|
|
295
304
|
type: "promise";
|
|
@@ -496,6 +505,71 @@ export interface ICsqTriageDecision {
|
|
|
496
505
|
mode: CsqTriageMode;
|
|
497
506
|
reasons: CsqTriageReason[];
|
|
498
507
|
}
|
|
508
|
+
/** Evento canonico de agenda extraido pelo detector (independente do juiz).
|
|
509
|
+
* `slot_offered` sozinho nao vira claim: oferta nao aceita nao e agendamento
|
|
510
|
+
* informado. */
|
|
511
|
+
export type CsqAppointmentEventKind = "slot_offered" | "slot_accepted" | "appointment_confirmed" | "reschedule_requested" | "appointment_cancelled";
|
|
512
|
+
/** Quem produziu o evento na conversa. */
|
|
513
|
+
export type CsqAppointmentEventActor = "attendant" | "lead" | "hubia" | "automation";
|
|
514
|
+
export interface ICsqAppointmentEvent {
|
|
515
|
+
kind: CsqAppointmentEventKind;
|
|
516
|
+
/** YYYY-MM-DD absoluto, TZ do tenant. */
|
|
517
|
+
date?: string;
|
|
518
|
+
/** HH:mm absoluto, TZ do tenant. */
|
|
519
|
+
time?: string;
|
|
520
|
+
professional?: string;
|
|
521
|
+
patient_name?: string;
|
|
522
|
+
modality?: string;
|
|
523
|
+
actor: CsqAppointmentEventActor;
|
|
524
|
+
/** `message_id`/`ticket_id` do recorte; `ts` sempre do transcript. */
|
|
525
|
+
evidence: ICsqEvidence[];
|
|
526
|
+
/** `YYYY-MM-DD|HH:mm` (hora pode faltar: `YYYY-MM-DD|`) do agendamento que
|
|
527
|
+
* este evento cancela ou remarca. */
|
|
528
|
+
supersedes?: string;
|
|
529
|
+
}
|
|
530
|
+
/** `off`: nao roda; `shadow`: roda e registra em `report.detector`, sem mexer
|
|
531
|
+
* nos claims; `on`: os claims do detector entram na verificacao. */
|
|
532
|
+
export type CsqDetectorMode = "off" | "shadow" | "on";
|
|
533
|
+
/** Como terminou a extracao por LLM do detector. */
|
|
534
|
+
export type CsqDetectorOutcome = "no_signal" | "ok" | "failed" | "skipped";
|
|
535
|
+
/** Uso do LLM do extrator (so quando houve chamada). */
|
|
536
|
+
export interface ICsqDetectorLlm {
|
|
537
|
+
provider: string;
|
|
538
|
+
model: string;
|
|
539
|
+
/** Doc em `llm-connections`; `null` quando sintetica. */
|
|
540
|
+
connection_id: string | null;
|
|
541
|
+
/** `extractor` = `extractor_connection_id`; `judge` = conexao do juiz. */
|
|
542
|
+
connection_source: "extractor" | "judge";
|
|
543
|
+
input_tokens: number;
|
|
544
|
+
/** Parte da entrada servida do cache do provedor (OpenAI: prefixo do system). */
|
|
545
|
+
cache_read_tokens?: number;
|
|
546
|
+
output_tokens: number;
|
|
547
|
+
rounds: number;
|
|
548
|
+
cost_usd_est: number | null;
|
|
549
|
+
duration_ms: number;
|
|
550
|
+
}
|
|
551
|
+
/** Divergencia detector x juiz do laudo (registrada, nao escalada — F4). */
|
|
552
|
+
export interface ICsqDetectorReport {
|
|
553
|
+
mode: CsqDetectorMode;
|
|
554
|
+
outcome: CsqDetectorOutcome;
|
|
555
|
+
/** Mensagens com sinal deterministico (data/hora, confirmacao, desfecho). */
|
|
556
|
+
signals: number;
|
|
557
|
+
/** Mensagens no recorte enviado ao extrator (sinais + vizinhanca). */
|
|
558
|
+
excerpt_messages: number;
|
|
559
|
+
events: number;
|
|
560
|
+
claims_detector: number;
|
|
561
|
+
claims_judge: number;
|
|
562
|
+
only_detector: number;
|
|
563
|
+
only_judge: number;
|
|
564
|
+
superseded_by_detector: number;
|
|
565
|
+
/** Claims do detector no MESMO dia de um claim do juiz, com outra hora: nao
|
|
566
|
+
* entram na verificacao (o juiz manda), so contam. */
|
|
567
|
+
time_mismatch?: number;
|
|
568
|
+
/** Eventos extraidos (com evidencia ja validada). */
|
|
569
|
+
event_list?: ICsqAppointmentEvent[];
|
|
570
|
+
llm?: ICsqDetectorLlm | null;
|
|
571
|
+
error?: string;
|
|
572
|
+
}
|
|
499
573
|
/** Tamanho de um bloco do prompt do juiz. `tokens_est` e estimativa
|
|
500
574
|
* deterministica (chars / 3,6), nao contagem do tokenizer. */
|
|
501
575
|
export interface ICsqPromptBlockUsage {
|
|
@@ -818,4 +892,7 @@ export interface ICsqLeadReport extends IFireDoc {
|
|
|
818
892
|
/** feat-206: presente quando o ULTIMO ticket nao passou pelo juiz. A avaliacao
|
|
819
893
|
* (score, pilares, criterios), `model` e `llm_usage` sao do ultimo juiz. */
|
|
820
894
|
judge_skipped_reasons?: CsqTriageReason[];
|
|
895
|
+
/** feat-206 F3: detector de agenda (contagens e divergencia com o juiz).
|
|
896
|
+
* Ausente quando o detector esta `off` ou o laudo e anterior a F3. */
|
|
897
|
+
detector?: ICsqDetectorReport;
|
|
821
898
|
}
|
|
@@ -501,9 +501,19 @@ export interface ICsqClaimAppointmentInformed {
|
|
|
501
501
|
* jornada (o lead cancelou/desistiu, ou foi trocado por outro horario). O
|
|
502
502
|
* codigo nao exige registro na agenda de um claim assim. */
|
|
503
503
|
superseded?: boolean;
|
|
504
|
+
/** feat-206 F3: quem extraiu o claim. Ausente = o juiz (laudos anteriores a
|
|
505
|
+
* F3 e claim so do juiz). `detector` = so o detector de agenda; `both` = os
|
|
506
|
+
* dois (mesma data/hora; a evidencia e a uniao). */
|
|
507
|
+
source?: CsqClaimSource;
|
|
508
|
+
/** feat-206 F3: `YYYY-MM-DD|HH:mm` do horario que substituiu este (o
|
|
509
|
+
* detector viu um horario confirmado depois). */
|
|
510
|
+
superseded_by?: string;
|
|
504
511
|
evidence: ICsqEvidence[];
|
|
505
512
|
}
|
|
506
513
|
|
|
514
|
+
/** feat-206 F3: origem de um claim `appointment_informed`. */
|
|
515
|
+
export type CsqClaimSource = "judge" | "detector" | "both";
|
|
516
|
+
|
|
507
517
|
/** "Prometi X ate quando". */
|
|
508
518
|
export interface ICsqClaimPromise {
|
|
509
519
|
type: "promise";
|
|
@@ -767,6 +777,85 @@ export interface ICsqTriageDecision {
|
|
|
767
777
|
reasons: CsqTriageReason[];
|
|
768
778
|
}
|
|
769
779
|
|
|
780
|
+
// ───────── Detector de agenda (feat-206 F3) ─────────
|
|
781
|
+
|
|
782
|
+
/** Evento canonico de agenda extraido pelo detector (independente do juiz).
|
|
783
|
+
* `slot_offered` sozinho nao vira claim: oferta nao aceita nao e agendamento
|
|
784
|
+
* informado. */
|
|
785
|
+
export type CsqAppointmentEventKind =
|
|
786
|
+
| "slot_offered"
|
|
787
|
+
| "slot_accepted"
|
|
788
|
+
| "appointment_confirmed"
|
|
789
|
+
| "reschedule_requested"
|
|
790
|
+
| "appointment_cancelled";
|
|
791
|
+
|
|
792
|
+
/** Quem produziu o evento na conversa. */
|
|
793
|
+
export type CsqAppointmentEventActor = "attendant" | "lead" | "hubia" | "automation";
|
|
794
|
+
|
|
795
|
+
export interface ICsqAppointmentEvent {
|
|
796
|
+
kind: CsqAppointmentEventKind;
|
|
797
|
+
/** YYYY-MM-DD absoluto, TZ do tenant. */
|
|
798
|
+
date?: string;
|
|
799
|
+
/** HH:mm absoluto, TZ do tenant. */
|
|
800
|
+
time?: string;
|
|
801
|
+
professional?: string;
|
|
802
|
+
patient_name?: string;
|
|
803
|
+
modality?: string;
|
|
804
|
+
actor: CsqAppointmentEventActor;
|
|
805
|
+
/** `message_id`/`ticket_id` do recorte; `ts` sempre do transcript. */
|
|
806
|
+
evidence: ICsqEvidence[];
|
|
807
|
+
/** `YYYY-MM-DD|HH:mm` (hora pode faltar: `YYYY-MM-DD|`) do agendamento que
|
|
808
|
+
* este evento cancela ou remarca. */
|
|
809
|
+
supersedes?: string;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/** `off`: nao roda; `shadow`: roda e registra em `report.detector`, sem mexer
|
|
813
|
+
* nos claims; `on`: os claims do detector entram na verificacao. */
|
|
814
|
+
export type CsqDetectorMode = "off" | "shadow" | "on";
|
|
815
|
+
|
|
816
|
+
/** Como terminou a extracao por LLM do detector. */
|
|
817
|
+
export type CsqDetectorOutcome = "no_signal" | "ok" | "failed" | "skipped";
|
|
818
|
+
|
|
819
|
+
/** Uso do LLM do extrator (so quando houve chamada). */
|
|
820
|
+
export interface ICsqDetectorLlm {
|
|
821
|
+
provider: string;
|
|
822
|
+
model: string;
|
|
823
|
+
/** Doc em `llm-connections`; `null` quando sintetica. */
|
|
824
|
+
connection_id: string | null;
|
|
825
|
+
/** `extractor` = `extractor_connection_id`; `judge` = conexao do juiz. */
|
|
826
|
+
connection_source: "extractor" | "judge";
|
|
827
|
+
input_tokens: number;
|
|
828
|
+
/** Parte da entrada servida do cache do provedor (OpenAI: prefixo do system). */
|
|
829
|
+
cache_read_tokens?: number;
|
|
830
|
+
output_tokens: number;
|
|
831
|
+
rounds: number;
|
|
832
|
+
cost_usd_est: number | null;
|
|
833
|
+
duration_ms: number;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/** Divergencia detector x juiz do laudo (registrada, nao escalada — F4). */
|
|
837
|
+
export interface ICsqDetectorReport {
|
|
838
|
+
mode: CsqDetectorMode;
|
|
839
|
+
outcome: CsqDetectorOutcome;
|
|
840
|
+
/** Mensagens com sinal deterministico (data/hora, confirmacao, desfecho). */
|
|
841
|
+
signals: number;
|
|
842
|
+
/** Mensagens no recorte enviado ao extrator (sinais + vizinhanca). */
|
|
843
|
+
excerpt_messages: number;
|
|
844
|
+
events: number;
|
|
845
|
+
claims_detector: number;
|
|
846
|
+
claims_judge: number;
|
|
847
|
+
only_detector: number;
|
|
848
|
+
only_judge: number;
|
|
849
|
+
superseded_by_detector: number;
|
|
850
|
+
/** Claims do detector no MESMO dia de um claim do juiz, com outra hora: nao
|
|
851
|
+
* entram na verificacao (o juiz manda), so contam. */
|
|
852
|
+
time_mismatch?: number;
|
|
853
|
+
/** Eventos extraidos (com evidencia ja validada). */
|
|
854
|
+
event_list?: ICsqAppointmentEvent[];
|
|
855
|
+
llm?: ICsqDetectorLlm | null;
|
|
856
|
+
error?: string;
|
|
857
|
+
}
|
|
858
|
+
|
|
770
859
|
/** Tamanho de um bloco do prompt do juiz. `tokens_est` e estimativa
|
|
771
860
|
* deterministica (chars / 3,6), nao contagem do tokenizer. */
|
|
772
861
|
export interface ICsqPromptBlockUsage {
|
|
@@ -1127,4 +1216,7 @@ export interface ICsqLeadReport extends IFireDoc {
|
|
|
1127
1216
|
/** feat-206: presente quando o ULTIMO ticket nao passou pelo juiz. A avaliacao
|
|
1128
1217
|
* (score, pilares, criterios), `model` e `llm_usage` sao do ultimo juiz. */
|
|
1129
1218
|
judge_skipped_reasons?: CsqTriageReason[];
|
|
1219
|
+
/** feat-206 F3: detector de agenda (contagens e divergencia com o juiz).
|
|
1220
|
+
* Ausente quando o detector esta `off` ou o laudo e anterior a F3. */
|
|
1221
|
+
detector?: ICsqDetectorReport;
|
|
1130
1222
|
}
|
|
@@ -137,6 +137,12 @@ export interface INexFinopsBillingCardCharge {
|
|
|
137
137
|
/** Provider/ambiente onde o `pay_` foi criado. */
|
|
138
138
|
provider_id?: string | null;
|
|
139
139
|
env?: 'sandbox' | 'production' | null;
|
|
140
|
+
/**
|
|
141
|
+
* feat-253 fatia 9: quem gerou a fatura de captura. `portal` = o próprio cliente pediu
|
|
142
|
+
* "Cadastrar/trocar cartão" → o cartão capturado vira o padrão do contrato. Ausente/`nexus`
|
|
143
|
+
* = regra da F2b (habilita só em contrato sem método; senão fica como sugestão).
|
|
144
|
+
*/
|
|
145
|
+
capture_origin?: 'nexus' | 'portal' | null;
|
|
140
146
|
}
|
|
141
147
|
export type NexFinopsBillingCardCaptureStatus = 'captured' | 'no_token' | 'skipped';
|
|
142
148
|
export interface INexFinopsBilling extends IFireGlobalDoc {
|
|
@@ -168,6 +168,12 @@ export interface INexFinopsBillingCardCharge {
|
|
|
168
168
|
/** Provider/ambiente onde o `pay_` foi criado. */
|
|
169
169
|
provider_id?: string | null;
|
|
170
170
|
env?: 'sandbox' | 'production' | null;
|
|
171
|
+
/**
|
|
172
|
+
* feat-253 fatia 9: quem gerou a fatura de captura. `portal` = o próprio cliente pediu
|
|
173
|
+
* "Cadastrar/trocar cartão" → o cartão capturado vira o padrão do contrato. Ausente/`nexus`
|
|
174
|
+
* = regra da F2b (habilita só em contrato sem método; senão fica como sugestão).
|
|
175
|
+
*/
|
|
176
|
+
capture_origin?: 'nexus' | 'portal' | null;
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
export type NexFinopsBillingCardCaptureStatus = 'captured' | 'no_token' | 'skipped';
|
|
@@ -51,6 +51,8 @@ export interface IAutomationAppointmentSelection {
|
|
|
51
51
|
payment_status_not_in?: string[];
|
|
52
52
|
appointment_mode_in?: string[];
|
|
53
53
|
appointment_mode_not_in?: string[];
|
|
54
|
+
appointment_type_names?: string[];
|
|
55
|
+
appointment_type_names_not_in?: string[];
|
|
54
56
|
time_range?: {
|
|
55
57
|
start: string;
|
|
56
58
|
end: string;
|
|
@@ -128,6 +128,12 @@ export interface IAutomationAppointmentSelection {
|
|
|
128
128
|
// wildcard glob (same style as payment_status_in).
|
|
129
129
|
appointment_mode_in?: string[];
|
|
130
130
|
appointment_mode_not_in?: string[];
|
|
131
|
+
|
|
132
|
+
// ---- fix-262: free-text type NAME as it shows on the calendar
|
|
133
|
+
// (`appointmentType`, e.g. "Consulta particular"), complementing the BASE
|
|
134
|
+
// filter above. Glob-aware like the other name filters.
|
|
135
|
+
appointment_type_names?: string[];
|
|
136
|
+
appointment_type_names_not_in?: string[];
|
|
131
137
|
// Local-time window over appointment.startDate, evaluated in the TENANT
|
|
132
138
|
// timezone. Boundaries: `start <= hh:mm < end` (start inclusive, end
|
|
133
139
|
// exclusive) so adjacent ranges (08–12, 12–18) partition the day without
|