evo360-types 1.3.651 → 1.3.654
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-finops/zod-schemas.d.ts +15 -0
- package/dist/apps/evo-finops/zod-schemas.js +12 -1
- package/dist/apps/evo-finops/zod-schemas.ts +12 -0
- package/dist/types/evo-billing/index.d.ts +42 -0
- package/dist/types/evo-billing/index.ts +61 -0
- package/dist/types/evo-finops/common/billing.d.ts +6 -0
- package/dist/types/evo-finops/common/billing.ts +6 -0
- package/package.json +1 -1
|
@@ -14785,6 +14785,21 @@ export declare const zNexFinopsBillingCardChargeSchema: z.ZodObject<{
|
|
|
14785
14785
|
taker_id?: string | undefined;
|
|
14786
14786
|
allow_early?: boolean | undefined;
|
|
14787
14787
|
}>;
|
|
14788
|
+
/**
|
|
14789
|
+
* Portal (`evo_billing`) `POST /me/payment-methods/capture` (feat-253 fatia 9).
|
|
14790
|
+
* O cliente confirma a cobrança e o valor que viu na prévia (`capture_target`);
|
|
14791
|
+
* provider/ambiente/tomador são resolvidos no backend. `.strip()`: nada de cartão entra aqui.
|
|
14792
|
+
*/
|
|
14793
|
+
export declare const zEvoBillingPortalCardCaptureSchema: z.ZodObject<{
|
|
14794
|
+
billing_id: z.ZodString;
|
|
14795
|
+
expected_value: z.ZodNumber;
|
|
14796
|
+
}, "strip", z.ZodTypeAny, {
|
|
14797
|
+
expected_value: number;
|
|
14798
|
+
billing_id: string;
|
|
14799
|
+
}, {
|
|
14800
|
+
expected_value: number;
|
|
14801
|
+
billing_id: string;
|
|
14802
|
+
}>;
|
|
14788
14803
|
/** `POST /payment-methods/discover` — sem `confirm` é dry-run. */
|
|
14789
14804
|
export declare const zNexFinopsPaymentMethodsDiscoverSchema: z.ZodObject<{
|
|
14790
14805
|
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.zNexFinopsPaymentMethodsDiscoverSchema = 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.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;
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const zod_schemas_1 = require("../shared/zod-schemas");
|
|
7
7
|
// ---- Provider enums and base ----
|
|
@@ -984,6 +984,17 @@ exports.zNexFinopsBillingCardChargeSchema = zod_1.z
|
|
|
984
984
|
allow_early: zod_1.z.boolean().optional(),
|
|
985
985
|
})
|
|
986
986
|
.strip();
|
|
987
|
+
/**
|
|
988
|
+
* Portal (`evo_billing`) `POST /me/payment-methods/capture` (feat-253 fatia 9).
|
|
989
|
+
* O cliente confirma a cobrança e o valor que viu na prévia (`capture_target`);
|
|
990
|
+
* provider/ambiente/tomador são resolvidos no backend. `.strip()`: nada de cartão entra aqui.
|
|
991
|
+
*/
|
|
992
|
+
exports.zEvoBillingPortalCardCaptureSchema = zod_1.z
|
|
993
|
+
.object({
|
|
994
|
+
billing_id: zod_1.z.string().min(1).max(128),
|
|
995
|
+
expected_value: zod_1.z.number(),
|
|
996
|
+
})
|
|
997
|
+
.strip();
|
|
987
998
|
/** `POST /payment-methods/discover` — sem `confirm` é dry-run. */
|
|
988
999
|
exports.zNexFinopsPaymentMethodsDiscoverSchema = zod_1.z
|
|
989
1000
|
.object({
|
|
@@ -1080,6 +1080,18 @@ export const zNexFinopsBillingCardChargeSchema = z
|
|
|
1080
1080
|
})
|
|
1081
1081
|
.strip();
|
|
1082
1082
|
|
|
1083
|
+
/**
|
|
1084
|
+
* Portal (`evo_billing`) `POST /me/payment-methods/capture` (feat-253 fatia 9).
|
|
1085
|
+
* O cliente confirma a cobrança e o valor que viu na prévia (`capture_target`);
|
|
1086
|
+
* provider/ambiente/tomador são resolvidos no backend. `.strip()`: nada de cartão entra aqui.
|
|
1087
|
+
*/
|
|
1088
|
+
export const zEvoBillingPortalCardCaptureSchema = z
|
|
1089
|
+
.object({
|
|
1090
|
+
billing_id: z.string().min(1).max(128),
|
|
1091
|
+
expected_value: z.number(),
|
|
1092
|
+
})
|
|
1093
|
+
.strip();
|
|
1094
|
+
|
|
1083
1095
|
/** `POST /payment-methods/discover` — sem `confirm` é dry-run. */
|
|
1084
1096
|
export const zNexFinopsPaymentMethodsDiscoverSchema = z
|
|
1085
1097
|
.object({
|
|
@@ -5,3 +5,45 @@ export declare const EvoBillingPermissions: {
|
|
|
5
5
|
readonly Admin: "evo_billing_admin";
|
|
6
6
|
};
|
|
7
7
|
export type EvoBillingPermissions = (typeof EvoBillingPermissions)[keyof typeof EvoBillingPermissions];
|
|
8
|
+
export type EvoBillingPortalPaymentMethodKind = 'asaas_card_token' | 'asaas_subscription';
|
|
9
|
+
export type EvoBillingPortalPaymentMethodStatus = 'active' | 'failing' | 'inactive' | 'revoked';
|
|
10
|
+
export interface IEvoBillingPortalPaymentMethodContract {
|
|
11
|
+
contract_id: string;
|
|
12
|
+
name: string | null;
|
|
13
|
+
/** O contrato cobra neste método por padrão. */
|
|
14
|
+
is_default: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface IEvoBillingPortalPaymentMethod {
|
|
17
|
+
/** Chave opaca só para a lista (não é o id do método). */
|
|
18
|
+
key: string;
|
|
19
|
+
kind: EvoBillingPortalPaymentMethodKind;
|
|
20
|
+
status: EvoBillingPortalPaymentMethodStatus;
|
|
21
|
+
brand: string | null;
|
|
22
|
+
last4: string | null;
|
|
23
|
+
/** Contratos do cliente que usam este método. */
|
|
24
|
+
contracts: IEvoBillingPortalPaymentMethodContract[];
|
|
25
|
+
}
|
|
26
|
+
/** Cobrança que o "Cadastrar/trocar cartão" usaria agora (ou null: aguarda a próxima). */
|
|
27
|
+
export interface IEvoBillingPortalCardCaptureTarget {
|
|
28
|
+
billing_id: string;
|
|
29
|
+
contract_id: string | null;
|
|
30
|
+
competency_key: string | null;
|
|
31
|
+
value: number;
|
|
32
|
+
due_date: string | null;
|
|
33
|
+
}
|
|
34
|
+
export interface IEvoBillingPortalPaymentMethodsResponse {
|
|
35
|
+
ok: true;
|
|
36
|
+
items: IEvoBillingPortalPaymentMethod[];
|
|
37
|
+
/** O cadastro de cartão pelo portal está ligado no ambiente atual. */
|
|
38
|
+
capture_enabled: boolean;
|
|
39
|
+
capture_target: IEvoBillingPortalCardCaptureTarget | null;
|
|
40
|
+
}
|
|
41
|
+
export interface IEvoBillingPortalCardCaptureResponse {
|
|
42
|
+
ok: true;
|
|
43
|
+
billing_id: string;
|
|
44
|
+
invoice_url: string;
|
|
45
|
+
value: number;
|
|
46
|
+
due_date: string;
|
|
47
|
+
reused: boolean;
|
|
48
|
+
}
|
|
49
|
+
export type EvoBillingPortalCardCaptureErrorCode = 'no_open_billing' | 'card_capture_unavailable' | 'customer_document_missing' | 'taker_without_remote_customer' | 'preview_changed' | 'already_paid' | 'internal';
|
|
@@ -8,3 +8,64 @@ export const EvoBillingPermissions = {
|
|
|
8
8
|
|
|
9
9
|
export type EvoBillingPermissions =
|
|
10
10
|
(typeof EvoBillingPermissions)[keyof typeof EvoBillingPermissions];
|
|
11
|
+
|
|
12
|
+
// ── Métodos de pagamento no portal (feat-253 fatia 9) ──
|
|
13
|
+
//
|
|
14
|
+
// Projeção do `payment_methods` para o cliente. PCI/escopo: só bandeira + últimos 4.
|
|
15
|
+
// Sem id do método, `cus_`, `pay_`/`sub_` ou token.
|
|
16
|
+
|
|
17
|
+
export type EvoBillingPortalPaymentMethodKind = 'asaas_card_token' | 'asaas_subscription';
|
|
18
|
+
export type EvoBillingPortalPaymentMethodStatus = 'active' | 'failing' | 'inactive' | 'revoked';
|
|
19
|
+
|
|
20
|
+
export interface IEvoBillingPortalPaymentMethodContract {
|
|
21
|
+
contract_id: string;
|
|
22
|
+
name: string | null;
|
|
23
|
+
/** O contrato cobra neste método por padrão. */
|
|
24
|
+
is_default: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IEvoBillingPortalPaymentMethod {
|
|
28
|
+
/** Chave opaca só para a lista (não é o id do método). */
|
|
29
|
+
key: string;
|
|
30
|
+
kind: EvoBillingPortalPaymentMethodKind;
|
|
31
|
+
status: EvoBillingPortalPaymentMethodStatus;
|
|
32
|
+
brand: string | null;
|
|
33
|
+
last4: string | null;
|
|
34
|
+
/** Contratos do cliente que usam este método. */
|
|
35
|
+
contracts: IEvoBillingPortalPaymentMethodContract[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Cobrança que o "Cadastrar/trocar cartão" usaria agora (ou null: aguarda a próxima). */
|
|
39
|
+
export interface IEvoBillingPortalCardCaptureTarget {
|
|
40
|
+
billing_id: string;
|
|
41
|
+
contract_id: string | null;
|
|
42
|
+
competency_key: string | null;
|
|
43
|
+
value: number;
|
|
44
|
+
due_date: string | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface IEvoBillingPortalPaymentMethodsResponse {
|
|
48
|
+
ok: true;
|
|
49
|
+
items: IEvoBillingPortalPaymentMethod[];
|
|
50
|
+
/** O cadastro de cartão pelo portal está ligado no ambiente atual. */
|
|
51
|
+
capture_enabled: boolean;
|
|
52
|
+
capture_target: IEvoBillingPortalCardCaptureTarget | null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface IEvoBillingPortalCardCaptureResponse {
|
|
56
|
+
ok: true;
|
|
57
|
+
billing_id: string;
|
|
58
|
+
invoice_url: string;
|
|
59
|
+
value: number;
|
|
60
|
+
due_date: string;
|
|
61
|
+
reused: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type EvoBillingPortalCardCaptureErrorCode =
|
|
65
|
+
| 'no_open_billing'
|
|
66
|
+
| 'card_capture_unavailable'
|
|
67
|
+
| 'customer_document_missing'
|
|
68
|
+
| 'taker_without_remote_customer'
|
|
69
|
+
| 'preview_changed'
|
|
70
|
+
| 'already_paid'
|
|
71
|
+
| 'internal';
|
|
@@ -137,6 +137,12 @@ export interface INexFinopsBillingCardCharge {
|
|
|
137
137
|
/** Provider/ambiente onde o `pay_` foi criado. */
|
|
138
138
|
provider_id?: string | null;
|
|
139
139
|
env?: 'sandbox' | 'production' | null;
|
|
140
|
+
/**
|
|
141
|
+
* feat-253 fatia 9: quem gerou a fatura de captura. `portal` = o próprio cliente pediu
|
|
142
|
+
* "Cadastrar/trocar cartão" → o cartão capturado vira o padrão do contrato. Ausente/`nexus`
|
|
143
|
+
* = regra da F2b (habilita só em contrato sem método; senão fica como sugestão).
|
|
144
|
+
*/
|
|
145
|
+
capture_origin?: 'nexus' | 'portal' | null;
|
|
140
146
|
}
|
|
141
147
|
export type NexFinopsBillingCardCaptureStatus = 'captured' | 'no_token' | 'skipped';
|
|
142
148
|
export interface INexFinopsBilling extends IFireGlobalDoc {
|
|
@@ -168,6 +168,12 @@ export interface INexFinopsBillingCardCharge {
|
|
|
168
168
|
/** Provider/ambiente onde o `pay_` foi criado. */
|
|
169
169
|
provider_id?: string | null;
|
|
170
170
|
env?: 'sandbox' | 'production' | null;
|
|
171
|
+
/**
|
|
172
|
+
* feat-253 fatia 9: quem gerou a fatura de captura. `portal` = o próprio cliente pediu
|
|
173
|
+
* "Cadastrar/trocar cartão" → o cartão capturado vira o padrão do contrato. Ausente/`nexus`
|
|
174
|
+
* = regra da F2b (habilita só em contrato sem método; senão fica como sugestão).
|
|
175
|
+
*/
|
|
176
|
+
capture_origin?: 'nexus' | 'portal' | null;
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
export type NexFinopsBillingCardCaptureStatus = 'captured' | 'no_token' | 'skipped';
|