evo360-types 1.3.728 → 1.3.732

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.
@@ -0,0 +1,36 @@
1
+ import type { ProviderServiceInvoiceStatus, ServiceInvoiceState } from "../../types/evo-finops/invoices";
2
+ /** Tamanho mínimo do motivo (após normalizar). */
3
+ export declare const NFSE_CANCEL_REASON_MIN = 5;
4
+ /** Tamanho máximo do motivo (após normalizar). */
5
+ export declare const NFSE_CANCEL_REASON_MAX = 500;
6
+ /**
7
+ * Normaliza o motivo do cancelamento: remove espaços nas pontas e colapsa
8
+ * qualquer sequência de espaços em branco (inclusive quebras de linha) em um espaço.
9
+ * Valor ausente vira string vazia.
10
+ */
11
+ export declare function normalizeNfseCancelReason(s: string | null | undefined): string;
12
+ /** Por que a nota não pode ser cancelada (`null` = pode). */
13
+ export type NfseCancelBlockReason = "no_provider_id" | "draft" | "not_yet_scheduled" | "synchronized" | "processing" | "canceled" | "error" | "deleted";
14
+ /** Recorte mínimo da nota que a regra precisa (aceita `IServiceInvoice` ou linha da lista). */
15
+ export interface INfseCancelCheckInput {
16
+ state?: ServiceInvoiceState | string | null;
17
+ provider_status?: ProviderServiceInvoiceStatus | string | null;
18
+ provider_invoice_id?: string | null;
19
+ deleted_at?: unknown;
20
+ }
21
+ /**
22
+ * Diz por que a NFS-e não pode ser cancelada, ou `null` se pode.
23
+ *
24
+ * Precedência: `deleted` > `no_provider_id` > estado.
25
+ *
26
+ * Matriz por estado:
27
+ * - SCHEDULED, AUTHORIZED, CANCELLATION_DENIED ⇒ cancelável (negação pode tentar de novo).
28
+ * - SENT com `provider_status = SCHEDULED` ⇒ cancelável (no Asaas já está agendada; só falta o webhook).
29
+ * - SENT sem `provider_status = SCHEDULED` ⇒ `not_yet_scheduled`.
30
+ * - DRAFT ⇒ `draft`; SYNCHRONIZED ⇒ `synchronized`; PROCESSING_CANCELLATION ⇒ `processing`;
31
+ * CANCELED ⇒ `canceled`; ERROR ⇒ `error`.
32
+ * - Estado ausente ou desconhecido ⇒ `error` (na dúvida, bloqueia).
33
+ */
34
+ export declare function nfseCancelBlockReason(inv: INfseCancelCheckInput | null | undefined): NfseCancelBlockReason | null;
35
+ /** `true` quando a NFS-e pode ser cancelada pela plataforma. */
36
+ export declare function isNfseCancellable(inv: INfseCancelCheckInput | null | undefined): boolean;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ // Regra única de cancelamento de NFS-e (feat-291), usada pelo backend e pelo front-end.
3
+ // Runtime lib: es6 — sem dependências de Node e sem APIs posteriores ao target.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.NFSE_CANCEL_REASON_MAX = exports.NFSE_CANCEL_REASON_MIN = void 0;
6
+ exports.normalizeNfseCancelReason = normalizeNfseCancelReason;
7
+ exports.nfseCancelBlockReason = nfseCancelBlockReason;
8
+ exports.isNfseCancellable = isNfseCancellable;
9
+ /** Tamanho mínimo do motivo (após normalizar). */
10
+ exports.NFSE_CANCEL_REASON_MIN = 5;
11
+ /** Tamanho máximo do motivo (após normalizar). */
12
+ exports.NFSE_CANCEL_REASON_MAX = 500;
13
+ /**
14
+ * Normaliza o motivo do cancelamento: remove espaços nas pontas e colapsa
15
+ * qualquer sequência de espaços em branco (inclusive quebras de linha) em um espaço.
16
+ * Valor ausente vira string vazia.
17
+ */
18
+ function normalizeNfseCancelReason(s) {
19
+ if (s === null || s === undefined)
20
+ return "";
21
+ return String(s).replace(/\s+/g, " ").trim();
22
+ }
23
+ /**
24
+ * Diz por que a NFS-e não pode ser cancelada, ou `null` se pode.
25
+ *
26
+ * Precedência: `deleted` > `no_provider_id` > estado.
27
+ *
28
+ * Matriz por estado:
29
+ * - SCHEDULED, AUTHORIZED, CANCELLATION_DENIED ⇒ cancelável (negação pode tentar de novo).
30
+ * - SENT com `provider_status = SCHEDULED` ⇒ cancelável (no Asaas já está agendada; só falta o webhook).
31
+ * - SENT sem `provider_status = SCHEDULED` ⇒ `not_yet_scheduled`.
32
+ * - DRAFT ⇒ `draft`; SYNCHRONIZED ⇒ `synchronized`; PROCESSING_CANCELLATION ⇒ `processing`;
33
+ * CANCELED ⇒ `canceled`; ERROR ⇒ `error`.
34
+ * - Estado ausente ou desconhecido ⇒ `error` (na dúvida, bloqueia).
35
+ */
36
+ function nfseCancelBlockReason(inv) {
37
+ if (!inv)
38
+ return "error";
39
+ if (inv.deleted_at)
40
+ return "deleted";
41
+ if (!inv.provider_invoice_id)
42
+ return "no_provider_id";
43
+ switch (inv.state) {
44
+ case "SCHEDULED":
45
+ case "AUTHORIZED":
46
+ case "CANCELLATION_DENIED":
47
+ return null;
48
+ case "SENT":
49
+ return inv.provider_status === "SCHEDULED" ? null : "not_yet_scheduled";
50
+ case "DRAFT":
51
+ return "draft";
52
+ case "SYNCHRONIZED":
53
+ return "synchronized";
54
+ case "PROCESSING_CANCELLATION":
55
+ return "processing";
56
+ case "CANCELED":
57
+ return "canceled";
58
+ case "ERROR":
59
+ return "error";
60
+ default:
61
+ return "error";
62
+ }
63
+ }
64
+ /** `true` quando a NFS-e pode ser cancelada pela plataforma. */
65
+ function isNfseCancellable(inv) {
66
+ return nfseCancelBlockReason(inv) === null;
67
+ }
@@ -0,0 +1,90 @@
1
+ // Regra única de cancelamento de NFS-e (feat-291), usada pelo backend e pelo front-end.
2
+ // Runtime lib: es6 — sem dependências de Node e sem APIs posteriores ao target.
3
+
4
+ import type {
5
+ ProviderServiceInvoiceStatus,
6
+ ServiceInvoiceState,
7
+ } from "../../types/evo-finops/invoices";
8
+
9
+ /** Tamanho mínimo do motivo (após normalizar). */
10
+ export const NFSE_CANCEL_REASON_MIN = 5;
11
+ /** Tamanho máximo do motivo (após normalizar). */
12
+ export const NFSE_CANCEL_REASON_MAX = 500;
13
+
14
+ /**
15
+ * Normaliza o motivo do cancelamento: remove espaços nas pontas e colapsa
16
+ * qualquer sequência de espaços em branco (inclusive quebras de linha) em um espaço.
17
+ * Valor ausente vira string vazia.
18
+ */
19
+ export function normalizeNfseCancelReason(s: string | null | undefined): string {
20
+ if (s === null || s === undefined) return "";
21
+ return String(s).replace(/\s+/g, " ").trim();
22
+ }
23
+
24
+ /** Por que a nota não pode ser cancelada (`null` = pode). */
25
+ export type NfseCancelBlockReason =
26
+ | "no_provider_id"
27
+ | "draft"
28
+ | "not_yet_scheduled"
29
+ | "synchronized"
30
+ | "processing"
31
+ | "canceled"
32
+ | "error"
33
+ | "deleted";
34
+
35
+ /** Recorte mínimo da nota que a regra precisa (aceita `IServiceInvoice` ou linha da lista). */
36
+ export interface INfseCancelCheckInput {
37
+ state?: ServiceInvoiceState | string | null;
38
+ provider_status?: ProviderServiceInvoiceStatus | string | null;
39
+ provider_invoice_id?: string | null;
40
+ deleted_at?: unknown;
41
+ }
42
+
43
+ /**
44
+ * Diz por que a NFS-e não pode ser cancelada, ou `null` se pode.
45
+ *
46
+ * Precedência: `deleted` > `no_provider_id` > estado.
47
+ *
48
+ * Matriz por estado:
49
+ * - SCHEDULED, AUTHORIZED, CANCELLATION_DENIED ⇒ cancelável (negação pode tentar de novo).
50
+ * - SENT com `provider_status = SCHEDULED` ⇒ cancelável (no Asaas já está agendada; só falta o webhook).
51
+ * - SENT sem `provider_status = SCHEDULED` ⇒ `not_yet_scheduled`.
52
+ * - DRAFT ⇒ `draft`; SYNCHRONIZED ⇒ `synchronized`; PROCESSING_CANCELLATION ⇒ `processing`;
53
+ * CANCELED ⇒ `canceled`; ERROR ⇒ `error`.
54
+ * - Estado ausente ou desconhecido ⇒ `error` (na dúvida, bloqueia).
55
+ */
56
+ export function nfseCancelBlockReason(
57
+ inv: INfseCancelCheckInput | null | undefined,
58
+ ): NfseCancelBlockReason | null {
59
+ if (!inv) return "error";
60
+ if (inv.deleted_at) return "deleted";
61
+ if (!inv.provider_invoice_id) return "no_provider_id";
62
+
63
+ switch (inv.state) {
64
+ case "SCHEDULED":
65
+ case "AUTHORIZED":
66
+ case "CANCELLATION_DENIED":
67
+ return null;
68
+ case "SENT":
69
+ return inv.provider_status === "SCHEDULED" ? null : "not_yet_scheduled";
70
+ case "DRAFT":
71
+ return "draft";
72
+ case "SYNCHRONIZED":
73
+ return "synchronized";
74
+ case "PROCESSING_CANCELLATION":
75
+ return "processing";
76
+ case "CANCELED":
77
+ return "canceled";
78
+ case "ERROR":
79
+ return "error";
80
+ default:
81
+ return "error";
82
+ }
83
+ }
84
+
85
+ /** `true` quando a NFS-e pode ser cancelada pela plataforma. */
86
+ export function isNfseCancellable(
87
+ inv: INfseCancelCheckInput | null | undefined,
88
+ ): boolean {
89
+ return nfseCancelBlockReason(inv) === null;
90
+ }
@@ -12555,6 +12555,113 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
12555
12555
  body?: unknown;
