@fiado/type-kit 3.171.0 → 3.173.0
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/_test_/unit/remittance/kycOnboardingAttempt.test.ts +46 -0
- package/bin/places/enums/EstablishmentBrandEnum.d.ts +1 -0
- package/bin/places/enums/EstablishmentBrandEnum.js +1 -0
- package/bin/remittance/dtos/RemittanceKyc.d.ts +42 -0
- package/bin/remittance/dtos/RemittanceKyc.js +23 -1
- package/package.json +1 -1
- package/src/places/enums/EstablishmentBrandEnum.ts +1 -0
- package/src/remittance/dtos/RemittanceKyc.ts +47 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KycOnboardingAttempt,
|
|
3
|
+
KycOnboardingAttemptsResponse,
|
|
4
|
+
RegisterOnboardingBlockRequest,
|
|
5
|
+
} from "../../../src/remittance/dtos/RemittanceKyc";
|
|
6
|
+
|
|
7
|
+
describe("KycOnboardingAttempt DTOs", () => {
|
|
8
|
+
it("acepta un intento con request/response completos (verbatim) y una lista", () => {
|
|
9
|
+
const attempt: KycOnboardingAttempt = {
|
|
10
|
+
attemptId: "2026-07-09T10:00:00.000Z#a1b2c3d4",
|
|
11
|
+
at: "2026-07-09T10:00:00.000Z",
|
|
12
|
+
outcome: "SUCCESS",
|
|
13
|
+
phase: "COMPLETE",
|
|
14
|
+
responseCode: "00000000",
|
|
15
|
+
rejectionCode: null,
|
|
16
|
+
rejectionMessage: null,
|
|
17
|
+
// JSON completo tal cual (payload externo de UNIR)
|
|
18
|
+
request: { partnerCode: "XX", agreementLocale: "ES", remitterPersonalInfo: { emailAddress: "a@b.com", firstName: "MARIA", lastName: "GOMEZ", cellPhone: "2024021401" } },
|
|
19
|
+
response: { responseCode: "00000000", extraFields: [] },
|
|
20
|
+
};
|
|
21
|
+
const list: KycOnboardingAttemptsResponse = { items: [attempt] };
|
|
22
|
+
expect(list.items[0].outcome).toBe("SUCCESS");
|
|
23
|
+
expect((list.items[0].request as Record<string, any>).remitterPersonalInfo.firstName).toBe("MARIA");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("permite request/response null (bloqueo por dirección)", () => {
|
|
27
|
+
const blocked: KycOnboardingAttempt = {
|
|
28
|
+
attemptId: "2026-07-08T09:00:00.000Z#33aa22bb",
|
|
29
|
+
at: "2026-07-08T09:00:00.000Z",
|
|
30
|
+
outcome: "BLOCKED",
|
|
31
|
+
phase: "ADDRESS_BLOCK",
|
|
32
|
+
responseCode: null,
|
|
33
|
+
rejectionCode: "NO_PRINCIPAL_ADDRESS",
|
|
34
|
+
rejectionMessage: "Usuario sin dirección principal US",
|
|
35
|
+
request: null,
|
|
36
|
+
response: null,
|
|
37
|
+
};
|
|
38
|
+
expect(blocked.request).toBeNull();
|
|
39
|
+
expect(blocked.rejectionCode).toBe("NO_PRINCIPAL_ADDRESS");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("RegisterOnboardingBlockRequest tiene la forma esperada", () => {
|
|
43
|
+
const block: RegisterOnboardingBlockRequest = { directoryId: "d1", email: "a@b.com", code: "NO_PRINCIPAL_ADDRESS", message: "x" };
|
|
44
|
+
expect(block.code).toBe("NO_PRINCIPAL_ADDRESS");
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -6,6 +6,7 @@ var EstablishmentBrandEnum;
|
|
|
6
6
|
// --- Solo US (GreenDot) ---
|
|
7
7
|
EstablishmentBrandEnum["CVS"] = "CVS";
|
|
8
8
|
EstablishmentBrandEnum["DOLLAR_TREE"] = "DOLLAR_TREE";
|
|
9
|
+
EstablishmentBrandEnum["FAMILY_DOLLAR"] = "FAMILY_DOLLAR";
|
|
9
10
|
// RITE_AID eliminada (2026-06-24): la cadena desapareció tras su bancarrota de 2025.
|
|
10
11
|
// --- Compartidas US (GreenDot) y MX (Passport): el PAÍS define el proveedor ---
|
|
11
12
|
EstablishmentBrandEnum["WALMART"] = "WALMART";
|
|
@@ -68,3 +68,45 @@ export declare class RefreshUserProfileResponse {
|
|
|
68
68
|
remitterLevel: string | null;
|
|
69
69
|
lastDataSyncAt: string;
|
|
70
70
|
}
|
|
71
|
+
/** Resultado de un intento de onboarding (SignUp) contra UNIR. */
|
|
72
|
+
export type OnboardingAttemptOutcome = "SUCCESS" | "REJECTED" | "ERROR" | "BLOCKED";
|
|
73
|
+
/**
|
|
74
|
+
* Un intento de onboarding contra UNIR (audit — `RemittanceOnboardingAttempts_GT`).
|
|
75
|
+
*
|
|
76
|
+
* `request`/`response` son el JSON COMPLETO tal cual (verbatim) que se envió/recibió del
|
|
77
|
+
* SignUp — payload externo de UNIR, por eso se tipa a propósito como `Record<string, unknown>`
|
|
78
|
+
* (no se cura campo por campo: el requerimiento es NO omitir nada; el connector lo persiste
|
|
79
|
+
* cifrado con KMS). Son `null` cuando no hubo SignUp (bloqueo por dirección o fallo previo).
|
|
80
|
+
*/
|
|
81
|
+
export declare class KycOnboardingAttempt {
|
|
82
|
+
/** `${at}#${uuid8}` — ordenable por tiempo. */
|
|
83
|
+
attemptId: string;
|
|
84
|
+
/** ISO-8601. */
|
|
85
|
+
at: string;
|
|
86
|
+
outcome: OnboardingAttemptOutcome;
|
|
87
|
+
/** SIGNUP | COMPLETE | PASSWORD_GRANT | WALLET | ADDRESS_BLOCK. */
|
|
88
|
+
phase: string;
|
|
89
|
+
/** Extraído en claro para lista/filtro (no es la fuente de verdad). */
|
|
90
|
+
responseCode: string | null;
|
|
91
|
+
rejectionCode: string | null;
|
|
92
|
+
rejectionMessage: string | null;
|
|
93
|
+
request: Record<string, unknown> | null;
|
|
94
|
+
response: Record<string, unknown> | null;
|
|
95
|
+
}
|
|
96
|
+
/** Historial de intentos de onboarding de un usuario (orden descendente por `at`). */
|
|
97
|
+
export declare class KycOnboardingAttemptsResponse {
|
|
98
|
+
items: KycOnboardingAttempt[];
|
|
99
|
+
}
|
|
100
|
+
/** #3 — Body para registrar un onboarding bloqueado por dirección (deja PENDING + rejection). */
|
|
101
|
+
export declare class RegisterOnboardingBlockRequest {
|
|
102
|
+
directoryId: string;
|
|
103
|
+
email: string;
|
|
104
|
+
/** NO_PRINCIPAL_ADDRESS | MULTIPLE_PRINCIPAL_ADDRESS | INCOMPLETE_ADDRESS. */
|
|
105
|
+
code: string;
|
|
106
|
+
message: string;
|
|
107
|
+
}
|
|
108
|
+
export declare class RegisterOnboardingBlockResponse {
|
|
109
|
+
directoryId: string;
|
|
110
|
+
status: string;
|
|
111
|
+
rejectionCode: string;
|
|
112
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `lastRejection` es el último rechazo persistido (MVP guarda solo el último).
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.RefreshUserProfileResponse = exports.KycUsersListResponse = exports.KycUserDetail = exports.KycUserSummary = exports.KycUserIdentity = exports.KycUserAddress = exports.KycRejection = void 0;
|
|
10
|
+
exports.RegisterOnboardingBlockResponse = exports.RegisterOnboardingBlockRequest = exports.KycOnboardingAttemptsResponse = exports.KycOnboardingAttempt = exports.RefreshUserProfileResponse = exports.KycUsersListResponse = exports.KycUserDetail = exports.KycUserSummary = exports.KycUserIdentity = exports.KycUserAddress = exports.KycRejection = void 0;
|
|
11
11
|
class KycRejection {
|
|
12
12
|
}
|
|
13
13
|
exports.KycRejection = KycRejection;
|
|
@@ -34,3 +34,25 @@ exports.KycUsersListResponse = KycUsersListResponse;
|
|
|
34
34
|
class RefreshUserProfileResponse {
|
|
35
35
|
}
|
|
36
36
|
exports.RefreshUserProfileResponse = RefreshUserProfileResponse;
|
|
37
|
+
/**
|
|
38
|
+
* Un intento de onboarding contra UNIR (audit — `RemittanceOnboardingAttempts_GT`).
|
|
39
|
+
*
|
|
40
|
+
* `request`/`response` son el JSON COMPLETO tal cual (verbatim) que se envió/recibió del
|
|
41
|
+
* SignUp — payload externo de UNIR, por eso se tipa a propósito como `Record<string, unknown>`
|
|
42
|
+
* (no se cura campo por campo: el requerimiento es NO omitir nada; el connector lo persiste
|
|
43
|
+
* cifrado con KMS). Son `null` cuando no hubo SignUp (bloqueo por dirección o fallo previo).
|
|
44
|
+
*/
|
|
45
|
+
class KycOnboardingAttempt {
|
|
46
|
+
}
|
|
47
|
+
exports.KycOnboardingAttempt = KycOnboardingAttempt;
|
|
48
|
+
/** Historial de intentos de onboarding de un usuario (orden descendente por `at`). */
|
|
49
|
+
class KycOnboardingAttemptsResponse {
|
|
50
|
+
}
|
|
51
|
+
exports.KycOnboardingAttemptsResponse = KycOnboardingAttemptsResponse;
|
|
52
|
+
/** #3 — Body para registrar un onboarding bloqueado por dirección (deja PENDING + rejection). */
|
|
53
|
+
class RegisterOnboardingBlockRequest {
|
|
54
|
+
}
|
|
55
|
+
exports.RegisterOnboardingBlockRequest = RegisterOnboardingBlockRequest;
|
|
56
|
+
class RegisterOnboardingBlockResponse {
|
|
57
|
+
}
|
|
58
|
+
exports.RegisterOnboardingBlockResponse = RegisterOnboardingBlockResponse;
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ export enum EstablishmentBrandEnum {
|
|
|
2
2
|
// --- Solo US (GreenDot) ---
|
|
3
3
|
CVS = 'CVS',
|
|
4
4
|
DOLLAR_TREE = 'DOLLAR_TREE',
|
|
5
|
+
FAMILY_DOLLAR = 'FAMILY_DOLLAR',
|
|
5
6
|
// RITE_AID eliminada (2026-06-24): la cadena desapareció tras su bancarrota de 2025.
|
|
6
7
|
|
|
7
8
|
// --- Compartidas US (GreenDot) y MX (Passport): el PAÍS define el proveedor ---
|
|
@@ -75,3 +75,50 @@ export class RefreshUserProfileResponse {
|
|
|
75
75
|
remitterLevel!: string | null;
|
|
76
76
|
lastDataSyncAt!: string;
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
/** Resultado de un intento de onboarding (SignUp) contra UNIR. */
|
|
80
|
+
export type OnboardingAttemptOutcome = "SUCCESS" | "REJECTED" | "ERROR" | "BLOCKED";
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Un intento de onboarding contra UNIR (audit — `RemittanceOnboardingAttempts_GT`).
|
|
84
|
+
*
|
|
85
|
+
* `request`/`response` son el JSON COMPLETO tal cual (verbatim) que se envió/recibió del
|
|
86
|
+
* SignUp — payload externo de UNIR, por eso se tipa a propósito como `Record<string, unknown>`
|
|
87
|
+
* (no se cura campo por campo: el requerimiento es NO omitir nada; el connector lo persiste
|
|
88
|
+
* cifrado con KMS). Son `null` cuando no hubo SignUp (bloqueo por dirección o fallo previo).
|
|
89
|
+
*/
|
|
90
|
+
export class KycOnboardingAttempt {
|
|
91
|
+
/** `${at}#${uuid8}` — ordenable por tiempo. */
|
|
92
|
+
attemptId!: string;
|
|
93
|
+
/** ISO-8601. */
|
|
94
|
+
at!: string;
|
|
95
|
+
outcome!: OnboardingAttemptOutcome;
|
|
96
|
+
/** SIGNUP | COMPLETE | PASSWORD_GRANT | WALLET | ADDRESS_BLOCK. */
|
|
97
|
+
phase!: string;
|
|
98
|
+
/** Extraído en claro para lista/filtro (no es la fuente de verdad). */
|
|
99
|
+
responseCode!: string | null;
|
|
100
|
+
rejectionCode!: string | null;
|
|
101
|
+
rejectionMessage!: string | null;
|
|
102
|
+
request!: Record<string, unknown> | null;
|
|
103
|
+
response!: Record<string, unknown> | null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Historial de intentos de onboarding de un usuario (orden descendente por `at`). */
|
|
107
|
+
export class KycOnboardingAttemptsResponse {
|
|
108
|
+
items!: KycOnboardingAttempt[];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** #3 — Body para registrar un onboarding bloqueado por dirección (deja PENDING + rejection). */
|
|
112
|
+
export class RegisterOnboardingBlockRequest {
|
|
113
|
+
directoryId!: string;
|
|
114
|
+
email!: string;
|
|
115
|
+
/** NO_PRINCIPAL_ADDRESS | MULTIPLE_PRINCIPAL_ADDRESS | INCOMPLETE_ADDRESS. */
|
|
116
|
+
code!: string;
|
|
117
|
+
message!: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export class RegisterOnboardingBlockResponse {
|
|
121
|
+
directoryId!: string;
|
|
122
|
+
status!: string; // PENDING
|
|
123
|
+
rejectionCode!: string;
|
|
124
|
+
}
|