evo360-types 1.3.697 → 1.3.699
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/types/evo-finops/index.d.ts +1 -0
- package/dist/types/evo-finops/index.js +1 -0
- package/dist/types/evo-finops/index.ts +1 -0
- package/dist/types/evo-finops/providers/asaas/asaas_kyc.d.ts +63 -0
- package/dist/types/evo-finops/providers/asaas/asaas_kyc.js +14 -0
- package/dist/types/evo-finops/providers/asaas/asaas_kyc.ts +85 -0
- package/dist/types/evo-finops/providers/asaas/asaas_provider.d.ts +87 -2
- package/dist/types/evo-finops/providers/asaas/asaas_provider.ts +107 -1
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export * from "./common/nfse-fee-reimbursement";
|
|
|
9
9
|
export * from "./providers";
|
|
10
10
|
export * from "./providers/provider_fiscal_types";
|
|
11
11
|
export * from "./providers/asaas/asaas_provider";
|
|
12
|
+
export * from "./providers/asaas/asaas_kyc";
|
|
12
13
|
export * from "./providers/inter/inter_provider";
|
|
13
14
|
export * from "./dic";
|
|
14
15
|
export * from "./invoices";
|
|
@@ -26,6 +26,7 @@ __exportStar(require("./common/nfse-fee-reimbursement"), exports);
|
|
|
26
26
|
__exportStar(require("./providers"), exports);
|
|
27
27
|
__exportStar(require("./providers/provider_fiscal_types"), exports);
|
|
28
28
|
__exportStar(require("./providers/asaas/asaas_provider"), exports);
|
|
29
|
+
__exportStar(require("./providers/asaas/asaas_kyc"), exports);
|
|
29
30
|
__exportStar(require("./providers/inter/inter_provider"), exports);
|
|
30
31
|
__exportStar(require("./dic"), exports);
|
|
31
32
|
__exportStar(require("./invoices"), exports);
|
|
@@ -11,6 +11,7 @@ export * from "./common/nfse-fee-reimbursement";
|
|
|
11
11
|
export * from "./providers";
|
|
12
12
|
export * from "./providers/provider_fiscal_types";
|
|
13
13
|
export * from "./providers/asaas/asaas_provider";
|
|
14
|
+
export * from "./providers/asaas/asaas_kyc";
|
|
14
15
|
export * from "./providers/inter/inter_provider";
|
|
15
16
|
export * from "./dic";
|
|
16
17
|
export * from "./invoices";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AsaasAccessTokenStatus, AsaasAccountStatusValue, AsaasEnvironment, AsaasKycNotificationTrigger, AsaasOnboardingNextAction, IAsaasCommercialInfoExpiration } from "./asaas_provider";
|
|
2
|
+
/** Tópico Pub/Sub dos pedidos de aviso de KYC (publicado pelo functions-app). */
|
|
3
|
+
export declare const FINOPS_ASAAS_KYC_NOTIFY_TOPIC = "app_evo-finops_asaas-kyc_notify-requested";
|
|
4
|
+
/** Gatilho do aviso: os de KYC + alerta de chave de API (destinado ao staff). */
|
|
5
|
+
export type FinopsAsaasKycNotifyTrigger = AsaasKycNotificationTrigger | "access_token_alert";
|
|
6
|
+
export interface IFinopsAsaasKycNotifyRecipient {
|
|
7
|
+
name?: string | null;
|
|
8
|
+
email?: string | null;
|
|
9
|
+
/** E.164 normalizado. */
|
|
10
|
+
mobile_phone?: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface IFinopsAsaasKycNotifyMessage {
|
|
13
|
+
tenant: string;
|
|
14
|
+
provider_id: string;
|
|
15
|
+
provider_name?: string;
|
|
16
|
+
trigger: FinopsAsaasKycNotifyTrigger;
|
|
17
|
+
/** Escopo do dedup (ex.: hash do link, data agendada). Chave = `${trigger}:${dedup_scope}`. */
|
|
18
|
+
dedup_scope: string;
|
|
19
|
+
/**
|
|
20
|
+
* Opcional: o consumidor resolve o contato administrativo da clínica
|
|
21
|
+
* (cliente do Nexus por `tenant_refs[].tenant`, leads com role `administrative`).
|
|
22
|
+
*/
|
|
23
|
+
recipients?: IFinopsAsaasKycNotifyRecipient[];
|
|
24
|
+
/** Usado quando o cliente do Nexus não tem contato administrativo (vem do `holder_contact`). */
|
|
25
|
+
fallback_recipients?: IFinopsAsaasKycNotifyRecipient[];
|
|
26
|
+
/** nome, clinica, link, data_limite, motivo… */
|
|
27
|
+
variables: Record<string, string>;
|
|
28
|
+
/** ISO datetime. */
|
|
29
|
+
requested_at: string;
|
|
30
|
+
}
|
|
31
|
+
/** Grupo de documento pendente, resumido para a fila. */
|
|
32
|
+
export interface INexKycQueuePendingGroup {
|
|
33
|
+
title?: string | null;
|
|
34
|
+
status?: string | null;
|
|
35
|
+
}
|
|
36
|
+
/** Resumo de `IAsaasAccessTokenMeta` exibido na fila. */
|
|
37
|
+
export interface INexKycQueueAccessTokenSummary {
|
|
38
|
+
status: AsaasAccessTokenStatus;
|
|
39
|
+
projected_expiration_by_lack_of_use?: string | null;
|
|
40
|
+
last_event?: string | null;
|
|
41
|
+
}
|
|
42
|
+
/** feat-275 — linha da fila de KYC do Nexus (uma por provider `asaas_subaccount` não aprovado). */
|
|
43
|
+
export interface INexKycQueueItem {
|
|
44
|
+
tenant: string;
|
|
45
|
+
provider_id: string;
|
|
46
|
+
provider_name?: string | null;
|
|
47
|
+
/** Ambiente do snapshot exibido. */
|
|
48
|
+
env?: AsaasEnvironment;
|
|
49
|
+
/** ISO datetime de criação do provider. */
|
|
50
|
+
created_at?: string | null;
|
|
51
|
+
general?: AsaasAccountStatusValue | null;
|
|
52
|
+
documentation?: AsaasAccountStatusValue | null;
|
|
53
|
+
commercialInfo?: AsaasAccountStatusValue | null;
|
|
54
|
+
next_action?: AsaasOnboardingNextAction | null;
|
|
55
|
+
documents_fetched_at?: string | null;
|
|
56
|
+
has_onboarding_url: boolean;
|
|
57
|
+
pending_groups: INexKycQueuePendingGroup[];
|
|
58
|
+
commercial_info_expiration?: IAsaasCommercialInfoExpiration | null;
|
|
59
|
+
access_token_meta?: INexKycQueueAccessTokenSummary | null;
|
|
60
|
+
last_error?: {
|
|
61
|
+
code?: string | null;
|
|
62
|
+
} | null;
|
|
63
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ── feat-275 — KYC da subconta Asaas (BaaS) ──
|
|
3
|
+
//
|
|
4
|
+
// Contratos compartilhados functions-app ↔ functions-nexus:
|
|
5
|
+
// - mensagem Pub/Sub que pede um aviso de KYC ao cliente (o consumidor no
|
|
6
|
+
// functions-nexus resolve o contato administrativo da clínica no cadastro do
|
|
7
|
+
// cliente do Nexus; `fallback_recipients` vem do `holder_contact` da subconta);
|
|
8
|
+
// - linha da fila de KYC do Nexus.
|
|
9
|
+
//
|
|
10
|
+
// Runtime `lib: es6`: as constantes abaixo são só dados.
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FINOPS_ASAAS_KYC_NOTIFY_TOPIC = void 0;
|
|
13
|
+
/** Tópico Pub/Sub dos pedidos de aviso de KYC (publicado pelo functions-app). */
|
|
14
|
+
exports.FINOPS_ASAAS_KYC_NOTIFY_TOPIC = "app_evo-finops_asaas-kyc_notify-requested";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// ── feat-275 — KYC da subconta Asaas (BaaS) ──
|
|
2
|
+
//
|
|
3
|
+
// Contratos compartilhados functions-app ↔ functions-nexus:
|
|
4
|
+
// - mensagem Pub/Sub que pede um aviso de KYC ao cliente (o consumidor no
|
|
5
|
+
// functions-nexus resolve o contato administrativo da clínica no cadastro do
|
|
6
|
+
// cliente do Nexus; `fallback_recipients` vem do `holder_contact` da subconta);
|
|
7
|
+
// - linha da fila de KYC do Nexus.
|
|
8
|
+
//
|
|
9
|
+
// Runtime `lib: es6`: as constantes abaixo são só dados.
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
AsaasAccessTokenStatus,
|
|
13
|
+
AsaasAccountStatusValue,
|
|
14
|
+
AsaasEnvironment,
|
|
15
|
+
AsaasKycNotificationTrigger,
|
|
16
|
+
AsaasOnboardingNextAction,
|
|
17
|
+
IAsaasCommercialInfoExpiration,
|
|
18
|
+
} from "./asaas_provider";
|
|
19
|
+
|
|
20
|
+
/** Tópico Pub/Sub dos pedidos de aviso de KYC (publicado pelo functions-app). */
|
|
21
|
+
export const FINOPS_ASAAS_KYC_NOTIFY_TOPIC = "app_evo-finops_asaas-kyc_notify-requested";
|
|
22
|
+
|
|
23
|
+
/** Gatilho do aviso: os de KYC + alerta de chave de API (destinado ao staff). */
|
|
24
|
+
export type FinopsAsaasKycNotifyTrigger = AsaasKycNotificationTrigger | "access_token_alert";
|
|
25
|
+
|
|
26
|
+
export interface IFinopsAsaasKycNotifyRecipient {
|
|
27
|
+
name?: string | null;
|
|
28
|
+
email?: string | null;
|
|
29
|
+
/** E.164 normalizado. */
|
|
30
|
+
mobile_phone?: string | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IFinopsAsaasKycNotifyMessage {
|
|
34
|
+
tenant: string;
|
|
35
|
+
provider_id: string;
|
|
36
|
+
provider_name?: string;
|
|
37
|
+
trigger: FinopsAsaasKycNotifyTrigger;
|
|
38
|
+
/** Escopo do dedup (ex.: hash do link, data agendada). Chave = `${trigger}:${dedup_scope}`. */
|
|
39
|
+
dedup_scope: string;
|
|
40
|
+
/**
|
|
41
|
+
* Opcional: o consumidor resolve o contato administrativo da clínica
|
|
42
|
+
* (cliente do Nexus por `tenant_refs[].tenant`, leads com role `administrative`).
|
|
43
|
+
*/
|
|
44
|
+
recipients?: IFinopsAsaasKycNotifyRecipient[];
|
|
45
|
+
/** Usado quando o cliente do Nexus não tem contato administrativo (vem do `holder_contact`). */
|
|
46
|
+
fallback_recipients?: IFinopsAsaasKycNotifyRecipient[];
|
|
47
|
+
/** nome, clinica, link, data_limite, motivo… */
|
|
48
|
+
variables: Record<string, string>;
|
|
49
|
+
/** ISO datetime. */
|
|
50
|
+
requested_at: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Grupo de documento pendente, resumido para a fila. */
|
|
54
|
+
export interface INexKycQueuePendingGroup {
|
|
55
|
+
title?: string | null;
|
|
56
|
+
status?: string | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Resumo de `IAsaasAccessTokenMeta` exibido na fila. */
|
|
60
|
+
export interface INexKycQueueAccessTokenSummary {
|
|
61
|
+
status: AsaasAccessTokenStatus;
|
|
62
|
+
projected_expiration_by_lack_of_use?: string | null;
|
|
63
|
+
last_event?: string | null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** feat-275 — linha da fila de KYC do Nexus (uma por provider `asaas_subaccount` não aprovado). */
|
|
67
|
+
export interface INexKycQueueItem {
|
|
68
|
+
tenant: string;
|
|
69
|
+
provider_id: string;
|
|
70
|
+
provider_name?: string | null;
|
|
71
|
+
/** Ambiente do snapshot exibido. */
|
|
72
|
+
env?: AsaasEnvironment;
|
|
73
|
+
/** ISO datetime de criação do provider. */
|
|
74
|
+
created_at?: string | null;
|
|
75
|
+
general?: AsaasAccountStatusValue | null;
|
|
76
|
+
documentation?: AsaasAccountStatusValue | null;
|
|
77
|
+
commercialInfo?: AsaasAccountStatusValue | null;
|
|
78
|
+
next_action?: AsaasOnboardingNextAction | null;
|
|
79
|
+
documents_fetched_at?: string | null;
|
|
80
|
+
has_onboarding_url: boolean;
|
|
81
|
+
pending_groups: INexKycQueuePendingGroup[];
|
|
82
|
+
commercial_info_expiration?: IAsaasCommercialInfoExpiration | null;
|
|
83
|
+
access_token_meta?: INexKycQueueAccessTokenSummary | null;
|
|
84
|
+
last_error?: { code?: string | null } | null;
|
|
85
|
+
}
|
|
@@ -99,9 +99,27 @@ export interface IAsaasSubaccountInput {
|
|
|
99
99
|
/** Valores do status cadastral devolvidos pelo Asaas em GET /v3/myAccount/status. */
|
|
100
100
|
export type AsaasAccountStatusValue = "APPROVED" | "AWAITING_APPROVAL" | "PENDING" | "REJECTED" | "EXPIRING_SOON" | "EXPIRED";
|
|
101
101
|
/** O que originou a escrita do snapshot cadastral. */
|
|
102
|
-
export type AsaasOnboardingSource = "manual_refresh" | "webhook" | "provider_create" | "scheduled_refresh"
|
|
102
|
+
export type AsaasOnboardingSource = "manual_refresh" | "webhook" | "provider_create" | "scheduled_refresh"
|
|
103
|
+
/** feat-275 — rebusca de documentos disparada por webhook ACCOUNT_STATUS_*. */
|
|
104
|
+
| "webhook_refetch"
|
|
105
|
+
/** feat-275 — refresh inline no gate de emissão (subconta sem snapshot). */
|
|
106
|
+
| "gate_refresh"
|
|
107
|
+
/** feat-275 — upload de documento pela nossa tela. */
|
|
108
|
+
| "document_upload"
|
|
109
|
+
/** feat-275 — atualização/confirmação dos dados comerciais pela nossa tela. */
|
|
110
|
+
| "commercial_info_update"
|
|
111
|
+
/** feat-275 — troca/registro de chave de API da subconta. */
|
|
112
|
+
| "key_rotation";
|
|
103
113
|
/** Próxima ação que o dono da conta precisa executar para destravar a subconta. */
|
|
104
|
-
export type AsaasOnboardingNextAction = "approved" | "rejected" | "awaiting_analysis" | "open_onboarding_link"
|
|
114
|
+
export type AsaasOnboardingNextAction = "approved" | "rejected" | "awaiting_analysis" | "open_onboarding_link"
|
|
115
|
+
/** Legado: permanece para snapshots antigos; o mapper da feat-275 deixa de emiti-lo. */
|
|
116
|
+
| "send_documents_external" | "fix_commercial_info" | "pending_bank_account"
|
|
117
|
+
/** feat-275 — grupo sem onboarding_url: upload pela nossa tela. */
|
|
118
|
+
| "upload_documents"
|
|
119
|
+
/** feat-275 — confirmação anual dos dados comerciais (EXPIRING_SOON / EXPIRED). */
|
|
120
|
+
| "confirm_commercial_info"
|
|
121
|
+
/** feat-275 — subconta recém-criada; o Asaas ainda não gerou os documentos. */
|
|
122
|
+
| "awaiting_link" | "unknown";
|
|
105
123
|
/** Snapshot de GET /v3/myAccount/status. Sobrescrito inteiro a cada leitura/evento. */
|
|
106
124
|
export interface IAsaasAccountStatusSnapshot {
|
|
107
125
|
fetched_at: string;
|
|
@@ -134,6 +152,10 @@ export interface IAsaasOnboardingDocumentGroup {
|
|
|
134
152
|
id?: string;
|
|
135
153
|
status?: string;
|
|
136
154
|
}>;
|
|
155
|
+
/** feat-275 — quando fizemos o último upload deste grupo (metadado; nunca o arquivo). */
|
|
156
|
+
last_upload_at?: string | null;
|
|
157
|
+
/** feat-275 — userId de quem fez o último upload. */
|
|
158
|
+
last_upload_by?: string | null;
|
|
137
159
|
}
|
|
138
160
|
/** Snapshot de GET /v3/myAccount/documents + próxima ação derivada. */
|
|
139
161
|
export interface IAsaasOnboardingSnapshot {
|
|
@@ -142,6 +164,61 @@ export interface IAsaasOnboardingSnapshot {
|
|
|
142
164
|
document_groups: IAsaasOnboardingDocumentGroup[];
|
|
143
165
|
next_action: AsaasOnboardingNextAction;
|
|
144
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* feat-275 — confirmação anual dos dados comerciais.
|
|
169
|
+
* Com `is_expired` o Asaas responde 403 em tudo, exceto GET/POST /myAccount/commercialInfo.
|
|
170
|
+
*/
|
|
171
|
+
export interface IAsaasCommercialInfoExpiration {
|
|
172
|
+
is_expired: boolean;
|
|
173
|
+
/** YYYY-MM-DD (`additionalInfo.scheduledDate` do evento EXPIRING_SOON). */
|
|
174
|
+
scheduled_date?: string | null;
|
|
175
|
+
updated_at: string;
|
|
176
|
+
source: "provider_create" | "webhook" | "commercial_info_fetch" | "commercial_info_update";
|
|
177
|
+
}
|
|
178
|
+
/** feat-275 — contato de negócio do titular da subconta (LGPD: só nome, e-mail e celular). */
|
|
179
|
+
export interface IAsaasHolderContact {
|
|
180
|
+
name?: string | null;
|
|
181
|
+
email?: string | null;
|
|
182
|
+
/** E.164 normalizado. */
|
|
183
|
+
mobile_phone?: string | null;
|
|
184
|
+
source: "provider_create" | "commercial_info";
|
|
185
|
+
updated_at: string;
|
|
186
|
+
}
|
|
187
|
+
/** feat-275 — gatilhos de aviso de KYC ao cliente. */
|
|
188
|
+
export type AsaasKycNotificationTrigger = "link_available" | "link_renewed" | "rejected" | "commercial_info_expiring" | "commercial_info_expired";
|
|
189
|
+
/** feat-275 — estado de dedup dos avisos de KYC. */
|
|
190
|
+
export interface IAsaasKycNotificationState {
|
|
191
|
+
/** chave = `${trigger}:${scope}` (ex.: `link_available:3f9a...`); valor = quando foi publicado. */
|
|
192
|
+
sent?: Record<string, {
|
|
193
|
+
at: string;
|
|
194
|
+
trigger: AsaasKycNotificationTrigger;
|
|
195
|
+
}>;
|
|
196
|
+
/** sha256(url).slice(0,16) — nunca a URL. */
|
|
197
|
+
last_link_hash?: string | null;
|
|
198
|
+
}
|
|
199
|
+
/** feat-275 — estado da chave de API da subconta. */
|
|
200
|
+
export type AsaasAccessTokenStatus = "active" | "disabled" | "expired" | "deleted" | "invalid" | "unknown";
|
|
201
|
+
/**
|
|
202
|
+
* feat-275 — metadado da chave de API (nunca o valor). Alimentado por eventos ACCESS_TOKEN_*
|
|
203
|
+
* e pela checagem diária (`GET /myAccount/status` com a chave da subconta).
|
|
204
|
+
*/
|
|
205
|
+
export interface IAsaasAccessTokenMeta {
|
|
206
|
+
asaas_access_token_id?: string | null;
|
|
207
|
+
name?: string | null;
|
|
208
|
+
status: AsaasAccessTokenStatus;
|
|
209
|
+
enabled?: boolean | null;
|
|
210
|
+
/** MANUAL | LACK_OF_USE */
|
|
211
|
+
disable_reason?: string | null;
|
|
212
|
+
expiration_date?: string | null;
|
|
213
|
+
/** A chave BaaS expira após 6 meses SEM USO; data projetada pelo Asaas. */
|
|
214
|
+
projected_expiration_by_lack_of_use?: string | null;
|
|
215
|
+
/** ACCESS_TOKEN_* */
|
|
216
|
+
last_event?: string | null;
|
|
217
|
+
last_event_at?: string | null;
|
|
218
|
+
rotated_at?: string | null;
|
|
219
|
+
/** loginId do staff. */
|
|
220
|
+
rotated_by?: string | null;
|
|
221
|
+
}
|
|
145
222
|
export interface IAsaasEnvAuthConfig {
|
|
146
223
|
enabled: boolean;
|
|
147
224
|
base_url?: string;
|
|
@@ -152,6 +229,14 @@ export interface IAsaasEnvAuthConfig {
|
|
|
152
229
|
account_scope?: IAsaasAccountScope;
|
|
153
230
|
account_status?: IAsaasAccountStatusSnapshot;
|
|
154
231
|
onboarding?: IAsaasOnboardingSnapshot;
|
|
232
|
+
/** feat-275 — confirmação anual dos dados comerciais. */
|
|
233
|
+
commercial_info_expiration?: IAsaasCommercialInfoExpiration;
|
|
234
|
+
/** feat-275 — contato do titular (fallback de destinatário dos avisos de KYC). */
|
|
235
|
+
holder_contact?: IAsaasHolderContact;
|
|
236
|
+
/** feat-275 — dedup dos avisos de KYC. */
|
|
237
|
+
kyc_notifications?: IAsaasKycNotificationState;
|
|
238
|
+
/** feat-275 — estado da chave de API (nunca o valor). */
|
|
239
|
+
access_token_meta?: IAsaasAccessTokenMeta;
|
|
155
240
|
subaccount_input?: IAsaasSubaccountInput;
|
|
156
241
|
operational?: {
|
|
157
242
|
rate_limit_max_per_minute?: number;
|
|
@@ -145,7 +145,17 @@ export type AsaasOnboardingSource =
|
|
|
145
145
|
| "manual_refresh"
|
|
146
146
|
| "webhook"
|
|
147
147
|
| "provider_create"
|
|
148
|
-
| "scheduled_refresh"
|
|
148
|
+
| "scheduled_refresh"
|
|
149
|
+
/** feat-275 — rebusca de documentos disparada por webhook ACCOUNT_STATUS_*. */
|
|
150
|
+
| "webhook_refetch"
|
|
151
|
+
/** feat-275 — refresh inline no gate de emissão (subconta sem snapshot). */
|
|
152
|
+
| "gate_refresh"
|
|
153
|
+
/** feat-275 — upload de documento pela nossa tela. */
|
|
154
|
+
| "document_upload"
|
|
155
|
+
/** feat-275 — atualização/confirmação dos dados comerciais pela nossa tela. */
|
|
156
|
+
| "commercial_info_update"
|
|
157
|
+
/** feat-275 — troca/registro de chave de API da subconta. */
|
|
158
|
+
| "key_rotation";
|
|
149
159
|
|
|
150
160
|
/** Próxima ação que o dono da conta precisa executar para destravar a subconta. */
|
|
151
161
|
export type AsaasOnboardingNextAction =
|
|
@@ -153,9 +163,16 @@ export type AsaasOnboardingNextAction =
|
|
|
153
163
|
| "rejected"
|
|
154
164
|
| "awaiting_analysis"
|
|
155
165
|
| "open_onboarding_link"
|
|
166
|
+
/** Legado: permanece para snapshots antigos; o mapper da feat-275 deixa de emiti-lo. */
|
|
156
167
|
| "send_documents_external"
|
|
157
168
|
| "fix_commercial_info"
|
|
158
169
|
| "pending_bank_account"
|
|
170
|
+
/** feat-275 — grupo sem onboarding_url: upload pela nossa tela. */
|
|
171
|
+
| "upload_documents"
|
|
172
|
+
/** feat-275 — confirmação anual dos dados comerciais (EXPIRING_SOON / EXPIRED). */
|
|
173
|
+
| "confirm_commercial_info"
|
|
174
|
+
/** feat-275 — subconta recém-criada; o Asaas ainda não gerou os documentos. */
|
|
175
|
+
| "awaiting_link"
|
|
159
176
|
| "unknown";
|
|
160
177
|
|
|
161
178
|
/** Snapshot de GET /v3/myAccount/status. Sobrescrito inteiro a cada leitura/evento. */
|
|
@@ -185,6 +202,10 @@ export interface IAsaasOnboardingDocumentGroup {
|
|
|
185
202
|
onboarding_url?: string | null;
|
|
186
203
|
responsible?: { name?: string | null; type?: string | null };
|
|
187
204
|
documents?: Array<{ id?: string; status?: string }>;
|
|
205
|
+
/** feat-275 — quando fizemos o último upload deste grupo (metadado; nunca o arquivo). */
|
|
206
|
+
last_upload_at?: string | null;
|
|
207
|
+
/** feat-275 — userId de quem fez o último upload. */
|
|
208
|
+
last_upload_by?: string | null;
|
|
188
209
|
}
|
|
189
210
|
|
|
190
211
|
/** Snapshot de GET /v3/myAccount/documents + próxima ação derivada. */
|
|
@@ -195,6 +216,79 @@ export interface IAsaasOnboardingSnapshot {
|
|
|
195
216
|
next_action: AsaasOnboardingNextAction;
|
|
196
217
|
}
|
|
197
218
|
|
|
219
|
+
/**
|
|
220
|
+
* feat-275 — confirmação anual dos dados comerciais.
|
|
221
|
+
* Com `is_expired` o Asaas responde 403 em tudo, exceto GET/POST /myAccount/commercialInfo.
|
|
222
|
+
*/
|
|
223
|
+
export interface IAsaasCommercialInfoExpiration {
|
|
224
|
+
is_expired: boolean;
|
|
225
|
+
/** YYYY-MM-DD (`additionalInfo.scheduledDate` do evento EXPIRING_SOON). */
|
|
226
|
+
scheduled_date?: string | null;
|
|
227
|
+
updated_at: string;
|
|
228
|
+
source:
|
|
229
|
+
| "provider_create"
|
|
230
|
+
| "webhook"
|
|
231
|
+
| "commercial_info_fetch"
|
|
232
|
+
| "commercial_info_update";
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** feat-275 — contato de negócio do titular da subconta (LGPD: só nome, e-mail e celular). */
|
|
236
|
+
export interface IAsaasHolderContact {
|
|
237
|
+
name?: string | null;
|
|
238
|
+
email?: string | null;
|
|
239
|
+
/** E.164 normalizado. */
|
|
240
|
+
mobile_phone?: string | null;
|
|
241
|
+
source: "provider_create" | "commercial_info";
|
|
242
|
+
updated_at: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** feat-275 — gatilhos de aviso de KYC ao cliente. */
|
|
246
|
+
export type AsaasKycNotificationTrigger =
|
|
247
|
+
| "link_available"
|
|
248
|
+
| "link_renewed"
|
|
249
|
+
| "rejected"
|
|
250
|
+
| "commercial_info_expiring"
|
|
251
|
+
| "commercial_info_expired";
|
|
252
|
+
|
|
253
|
+
/** feat-275 — estado de dedup dos avisos de KYC. */
|
|
254
|
+
export interface IAsaasKycNotificationState {
|
|
255
|
+
/** chave = `${trigger}:${scope}` (ex.: `link_available:3f9a...`); valor = quando foi publicado. */
|
|
256
|
+
sent?: Record<string, { at: string; trigger: AsaasKycNotificationTrigger }>;
|
|
257
|
+
/** sha256(url).slice(0,16) — nunca a URL. */
|
|
258
|
+
last_link_hash?: string | null;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** feat-275 — estado da chave de API da subconta. */
|
|
262
|
+
export type AsaasAccessTokenStatus =
|
|
263
|
+
| "active"
|
|
264
|
+
| "disabled"
|
|
265
|
+
| "expired"
|
|
266
|
+
| "deleted"
|
|
267
|
+
| "invalid"
|
|
268
|
+
| "unknown";
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* feat-275 — metadado da chave de API (nunca o valor). Alimentado por eventos ACCESS_TOKEN_*
|
|
272
|
+
* e pela checagem diária (`GET /myAccount/status` com a chave da subconta).
|
|
273
|
+
*/
|
|
274
|
+
export interface IAsaasAccessTokenMeta {
|
|
275
|
+
asaas_access_token_id?: string | null;
|
|
276
|
+
name?: string | null;
|
|
277
|
+
status: AsaasAccessTokenStatus;
|
|
278
|
+
enabled?: boolean | null;
|
|
279
|
+
/** MANUAL | LACK_OF_USE */
|
|
280
|
+
disable_reason?: string | null;
|
|
281
|
+
expiration_date?: string | null;
|
|
282
|
+
/** A chave BaaS expira após 6 meses SEM USO; data projetada pelo Asaas. */
|
|
283
|
+
projected_expiration_by_lack_of_use?: string | null;
|
|
284
|
+
/** ACCESS_TOKEN_* */
|
|
285
|
+
last_event?: string | null;
|
|
286
|
+
last_event_at?: string | null;
|
|
287
|
+
rotated_at?: string | null;
|
|
288
|
+
/** loginId do staff. */
|
|
289
|
+
rotated_by?: string | null;
|
|
290
|
+
}
|
|
291
|
+
|
|
198
292
|
export interface IAsaasEnvAuthConfig {
|
|
199
293
|
enabled: boolean;
|
|
200
294
|
|
|
@@ -218,6 +312,18 @@ export interface IAsaasEnvAuthConfig {
|
|
|
218
312
|
// Documentos pendentes e próxima ação de ativação.
|
|
219
313
|
onboarding?: IAsaasOnboardingSnapshot;
|
|
220
314
|
|
|
315
|
+
/** feat-275 — confirmação anual dos dados comerciais. */
|
|
316
|
+
commercial_info_expiration?: IAsaasCommercialInfoExpiration;
|
|
317
|
+
|
|
318
|
+
/** feat-275 — contato do titular (fallback de destinatário dos avisos de KYC). */
|
|
319
|
+
holder_contact?: IAsaasHolderContact;
|
|
320
|
+
|
|
321
|
+
/** feat-275 — dedup dos avisos de KYC. */
|
|
322
|
+
kyc_notifications?: IAsaasKycNotificationState;
|
|
323
|
+
|
|
324
|
+
/** feat-275 — estado da chave de API (nunca o valor). */
|
|
325
|
+
access_token_meta?: IAsaasAccessTokenMeta;
|
|
326
|
+
|
|
221
327
|
// Input data used only when creating subaccounts (not persisted).
|
|
222
328
|
subaccount_input?: IAsaasSubaccountInput;
|
|
223
329
|
|