evo360-types 1.3.670 → 1.3.673

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.
@@ -14753,10 +14753,11 @@ export declare const zNexFinopsContractPaymentMethodsWriteSchema: z.ZodObject<{
14753
14753
  * - `charge_now`: cobra no cartão salvo (`confirm` + `expected_value`).
14754
14754
  * - `send_invoice`: fatura hospedada do Asaas (`billing_type` CREDIT_CARD captura o cartão; UNDEFINED = cliente escolhe).
14755
14755
  * - `cancel_invoice`: cancela a fatura aberta (`asaas_payment_id`).
14756
+ * - `schedule` / `unschedule`: liga/desliga "cobrar no cartão no vencimento" (fatia 8).
14756
14757
  * `.strip()`: dados de cartão/token nunca entram por aqui.
14757
14758
  */
14758
14759
  export declare const zNexFinopsBillingCardChargeSchema: z.ZodObject<{
14759
- action: z.ZodEnum<["preview", "charge_now", "send_invoice", "cancel_invoice"]>;
14760
+ action: z.ZodEnum<["preview", "charge_now", "send_invoice", "cancel_invoice", "schedule", "unschedule"]>;
14760
14761
  expected_value: z.ZodOptional<z.ZodNumber>;
14761
14762
  asaas_payment_id: z.ZodOptional<z.ZodString>;
14762
14763
  confirm: z.ZodOptional<z.ZodBoolean>;
@@ -14767,7 +14768,7 @@ export declare const zNexFinopsBillingCardChargeSchema: z.ZodObject<{
14767
14768
  taker_id: z.ZodOptional<z.ZodString>;
14768
14769
  allow_early: z.ZodOptional<z.ZodBoolean>;
14769
14770
  }, "strip", z.ZodTypeAny, {
14770
- action: "send_invoice" | "cancel_invoice" | "preview" | "charge_now";
14771
+ action: "schedule" | "send_invoice" | "cancel_invoice" | "preview" | "charge_now" | "unschedule";
14771
14772
  confirm?: boolean | undefined;
14772
14773
  provider_id?: string | undefined;
14773
14774
  billing_type?: "CREDIT_CARD" | "UNDEFINED" | undefined;
@@ -14778,7 +14779,7 @@ export declare const zNexFinopsBillingCardChargeSchema: z.ZodObject<{
14778
14779
  taker_id?: string | undefined;
14779
14780
  allow_early?: boolean | undefined;
14780
14781
  }, {
14781
- action: "send_invoice" | "cancel_invoice" | "preview" | "charge_now";
14782
+ action: "schedule" | "send_invoice" | "cancel_invoice" | "preview" | "charge_now" | "unschedule";
14782
14783
  confirm?: boolean | undefined;
14783
14784
  provider_id?: string | undefined;
14784
14785
  billing_type?: "CREDIT_CARD" | "UNDEFINED" | undefined;
@@ -14804,6 +14805,24 @@ export declare const zEvoBillingPortalCardCaptureSchema: z.ZodObject<{
14804
14805
  expected_value: number;
14805
14806
  billing_id: string;
14806
14807
  }>;
14808
+ /**
14809
+ * `POST /billings/card-charge-sweep` (feat-253 fatia 8) — rotina diária disparada pelo n8n:
14810
+ * avisa e cobra as cobranças marcadas "cobrar no cartão no vencimento".
14811
+ * `today` (YYYY-MM-DD, BRT) só para reprocessar/testar; `dry_run` não cobra nem avisa.
14812
+ */
14813
+ export declare const zNexFinopsBillingCardChargeSweepSchema: z.ZodObject<{
14814
+ today: z.ZodOptional<z.ZodString>;
14815
+ dry_run: z.ZodOptional<z.ZodBoolean>;
14816
+ notify_days_before: z.ZodOptional<z.ZodNumber>;
14817
+ }, "strip", z.ZodTypeAny, {
14818
+ dry_run?: boolean | undefined;
14819
+ today?: string | undefined;
14820
+ notify_days_before?: number | undefined;
14821
+ }, {
14822
+ dry_run?: boolean | undefined;
14823
+ today?: string | undefined;
14824
+ notify_days_before?: number | undefined;
14825
+ }>;
14807
14826
  /** `POST /payment-methods/discover` — sem `confirm` é dry-run. */
14808
14827
  export declare const zNexFinopsPaymentMethodsDiscoverSchema: z.ZodObject<{
14809
14828
  customer_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.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.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 ----
@@ -970,11 +970,12 @@ exports.zNexFinopsContractPaymentMethodsWriteSchema = zod_1.z
970
970
  * - `charge_now`: cobra no cartão salvo (`confirm` + `expected_value`).
971
971
  * - `send_invoice`: fatura hospedada do Asaas (`billing_type` CREDIT_CARD captura o cartão; UNDEFINED = cliente escolhe).
972
972
  * - `cancel_invoice`: cancela a fatura aberta (`asaas_payment_id`).
973
+ * - `schedule` / `unschedule`: liga/desliga "cobrar no cartão no vencimento" (fatia 8).
973
974
  * `.strip()`: dados de cartão/token nunca entram por aqui.
974
975
  */
975
976
  exports.zNexFinopsBillingCardChargeSchema = zod_1.z
976
977
  .object({
977
- action: zod_1.z.enum(["preview", "charge_now", "send_invoice", "cancel_invoice"]),
978
+ action: zod_1.z.enum(["preview", "charge_now", "send_invoice", "cancel_invoice", "schedule", "unschedule"]),
978
979
  expected_value: zod_1.z.number().optional(),
979
980
  asaas_payment_id: zod_1.z.string().min(1).max(128).optional(),
980
981
  confirm: zod_1.z.boolean().optional(),
@@ -997,6 +998,18 @@ exports.zEvoBillingPortalCardCaptureSchema = zod_1.z
997
998
  expected_value: zod_1.z.number(),
998
999
  })
999
1000
  .strip();
1001
+ /**
1002
+ * `POST /billings/card-charge-sweep` (feat-253 fatia 8) — rotina diária disparada pelo n8n:
1003
+ * avisa e cobra as cobranças marcadas "cobrar no cartão no vencimento".
1004
+ * `today` (YYYY-MM-DD, BRT) só para reprocessar/testar; `dry_run` não cobra nem avisa.
1005
+ */
1006
+ exports.zNexFinopsBillingCardChargeSweepSchema = zod_1.z
1007
+ .object({
1008
+ today: zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
1009
+ dry_run: zod_1.z.boolean().optional(),
1010
+ notify_days_before: zod_1.z.number().int().min(0).max(10).optional(),
1011
+ })
1012
+ .strip();
1000
1013
  /** `POST /payment-methods/discover` — sem `confirm` é dry-run. */
1001
1014
  exports.zNexFinopsPaymentMethodsDiscoverSchema = zod_1.z
1002
1015
  .object({
@@ -1065,11 +1065,12 @@ export const zNexFinopsContractPaymentMethodsWriteSchema = z
1065
1065
  * - `charge_now`: cobra no cartão salvo (`confirm` + `expected_value`).
1066
1066
  * - `send_invoice`: fatura hospedada do Asaas (`billing_type` CREDIT_CARD captura o cartão; UNDEFINED = cliente escolhe).
1067
1067
  * - `cancel_invoice`: cancela a fatura aberta (`asaas_payment_id`).
1068
+ * - `schedule` / `unschedule`: liga/desliga "cobrar no cartão no vencimento" (fatia 8).
1068
1069
  * `.strip()`: dados de cartão/token nunca entram por aqui.
1069
1070
  */
1070
1071
  export const zNexFinopsBillingCardChargeSchema = z
1071
1072
  .object({
1072
- action: z.enum(["preview", "charge_now", "send_invoice", "cancel_invoice"]),
1073
+ action: z.enum(["preview", "charge_now", "send_invoice", "cancel_invoice", "schedule", "unschedule"]),
1073
1074
  expected_value: z.number().optional(),
1074
1075
  asaas_payment_id: z.string().min(1).max(128).optional(),
1075
1076
  confirm: z.boolean().optional(),
@@ -1094,6 +1095,19 @@ export const zEvoBillingPortalCardCaptureSchema = z
1094
1095
  })
1095
1096
  .strip();
1096
1097
 
1098
+ /**
1099
+ * `POST /billings/card-charge-sweep` (feat-253 fatia 8) — rotina diária disparada pelo n8n:
1100
+ * avisa e cobra as cobranças marcadas "cobrar no cartão no vencimento".
1101
+ * `today` (YYYY-MM-DD, BRT) só para reprocessar/testar; `dry_run` não cobra nem avisa.
1102
+ */
1103
+ export const zNexFinopsBillingCardChargeSweepSchema = z
1104
+ .object({
1105
+ today: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
1106
+ dry_run: z.boolean().optional(),
1107
+ notify_days_before: z.number().int().min(0).max(10).optional(),
1108
+ })
1109
+ .strip();
1110
+
1097
1111
  /** `POST /payment-methods/discover` — sem `confirm` é dry-run. */
1098
1112
  export const zNexFinopsPaymentMethodsDiscoverSchema = z
1099
1113
  .object({
@@ -145,6 +145,38 @@ export interface INexFinopsBillingCardCharge {
145
145
  capture_origin?: 'nexus' | 'portal' | null;
146
146
  }
147
147
  export type NexFinopsBillingCardCaptureStatus = 'captured' | 'no_token' | 'skipped';
148
+ /**
149
+ * feat-253 fatia 8 — "Cobrar no cartão no vencimento". O operador marca a cobrança;
150
+ * a rotina diária (`POST /billings/card-charge-sweep`, disparada pelo n8n) avisa o
151
+ * cliente alguns dias antes e cobra o cartão salvo no dia do vencimento.
152
+ *
153
+ * - `scheduled`: aguardando o vencimento;
154
+ * - `processing`: cobrança criada no Asaas e em análise (aguarda o webhook);
155
+ * - `charged`: cobrada e paga;
156
+ * - `failed`: recusada (ou erro repetido) — o operador decide o próximo passo;
157
+ * - `canceled`: desmarcada, ou a cobrança foi paga/cancelada por outro caminho.
158
+ */
159
+ export type NexFinopsBillingCardChargeScheduleStatus = 'scheduled' | 'processing' | 'charged' | 'failed' | 'canceled';
160
+ export interface INexFinopsBillingCardChargeSchedule {
161
+ status: NexFinopsBillingCardChargeScheduleStatus;
162
+ /** Método `atok_` que será cobrado (o da cobrança no momento da marcação). */
163
+ payment_method_id: string;
164
+ scheduled_at: string;
165
+ scheduled_by: {
166
+ kind: 'user' | 'system';
167
+ id: string | null;
168
+ };
169
+ /** Aviso "será cobrado no cartão em DD/MM" já disparado. */
170
+ notified_upcoming_at?: string | null;
171
+ last_attempt_at?: string | null;
172
+ attempts?: number;
173
+ /** `pay_` da cobrança feita pela rotina. */
174
+ asaas_payment_id?: string | null;
175
+ last_error?: string | null;
176
+ /** Por que saiu de `scheduled` sem cobrar (desmarcada, paga por outro meio...). */
177
+ closed_reason?: string | null;
178
+ updated_at?: string | null;
179
+ }
148
180
  export interface INexFinopsBilling extends IFireGlobalDoc {
149
181
  customer_id: string;
150
182
  customer_ref?: string | null;
@@ -176,6 +208,8 @@ export interface INexFinopsBilling extends IFireGlobalDoc {
176
208
  /** Todos os `pay_` do Asaas já associados (A e B) — chave do roteamento do webhook. Interno. */
177
209
  card_payment_ids?: string[];
178
210
  card_charge?: INexFinopsBillingCardCharge | null;
211
+ /** feat-253 fatia 8 — cobrar no cartão salvo no vencimento. */
212
+ card_charge_schedule?: INexFinopsBillingCardChargeSchedule | null;
179
213
  /** Trava curta da cobrança no cartão (`charge_now`). Interno (fora das projeções). */
180
214
  card_charge_lock?: {
181
215
  by: string | null;
@@ -178,6 +178,37 @@ export interface INexFinopsBillingCardCharge {
178
178
 
179
179
  export type NexFinopsBillingCardCaptureStatus = 'captured' | 'no_token' | 'skipped';
180
180
 
181
+ /**
182
+ * feat-253 fatia 8 — "Cobrar no cartão no vencimento". O operador marca a cobrança;
183
+ * a rotina diária (`POST /billings/card-charge-sweep`, disparada pelo n8n) avisa o
184
+ * cliente alguns dias antes e cobra o cartão salvo no dia do vencimento.
185
+ *
186
+ * - `scheduled`: aguardando o vencimento;
187
+ * - `processing`: cobrança criada no Asaas e em análise (aguarda o webhook);
188
+ * - `charged`: cobrada e paga;
189
+ * - `failed`: recusada (ou erro repetido) — o operador decide o próximo passo;
190
+ * - `canceled`: desmarcada, ou a cobrança foi paga/cancelada por outro caminho.
191
+ */
192
+ export type NexFinopsBillingCardChargeScheduleStatus = 'scheduled' | 'processing' | 'charged' | 'failed' | 'canceled';
193
+
194
+ export interface INexFinopsBillingCardChargeSchedule {
195
+ status: NexFinopsBillingCardChargeScheduleStatus;
196
+ /** Método `atok_` que será cobrado (o da cobrança no momento da marcação). */
197
+ payment_method_id: string;
198
+ scheduled_at: string;
199
+ scheduled_by: { kind: 'user' | 'system'; id: string | null };
200
+ /** Aviso "será cobrado no cartão em DD/MM" já disparado. */
201
+ notified_upcoming_at?: string | null;
202
+ last_attempt_at?: string | null;
203
+ attempts?: number;
204
+ /** `pay_` da cobrança feita pela rotina. */
205
+ asaas_payment_id?: string | null;
206
+ last_error?: string | null;
207
+ /** Por que saiu de `scheduled` sem cobrar (desmarcada, paga por outro meio...). */
208
+ closed_reason?: string | null;
209
+ updated_at?: string | null;
210
+ }
211
+
181
212
  // ── Main Document ──
182
213
 
183
214
  export interface INexFinopsBilling extends IFireGlobalDoc {
@@ -243,6 +274,8 @@ export interface INexFinopsBilling extends IFireGlobalDoc {
243
274
  /** Todos os `pay_` do Asaas já associados (A e B) — chave do roteamento do webhook. Interno. */
244
275
  card_payment_ids?: string[];
245
276
  card_charge?: INexFinopsBillingCardCharge | null;
277
+ /** feat-253 fatia 8 — cobrar no cartão salvo no vencimento. */
278
+ card_charge_schedule?: INexFinopsBillingCardChargeSchedule | null;
246
279
  /** Trava curta da cobrança no cartão (`charge_now`). Interno (fora das projeções). */
247
280
  card_charge_lock?: { by: string | null; until: string } | null;
248
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.670",
3
+ "version": "1.3.673",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",