12556
12556
  }>, "many">>;
12557
12557
  }, z.ZodTypeAny, "passthrough">>;
12558
+ export declare const zNfseCancellationStatusSchema: z.ZodEnum<["requesting", "requested", "failed"]>;
12559
+ export declare const zServiceInvoiceCancellationSchema: z.ZodObject<{
12560
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
12561
+ reason: z.ZodString;
12562
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
12563
+ requested_by: z.ZodObject<{
12564
+ user_id: z.ZodString;
12565
+ login_id: z.ZodOptional<z.ZodString>;
12566
+ name: z.ZodOptional<z.ZodString>;
12567
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12568
+ user_id: z.ZodString;
12569
+ login_id: z.ZodOptional<z.ZodString>;
12570
+ name: z.ZodOptional<z.ZodString>;
12571
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
12572
+ user_id: z.ZodString;
12573
+ login_id: z.ZodOptional<z.ZodString>;
12574
+ name: z.ZodOptional<z.ZodString>;
12575
+ }, z.ZodTypeAny, "passthrough">>;
12576
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
12577
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
12578
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
12579
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
12580
+ error: z.ZodOptional<z.ZodObject<{
12581
+ http_status: z.ZodOptional<z.ZodNumber>;
12582
+ code: z.ZodOptional<z.ZodString>;
12583
+ description: z.ZodOptional<z.ZodString>;
12584
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12585
+ http_status: z.ZodOptional<z.ZodNumber>;
12586
+ code: z.ZodOptional<z.ZodString>;
12587
+ description: z.ZodOptional<z.ZodString>;
12588
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
12589
+ http_status: z.ZodOptional<z.ZodNumber>;
12590
+ code: z.ZodOptional<z.ZodString>;
12591
+ description: z.ZodOptional<z.ZodString>;
12592
+ }, z.ZodTypeAny, "passthrough">>>;
12593
+ attempts: z.ZodNumber;
12594
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12595
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
12596
+ reason: z.ZodString;
12597
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
12598
+ requested_by: z.ZodObject<{
12599
+ user_id: z.ZodString;
12600
+ login_id: z.ZodOptional<z.ZodString>;
12601
+ name: z.ZodOptional<z.ZodString>;
12602
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12603
+ user_id: z.ZodString;
12604
+ login_id: z.ZodOptional<z.ZodString>;
12605
+ name: z.ZodOptional<z.ZodString>;
12606
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
12607
+ user_id: z.ZodString;
12608
+ login_id: z.ZodOptional<z.ZodString>;
12609
+ name: z.ZodOptional<z.ZodString>;
12610
+ }, z.ZodTypeAny, "passthrough">>;
12611
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
12612
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
12613
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
12614
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
12615
+ error: z.ZodOptional<z.ZodObject<{
12616
+ http_status: z.ZodOptional<z.ZodNumber>;
12617
+ code: z.ZodOptional<z.ZodString>;
12618
+ description: z.ZodOptional<z.ZodString>;
12619
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12620
+ http_status: z.ZodOptional<z.ZodNumber>;
12621
+ code: z.ZodOptional<z.ZodString>;
12622
+ description: z.ZodOptional<z.ZodString>;
12623
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
12624
+ http_status: z.ZodOptional<z.ZodNumber>;
12625
+ code: z.ZodOptional<z.ZodString>;
12626
+ description: z.ZodOptional<z.ZodString>;
12627
+ }, z.ZodTypeAny, "passthrough">>>;
12628
+ attempts: z.ZodNumber;
12629
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
12630
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
12631
+ reason: z.ZodString;
12632
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
12633
+ requested_by: z.ZodObject<{
12634
+ user_id: z.ZodString;
12635
+ login_id: z.ZodOptional<z.ZodString>;
12636
+ name: z.ZodOptional<z.ZodString>;
12637
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12638
+ user_id: z.ZodString;
12639
+ login_id: z.ZodOptional<z.ZodString>;
12640
+ name: z.ZodOptional<z.ZodString>;
12641
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
12642
+ user_id: z.ZodString;
12643
+ login_id: z.ZodOptional<z.ZodString>;
12644
+ name: z.ZodOptional<z.ZodString>;
12645
+ }, z.ZodTypeAny, "passthrough">>;
12646
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
12647
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
12648
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
12649
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
12650
+ error: z.ZodOptional<z.ZodObject<{
12651
+ http_status: z.ZodOptional<z.ZodNumber>;
12652
+ code: z.ZodOptional<z.ZodString>;
12653
+ description: z.ZodOptional<z.ZodString>;
12654
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12655
+ http_status: z.ZodOptional<z.ZodNumber>;
12656
+ code: z.ZodOptional<z.ZodString>;
12657
+ description: z.ZodOptional<z.ZodString>;
12658
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
12659
+ http_status: z.ZodOptional<z.ZodNumber>;
12660
+ code: z.ZodOptional<z.ZodString>;
12661
+ description: z.ZodOptional<z.ZodString>;
12662
+ }, z.ZodTypeAny, "passthrough">>>;
12663
+ attempts: z.ZodNumber;
12664
+ }, z.ZodTypeAny, "passthrough">>;
12558
12665
  export declare const zServiceInvoiceSchema: z.ZodObject<{
12559
12666
  id: z.ZodString;
12560
12667
  ref: z.ZodAny;
@@ -13008,6 +13115,112 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
13008
13115
  code: z.ZodOptional<z.ZodString>;
13009
13116
  details: z.ZodOptional<z.ZodUnknown>;
13010
13117
  }, z.ZodTypeAny, "passthrough">>>>;
