evo360-types 1.3.667 → 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.
- package/dist/apps/evo-crm/lead/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-finops/zod-schemas.d.ts +22 -3
- package/dist/apps/evo-finops/zod-schemas.js +15 -2
- package/dist/apps/evo-finops/zod-schemas.ts +15 -1
- package/dist/apps/evo-med/insurance/zod-schemas.d.ts +6 -6
- package/dist/apps/evo-med/people/zod-schemas.d.ts +12 -12
- package/dist/apps/shared/zod-schemas.d.ts +2 -2
- package/dist/apps/shared/zod-schemas.js +4 -2
- package/dist/apps/shared/zod-schemas.ts +9 -2
- package/dist/types/evo-finops/common/billing.d.ts +34 -0
- package/dist/types/evo-finops/common/billing.ts +33 -0
- package/package.json +1 -1
|
@@ -107,7 +107,7 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
107
107
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
108
108
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
109
109
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
110
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
110
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
111
111
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
112
112
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
113
113
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -128,7 +128,7 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
128
128
|
zip: string;
|
|
129
129
|
geo?: any;
|
|
130
130
|
}, {
|
|
131
|
-
number?:
|
|
131
|
+
number?: string | undefined;
|
|
132
132
|
name?: string | undefined;
|
|
133
133
|
kind?: string | undefined;
|
|
134
134
|
country?: string | undefined;
|
|
@@ -366,7 +366,7 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
366
366
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
367
367
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
368
368
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
369
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
369
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
370
370
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
371
371
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
372
372
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -387,7 +387,7 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
387
387
|
zip: string;
|
|
388
388
|
geo?: any;
|
|
389
389
|
}, {
|
|
390
|
-
number?:
|
|
390
|
+
number?: string | undefined;
|
|
391
391
|
name?: string | undefined;
|
|
392
392
|
kind?: string | undefined;
|
|
393
393
|
country?: string | undefined;
|
|
@@ -625,7 +625,7 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
625
625
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
626
626
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
627
627
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
628
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
628
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
629
629
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
630
630
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
631
631
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -646,7 +646,7 @@ export declare const zLeadSchema: z.ZodObject<{
|
|
|
646
646
|
zip: string;
|
|
647
647
|
geo?: any;
|
|
648
648
|
}, {
|
|
649
|
-
number?:
|
|
649
|
+
number?: string | undefined;
|
|
650
650
|
name?: string | undefined;
|
|
651
651
|
kind?: string | undefined;
|
|
652
652
|
country?: string | undefined;
|
|
@@ -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({
|
|
@@ -129,7 +129,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
129
129
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
130
130
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
131
131
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
132
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
132
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
133
133
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
134
134
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
135
135
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -150,7 +150,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
150
150
|
zip: string;
|
|
151
151
|
geo?: any;
|
|
152
152
|
}, {
|
|
153
|
-
number?:
|
|
153
|
+
number?: string | undefined;
|
|
154
154
|
name?: string | undefined;
|
|
155
155
|
kind?: string | undefined;
|
|
156
156
|
country?: string | undefined;
|
|
@@ -271,7 +271,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
271
271
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
272
272
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
273
273
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
274
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
274
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
275
275
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
276
276
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
277
277
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -292,7 +292,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
292
292
|
zip: string;
|
|
293
293
|
geo?: any;
|
|
294
294
|
}, {
|
|
295
|
-
number?:
|
|
295
|
+
number?: string | undefined;
|
|
296
296
|
name?: string | undefined;
|
|
297
297
|
kind?: string | undefined;
|
|
298
298
|
country?: string | undefined;
|
|
@@ -413,7 +413,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
413
413
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
414
414
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
415
415
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
416
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
416
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
417
417
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
418
418
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
419
419
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -434,7 +434,7 @@ export declare const zInsuranceCompanySchema: z.ZodObject<{
|
|
|
434
434
|
zip: string;
|
|
435
435
|
geo?: any;
|
|
436
436
|
}, {
|
|
437
|
-
number?:
|
|
437
|
+
number?: string | undefined;
|
|
438
438
|
name?: string | undefined;
|
|
439
439
|
kind?: string | undefined;
|
|
440
440
|
country?: string | undefined;
|
|
@@ -124,7 +124,7 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
124
124
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
125
125
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
126
126
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
127
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
127
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
128
128
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
129
129
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
130
130
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -145,7 +145,7 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
145
145
|
zip: string;
|
|
146
146
|
geo?: any;
|
|
147
147
|
}, {
|
|
148
|
-
number?:
|
|
148
|
+
number?: string | undefined;
|
|
149
149
|
name?: string | undefined;
|
|
150
150
|
kind?: string | undefined;
|
|
151
151
|
country?: string | undefined;
|
|
@@ -281,7 +281,7 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
281
281
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
282
282
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
283
283
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
284
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
284
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
285
285
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
286
286
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
287
287
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -302,7 +302,7 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
302
302
|
zip: string;
|
|
303
303
|
geo?: any;
|
|
304
304
|
}, {
|
|
305
|
-
number?:
|
|
305
|
+
number?: string | undefined;
|
|
306
306
|
name?: string | undefined;
|
|
307
307
|
kind?: string | undefined;
|
|
308
308
|
country?: string | undefined;
|
|
@@ -438,7 +438,7 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
438
438
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
439
439
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
440
440
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
441
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
441
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
442
442
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
443
443
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
444
444
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -459,7 +459,7 @@ export declare const zProfessionalSchema: z.ZodObject<{
|
|
|
459
459
|
zip: string;
|
|
460
460
|
geo?: any;
|
|
461
461
|
}, {
|
|
462
|
-
number?:
|
|
462
|
+
number?: string | undefined;
|
|
463
463
|
name?: string | undefined;
|
|
464
464
|
kind?: string | undefined;
|
|
465
465
|
country?: string | undefined;
|
|
@@ -982,7 +982,7 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
982
982
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
983
983
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
984
984
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
985
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
985
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
986
986
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
987
987
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
988
988
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -1003,7 +1003,7 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
1003
1003
|
zip: string;
|
|
1004
1004
|
geo?: any;
|
|
1005
1005
|
}, {
|
|
1006
|
-
number?:
|
|
1006
|
+
number?: string | undefined;
|
|
1007
1007
|
name?: string | undefined;
|
|
1008
1008
|
kind?: string | undefined;
|
|
1009
1009
|
country?: string | undefined;
|
|
@@ -1633,7 +1633,7 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
1633
1633
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1634
1634
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1635
1635
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1636
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
1636
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
1637
1637
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1638
1638
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1639
1639
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -1654,7 +1654,7 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
1654
1654
|
zip: string;
|
|
1655
1655
|
geo?: any;
|
|
1656
1656
|
}, {
|
|
1657
|
-
number?:
|
|
1657
|
+
number?: string | undefined;
|
|
1658
1658
|
name?: string | undefined;
|
|
1659
1659
|
kind?: string | undefined;
|
|
1660
1660
|
country?: string | undefined;
|
|
@@ -2284,7 +2284,7 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
2284
2284
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
2285
2285
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
2286
2286
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
2287
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
2287
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
2288
2288
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
2289
2289
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
2290
2290
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -2305,7 +2305,7 @@ export declare const zPatientSchema: z.ZodObject<{
|
|
|
2305
2305
|
zip: string;
|
|
2306
2306
|
geo?: any;
|
|
2307
2307
|
}, {
|
|
2308
|
-
number?:
|
|
2308
|
+
number?: string | undefined;
|
|
2309
2309
|
name?: string | undefined;
|
|
2310
2310
|
kind?: string | undefined;
|
|
2311
2311
|
country?: string | undefined;
|
|
@@ -53,7 +53,7 @@ export declare const zAddressSchema: z.ZodObject<{
|
|
|
53
53
|
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
54
54
|
kind: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
55
55
|
line1: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
56
|
-
number: z.ZodDefault<z.ZodOptional<z.
|
|
56
|
+
number: z.ZodDefault<z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>>;
|
|
57
57
|
line2: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
58
58
|
neighborhood: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
59
59
|
city: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -74,7 +74,7 @@ export declare const zAddressSchema: z.ZodObject<{
|
|
|
74
74
|
zip: string;
|
|
75
75
|
geo?: any;
|
|
76
76
|
}, {
|
|
77
|
-
number?:
|
|
77
|
+
number?: string | undefined;
|
|
78
78
|
name?: string | undefined;
|
|
79
79
|
kind?: string | undefined;
|
|
80
80
|
country?: string | undefined;
|
|
@@ -73,8 +73,10 @@ exports.zAddressSchema = zod_1.z.object({
|
|
|
73
73
|
name: zod_1.z.string().max(255).optional().default(""),
|
|
74
74
|
kind: zod_1.z.string().max(255).optional().default(""),
|
|
75
75
|
line1: zod_1.z.string().max(255).optional().default(""),
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
// Externo pode mandar 284 (número): o preprocess normaliza para string. O cast
|
|
77
|
+
// fixa o tipo de ENTRADA em string — sem ele vira `unknown`, e os models que
|
|
78
|
+
// usam `z.ZodSchema<IPatient | ILead | ...>` (entrada = interface) não compilam.
|
|
79
|
+
number: zod_1.z.preprocess((v) => (v === null || v === undefined ? "" : String(v)), zod_1.z.string().max(255))
|
|
78
80
|
.optional()
|
|
79
81
|
.default(""),
|
|
80
82
|
line2: zod_1.z.string().max(255).optional().default(""),
|
|
@@ -87,8 +87,15 @@ export const zAddressSchema = z.object({
|
|
|
87
87
|
name: z.string().max(255).optional().default(""),
|
|
88
88
|
kind: z.string().max(255).optional().default(""),
|
|
89
89
|
line1: z.string().max(255).optional().default(""),
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
// Externo pode mandar 284 (número): o preprocess normaliza para string. O cast
|
|
91
|
+
// fixa o tipo de ENTRADA em string — sem ele vira `unknown`, e os models que
|
|
92
|
+
// usam `z.ZodSchema<IPatient | ILead | ...>` (entrada = interface) não compilam.
|
|
93
|
+
number: (
|
|
94
|
+
z.preprocess(
|
|
95
|
+
(v) => (v === null || v === undefined ? "" : String(v)),
|
|
96
|
+
z.string().max(255),
|
|
97
|
+
) as unknown as z.ZodType<string, z.ZodTypeDef, string>
|
|
98
|
+
)
|
|
92
99
|
.optional()
|
|
93
100
|
.default(""),
|
|
94
101
|
line2: z.string().max(255).optional().default(""),
|
|
@@ -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
|
}
|