@fiado/type-kit 3.200.0 → 3.203.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/auth/SignUpProspectRequest.test.ts +32 -0
- package/_test_/unit/auth/SignUpProspectResponse.test.ts +26 -0
- package/_test_/unit/kyc/KycByDirectoryResponse.test.ts +139 -0
- package/_test_/unit/kyc/KycVerificationChangedV1.test.ts +99 -0
- package/_test_/unit/messagesConnector/SendMessageRequest.test.ts +48 -0
- package/bin/auth/dtos/SignUpProspectRequest.d.ts +15 -0
- package/bin/{platformRbac/dtos/ResendSelfRegisterOtpRequest.js → auth/dtos/SignUpProspectRequest.js} +19 -11
- package/bin/auth/dtos/SignUpProspectResponse.d.ts +11 -0
- package/bin/{platformRbac/dtos/ResendOtpRequest.js → auth/dtos/SignUpProspectResponse.js} +11 -11
- package/bin/auth/index.d.ts +2 -0
- package/bin/auth/index.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +5 -0
- package/bin/kyc/dtos/responses/KycByDirectoryResponse.d.ts +49 -0
- package/bin/kyc/dtos/responses/KycByDirectoryResponse.js +91 -0
- package/bin/kyc/dtos/responses/KycPersonData.d.ts +11 -0
- package/bin/kyc/dtos/responses/KycPersonData.js +51 -0
- package/bin/kyc/enums/KycVerificationStatusEnum.d.ts +18 -0
- package/bin/kyc/enums/KycVerificationStatusEnum.js +22 -0
- package/bin/kyc/events/KycVerificationChangedV1.d.ts +35 -0
- package/bin/kyc/events/KycVerificationChangedV1.js +76 -0
- package/bin/kyc/index.d.ts +4 -0
- package/bin/kyc/index.js +24 -0
- package/bin/loanCredit/dtos/LoanBorrower.d.ts +2 -0
- package/bin/loanCredit/dtos/LoanBorrower.js +6 -0
- package/bin/loanCredit/dtos/requests/SignLoanCreditRequest.d.ts +12 -0
- package/bin/loanCredit/dtos/requests/SignLoanCreditRequest.js +12 -0
- package/bin/loanCredit/dtos/requests/UpdateActivationChecklistRequest.d.ts +11 -0
- package/bin/loanCredit/dtos/requests/UpdateActivationChecklistRequest.js +46 -0
- package/bin/loanCredit/dtos/requests/UpsertLoanBorrowerRequest.d.ts +2 -0
- package/bin/loanCredit/dtos/requests/UpsertLoanBorrowerRequest.js +6 -0
- package/bin/loanCredit/dtos/responses/LoanBorrowerResponse.d.ts +1 -0
- package/bin/loanCredit/enums/ClientLevelEnum.d.ts +11 -0
- package/bin/loanCredit/enums/ClientLevelEnum.js +15 -0
- package/bin/messagesConnector/dtos/SendMessageRequest.js +2 -1
- package/package.json +1 -1
- package/src/auth/dtos/SignUpProspectRequest.ts +23 -0
- package/src/auth/dtos/SignUpProspectResponse.ts +17 -0
- package/src/auth/index.ts +2 -0
- package/src/index.ts +4 -0
- package/src/kyc/dtos/responses/KycByDirectoryResponse.ts +69 -0
- package/src/kyc/dtos/responses/KycPersonData.ts +23 -0
- package/src/kyc/enums/KycVerificationStatusEnum.ts +18 -0
- package/src/kyc/events/KycVerificationChangedV1.ts +51 -0
- package/src/kyc/index.ts +10 -0
- package/src/loanCredit/dtos/LoanBorrower.ts +6 -0
- package/src/loanCredit/dtos/requests/SignLoanCreditRequest.ts +20 -0
- package/src/loanCredit/dtos/requests/UpsertLoanBorrowerRequest.ts +6 -0
- package/src/loanCredit/dtos/responses/LoanBorrowerResponse.ts +1 -0
- package/src/messagesConnector/dtos/SendMessageRequest.ts +8 -1
- package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +0 -11
- package/bin/benefitCenter/enums/BenefitFlowEnum.js +0 -15
- package/bin/loanConfig/enums/ModifiableByRoleEnum.d.ts +0 -11
- package/bin/loanConfig/enums/ModifiableByRoleEnum.js +0 -15
- package/bin/places/dtos/CashInFeeDto.d.ts +0 -17
- package/bin/places/dtos/CashInFeeDto.js +0 -12
- package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +0 -22
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +0 -11
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsISO8601, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { IdentificationDocumentStatus } from '../../identity/enums/IdentificationDocumentStatus';
|
|
4
|
+
import { KycVerificationStatusEnum } from '../enums/KycVerificationStatusEnum';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Cambio terminal de una verificación KYC, tal como llega desde el DDB Stream de
|
|
8
|
+
* `KycVerifications` a través del EventBridge Pipe (filtrado a COMPLETED).
|
|
9
|
+
*
|
|
10
|
+
* NO lleva `tenantId`: el de la tabla es un valor hardcodeado que no discrimina silo.
|
|
11
|
+
* La pertenencia se resuelve en el consumer con el gate de `WizardSession`.
|
|
12
|
+
*
|
|
13
|
+
* Los estados viajan CRUDOS para no acoplar al consumidor con el mapeo del dominio dueño.
|
|
14
|
+
*
|
|
15
|
+
* DEC-KYC-015: los tres identificadores usan `@IsNotEmpty()`. El NewImage de DDB puede traer
|
|
16
|
+
* `S: ""` — que `@IsString()` aceptaría en silencio. Preferimos que el mensaje caiga al DLQ
|
|
17
|
+
* en el boundary antes que fallar mudo tres pasos río abajo.
|
|
18
|
+
*
|
|
19
|
+
* DEC-KYC-016: `verificationResult` reusa `IdentificationDocumentStatus` — es el enum que el
|
|
20
|
+
* lambda productor (`kyc-verifications-business`) escribe literalmente en la tabla; duplicarlo
|
|
21
|
+
* aquí sería drift garantizado.
|
|
22
|
+
*/
|
|
23
|
+
export class KycVerificationChangedV1 {
|
|
24
|
+
/** La PK de la fila (`id`) mapeada a nombre de negocio. */
|
|
25
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
26
|
+
verificationId!: string;
|
|
27
|
+
|
|
28
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
29
|
+
directoryId!: string;
|
|
30
|
+
|
|
31
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
32
|
+
peopleId!: string;
|
|
33
|
+
|
|
34
|
+
@Expose() @IsOptional() @IsString()
|
|
35
|
+
metamapFlowId?: string;
|
|
36
|
+
|
|
37
|
+
@Expose() @IsEnum(KycVerificationStatusEnum)
|
|
38
|
+
verificationStatus!: KycVerificationStatusEnum;
|
|
39
|
+
|
|
40
|
+
@Expose() @IsEnum(IdentificationDocumentStatus)
|
|
41
|
+
verificationResult!: IdentificationDocumentStatus;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* ISO-8601 obligatorio: el ordenamiento del endpoint (spec §6) se apoya en que la fecha es
|
|
45
|
+
* léxicamente ordenable. Se escanearon las 193 filas de `KycVerifications` en dev —
|
|
46
|
+
* `createDate` 193/193 y `updateDate` 193/193 ISO-8601: 386/386, cero excepciones
|
|
47
|
+
* (ejemplo real: '2025-10-06T21:40:58.277Z'). Verificado, no asumido (2026-07-21).
|
|
48
|
+
*/
|
|
49
|
+
@Expose() @IsString() @IsISO8601()
|
|
50
|
+
updateDate!: string;
|
|
51
|
+
}
|
package/src/kyc/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Enums (el consolidado reusa RetailKycStatusEnum del dominio retailCustomer — DEC-KYC-014;
|
|
2
|
+
// `verificationResult` reusa IdentificationDocumentStatus de `identity` — DEC-KYC-016)
|
|
3
|
+
export * from './enums/KycVerificationStatusEnum';
|
|
4
|
+
|
|
5
|
+
// Response DTOs
|
|
6
|
+
export * from './dtos/responses/KycPersonData';
|
|
7
|
+
export * from './dtos/responses/KycByDirectoryResponse';
|
|
8
|
+
|
|
9
|
+
// Events
|
|
10
|
+
export * from './events/KycVerificationChangedV1';
|
|
@@ -28,6 +28,12 @@ export class LoanBorrower {
|
|
|
28
28
|
@IsString()
|
|
29
29
|
retailCustomerId!: string;
|
|
30
30
|
|
|
31
|
+
/** DirectoryId Fiado del cliente (id operacional — hidratado de CustomerKycVerifiedV1). */
|
|
32
|
+
@Expose()
|
|
33
|
+
@IsOptional()
|
|
34
|
+
@IsString()
|
|
35
|
+
fiadoDirectoryId?: string;
|
|
36
|
+
|
|
31
37
|
/** SCI vigente 0-100 (M7). Ausente hasta la primera evaluación. */
|
|
32
38
|
@Expose()
|
|
33
39
|
@IsOptional()
|
|
@@ -21,4 +21,24 @@ export class SignLoanCreditRequest {
|
|
|
21
21
|
@IsString()
|
|
22
22
|
@Length(4, 4)
|
|
23
23
|
otpCode?: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* SOLO en el inicio de firma (tiempo 1) con el OTP REAL de messages-business: el directoryId
|
|
27
|
+
* Fiado del cliente (lo aporta el WIZARD — dueño del dato; fallback: el fiadoDirectoryId
|
|
28
|
+
* hidratado en el borrower). El OTP se genera/verifica keyeado a este id (D5).
|
|
29
|
+
*/
|
|
30
|
+
@Expose()
|
|
31
|
+
@IsOptional()
|
|
32
|
+
@IsString()
|
|
33
|
+
otpDirectoryId?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* SOLO en el inicio de firma (tiempo 1) con el OTP REAL: el teléfono destino del SMS (E.164).
|
|
37
|
+
* PII TRANSITORIA: el motor la pasa a messages-business y NO la persiste ni loggea (silo
|
|
38
|
+
* PII-zero — el teléfono vive en RetailCustomer).
|
|
39
|
+
*/
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@IsString()
|
|
43
|
+
otpDestination?: string;
|
|
24
44
|
}
|
|
@@ -23,6 +23,12 @@ export class UpsertLoanBorrowerRequest {
|
|
|
23
23
|
@IsNotEmpty()
|
|
24
24
|
retailCustomerId!: string;
|
|
25
25
|
|
|
26
|
+
/** DirectoryId Fiado del cliente (id operacional). */
|
|
27
|
+
@Expose()
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsString()
|
|
30
|
+
fiadoDirectoryId?: string;
|
|
31
|
+
|
|
26
32
|
@Expose()
|
|
27
33
|
@IsOptional()
|
|
28
34
|
@IsInt()
|
|
@@ -7,6 +7,7 @@ import { ClientLevelEnum } from '../../../loanScoring/enums/ClientLevelEnum';
|
|
|
7
7
|
export interface LoanBorrowerResponse {
|
|
8
8
|
borrowerId: string;
|
|
9
9
|
retailCustomerId: string;
|
|
10
|
+
fiadoDirectoryId?: string;
|
|
10
11
|
sciScore?: number;
|
|
11
12
|
clientLevel?: ClientLevelEnum;
|
|
12
13
|
bureauScore?: number;
|
|
@@ -5,7 +5,14 @@ import { DeliveryChannelEnum } from '../../messaging';
|
|
|
5
5
|
export class SendMessageRequest {
|
|
6
6
|
@Expose() @IsEnum(DeliveryChannelEnum) channelType!: DeliveryChannelEnum;
|
|
7
7
|
@Expose() @IsString() @IsNotEmpty() messageType!: string;
|
|
8
|
-
|
|
8
|
+
// directoryId NO se valida como @IsUUID: para messages es una LLAVE DE CORRELACIÓN opaca
|
|
9
|
+
// (rate-limit + log + verify), no una FK a ningún directorio — la llave real es el par
|
|
10
|
+
// (typeOfDirectory, directoryId). Exigir UUID rompía dos casos legítimos: los cognitoSub UUID v7
|
|
11
|
+
// (que class-validator @IsUUID() v1-5 rechaza) y el OTP de teléfono del wizard retail, donde el
|
|
12
|
+
// cliente todavía NO tiene identidad Fiado — el OTP es justamente lo que verifica el teléfono, y
|
|
13
|
+
// corre ANTES de crear directory/people. Las otras dos puertas ya usan @IsString:
|
|
14
|
+
// VerifyOtpRequest y NotificationQueueMessageRequestV2 — esto deja el SEND HTTP consistente.
|
|
15
|
+
@Expose() @IsString() @IsNotEmpty() directoryId!: string;
|
|
9
16
|
@Expose() @IsString() @IsNotEmpty() typeOfDirectory!: string;
|
|
10
17
|
@Expose() @IsString() @IsNotEmpty() language!: string;
|
|
11
18
|
@Expose() @IsString() @IsNotEmpty() country!: string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare enum BenefitFlowEnum {
|
|
2
|
-
TOPUPS = "TOPUPS",
|
|
3
|
-
BILL_PAYMENT = "BILL_PAYMENT",
|
|
4
|
-
CREDIT = "CREDIT",
|
|
5
|
-
INSURANCE = "INSURANCE",
|
|
6
|
-
DONATION = "DONATION",
|
|
7
|
-
PHARMACY = "PHARMACY",
|
|
8
|
-
REMITTANCE = "REMITTANCE",
|
|
9
|
-
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
10
|
-
WALLET_FUNDING = "WALLET_FUNDING"
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BenefitFlowEnum = void 0;
|
|
4
|
-
var BenefitFlowEnum;
|
|
5
|
-
(function (BenefitFlowEnum) {
|
|
6
|
-
BenefitFlowEnum["TOPUPS"] = "TOPUPS";
|
|
7
|
-
BenefitFlowEnum["BILL_PAYMENT"] = "BILL_PAYMENT";
|
|
8
|
-
BenefitFlowEnum["CREDIT"] = "CREDIT";
|
|
9
|
-
BenefitFlowEnum["INSURANCE"] = "INSURANCE";
|
|
10
|
-
BenefitFlowEnum["DONATION"] = "DONATION";
|
|
11
|
-
BenefitFlowEnum["PHARMACY"] = "PHARMACY";
|
|
12
|
-
BenefitFlowEnum["REMITTANCE"] = "REMITTANCE";
|
|
13
|
-
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
14
|
-
BenefitFlowEnum["WALLET_FUNDING"] = "WALLET_FUNDING";
|
|
15
|
-
})(BenefitFlowEnum || (exports.BenefitFlowEnum = BenefitFlowEnum = {}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rol RBAC mínimo que puede modificar un parámetro (RBAC a nivel de parámetro, modelo-datos §8).
|
|
3
|
-
* `retailer_admin` = "Admin VentasLuga" de M6 §8. Valores = identificadores de rol de RBAC F0.
|
|
4
|
-
* TD-004: confirmar mapeo super_admin ↔ platform_super_admin con el naming real de F0.
|
|
5
|
-
* @enum {string}
|
|
6
|
-
*/
|
|
7
|
-
export declare enum ModifiableByRoleEnum {
|
|
8
|
-
SUPER_ADMIN = "super_admin",
|
|
9
|
-
SOFOM_ADMIN = "sofom_admin",
|
|
10
|
-
RETAILER_ADMIN = "retailer_admin"
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModifiableByRoleEnum = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Rol RBAC mínimo que puede modificar un parámetro (RBAC a nivel de parámetro, modelo-datos §8).
|
|
6
|
-
* `retailer_admin` = "Admin VentasLuga" de M6 §8. Valores = identificadores de rol de RBAC F0.
|
|
7
|
-
* TD-004: confirmar mapeo super_admin ↔ platform_super_admin con el naming real de F0.
|
|
8
|
-
* @enum {string}
|
|
9
|
-
*/
|
|
10
|
-
var ModifiableByRoleEnum;
|
|
11
|
-
(function (ModifiableByRoleEnum) {
|
|
12
|
-
ModifiableByRoleEnum["SUPER_ADMIN"] = "super_admin";
|
|
13
|
-
ModifiableByRoleEnum["SOFOM_ADMIN"] = "sofom_admin";
|
|
14
|
-
ModifiableByRoleEnum["RETAILER_ADMIN"] = "retailer_admin";
|
|
15
|
-
})(ModifiableByRoleEnum || (exports.ModifiableByRoleEnum = ModifiableByRoleEnum = {}));
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CurrencyId } from '../../currency/enums/CurrencyId';
|
|
2
|
-
/**
|
|
3
|
-
* Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
|
|
4
|
-
* - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
|
|
5
|
-
* - Passport (MX): por red → `fixed` + `percentage`.
|
|
6
|
-
* Response DTO — sin decoradores de validación.
|
|
7
|
-
*/
|
|
8
|
-
export declare class CashInFeeDto {
|
|
9
|
-
/** Comisión fija, en la moneda del país. */
|
|
10
|
-
fixed?: number;
|
|
11
|
-
/** Porcentaje del monto depositado (0–100). */
|
|
12
|
-
percentage?: number;
|
|
13
|
-
/** Tope máximo de comisión (GreenDot: el asociado cobra hasta este cap). */
|
|
14
|
-
cap?: number;
|
|
15
|
-
/** Moneda del fee: USD (GreenDot) | MXN (Passport). */
|
|
16
|
-
currency: CurrencyId;
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CashInFeeDto = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
|
|
6
|
-
* - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
|
|
7
|
-
* - Passport (MX): por red → `fixed` + `percentage`.
|
|
8
|
-
* Response DTO — sin decoradores de validación.
|
|
9
|
-
*/
|
|
10
|
-
class CashInFeeDto {
|
|
11
|
-
}
|
|
12
|
-
exports.CashInFeeDto = CashInFeeDto;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { MfaMethodEnum } from '../enums/MfaMethodEnum';
|
|
2
|
-
/**
|
|
3
|
-
* Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
4
|
-
* Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
|
|
5
|
-
* identidad SIN password. `tenantId` obligatorio (DEC-064 — el picker ya lo resolvió, NO "solo email").
|
|
6
|
-
* El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
|
|
7
|
-
* siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
|
|
8
|
-
*/
|
|
9
|
-
export declare class ResendOtpRequest {
|
|
10
|
-
email: string;
|
|
11
|
-
tenantId: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Respuesta del resend-otp. `session`/`mfaMethod` frescos del nuevo challenge CUSTOM_AUTH.
|
|
15
|
-
* Plain sin validators (no validamos lo que mandamos al cliente — fiado-validation-and-dtos § 7).
|
|
16
|
-
* Ambos opcionales: en los caminos de rechazo silencioso (anti-enumeración) o ramas sin CUSTOM_AUTH
|
|
17
|
-
* el server responde 200 genérico sin session ni método.
|
|
18
|
-
*/
|
|
19
|
-
export interface ResendOtpResponse {
|
|
20
|
-
session?: string;
|
|
21
|
-
mfaMethod?: MfaMethodEnum;
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
3
|
-
* Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
|
|
4
|
-
* `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
|
|
5
|
-
* server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
|
|
6
|
-
* scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
|
|
7
|
-
*/
|
|
8
|
-
export declare class ResendSelfRegisterOtpRequest {
|
|
9
|
-
tenantId: string;
|
|
10
|
-
email: string;
|
|
11
|
-
}
|