13118
+ cancellation: z.ZodOptional<z.ZodObject<{
13119
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
13120
+ reason: z.ZodString;
13121
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
13122
+ requested_by: z.ZodObject<{
13123
+ user_id: z.ZodString;
13124
+ login_id: z.ZodOptional<z.ZodString>;
13125
+ name: z.ZodOptional<z.ZodString>;
13126
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13127
+ user_id: z.ZodString;
13128
+ login_id: z.ZodOptional<z.ZodString>;
13129
+ name: z.ZodOptional<z.ZodString>;
13130
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13131
+ user_id: z.ZodString;
13132
+ login_id: z.ZodOptional<z.ZodString>;
13133
+ name: z.ZodOptional<z.ZodString>;
13134
+ }, z.ZodTypeAny, "passthrough">>;
13135
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
13136
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13137
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13138
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
13139
+ error: z.ZodOptional<z.ZodObject<{
13140
+ http_status: z.ZodOptional<z.ZodNumber>;
13141
+ code: z.ZodOptional<z.ZodString>;
13142
+ description: z.ZodOptional<z.ZodString>;
13143
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13144
+ http_status: z.ZodOptional<z.ZodNumber>;
13145
+ code: z.ZodOptional<z.ZodString>;
13146
+ description: z.ZodOptional<z.ZodString>;
13147
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13148
+ http_status: z.ZodOptional<z.ZodNumber>;
13149
+ code: z.ZodOptional<z.ZodString>;
13150
+ description: z.ZodOptional<z.ZodString>;
13151
+ }, z.ZodTypeAny, "passthrough">>>;
13152
+ attempts: z.ZodNumber;
13153
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13154
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
13155
+ reason: z.ZodString;
13156
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
13157
+ requested_by: z.ZodObject<{
13158
+ user_id: z.ZodString;
13159
+ login_id: z.ZodOptional<z.ZodString>;
13160
+ name: z.ZodOptional<z.ZodString>;
13161
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13162
+ user_id: z.ZodString;
13163
+ login_id: z.ZodOptional<z.ZodString>;
13164
+ name: z.ZodOptional<z.ZodString>;
13165
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13166
+ user_id: z.ZodString;
13167
+ login_id: z.ZodOptional<z.ZodString>;
13168
+ name: z.ZodOptional<z.ZodString>;
13169
+ }, z.ZodTypeAny, "passthrough">>;
13170
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
13171
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13172
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13173
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
13174
+ error: z.ZodOptional<z.ZodObject<{
13175
+ http_status: z.ZodOptional<z.ZodNumber>;
13176
+ code: z.ZodOptional<z.ZodString>;
13177
+ description: z.ZodOptional<z.ZodString>;
13178
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13179
+ http_status: z.ZodOptional<z.ZodNumber>;
13180
+ code: z.ZodOptional<z.ZodString>;
13181
+ description: z.ZodOptional<z.ZodString>;
13182
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13183
+ http_status: z.ZodOptional<z.ZodNumber>;
13184
+ code: z.ZodOptional<z.ZodString>;
13185
+ description: z.ZodOptional<z.ZodString>;
13186
+ }, z.ZodTypeAny, "passthrough">>>;
13187
+ attempts: z.ZodNumber;
13188
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13189
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
13190
+ reason: z.ZodString;
13191
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
13192
+ requested_by: z.ZodObject<{
13193
+ user_id: z.ZodString;
13194
+ login_id: z.ZodOptional<z.ZodString>;
13195
+ name: z.ZodOptional<z.ZodString>;
13196
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13197
+ user_id: z.ZodString;
13198
+ login_id: z.ZodOptional<z.ZodString>;
13199
+ name: z.ZodOptional<z.ZodString>;
13200
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13201
+ user_id: z.ZodString;
13202
+ login_id: z.ZodOptional<z.ZodString>;
13203
+ name: z.ZodOptional<z.ZodString>;
13204
+ }, z.ZodTypeAny, "passthrough">>;
13205
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
13206
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13207
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13208
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
13209
+ error: z.ZodOptional<z.ZodObject<{
13210
+ http_status: z.ZodOptional<z.ZodNumber>;
13211
+ code: z.ZodOptional<z.ZodString>;
13212
+ description: z.ZodOptional<z.ZodString>;
13213
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13214
+ http_status: z.ZodOptional<z.ZodNumber>;
13215
+ code: z.ZodOptional<z.ZodString>;
13216
+ description: z.ZodOptional<z.ZodString>;
13217
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13218
+ http_status: z.ZodOptional<z.ZodNumber>;
13219
+ code: z.ZodOptional<z.ZodString>;
13220
+ description: z.ZodOptional<z.ZodString>;
13221
+ }, z.ZodTypeAny, "passthrough">>>;
13222
+ attempts: z.ZodNumber;
13223
+ }, z.ZodTypeAny, "passthrough">>>;
13011
13224
  trace: z.ZodOptional<z.ZodObject<{
13012
13225
  provider_id: z.ZodString;
13013
13226
  account_id: z.ZodOptional<z.ZodString>;
@@ -13505,6 +13718,112 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
13505
13718
  code: z.ZodOptional<z.ZodString>;
13506
13719
  details: z.ZodOptional<z.ZodUnknown>;
13507
13720
  }, z.ZodTypeAny, "passthrough">>>>;
