@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,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Datos de identidad del cliente, leídos de People tras un KYC completado.
|
|
3
|
+
* ⚠️ PII: nunca loguear esta estructura ni exponerla en endpoints de alta frecuencia.
|
|
4
|
+
*/
|
|
5
|
+
export declare class KycPersonData {
|
|
6
|
+
names?: string;
|
|
7
|
+
paternalLastName?: string;
|
|
8
|
+
maternalLastName?: string;
|
|
9
|
+
curp?: string;
|
|
10
|
+
dateOfBirth?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.KycPersonData = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Datos de identidad del cliente, leídos de People tras un KYC completado.
|
|
17
|
+
* ⚠️ PII: nunca loguear esta estructura ni exponerla en endpoints de alta frecuencia.
|
|
18
|
+
*/
|
|
19
|
+
class KycPersonData {
|
|
20
|
+
}
|
|
21
|
+
exports.KycPersonData = KycPersonData;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Expose)(),
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], KycPersonData.prototype, "names", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Expose)(),
|
|
30
|
+
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], KycPersonData.prototype, "paternalLastName", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_transformer_1.Expose)(),
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], KycPersonData.prototype, "maternalLastName", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Expose)(),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], KycPersonData.prototype, "curp", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_transformer_1.Expose)(),
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], KycPersonData.prototype, "dateOfBirth", void 0);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ciclo de vida de la verificación en `kyc-verifications-business` (crudo, sin colapsar).
|
|
3
|
+
*
|
|
4
|
+
* DEC-KYC-016: sí, duplica `KycVerificationStatus` de `@fiado/fiado-abstractions`
|
|
5
|
+
* (`bin/Fiado/Database/KycVerifications.d.ts`, mismos 5 valores) — y se queda así a propósito.
|
|
6
|
+
* `fiado-abstractions` es la lib legacy de la que `type-kit` está migrando: el contrato nuevo no
|
|
7
|
+
* debe depender de ella. No lo "arregles" importando desde abstractions.
|
|
8
|
+
*
|
|
9
|
+
* (Contraste: `verificationResult` NO se duplica — reusa `IdentificationDocumentStatus`, que ya
|
|
10
|
+
* vive publicado en esta misma lib bajo `identity`.)
|
|
11
|
+
*/
|
|
12
|
+
export declare enum KycVerificationStatusEnum {
|
|
13
|
+
CREATED = "CREATED",
|
|
14
|
+
SENT = "SENT",
|
|
15
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
16
|
+
COMPLETED = "COMPLETED",
|
|
17
|
+
ERROR = "ERROR"
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KycVerificationStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Ciclo de vida de la verificación en `kyc-verifications-business` (crudo, sin colapsar).
|
|
6
|
+
*
|
|
7
|
+
* DEC-KYC-016: sí, duplica `KycVerificationStatus` de `@fiado/fiado-abstractions`
|
|
8
|
+
* (`bin/Fiado/Database/KycVerifications.d.ts`, mismos 5 valores) — y se queda así a propósito.
|
|
9
|
+
* `fiado-abstractions` es la lib legacy de la que `type-kit` está migrando: el contrato nuevo no
|
|
10
|
+
* debe depender de ella. No lo "arregles" importando desde abstractions.
|
|
11
|
+
*
|
|
12
|
+
* (Contraste: `verificationResult` NO se duplica — reusa `IdentificationDocumentStatus`, que ya
|
|
13
|
+
* vive publicado en esta misma lib bajo `identity`.)
|
|
14
|
+
*/
|
|
15
|
+
var KycVerificationStatusEnum;
|
|
16
|
+
(function (KycVerificationStatusEnum) {
|
|
17
|
+
KycVerificationStatusEnum["CREATED"] = "CREATED";
|
|
18
|
+
KycVerificationStatusEnum["SENT"] = "SENT";
|
|
19
|
+
KycVerificationStatusEnum["IN_PROGRESS"] = "IN_PROGRESS";
|
|
20
|
+
KycVerificationStatusEnum["COMPLETED"] = "COMPLETED";
|
|
21
|
+
KycVerificationStatusEnum["ERROR"] = "ERROR";
|
|
22
|
+
})(KycVerificationStatusEnum || (exports.KycVerificationStatusEnum = KycVerificationStatusEnum = {}));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IdentificationDocumentStatus } from '../../identity/enums/IdentificationDocumentStatus';
|
|
2
|
+
import { KycVerificationStatusEnum } from '../enums/KycVerificationStatusEnum';
|
|
3
|
+
/**
|
|
4
|
+
* Cambio terminal de una verificación KYC, tal como llega desde el DDB Stream de
|
|
5
|
+
* `KycVerifications` a través del EventBridge Pipe (filtrado a COMPLETED).
|
|
6
|
+
*
|
|
7
|
+
* NO lleva `tenantId`: el de la tabla es un valor hardcodeado que no discrimina silo.
|
|
8
|
+
* La pertenencia se resuelve en el consumer con el gate de `WizardSession`.
|
|
9
|
+
*
|
|
10
|
+
* Los estados viajan CRUDOS para no acoplar al consumidor con el mapeo del dominio dueño.
|
|
11
|
+
*
|
|
12
|
+
* DEC-KYC-015: los tres identificadores usan `@IsNotEmpty()`. El NewImage de DDB puede traer
|
|
13
|
+
* `S: ""` — que `@IsString()` aceptaría en silencio. Preferimos que el mensaje caiga al DLQ
|
|
14
|
+
* en el boundary antes que fallar mudo tres pasos río abajo.
|
|
15
|
+
*
|
|
16
|
+
* DEC-KYC-016: `verificationResult` reusa `IdentificationDocumentStatus` — es el enum que el
|
|
17
|
+
* lambda productor (`kyc-verifications-business`) escribe literalmente en la tabla; duplicarlo
|
|
18
|
+
* aquí sería drift garantizado.
|
|
19
|
+
*/
|
|
20
|
+
export declare class KycVerificationChangedV1 {
|
|
21
|
+
/** La PK de la fila (`id`) mapeada a nombre de negocio. */
|
|
22
|
+
verificationId: string;
|
|
23
|
+
directoryId: string;
|
|
24
|
+
peopleId: string;
|
|
25
|
+
metamapFlowId?: string;
|
|
26
|
+
verificationStatus: KycVerificationStatusEnum;
|
|
27
|
+
verificationResult: IdentificationDocumentStatus;
|
|
28
|
+
/**
|
|
29
|
+
* ISO-8601 obligatorio: el ordenamiento del endpoint (spec §6) se apoya en que la fecha es
|
|
30
|
+
* léxicamente ordenable. Se escanearon las 193 filas de `KycVerifications` en dev —
|
|
31
|
+
* `createDate` 193/193 y `updateDate` 193/193 ISO-8601: 386/386, cero excepciones
|
|
32
|
+
* (ejemplo real: '2025-10-06T21:40:58.277Z'). Verificado, no asumido (2026-07-21).
|
|
33
|
+
*/
|
|
34
|
+
updateDate: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.KycVerificationChangedV1 = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const IdentificationDocumentStatus_1 = require("../../identity/enums/IdentificationDocumentStatus");
|
|
16
|
+
const KycVerificationStatusEnum_1 = require("../enums/KycVerificationStatusEnum");
|
|
17
|
+
/**
|
|
18
|
+
* Cambio terminal de una verificación KYC, tal como llega desde el DDB Stream de
|
|
19
|
+
* `KycVerifications` a través del EventBridge Pipe (filtrado a COMPLETED).
|
|
20
|
+
*
|
|
21
|
+
* NO lleva `tenantId`: el de la tabla es un valor hardcodeado que no discrimina silo.
|
|
22
|
+
* La pertenencia se resuelve en el consumer con el gate de `WizardSession`.
|
|
23
|
+
*
|
|
24
|
+
* Los estados viajan CRUDOS para no acoplar al consumidor con el mapeo del dominio dueño.
|
|
25
|
+
*
|
|
26
|
+
* DEC-KYC-015: los tres identificadores usan `@IsNotEmpty()`. El NewImage de DDB puede traer
|
|
27
|
+
* `S: ""` — que `@IsString()` aceptaría en silencio. Preferimos que el mensaje caiga al DLQ
|
|
28
|
+
* en el boundary antes que fallar mudo tres pasos río abajo.
|
|
29
|
+
*
|
|
30
|
+
* DEC-KYC-016: `verificationResult` reusa `IdentificationDocumentStatus` — es el enum que el
|
|
31
|
+
* lambda productor (`kyc-verifications-business`) escribe literalmente en la tabla; duplicarlo
|
|
32
|
+
* aquí sería drift garantizado.
|
|
33
|
+
*/
|
|
34
|
+
class KycVerificationChangedV1 {
|
|
35
|
+
}
|
|
36
|
+
exports.KycVerificationChangedV1 = KycVerificationChangedV1;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_transformer_1.Expose)(),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], KycVerificationChangedV1.prototype, "verificationId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_transformer_1.Expose)(),
|
|
45
|
+
(0, class_validator_1.IsString)(),
|
|
46
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], KycVerificationChangedV1.prototype, "directoryId", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_transformer_1.Expose)(),
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], KycVerificationChangedV1.prototype, "peopleId", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_transformer_1.Expose)(),
|
|
57
|
+
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
(0, class_validator_1.IsString)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], KycVerificationChangedV1.prototype, "metamapFlowId", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_transformer_1.Expose)(),
|
|
63
|
+
(0, class_validator_1.IsEnum)(KycVerificationStatusEnum_1.KycVerificationStatusEnum),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], KycVerificationChangedV1.prototype, "verificationStatus", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_transformer_1.Expose)(),
|
|
68
|
+
(0, class_validator_1.IsEnum)(IdentificationDocumentStatus_1.IdentificationDocumentStatus),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], KycVerificationChangedV1.prototype, "verificationResult", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_transformer_1.Expose)(),
|
|
73
|
+
(0, class_validator_1.IsString)(),
|
|
74
|
+
(0, class_validator_1.IsISO8601)(),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], KycVerificationChangedV1.prototype, "updateDate", void 0);
|
package/bin/kyc/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Enums (el consolidado reusa RetailKycStatusEnum del dominio retailCustomer — DEC-KYC-014;
|
|
18
|
+
// `verificationResult` reusa IdentificationDocumentStatus de `identity` — DEC-KYC-016)
|
|
19
|
+
__exportStar(require("./enums/KycVerificationStatusEnum"), exports);
|
|
20
|
+
// Response DTOs
|
|
21
|
+
__exportStar(require("./dtos/responses/KycPersonData"), exports);
|
|
22
|
+
__exportStar(require("./dtos/responses/KycByDirectoryResponse"), exports);
|
|
23
|
+
// Events
|
|
24
|
+
__exportStar(require("./events/KycVerificationChangedV1"), exports);
|
|
@@ -9,6 +9,8 @@ export declare class LoanBorrower {
|
|
|
9
9
|
borrowerId: string;
|
|
10
10
|
/** FK al comprador de retail (`RetailCustomer` — owner retail-customer-business). */
|
|
11
11
|
retailCustomerId: string;
|
|
12
|
+
/** DirectoryId Fiado del cliente (id operacional — hidratado de CustomerKycVerifiedV1). */
|
|
13
|
+
fiadoDirectoryId?: string;
|
|
12
14
|
/** SCI vigente 0-100 (M7). Ausente hasta la primera evaluación. */
|
|
13
15
|
sciScore?: number;
|
|
14
16
|
clientLevel?: ClientLevelEnum;
|
|
@@ -33,6 +33,12 @@ __decorate([
|
|
|
33
33
|
(0, class_validator_1.IsString)(),
|
|
34
34
|
__metadata("design:type", String)
|
|
35
35
|
], LoanBorrower.prototype, "retailCustomerId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_transformer_1.Expose)(),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], LoanBorrower.prototype, "fiadoDirectoryId", void 0);
|
|
36
42
|
__decorate([
|
|
37
43
|
(0, class_transformer_1.Expose)(),
|
|
38
44
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -14,4 +14,16 @@
|
|
|
14
14
|
export declare class SignLoanCreditRequest {
|
|
15
15
|
/** Código OTP de firma. Ausente = iniciar la firma (generar PDFs + enviar OTP). */
|
|
16
16
|
otpCode?: string;
|
|
17
|
+
/**
|
|
18
|
+
* SOLO en el inicio de firma (tiempo 1) con el OTP REAL de messages-business: el directoryId
|
|
19
|
+
* Fiado del cliente (lo aporta el WIZARD — dueño del dato; fallback: el fiadoDirectoryId
|
|
20
|
+
* hidratado en el borrower). El OTP se genera/verifica keyeado a este id (D5).
|
|
21
|
+
*/
|
|
22
|
+
otpDirectoryId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* SOLO en el inicio de firma (tiempo 1) con el OTP REAL: el teléfono destino del SMS (E.164).
|
|
25
|
+
* PII TRANSITORIA: el motor la pasa a messages-business y NO la persiste ni loggea (silo
|
|
26
|
+
* PII-zero — el teléfono vive en RetailCustomer).
|
|
27
|
+
*/
|
|
28
|
+
otpDestination?: string;
|
|
17
29
|
}
|
|
@@ -35,3 +35,15 @@ __decorate([
|
|
|
35
35
|
(0, class_validator_1.Length)(4, 4),
|
|
36
36
|
__metadata("design:type", String)
|
|
37
37
|
], SignLoanCreditRequest.prototype, "otpCode", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_transformer_1.Expose)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], SignLoanCreditRequest.prototype, "otpDirectoryId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_transformer_1.Expose)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], SignLoanCreditRequest.prototype, "otpDestination", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body de PUT /credits/:creditId/checklist (loan-credit-business). Marca condiciones de activación
|
|
3
|
+
* cumplidas. Solo se mandan las que cambian; en F3 las marcarán los flujos de firma de contrato
|
|
4
|
+
* (`downPayment` + `contractSigned`) y de enrolamiento MDM (`imeiEnrolled` + `lockVerified`).
|
|
5
|
+
*/
|
|
6
|
+
export declare class UpdateActivationChecklistRequest {
|
|
7
|
+
downPayment?: boolean;
|
|
8
|
+
contractSigned?: boolean;
|
|
9
|
+
imeiEnrolled?: boolean;
|
|
10
|
+
lockVerified?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UpdateActivationChecklistRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body de PUT /credits/:creditId/checklist (loan-credit-business). Marca condiciones de activación
|
|
17
|
+
* cumplidas. Solo se mandan las que cambian; en F3 las marcarán los flujos de firma de contrato
|
|
18
|
+
* (`downPayment` + `contractSigned`) y de enrolamiento MDM (`imeiEnrolled` + `lockVerified`).
|
|
19
|
+
*/
|
|
20
|
+
class UpdateActivationChecklistRequest {
|
|
21
|
+
}
|
|
22
|
+
exports.UpdateActivationChecklistRequest = UpdateActivationChecklistRequest;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_transformer_1.Expose)(),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_validator_1.IsBoolean)(),
|
|
27
|
+
__metadata("design:type", Boolean)
|
|
28
|
+
], UpdateActivationChecklistRequest.prototype, "downPayment", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsBoolean)(),
|
|
33
|
+
__metadata("design:type", Boolean)
|
|
34
|
+
], UpdateActivationChecklistRequest.prototype, "contractSigned", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsBoolean)(),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], UpdateActivationChecklistRequest.prototype, "imeiEnrolled", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsBoolean)(),
|
|
45
|
+
__metadata("design:type", Boolean)
|
|
46
|
+
], UpdateActivationChecklistRequest.prototype, "lockVerified", void 0);
|
|
@@ -7,6 +7,8 @@ import { LoanBeneficiary } from '../LoanBeneficiary';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class UpsertLoanBorrowerRequest {
|
|
9
9
|
retailCustomerId: string;
|
|
10
|
+
/** DirectoryId Fiado del cliente (id operacional). */
|
|
11
|
+
fiadoDirectoryId?: string;
|
|
10
12
|
sciScore?: number;
|
|
11
13
|
clientLevel?: ClientLevelEnum;
|
|
12
14
|
bureauScore?: number;
|
|
@@ -28,6 +28,12 @@ __decorate([
|
|
|
28
28
|
(0, class_validator_1.IsNotEmpty)(),
|
|
29
29
|
__metadata("design:type", String)
|
|
30
30
|
], UpsertLoanBorrowerRequest.prototype, "retailCustomerId", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], UpsertLoanBorrowerRequest.prototype, "fiadoDirectoryId", void 0);
|
|
31
37
|
__decorate([
|
|
32
38
|
(0, class_transformer_1.Expose)(),
|
|
33
39
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -6,6 +6,7 @@ import { ClientLevelEnum } from '../../../loanScoring/enums/ClientLevelEnum';
|
|
|
6
6
|
export interface LoanBorrowerResponse {
|
|
7
7
|
borrowerId: string;
|
|
8
8
|
retailCustomerId: string;
|
|
9
|
+
fiadoDirectoryId?: string;
|
|
9
10
|
sciScore?: number;
|
|
10
11
|
clientLevel?: ClientLevelEnum;
|
|
11
12
|
bureauScore?: number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nivel del cliente según su SCI (M7/05_MOTOR §3.2): 21-60 Bronce · 61-80 Plata · 81-100 Oro.
|
|
3
|
+
* Distinto de `CreditPlanLevelEnum` de loanOfferings (que además tiene `ALL` para planes):
|
|
4
|
+
* un CLIENTE nunca es `ALL`.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ClientLevelEnum {
|
|
8
|
+
BRONZE = "BRONZE",
|
|
9
|
+
SILVER = "SILVER",
|
|
10
|
+
GOLD = "GOLD"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientLevelEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Nivel del cliente según su SCI (M7/05_MOTOR §3.2): 21-60 Bronce · 61-80 Plata · 81-100 Oro.
|
|
6
|
+
* Distinto de `CreditPlanLevelEnum` de loanOfferings (que además tiene `ALL` para planes):
|
|
7
|
+
* un CLIENTE nunca es `ALL`.
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*/
|
|
10
|
+
var ClientLevelEnum;
|
|
11
|
+
(function (ClientLevelEnum) {
|
|
12
|
+
ClientLevelEnum["BRONZE"] = "BRONZE";
|
|
13
|
+
ClientLevelEnum["SILVER"] = "SILVER";
|
|
14
|
+
ClientLevelEnum["GOLD"] = "GOLD";
|
|
15
|
+
})(ClientLevelEnum || (exports.ClientLevelEnum = ClientLevelEnum = {}));
|
|
@@ -29,7 +29,8 @@ __decorate([
|
|
|
29
29
|
], SendMessageRequest.prototype, "messageType", void 0);
|
|
30
30
|
__decorate([
|
|
31
31
|
(0, class_transformer_1.Expose)(),
|
|
32
|
-
(0, class_validator_1.
|
|
32
|
+
(0, class_validator_1.IsString)(),
|
|
33
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
33
34
|
__metadata("design:type", String)
|
|
34
35
|
], SendMessageRequest.prototype, "directoryId", void 0);
|
|
35
36
|
__decorate([
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Alta de prospecto M2M en `auth-business` (crea onboarding + People + DirectoryUser).
|
|
6
|
+
* Contrato REDUCIDO respecto del de agente: sin caller, sin referral, sin campos de app.
|
|
7
|
+
*
|
|
8
|
+
* `tenantId` es OBLIGATORIO y explícito: la variante de agente lo tiene hardcodeado a
|
|
9
|
+
* `FIADO_BETA`, y eliminar ese hardcode es parte del contrato de este endpoint privado.
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ PII: nombre y teléfono — nunca loguear el request completo.
|
|
12
|
+
*/
|
|
13
|
+
export class SignUpProspectRequest {
|
|
14
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
15
|
+
name!: string;
|
|
16
|
+
|
|
17
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
18
|
+
phoneNumber!: string;
|
|
19
|
+
|
|
20
|
+
/** Decidido: sin `@Matches(/^[a-z0-9-]+$/)` — `FIADO_BETA` es un tenant real y ese regex lo rechazaría. */
|
|
21
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
22
|
+
tenantId!: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Identidad Fiado creada (o reusada) para el prospecto.
|
|
6
|
+
*
|
|
7
|
+
* DEC-KYC-015: `directoryId` y `peopleId` llevan `@IsNotEmpty()` — son los mismos dos
|
|
8
|
+
* identificadores que en el dominio `kyc`, y vienen de un destino que ya demostró devolver
|
|
9
|
+
* strings vacíos. `@IsString()` pelado los dejaría pasar en silencio.
|
|
10
|
+
*/
|
|
11
|
+
export class SignUpProspectResponse {
|
|
12
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
13
|
+
directoryId!: string;
|
|
14
|
+
|
|
15
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
16
|
+
peopleId!: string;
|
|
17
|
+
}
|
package/src/auth/index.ts
CHANGED
|
@@ -5,3 +5,5 @@ export * from './dtos/ResetPasswordBackofficeRequest';
|
|
|
5
5
|
export * from './dtos/SignInBackofficeRequest';
|
|
6
6
|
export * from './dtos/SignInBackofficeResponse';
|
|
7
7
|
export * from './dtos/SignUpBackofficeRequest';
|
|
8
|
+
export * from './dtos/SignUpProspectRequest';
|
|
9
|
+
export * from './dtos/SignUpProspectResponse';
|
package/src/index.ts
CHANGED
|
@@ -130,5 +130,9 @@ export * as LoanCredit from './loanCredit';
|
|
|
130
130
|
// ScoringProviderRouter configurable Modelias|Círculo con contrato agnóstico ScoringDecision;
|
|
131
131
|
// SureKeep Fase 2 — pista Loan/SOFOM).
|
|
132
132
|
export * as LoanScoring from './loanScoring';
|
|
133
|
+
// Kyc: contrato de la lectura confirmatoria del KYC (kyc-verifications-business) — estado
|
|
134
|
+
// consolidado + estados crudos + datos de persona. El consolidado reusa RetailKycStatusEnum
|
|
135
|
+
// (no hay enum consolidado propio — DEC-KYC-014). SureKeep Fase 2.
|
|
136
|
+
export * as Kyc from './kyc';
|
|
133
137
|
export * from './messaging';
|
|
134
138
|
export * from './complaint';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsISO8601, IsNotEmpty, IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
3
|
+
import { IdentificationDocumentStatus } from '../../../identity/enums/IdentificationDocumentStatus';
|
|
4
|
+
import { RetailKycStatusEnum } from '../../../retailCustomer/enums/RetailKycStatusEnum';
|
|
5
|
+
import { KycVerificationStatusEnum } from '../../enums/KycVerificationStatusEnum';
|
|
6
|
+
import { KycPersonData } from './KycPersonData';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Estado consolidado del KYC de un directorio + los estados crudos + los datos de persona.
|
|
10
|
+
*
|
|
11
|
+
* Los campos crudos viajan además del consolidado para que el consumidor NO tenga que
|
|
12
|
+
* reimplementar el mapeo de otro dominio.
|
|
13
|
+
*
|
|
14
|
+
* DEC-KYC-014: "sin verificación" se responde con 404, NO con un valor de enum. Por eso todos
|
|
15
|
+
* los campos de identidad y estado son REQUERIDOS — este DTO solo describe el caso en que sí
|
|
16
|
+
* existe una verificación.
|
|
17
|
+
*
|
|
18
|
+
* DEC-KYC-004: el vocabulario del consolidado es `RetailKycStatusEnum`, el único de la lib.
|
|
19
|
+
*
|
|
20
|
+
* DEC-KYC-016: `verificationResult` reusa `IdentificationDocumentStatus` — es el enum que el
|
|
21
|
+
* lambda productor (`kyc-verifications-business`) escribe literalmente en la tabla; duplicarlo
|
|
22
|
+
* aquí sería drift garantizado.
|
|
23
|
+
*
|
|
24
|
+
* ⚠️ Lleva PII en `person` (CURP y nombre completo).
|
|
25
|
+
*/
|
|
26
|
+
export class KycByDirectoryResponse {
|
|
27
|
+
@Expose() @IsEnum(RetailKycStatusEnum)
|
|
28
|
+
consolidated!: RetailKycStatusEnum;
|
|
29
|
+
|
|
30
|
+
/** La PK de la fila (`id`) mapeada a nombre de negocio. */
|
|
31
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
32
|
+
verificationId!: string;
|
|
33
|
+
|
|
34
|
+
/** DEC-KYC-015: `@IsNotEmpty()` — el 7.3% de las filas de dev trae string vacío. */
|
|
35
|
+
@Expose() @IsString() @IsNotEmpty()
|
|
36
|
+
peopleId!: string;
|
|
37
|
+
|
|
38
|
+
@Expose() @IsOptional() @IsString()
|
|
39
|
+
metamapFlowId?: string;
|
|
40
|
+
|
|
41
|
+
@Expose() @IsEnum(KycVerificationStatusEnum)
|
|
42
|
+
verificationStatus!: KycVerificationStatusEnum;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Requerido y acotado al enum: se escanearon las 193 filas de `KycVerifications` en dev y los
|
|
46
|
+
* valores son exactamente los tres — `IN_PROGRESS+UNVERIFIED` 104, `COMPLETED+VERIFIED` 69,
|
|
47
|
+
* `COMPLETED+UNVERIFIED` 19, `COMPLETED+REJECTED` 1. Cero valores fuera del set, cero vacíos.
|
|
48
|
+
* Verificado, no asumido (2026-07-21).
|
|
49
|
+
*/
|
|
50
|
+
@Expose() @IsEnum(IdentificationDocumentStatus)
|
|
51
|
+
verificationResult!: IdentificationDocumentStatus;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* ISO-8601 obligatorio: el ordenamiento del endpoint (spec §6) se apoya en que estas fechas
|
|
55
|
+
* son léxicamente ordenables — si no se valida el formato, el orden es una asunción sin red.
|
|
56
|
+
* Se escanearon las 193 filas de `KycVerifications` en dev: `createDate` 193/193 ISO-8601 y
|
|
57
|
+
* `updateDate` 193/193 — 386/386, cero excepciones (ejemplo real: '2025-10-06T21:40:58.277Z').
|
|
58
|
+
* Verificado, no asumido (2026-07-21).
|
|
59
|
+
*/
|
|
60
|
+
@Expose() @IsString() @IsISO8601()
|
|
61
|
+
createDate!: string;
|
|
62
|
+
|
|
63
|
+
/** ISO-8601 obligatorio — mismo escaneo de dev: 386/386 fechas ISO-8601 (2026-07-21). */
|
|
64
|
+
@Expose() @IsString() @IsISO8601()
|
|
65
|
+
updateDate!: string;
|
|
66
|
+
|
|
67
|
+
@Expose() @IsOptional() @ValidateNested() @Type(() => KycPersonData)
|
|
68
|
+
person?: KycPersonData;
|
|
69
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsOptional, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Datos de identidad del cliente, leídos de People tras un KYC completado.
|
|
6
|
+
* ⚠️ PII: nunca loguear esta estructura ni exponerla en endpoints de alta frecuencia.
|
|
7
|
+
*/
|
|
8
|
+
export class KycPersonData {
|
|
9
|
+
@Expose() @IsOptional() @IsString()
|
|
10
|
+
names?: string;
|
|
11
|
+
|
|
12
|
+
@Expose() @IsOptional() @IsString()
|
|
13
|
+
paternalLastName?: string;
|
|
14
|
+
|
|
15
|
+
@Expose() @IsOptional() @IsString()
|
|
16
|
+
maternalLastName?: string;
|
|
17
|
+
|
|
18
|
+
@Expose() @IsOptional() @IsString()
|
|
19
|
+
curp?: string;
|
|
20
|
+
|
|
21
|
+
@Expose() @IsOptional() @IsString()
|
|
22
|
+
dateOfBirth?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ciclo de vida de la verificación en `kyc-verifications-business` (crudo, sin colapsar).
|
|
3
|
+
*
|
|
4
|
+
* DEC-KYC-016: sí, duplica `KycVerificationStatus` de `@fiado/fiado-abstractions`
|
|
5
|
+
* (`bin/Fiado/Database/KycVerifications.d.ts`, mismos 5 valores) — y se queda así a propósito.
|
|
6
|
+
* `fiado-abstractions` es la lib legacy de la que `type-kit` está migrando: el contrato nuevo no
|
|
7
|
+
* debe depender de ella. No lo "arregles" importando desde abstractions.
|
|
8
|
+
*
|
|
9
|
+
* (Contraste: `verificationResult` NO se duplica — reusa `IdentificationDocumentStatus`, que ya
|
|
10
|
+
* vive publicado en esta misma lib bajo `identity`.)
|
|
11
|
+
*/
|
|
12
|
+
export enum KycVerificationStatusEnum {
|
|
13
|
+
CREATED = 'CREATED',
|
|
14
|
+
SENT = 'SENT',
|
|
15
|
+
IN_PROGRESS = 'IN_PROGRESS',
|
|
16
|
+
COMPLETED = 'COMPLETED',
|
|
17
|
+
ERROR = 'ERROR',
|
|
18
|
+
}
|