13721
+ cancellation: z.ZodOptional<z.ZodObject<{
13722
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
13723
+ reason: z.ZodString;
13724
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
13725
+ requested_by: z.ZodObject<{
13726
+ user_id: z.ZodString;
13727
+ login_id: z.ZodOptional<z.ZodString>;
13728
+ name: z.ZodOptional<z.ZodString>;
13729
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13730
+ user_id: z.ZodString;
13731
+ login_id: z.ZodOptional<z.ZodString>;
13732
+ name: z.ZodOptional<z.ZodString>;
13733
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13734
+ user_id: z.ZodString;
13735
+ login_id: z.ZodOptional<z.ZodString>;
13736
+ name: z.ZodOptional<z.ZodString>;
13737
+ }, z.ZodTypeAny, "passthrough">>;
13738
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
13739
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13740
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13741
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
13742
+ error: z.ZodOptional<z.ZodObject<{
13743
+ http_status: z.ZodOptional<z.ZodNumber>;
13744
+ code: z.ZodOptional<z.ZodString>;
13745
+ description: z.ZodOptional<z.ZodString>;
13746
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13747
+ http_status: z.ZodOptional<z.ZodNumber>;
13748
+ code: z.ZodOptional<z.ZodString>;
13749
+ description: z.ZodOptional<z.ZodString>;
13750
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13751
+ http_status: z.ZodOptional<z.ZodNumber>;
13752
+ code: z.ZodOptional<z.ZodString>;
13753
+ description: z.ZodOptional<z.ZodString>;
13754
+ }, z.ZodTypeAny, "passthrough">>>;
13755
+ attempts: z.ZodNumber;
13756
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13757
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
13758
+ reason: z.ZodString;
13759
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
13760
+ requested_by: z.ZodObject<{
13761
+ user_id: z.ZodString;
13762
+ login_id: z.ZodOptional<z.ZodString>;
13763
+ name: z.ZodOptional<z.ZodString>;
13764
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13765
+ user_id: z.ZodString;
13766
+ login_id: z.ZodOptional<z.ZodString>;
13767
+ name: z.ZodOptional<z.ZodString>;
13768
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13769
+ user_id: z.ZodString;
13770
+ login_id: z.ZodOptional<z.ZodString>;
13771
+ name: z.ZodOptional<z.ZodString>;
13772
+ }, z.ZodTypeAny, "passthrough">>;
13773
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
13774
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13775
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13776
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
13777
+ error: z.ZodOptional<z.ZodObject<{
13778
+ http_status: z.ZodOptional<z.ZodNumber>;
13779
+ code: z.ZodOptional<z.ZodString>;
13780
+ description: z.ZodOptional<z.ZodString>;
13781
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13782
+ http_status: z.ZodOptional<z.ZodNumber>;
13783
+ code: z.ZodOptional<z.ZodString>;
13784
+ description: z.ZodOptional<z.ZodString>;
13785
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13786
+ http_status: z.ZodOptional<z.ZodNumber>;
13787
+ code: z.ZodOptional<z.ZodString>;
13788
+ description: z.ZodOptional<z.ZodString>;
13789
+ }, z.ZodTypeAny, "passthrough">>>;
13790
+ attempts: z.ZodNumber;
13791
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13792
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
13793
+ reason: z.ZodString;
13794
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
13795
+ requested_by: z.ZodObject<{
13796
+ user_id: z.ZodString;
13797
+ login_id: z.ZodOptional<z.ZodString>;
13798
+ name: z.ZodOptional<z.ZodString>;
13799
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13800
+ user_id: z.ZodString;
13801
+ login_id: z.ZodOptional<z.ZodString>;
13802
+ name: z.ZodOptional<z.ZodString>;
13803
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13804
+ user_id: z.ZodString;
13805
+ login_id: z.ZodOptional<z.ZodString>;
13806
+ name: z.ZodOptional<z.ZodString>;
13807
+ }, z.ZodTypeAny, "passthrough">>;
13808
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
13809
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13810
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
13811
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
13812
+ error: z.ZodOptional<z.ZodObject<{
13813
+ http_status: z.ZodOptional<z.ZodNumber>;
13814
+ code: z.ZodOptional<z.ZodString>;
13815
+ description: z.ZodOptional<z.ZodString>;
13816
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
13817
+ http_status: z.ZodOptional<z.ZodNumber>;
13818
+ code: z.ZodOptional<z.ZodString>;
13819
+ description: z.ZodOptional<z.ZodString>;
13820
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
13821
+ http_status: z.ZodOptional<z.ZodNumber>;
13822
+ code: z.ZodOptional<z.ZodString>;
13823
+ description: z.ZodOptional<z.ZodString>;
13824
+ }, z.ZodTypeAny, "passthrough">>>;
13825
+ attempts: z.ZodNumber;
13826
+ }, z.ZodTypeAny, "passthrough">>>;
13508
13827
  trace: z.ZodOptional<z.ZodObject<{
13509
13828
  provider_id: z.ZodString;
13510
13829
  account_id: z.ZodOptional<z.ZodString>;
@@ -14002,6 +14321,112 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
14002
14321
  code: z.ZodOptional<z.ZodString>;
14003
14322
  details: z.ZodOptional<z.ZodUnknown>;
14004
14323
  }, z.ZodTypeAny, "passthrough">>>>;
14324
+ cancellation: z.ZodOptional<z.ZodObject<{
14325
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
14326
+ reason: z.ZodString;
14327
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
14328
+ requested_by: z.ZodObject<{
14329
+ user_id: z.ZodString;
14330
+ login_id: z.ZodOptional<z.ZodString>;
14331
+ name: z.ZodOptional<z.ZodString>;
14332
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14333
+ user_id: z.ZodString;
14334
+ login_id: z.ZodOptional<z.ZodString>;
14335
+ name: z.ZodOptional<z.ZodString>;
14336
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14337
+ user_id: z.ZodString;
14338
+ login_id: z.ZodOptional<z.ZodString>;
14339
+ name: z.ZodOptional<z.ZodString>;
14340
+ }, z.ZodTypeAny, "passthrough">>;
14341
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
14342
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
14343
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
14344
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
14345
+ error: z.ZodOptional<z.ZodObject<{
14346
+ http_status: z.ZodOptional<z.ZodNumber>;
14347
+ code: z.ZodOptional<z.ZodString>;
14348
+ description: z.ZodOptional<z.ZodString>;
14349
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14350
+ http_status: z.ZodOptional<z.ZodNumber>;
14351
+ code: z.ZodOptional<z.ZodString>;
14352
+ description: z.ZodOptional<z.ZodString>;
14353
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14354
+ http_status: z.ZodOptional<z.ZodNumber>;
14355
+ code: z.ZodOptional<z.ZodString>;
14356
+ description: z.ZodOptional<z.ZodString>;
14357
+ }, z.ZodTypeAny, "passthrough">>>;
14358
+ attempts: z.ZodNumber;
14359
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14360
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
14361
+ reason: z.ZodString;
14362
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
14363
+ requested_by: z.ZodObject<{
14364
+ user_id: z.ZodString;
14365
+ login_id: z.ZodOptional<z.ZodString>;
14366
+ name: z.ZodOptional<z.ZodString>;
14367
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14368
+ user_id: z.ZodString;
14369
+ login_id: z.ZodOptional<z.ZodString>;
14370
+ name: z.ZodOptional<z.ZodString>;
14371
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14372
+ user_id: z.ZodString;
14373
+ login_id: z.ZodOptional<z.ZodString>;
14374
+ name: z.ZodOptional<z.ZodString>;
14375
+ }, z.ZodTypeAny, "passthrough">>;
14376
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
14377
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
14378
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
14379
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
14380
+ error: z.ZodOptional<z.ZodObject<{
14381
+ http_status: z.ZodOptional<z.ZodNumber>;
14382
+ code: z.ZodOptional<z.ZodString>;
14383
+ description: z.ZodOptional<z.ZodString>;
14384
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14385
+ http_status: z.ZodOptional<z.ZodNumber>;
14386
+ code: z.ZodOptional<z.ZodString>;
14387
+ description: z.ZodOptional<z.ZodString>;
14388
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14389
+ http_status: z.ZodOptional<z.ZodNumber>;
14390
+ code: z.ZodOptional<z.ZodString>;
14391
+ description: z.ZodOptional<z.ZodString>;
14392
+ }, z.ZodTypeAny, "passthrough">>>;
14393
+ attempts: z.ZodNumber;
14394
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14395
+ status: z.ZodEnum<["requesting", "requested", "failed"]>;
14396
+ reason: z.ZodString;
14397
+ requested_at: z.ZodEffects<z.ZodDate, Date, unknown>;
14398
+ requested_by: z.ZodObject<{
14399
+ user_id: z.ZodString;
14400
+ login_id: z.ZodOptional<z.ZodString>;
14401
+ name: z.ZodOptional<z.ZodString>;
14402
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14403
+ user_id: z.ZodString;
14404
+ login_id: z.ZodOptional<z.ZodString>;
14405
+ name: z.ZodOptional<z.ZodString>;
14406
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14407
+ user_id: z.ZodString;
14408
+ login_id: z.ZodOptional<z.ZodString>;
14409
+ name: z.ZodOptional<z.ZodString>;
14410
+ }, z.ZodTypeAny, "passthrough">>;
14411
+ previous_state: z.ZodEnum<["DRAFT", "SENT", "SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>;
14412
+ previous_provider_status: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
14413
+ provider_status_at_response: z.ZodOptional<z.ZodEnum<["SCHEDULED", "SYNCHRONIZED", "AUTHORIZED", "PROCESSING_CANCELLATION", "CANCELED", "CANCELLATION_DENIED", "ERROR"]>>;
14414
+ responded_at: z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>;
14415
+ error: z.ZodOptional<z.ZodObject<{
14416
+ http_status: z.ZodOptional<z.ZodNumber>;
14417
+ code: z.ZodOptional<z.ZodString>;
14418
+ description: z.ZodOptional<z.ZodString>;
14419
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14420
+ http_status: z.ZodOptional<z.ZodNumber>;
14421
+ code: z.ZodOptional<z.ZodString>;
14422
+ description: z.ZodOptional<z.ZodString>;
14423
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14424
+ http_status: z.ZodOptional<z.ZodNumber>;
14425
+ code: z.ZodOptional<z.ZodString>;
14426
+ description: z.ZodOptional<z.ZodString>;
14427
+ }, z.ZodTypeAny, "passthrough">>>;
14428
+ attempts: z.ZodNumber;
14429
+ }, z.ZodTypeAny, "passthrough">>>;
14005
14430
  trace: z.ZodOptional<z.ZodObject<{
14006
14431
  provider_id: z.ZodString;
14007
14432
  account_id: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  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.zAsaasEnvFlagSchema = 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.zNfseFeeReimbursementExecuteSchema = exports.zNfseFeeReimbursementCompetenciaSchema = exports.zNexFinopsPaymentMethodsDiscoverSchema = exports.zNexFinopsBillingCardChargeSweepSchema = exports.zEvoBillingPortalCardCaptureSchema = exports.zNexFinopsBillingCardChargeSchema = exports.zNexFinopsContractPaymentMethodsWriteSchema = exports.zNexFinopsPaymentMethodPatchSchema = exports.zNexFinopsPaymentMethodStatusSchema = exports.zNexFinopsPaymentMethodKindSchema = 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 = exports.zProviderInvoiceLinksSchema = void 0;
4
+ exports.zNfseFeeReimbursementExecuteSchema = exports.zNfseFeeReimbursementCompetenciaSchema = exports.zNexFinopsPaymentMethodsDiscoverSchema = exports.zNexFinopsBillingCardChargeSweepSchema = exports.zEvoBillingPortalCardCaptureSchema = exports.zNexFinopsBillingCardChargeSchema = exports.zNexFinopsContractPaymentMethodsWriteSchema = exports.zNexFinopsPaymentMethodPatchSchema = exports.zNexFinopsPaymentMethodStatusSchema = exports.zNexFinopsPaymentMethodKindSchema = 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.zServiceInvoiceCancellationSchema = exports.zNfseCancellationStatusSchema = exports.zPaymentLinkSchema = exports.zPaymentLinkDocumentStateSchema = exports.zAsaasPaymentLinkSubscriptionCycleSchema = exports.zAsaasPaymentLinkChargeTypeSchema = exports.zAsaasPaymentLinkBillingTypeSchema = exports.zProviderPayloadSnapshotSchema = exports.zProviderTraceSchema = exports.zProviderInvoiceErrorSchema = exports.zProviderInvoiceIdentifiersSchema = exports.zProviderInvoiceLinksSchema = 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 ----
@@ -638,6 +638,39 @@ exports.zPaymentLinkSchema = zod_schemas_1.zFireDocSchema
638
638
  .optional(),
639
639
  })
640
640
  .passthrough();
641
+ // ---- Cancelamento de NFS-e (feat-291) ----
642
+ exports.zNfseCancellationStatusSchema = zod_1.z.enum([
643
+ "requesting",
644
+ "requested",
645
+ "failed",
646
+ ]);
647
+ exports.zServiceInvoiceCancellationSchema = zod_1.z
648
+ .object({
649
+ status: exports.zNfseCancellationStatusSchema,
650
+ reason: zod_1.z.string(),
651
+ requested_at: zod_schemas_1.zFirestoreDateSchema,
652
+ requested_by: zod_1.z
653
+ .object({
654
+ user_id: zod_1.z.string(),
655
+ login_id: zod_1.z.string().optional(),
656
+ name: zod_1.z.string().optional(),
657
+ })
658
+ .passthrough(),
659
+ previous_state: exports.zServiceInvoiceStateSchema,
660
+ previous_provider_status: exports.zProviderServiceInvoiceStatusSchema.optional(),
661
+ provider_status_at_response: exports.zProviderServiceInvoiceStatusSchema.optional(),
662
+ responded_at: zod_schemas_1.zFirestoreDateSchema.optional(),
663
+ error: zod_1.z
664
+ .object({
665
+ http_status: zod_1.z.number().optional(),
666
+ code: zod_1.z.string().optional(),
667
+ description: zod_1.z.string().optional(),
668
+ })
669
+ .passthrough()
670
+ .optional(),
671
+ attempts: zod_1.z.number().int().nonnegative(),
672
+ })
673
+ .passthrough();
641
674
  exports.zServiceInvoiceSchema = zod_schemas_1.zFireDocSchema
642
675
  .extend({
643
676
  providerId: zod_1.z.string(),
@@ -696,6 +729,7 @@ exports.zServiceInvoiceSchema = zod_schemas_1.zFireDocSchema
696
729
  authorized_at: zod_schemas_1.zFirestoreDateSchema.optional(),
697
730
  canceled_at: zod_schemas_1.zFirestoreDateSchema.optional(),
698
731
  error: exports.zProviderInvoiceErrorSchema.nullable().optional(),
732
+ cancellation: exports.zServiceInvoiceCancellationSchema.optional(),
699
733
  trace: exports.zProviderTraceSchema.optional(),
700
734
  snapshots: zod_1.z.array(exports.zProviderPayloadSnapshotSchema).optional(),
701
735
  })
@@ -697,6 +697,42 @@ export const zPaymentLinkSchema = zFireDocSchema
697
697
  })
698
698
  .passthrough();
699
699
 
700
+ // ---- Cancelamento de NFS-e (feat-291) ----
701
+
702
+ export const zNfseCancellationStatusSchema = z.enum([
703
+ "requesting",
704
+ "requested",
705
+ "failed",
706
+ ]);
707
+
708
+ export const zServiceInvoiceCancellationSchema = z
709
+ .object({
710
+ status: zNfseCancellationStatusSchema,
711
+ reason: z.string(),
712
+ requested_at: zFirestoreDateSchema,
713
+ requested_by: z
714
+ .object({
715
+ user_id: z.string(),
716
+ login_id: z.string().optional(),
717
+ name: z.string().optional(),
718
+ })
719
+ .passthrough(),
720
+ previous_state: zServiceInvoiceStateSchema,
721
+ previous_provider_status: zProviderServiceInvoiceStatusSchema.optional(),
722
+ provider_status_at_response: zProviderServiceInvoiceStatusSchema.optional(),
723
+ responded_at: zFirestoreDateSchema.optional(),
724
+ error: z
725
+ .object({
726
+ http_status: z.number().optional(),
727
+ code: z.string().optional(),
728
+ description: z.string().optional(),
729
+ })
730
+ .passthrough()
731
+ .optional(),
732
+ attempts: z.number().int().nonnegative(),
733
+ })
734
+ .passthrough();
735
+
700
736
  export const zServiceInvoiceSchema = zFireDocSchema
701
737
  .extend({
702
738
  providerId: z.string(),
@@ -757,6 +793,7 @@ export const zServiceInvoiceSchema = zFireDocSchema
757
793
  authorized_at: zFirestoreDateSchema.optional(),
758
794
  canceled_at: zFirestoreDateSchema.optional(),
759
795
  error: zProviderInvoiceErrorSchema.nullable().optional(),
796
+ cancellation: zServiceInvoiceCancellationSchema.optional(),
760
797
  trace: zProviderTraceSchema.optional(),
761
798
  snapshots: z.array(zProviderPayloadSnapshotSchema).optional(),
762
799
  })
@@ -1521,6 +1521,8 @@ export declare const zMedCalendarSchema: z.ZodObject<{
1521
1521
  }, z.ZodTypeAny, "passthrough">>>>;
1522
1522
  available_weekdays: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>>;
1523
1523
  available_for_hubia: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodBoolean>>>;
1524
+ hubia_appointment_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>, "many">>>;
1525
+ hubia_payment_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["private", "insurance"]>, "many">>>;
1524
1526
  integration: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1525
1527
  adapter_id: z.ZodString;
1526
1528
  credentials_id: z.ZodString;
@@ -3272,6 +3274,8 @@ export declare const zMedCalendarSchema: z.ZodObject<{
3272
3274
  }, z.ZodTypeAny, "passthrough">>>>;
3273
3275
  available_weekdays: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>>;
3274
3276
  available_for_hubia: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodBoolean>>>;
3277
+ hubia_appointment_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>, "many">>>;
3278
+ hubia_payment_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["private", "insurance"]>, "many">>>;
3275
3279
  integration: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3276
3280
  adapter_id: z.ZodString;
3277
3281
  credentials_id: z.ZodString;
@@ -5023,6 +5027,8 @@ export declare const zMedCalendarSchema: z.ZodObject<{
5023
5027
  }, z.ZodTypeAny, "passthrough">>>>;
5024
5028
  available_weekdays: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>>>;
5025
5029
  available_for_hubia: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodBoolean>>>;
5030
+ hubia_appointment_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["blocked", "consultation", "follow_up", "procedure", "surgery", "exam", "evaluation", "emergency", "check_up", "vaccination", "fit_test", "therapy", "meeting"]>, "many">>>;
5031
+ hubia_payment_types: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["private", "insurance"]>, "many">>>;
5026
5032
  integration: z.ZodOptional<z.ZodNullable<z.ZodObject<{
5027
5033
  adapter_id: z.ZodString;
5028
5034
  credentials_id: z.ZodString;
@@ -5,6 +5,7 @@ const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../../shared/zod-schemas");
6
6
  const zod_schemas_2 = require("../people/zod-schemas");
7
7
  const zod_schemas_3 = require("../../evo-integrations/zod-schemas");
8
+ const zod_schemas_4 = require("../dic/zod-schemas");
8
9
  // ----- Notification config (feat-048) — molde do `sync_config`: estruturado +
9
10
  // `.passthrough()` p/ tolerar campos futuros sem republish.
10
11
  //
@@ -197,6 +198,9 @@ exports.zMedCalendarSchema = zod_schemas_1.zFireDocSchema
197
198
  .nullable()
198
199
  .optional(),
199
200
  available_for_hubia: zod_1.z.boolean().default(false).nullable().optional(),
201
+ // feat-287 — filtros da HubIA por agenda. Vazio/ausente = aceita tudo.
202
+ hubia_appointment_types: zod_1.z.array(zod_schemas_4.zDicAppointmentTypeBaseSchema).nullable().optional(),
203
+ hubia_payment_types: zod_1.z.array(zod_1.z.enum(["private", "insurance"])).nullable().optional(),
200
204
  integration: zod_schemas_3.zMedCalendarIntegrationSchema.nullable().optional(),
201
205
  notification_config: exports.zMedCalendarNotificationConfigSchema.nullable().optional(),
202
206
  virtual_care: exports.zMedCalendarVirtualCareConfigSchema.nullable().optional(),
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  import { zFireDocSchema, zTagSchema } from "../../shared/zod-schemas";
3
3
  import { zAppointmentCountersSchema } from "../people/zod-schemas";
4
4
  import { zMedCalendarIntegrationSchema } from "../../evo-integrations/zod-schemas";
5
+ import { zDicAppointmentTypeBaseSchema } from "../dic/zod-schemas";
5
6
 
6
7
  // ----- Notification config (feat-048) — molde do `sync_config`: estruturado +
7
8
  // `.passthrough()` p/ tolerar campos futuros sem republish.
@@ -205,6 +206,9 @@ export const zMedCalendarSchema = zFireDocSchema
205
206
  .nullable()
206
207
  .optional(),
207
208
  available_for_hubia: z.boolean().default(false).nullable().optional(),
209
+ // feat-287 — filtros da HubIA por agenda. Vazio/ausente = aceita tudo.
210
+ hubia_appointment_types: z.array(zDicAppointmentTypeBaseSchema).nullable().optional(),
211
+ hubia_payment_types: z.array(z.enum(["private", "insurance"])).nullable().optional(),
208
212
  integration: zMedCalendarIntegrationSchema.nullable().optional(),
209
213
  notification_config: zMedCalendarNotificationConfigSchema.nullable().optional(),
210
214
  virtual_care: zMedCalendarVirtualCareConfigSchema.nullable().optional(),
package/dist/index.d.ts CHANGED
@@ -73,6 +73,7 @@ export * from "./apps/evo-tags/zod-schemas";
73
73
  export * from "./apps/evo-task/zod-schemas";
74
74
  export * from "./apps/evo-survey/zod-schemas";
75
75
  export * from "./apps/evo-finops/zod-schemas";
76
+ export * from "./apps/evo-finops/nfse-cancel";
76
77
  export * from "./apps/evo-notif-user/zod-schemas";
77
78
  export * from "./apps/evo-notifications/zod-schemas";
78
79
  export * from "./apps/evo-notifications/quick-reply-action/zod-schemas";
package/dist/index.js CHANGED
@@ -91,6 +91,7 @@ __exportStar(require("./apps/evo-tags/zod-schemas"), exports);
91
91
  __exportStar(require("./apps/evo-task/zod-schemas"), exports);
92
92
  __exportStar(require("./apps/evo-survey/zod-schemas"), exports);
93
93
  __exportStar(require("./apps/evo-finops/zod-schemas"), exports);
94
+ __exportStar(require("./apps/evo-finops/nfse-cancel"), exports);
94
95
  __exportStar(require("./apps/evo-notif-user/zod-schemas"), exports);
95
96
  __exportStar(require("./apps/evo-notifications/zod-schemas"), exports);
96
97
  __exportStar(require("./apps/evo-notifications/quick-reply-action/zod-schemas"), exports);
package/dist/index.ts CHANGED
@@ -76,6 +76,7 @@ export * from "./apps/evo-tags/zod-schemas";
76
76
  export * from "./apps/evo-task/zod-schemas";
77
77
  export * from "./apps/evo-survey/zod-schemas";
78
78
  export * from "./apps/evo-finops/zod-schemas";
79
+ export * from "./apps/evo-finops/nfse-cancel";
79
80
  export * from "./apps/evo-notif-user/zod-schemas";
80
81
  export * from "./apps/evo-notifications/zod-schemas";
81
82
  export * from "./apps/evo-notifications/quick-reply-action/zod-schemas";
@@ -105,6 +105,52 @@ export interface IProviderInvoiceError {
105
105
  code?: string;
106
106
  details?: unknown;
107
107
  }
108
+ /**
109
+ * Situação do pedido de cancelamento feito pela plataforma.
110
+ * - `requesting`: trava gravada, chamada ao provedor em andamento.
111
+ * - `requested`: provedor aceitou o pedido (o estado final chega pelo webhook).
112
+ * - `failed`: provedor recusou ou a chamada falhou; o estado da nota não muda.
113
+ */
114
+ export type NfseCancellationStatus = "requesting" | "requested" | "failed";
115
+ /** Registro do pedido de cancelamento de uma NFS-e (auditoria: quem, quando, por quê). */
116
+ export interface IServiceInvoiceCancellation {
117
+ status: NfseCancellationStatus;
118
+ /** Motivo obrigatório (5–500 caracteres), guardado só na plataforma — o Asaas não recebe motivo. */
119
+ reason: string;
120
+ requested_at: Date;
121
+ requested_by: {
122
+ user_id: string;
123
+ login_id?: string;
124
+ name?: string;
125
+ };
126
+ /** Estado da nota no momento do pedido. */
127
+ previous_state: ServiceInvoiceState;
128
+ previous_provider_status?: ProviderServiceInvoiceStatus;
129
+ /** Status devolvido pelo provedor na resposta do cancelamento. */
130
+ provider_status_at_response?: ProviderServiceInvoiceStatus;
131
+ responded_at?: Date;
132
+ error?: {
133
+ http_status?: number;
134
+ code?: string;
135
+ description?: string;
136
+ };
137
+ /** Quantas vezes o cancelamento foi pedido (inclui a tentativa atual). */
138
+ attempts: number;
139
+ }
140
+ /** Entrada do callable `finops_nfse-cancel`. */
141
+ export interface INfseCancelRequest {
142
+ tenant: string;
143
+ invoiceId: string;
144
+ reason: string;
145
+ }
146
+ /** Saída do callable `finops_nfse-cancel`. */
147
+ export interface INfseCancelResult {
148
+ invoiceId: string;
149
+ previousState: ServiceInvoiceState;
150
+ state: ServiceInvoiceState;
151
+ providerStatus?: ProviderServiceInvoiceStatus;
152
+ message: string;
153
+ }
108
154
  export interface IServiceInvoice extends IFireDoc {
109
155
  providerId: string;
110
156
  provider_name?: string;
@@ -142,6 +188,7 @@ export interface IServiceInvoice extends IFireDoc {
142
188
  authorized_at?: Date;
143
189
  canceled_at?: Date;
144
190
  error?: IProviderInvoiceError;
191
+ cancellation?: IServiceInvoiceCancellation;
145
192
  trace?: ProviderTrace;
146
193
  snapshots?: ProviderPayloadSnapshot[];
147
194
  [key: string]: unknown;
@@ -139,6 +139,58 @@ export interface IProviderInvoiceError {
139
139
  details?: unknown;
140
140
  }
141
141
 
142
+ // ---- Cancelamento de NFS-e (feat-291) ----
143
+
144
+ /**
145
+ * Situação do pedido de cancelamento feito pela plataforma.
146
+ * - `requesting`: trava gravada, chamada ao provedor em andamento.
147
+ * - `requested`: provedor aceitou o pedido (o estado final chega pelo webhook).
148
+ * - `failed`: provedor recusou ou a chamada falhou; o estado da nota não muda.
149
+ */
150
+ export type NfseCancellationStatus = "requesting" | "requested" | "failed";
151
+
152
+ /** Registro do pedido de cancelamento de uma NFS-e (auditoria: quem, quando, por quê). */
153
+ export interface IServiceInvoiceCancellation {
154
+ status: NfseCancellationStatus;
155
+ /** Motivo obrigatório (5–500 caracteres), guardado só na plataforma — o Asaas não recebe motivo. */
156
+ reason: string;
157
+ requested_at: Date;
158
+ requested_by: {
159
+ user_id: string;
160
+ login_id?: string;
161
+ name?: string;
162
+ };
163
+ /** Estado da nota no momento do pedido. */
164
+ previous_state: ServiceInvoiceState;
165
+ previous_provider_status?: ProviderServiceInvoiceStatus;
166
+ /** Status devolvido pelo provedor na resposta do cancelamento. */
167
+ provider_status_at_response?: ProviderServiceInvoiceStatus;
168
+ responded_at?: Date;
169
+ error?: {
170
+ http_status?: number;
171
+ code?: string;
172
+ description?: string;
173
+ };
174
+ /** Quantas vezes o cancelamento foi pedido (inclui a tentativa atual). */
175
+ attempts: number;
176
+ }
177
+
178
+ /** Entrada do callable `finops_nfse-cancel`. */
179
+ export interface INfseCancelRequest {
180
+ tenant: string;
181
+ invoiceId: string;
182
+ reason: string;
183
+ }
184
+
185
+ /** Saída do callable `finops_nfse-cancel`. */
186
+ export interface INfseCancelResult {
187
+ invoiceId: string;
188
+ previousState: ServiceInvoiceState;
189
+ state: ServiceInvoiceState;
190
+ providerStatus?: ProviderServiceInvoiceStatus;
191
+ message: string;
192
+ }
193
+
142
194
  export interface IServiceInvoice extends IFireDoc {
143
195
  providerId: string;
144
196
  provider_name?: string;
@@ -202,6 +254,9 @@ export interface IServiceInvoice extends IFireDoc {
202
254
  // Errors
203
255
  error?: IProviderInvoiceError;
204
256
 
257
+ // Último pedido de cancelamento feito pela plataforma (feat-291)
258
+ cancellation?: IServiceInvoiceCancellation;
259
+
205
260
  // Debug/audit
206
261
  trace?: ProviderTrace;
207
262
  snapshots?: ProviderPayloadSnapshot[]; // store last N snapshots (or store separately)
@@ -3,6 +3,7 @@ import type { FirestoreDocumentReference, IFireDoc, ITag } from "../../shared";
3
3
  import type { IAppointmentCounters } from "../people";
4
4
  import type { TelemedicineProvider } from "../appointment";
5
5
  import type { IMedCalendarIntegration } from "../../evo-integrations";
6
+ import type { AppointmentType } from "../dic";
6
7
  export declare const EvoMedCalendarPermissions: {
7
8
  readonly List: "evo_med_calendar_read";
8
9
  readonly Get: "evo_med_calendar_read";
@@ -288,6 +289,12 @@ export interface IMedCalendarVirtualCareSettings {
288
289
  * Para resolver, faça merge por nível (`{ ...DEFAULTS.recording, ...cfg.recording }`).
289
290
  */
290
291
  export declare const CALENDAR_VIRTUAL_CARE_DEFAULTS: IMedCalendarVirtualCareSettings;
292
+ /** feat-287 — forma de pagamento que uma agenda aceita para a HubIA. */
293
+ export declare const HubiaPaymentTypeEnum: {
294
+ readonly Private: "private";
295
+ readonly Insurance: "insurance";
296
+ };
297
+ export type HubiaPaymentType = (typeof HubiaPaymentTypeEnum)[keyof typeof HubiaPaymentTypeEnum];
291
298
  export interface IMedCalendar extends IFireDoc {
292
299
  calendarId: string;
293
300
  color?: string;
@@ -315,6 +322,17 @@ export interface IMedCalendar extends IFireDoc {
315
322
  appointmentCounters?: IAppointmentCounters | null;
316
323
  available_weekdays?: number[] | null;
317
324
  available_for_hubia?: boolean | null;
325
+ /**
326
+ * feat-287 — tipos de atendimento que a HubIA pode oferecer/agendar nesta
327
+ * agenda (`check_schedule_availability.tipo`, `schedule_appointment.tipo`).
328
+ * Vazio ou ausente = aceita todos.
329
+ */
330
+ hubia_appointment_types?: AppointmentType[] | null;
331
+ /**
332
+ * feat-287 — formas de pagamento aceitas nesta agenda para a HubIA
333
+ * (`check_schedule_availability.pagamento`). Vazio ou ausente = aceita todas.
334
+ */
335
+ hubia_payment_types?: HubiaPaymentType[] | null;
318
336
  integration?: IMedCalendarIntegration | null;
319
337
  notification_config?: IMedCalendarNotificationConfig | null;
320
338
  /**
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.CALENDAR_VIRTUAL_CARE_DEFAULTS = exports.VIRTUAL_CARE_MAX_DURATION_MINUTES_MAX = exports.VIRTUAL_CARE_MAX_DURATION_MINUTES_MIN = exports.VIRTUAL_CARE_RETENTION_DAYS_MAX = exports.VIRTUAL_CARE_RETENTION_DAYS_MIN = exports.VirtualCareRecordingModeEnum = exports.MedCalendarNotificationConfigKeys = exports.EvoMedCalendarPermissions = void 0;
17
+ exports.HubiaPaymentTypeEnum = exports.CALENDAR_VIRTUAL_CARE_DEFAULTS = exports.VIRTUAL_CARE_MAX_DURATION_MINUTES_MAX = exports.VIRTUAL_CARE_MAX_DURATION_MINUTES_MIN = exports.VIRTUAL_CARE_RETENTION_DAYS_MAX = exports.VIRTUAL_CARE_RETENTION_DAYS_MIN = exports.VirtualCareRecordingModeEnum = exports.MedCalendarNotificationConfigKeys = exports.EvoMedCalendarPermissions = void 0;
18
18
  __exportStar(require("../../evo-people/fb_collections"), exports);
19
19
  // Permissões para o calendário
20
20
  exports.EvoMedCalendarPermissions = {
@@ -146,3 +146,8 @@ exports.CALENDAR_VIRTUAL_CARE_DEFAULTS = {
146
146
  max_duration_minutes: 120,
147
147
  end_warning_minutes: 5,
148
148
  };
149
+ /** feat-287 — forma de pagamento que uma agenda aceita para a HubIA. */
150
+ exports.HubiaPaymentTypeEnum = {
151
+ Private: "private",
152
+ Insurance: "insurance",
153
+ };
@@ -3,6 +3,7 @@ import type { FirestoreDocumentReference, IFireDoc, ITag } from "../../shared";
3
3
  import type { IAppointmentCounters } from "../people";
4
4
  import type { TelemedicineProvider } from "../appointment";
5
5
  import type { IMedCalendarIntegration } from "../../evo-integrations";
6
+ import type { AppointmentType } from "../dic";
6
7
 
7
8
  // Permissões para o calendário
8
9
  export const EvoMedCalendarPermissions = {
@@ -352,6 +353,15 @@ export const CALENDAR_VIRTUAL_CARE_DEFAULTS: IMedCalendarVirtualCareSettings = {
352
353
  end_warning_minutes: 5,
353
354
  } as const;
354
355
 
356
+ /** feat-287 — forma de pagamento que uma agenda aceita para a HubIA. */
357
+ export const HubiaPaymentTypeEnum = {
358
+ Private: "private",
359
+ Insurance: "insurance",
360
+ } as const;
361
+
362
+ export type HubiaPaymentType =
363
+ (typeof HubiaPaymentTypeEnum)[keyof typeof HubiaPaymentTypeEnum];
364
+
355
365
  // ----- MedCalendarTypes
356
366
  export interface IMedCalendar extends IFireDoc {
357
367
  calendarId: string;
@@ -383,6 +393,17 @@ export interface IMedCalendar extends IFireDoc {
383
393
  available_weekdays?: number[] | null;
384
394
  // Se true, a agenda é elegível para oferecer horários via HubIA
385
395
  available_for_hubia?: boolean | null;
396
+ /**
397
+ * feat-287 — tipos de atendimento que a HubIA pode oferecer/agendar nesta
398
+ * agenda (`check_schedule_availability.tipo`, `schedule_appointment.tipo`).
399
+ * Vazio ou ausente = aceita todos.
400
+ */
401
+ hubia_appointment_types?: AppointmentType[] | null;
402
+ /**
403
+ * feat-287 — formas de pagamento aceitas nesta agenda para a HubIA
404
+ * (`check_schedule_availability.pagamento`). Vazio ou ausente = aceita todas.
405
+ */
406
+ hubia_payment_types?: HubiaPaymentType[] | null;
386
407
  // Config de integração (feat-004 evo-integrations). Opcional — calendars legados mantêm n8n_wf/url/ext_urls.
387
408
  integration?: IMedCalendarIntegration | null;
388
409
  // Config de notificações por-agenda (feat-048). Opcional — agendas sem lembrete não têm o bloco.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.728",
3
+ "version": "1.3.732",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",