@fiado/type-kit 3.198.0 → 3.200.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/bin/loanConfig/enums/ModifiableByRoleEnum.d.ts +11 -0
- package/bin/loanConfig/enums/ModifiableByRoleEnum.js +15 -0
- package/bin/loanCredit/dtos/LoanBorrower.d.ts +1 -1
- package/bin/loanCredit/dtos/LoanBorrower.js +1 -1
- package/bin/loanCredit/dtos/LoanContract.d.ts +27 -0
- package/bin/loanCredit/dtos/LoanContract.js +91 -0
- package/bin/loanCredit/dtos/LoanCredit.d.ts +5 -1
- package/bin/loanCredit/dtos/LoanCredit.js +14 -1
- package/bin/loanCredit/dtos/requests/ActivationCheckRequest.d.ts +21 -0
- package/bin/loanCredit/dtos/requests/{UpdateActivationChecklistRequest.js → ActivationCheckRequest.js} +18 -12
- package/bin/loanCredit/dtos/requests/OriginateLoanCreditRequest.d.ts +12 -9
- package/bin/loanCredit/dtos/requests/OriginateLoanCreditRequest.js +14 -13
- package/bin/loanCredit/dtos/requests/QuoteLoanCreditRequest.d.ts +11 -0
- package/bin/loanCredit/dtos/requests/QuoteLoanCreditRequest.js +39 -0
- package/bin/loanCredit/dtos/requests/SignLoanCreditRequest.d.ts +17 -0
- package/bin/loanCredit/dtos/requests/SignLoanCreditRequest.js +37 -0
- package/bin/loanCredit/dtos/requests/UpsertLoanBorrowerRequest.d.ts +1 -1
- package/bin/loanCredit/dtos/requests/UpsertLoanBorrowerRequest.js +1 -1
- package/bin/loanCredit/dtos/responses/ActivationCheckResponse.d.ts +10 -0
- package/bin/loanCredit/dtos/responses/ActivationCheckResponse.js +2 -0
- package/bin/loanCredit/dtos/responses/LoanBorrowerResponse.d.ts +1 -1
- package/bin/loanCredit/dtos/responses/LoanContractResponse.d.ts +16 -0
- package/bin/loanCredit/dtos/responses/LoanContractResponse.js +2 -0
- package/bin/loanCredit/dtos/responses/LoanCreditResponse.d.ts +1 -1
- package/bin/loanCredit/dtos/responses/OriginateLoanCreditResponse.d.ts +5 -2
- package/bin/loanCredit/dtos/responses/QuoteLoanCreditResponse.d.ts +10 -0
- package/bin/loanCredit/dtos/responses/QuoteLoanCreditResponse.js +2 -0
- package/bin/loanCredit/dtos/responses/SignLoanCreditResponse.d.ts +20 -0
- package/bin/loanCredit/dtos/responses/SignLoanCreditResponse.js +2 -0
- package/bin/loanCredit/enums/ContractTypeEnum.d.ts +12 -0
- package/bin/loanCredit/enums/ContractTypeEnum.js +16 -0
- package/bin/loanCredit/enums/LoanInstallmentStatusEnum.d.ts +5 -2
- package/bin/loanCredit/enums/LoanInstallmentStatusEnum.js +5 -2
- package/bin/loanCredit/index.d.ts +10 -2
- package/bin/loanCredit/index.js +13 -2
- package/bin/places/dtos/CashInFeeDto.d.ts +17 -0
- package/bin/places/dtos/CashInFeeDto.js +12 -0
- package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
- package/bin/{walletFunding/dtos/CancelFundingRequest.js → platformRbac/dtos/ResendOtpRequest.js} +16 -13
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
- package/bin/{walletFunding/dtos/CancelFundingReferenceRequest.js → platformRbac/dtos/ResendSelfRegisterOtpRequest.js} +18 -13
- package/bin/retailCustomer/dtos/RetailCustomer.d.ts +24 -2
- package/bin/retailCustomer/dtos/RetailCustomer.js +64 -1
- package/bin/retailCustomer/dtos/requests/CreateCustomerRequest.d.ts +7 -1
- package/bin/retailCustomer/dtos/requests/CreateCustomerRequest.js +30 -1
- package/bin/retailCustomer/dtos/requests/UpdateCustomerRequest.d.ts +7 -1
- package/bin/retailCustomer/dtos/requests/UpdateCustomerRequest.js +31 -1
- package/bin/retailCustomer/dtos/requests/UpsertCustomerFromKycRequest.d.ts +13 -1
- package/bin/retailCustomer/dtos/requests/UpsertCustomerFromKycRequest.js +41 -1
- package/bin/retailCustomer/dtos/responses/CustomerResponse.d.ts +14 -2
- package/bin/retailCustomer/enums/RetailCustomerStatusEnum.d.ts +10 -0
- package/bin/retailCustomer/enums/RetailCustomerStatusEnum.js +14 -0
- package/bin/retailCustomer/index.d.ts +1 -0
- package/bin/retailCustomer/index.js +1 -0
- package/package.json +1 -1
- package/src/loanCredit/dtos/LoanBorrower.ts +1 -1
- package/src/loanCredit/dtos/LoanContract.ts +70 -0
- package/src/loanCredit/dtos/LoanCredit.ts +14 -1
- package/src/loanCredit/dtos/requests/ActivationCheckRequest.ts +39 -0
- package/src/loanCredit/dtos/requests/OriginateLoanCreditRequest.ts +16 -15
- package/src/loanCredit/dtos/requests/QuoteLoanCreditRequest.ts +24 -0
- package/src/loanCredit/dtos/requests/SignLoanCreditRequest.ts +24 -0
- package/src/loanCredit/dtos/requests/UpsertLoanBorrowerRequest.ts +1 -1
- package/src/loanCredit/dtos/responses/ActivationCheckResponse.ts +11 -0
- package/src/loanCredit/dtos/responses/LoanBorrowerResponse.ts +1 -1
- package/src/loanCredit/dtos/responses/LoanContractResponse.ts +17 -0
- package/src/loanCredit/dtos/responses/LoanCreditResponse.ts +1 -1
- package/src/loanCredit/dtos/responses/OriginateLoanCreditResponse.ts +5 -2
- package/src/loanCredit/dtos/responses/QuoteLoanCreditResponse.ts +11 -0
- package/src/loanCredit/dtos/responses/SignLoanCreditResponse.ts +21 -0
- package/src/loanCredit/enums/ContractTypeEnum.ts +12 -0
- package/src/loanCredit/enums/LoanInstallmentStatusEnum.ts +5 -2
- package/src/loanCredit/index.ts +11 -2
- package/src/retailCustomer/dtos/RetailCustomer.ts +75 -3
- package/src/retailCustomer/dtos/requests/CreateCustomerRequest.ts +26 -2
- package/src/retailCustomer/dtos/requests/UpdateCustomerRequest.ts +28 -2
- package/src/retailCustomer/dtos/requests/UpsertCustomerFromKycRequest.ts +49 -2
- package/src/retailCustomer/dtos/responses/CustomerResponse.ts +14 -2
- package/src/retailCustomer/enums/RetailCustomerStatusEnum.ts +10 -0
- package/src/retailCustomer/index.ts +1 -0
- package/bin/loanCredit/dtos/requests/UpdateActivationChecklistRequest.d.ts +0 -11
- package/bin/loanCredit/enums/ClientLevelEnum.d.ts +0 -11
- package/bin/loanCredit/enums/ClientLevelEnum.js +0 -15
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +0 -6
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +0 -7
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +0 -6
- package/bin/walletFunding/dtos/CancelFundingRequest.d.ts +0 -11
- package/bin/walletFunding/dtos/CancelFundingResponse.d.ts +0 -14
- package/bin/walletFunding/dtos/CancelFundingResponse.js +0 -12
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +0 -3
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +0 -21
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +0 -7
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +0 -6
- package/src/loanCredit/dtos/requests/UpdateActivationChecklistRequest.ts +0 -29
- package/src/loanCredit/enums/ClientLevelEnum.ts +0 -11
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AddressBase } from '../../../address/dtos/AddressBase';
|
|
2
2
|
import { AccountStatusEnum } from '../../enums/AccountStatusEnum';
|
|
3
3
|
import { KycModalityEnum } from '../../enums/KycModalityEnum';
|
|
4
|
+
import { RetailCustomerStatusEnum } from '../../enums/RetailCustomerStatusEnum';
|
|
4
5
|
import { RetailKycStatusEnum } from '../../enums/RetailKycStatusEnum';
|
|
5
6
|
/**
|
|
6
7
|
* Vista de un cliente retail hacia el consumidor (BO / api-invoker). SureKeep Fase 2 — pista Retail.
|
|
@@ -9,9 +10,15 @@ import { RetailKycStatusEnum } from '../../enums/RetailKycStatusEnum';
|
|
|
9
10
|
export interface CustomerResponse {
|
|
10
11
|
retailCustomerId: string;
|
|
11
12
|
retailerId: string;
|
|
12
|
-
|
|
13
|
+
originStoreId: string;
|
|
14
|
+
names: string;
|
|
15
|
+
paternalLastName: string;
|
|
16
|
+
maternalLastName: string | null;
|
|
13
17
|
phone: string;
|
|
14
|
-
|
|
18
|
+
phoneVerified: boolean;
|
|
19
|
+
curp: string | null;
|
|
20
|
+
rfc: string | null;
|
|
21
|
+
email: string | null;
|
|
15
22
|
birthDate: string | null;
|
|
16
23
|
fiadoDirectoryId: string | null;
|
|
17
24
|
fiadoPeopleId: string | null;
|
|
@@ -25,6 +32,11 @@ export interface CustomerResponse {
|
|
|
25
32
|
addressConfirmed: boolean;
|
|
26
33
|
kycStatus: RetailKycStatusEnum;
|
|
27
34
|
kycModality: KycModalityEnum | null;
|
|
35
|
+
kycScore: number | null;
|
|
36
|
+
metamapVerificationId: string | null;
|
|
37
|
+
pldFlag: boolean;
|
|
38
|
+
notes: string | null;
|
|
39
|
+
status: RetailCustomerStatusEnum;
|
|
28
40
|
createdAt: string;
|
|
29
41
|
updatedAt: string;
|
|
30
42
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de vigencia del cliente retail — soft-delete de la convención F1 (modelo-datos F1 §1-§2:
|
|
3
|
+
* "soft-delete" es obligatorio en todas las entidades del silo). ACTIVE es el default del alta;
|
|
4
|
+
* INACTIVE marca la baja lógica (nunca se borra el ítem, para trazabilidad regulatoria).
|
|
5
|
+
* SureKeep Fase 2 — pista Retail.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum RetailCustomerStatusEnum {
|
|
8
|
+
ACTIVE = "ACTIVE",
|
|
9
|
+
INACTIVE = "INACTIVE"
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetailCustomerStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estado de vigencia del cliente retail — soft-delete de la convención F1 (modelo-datos F1 §1-§2:
|
|
6
|
+
* "soft-delete" es obligatorio en todas las entidades del silo). ACTIVE es el default del alta;
|
|
7
|
+
* INACTIVE marca la baja lógica (nunca se borra el ítem, para trazabilidad regulatoria).
|
|
8
|
+
* SureKeep Fase 2 — pista Retail.
|
|
9
|
+
*/
|
|
10
|
+
var RetailCustomerStatusEnum;
|
|
11
|
+
(function (RetailCustomerStatusEnum) {
|
|
12
|
+
RetailCustomerStatusEnum["ACTIVE"] = "ACTIVE";
|
|
13
|
+
RetailCustomerStatusEnum["INACTIVE"] = "INACTIVE";
|
|
14
|
+
})(RetailCustomerStatusEnum || (exports.RetailCustomerStatusEnum = RetailCustomerStatusEnum = {}));
|
|
@@ -2,6 +2,7 @@ export * from './enums/AccountStatusEnum';
|
|
|
2
2
|
export * from './enums/RetailKycStatusEnum';
|
|
3
3
|
export * from './enums/KycModalityEnum';
|
|
4
4
|
export * from './enums/KycReviewResultEnum';
|
|
5
|
+
export * from './enums/RetailCustomerStatusEnum';
|
|
5
6
|
export * from './dtos/KycReview';
|
|
6
7
|
export * from './dtos/RetailCustomer';
|
|
7
8
|
export * from './dtos/requests/CreateCustomerRequest';
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./enums/AccountStatusEnum"), exports);
|
|
|
19
19
|
__exportStar(require("./enums/RetailKycStatusEnum"), exports);
|
|
20
20
|
__exportStar(require("./enums/KycModalityEnum"), exports);
|
|
21
21
|
__exportStar(require("./enums/KycReviewResultEnum"), exports);
|
|
22
|
+
__exportStar(require("./enums/RetailCustomerStatusEnum"), exports);
|
|
22
23
|
// Entidades (planas, con class-validator + @Expose)
|
|
23
24
|
__exportStar(require("./dtos/KycReview"), exports);
|
|
24
25
|
__exportStar(require("./dtos/RetailCustomer"), exports);
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
ValidateNested,
|
|
11
11
|
} from 'class-validator';
|
|
12
12
|
import { regexIso8601 } from '../../helpers/constans/regex';
|
|
13
|
-
import { ClientLevelEnum } from '
|
|
13
|
+
import { ClientLevelEnum } from '../../loanScoring/enums/ClientLevelEnum';
|
|
14
14
|
import { LoanBeneficiary } from './LoanBeneficiary';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsEnum, IsOptional, IsString, Matches } from 'class-validator';
|
|
3
|
+
import { regexIso8601 } from '../../helpers/constans/regex';
|
|
4
|
+
import { ContractTypeEnum } from '../enums/ContractTypeEnum';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* LoanContract — documento del contrato de crédito con firma FES (modelo-datos §5b ·
|
|
8
|
+
* `<T>LoanContract_GT` · M2 §4.3-§4.4). Un registro por documento (3 por crédito — C4).
|
|
9
|
+
*
|
|
10
|
+
* Nace DRAFT en la originación (sin PDF); la firma FES genera el PDF, calcula su `sha256`,
|
|
11
|
+
* verifica el OTP y sella con NOM-151. Conservación documental: 10 años (NOM-151).
|
|
12
|
+
* `signedAt` ausente = draft sin firmar.
|
|
13
|
+
*/
|
|
14
|
+
export class LoanContract {
|
|
15
|
+
@Expose()
|
|
16
|
+
@IsString()
|
|
17
|
+
contractId!: string;
|
|
18
|
+
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsString()
|
|
21
|
+
creditId!: string;
|
|
22
|
+
|
|
23
|
+
@Expose()
|
|
24
|
+
@IsEnum(ContractTypeEnum)
|
|
25
|
+
type!: ContractTypeEnum;
|
|
26
|
+
|
|
27
|
+
/** Key del PDF en el bucket del tenant (`loan-{tenant}-{env}`). Ausente hasta generar (AS-09). */
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@IsString()
|
|
31
|
+
pdfS3Key?: string;
|
|
32
|
+
|
|
33
|
+
/** Hash SHA-256 del PDF firmado (trazabilidad FES — M2 §4.4). Ausente hasta generar. */
|
|
34
|
+
@Expose()
|
|
35
|
+
@IsOptional()
|
|
36
|
+
@IsString()
|
|
37
|
+
sha256?: string;
|
|
38
|
+
|
|
39
|
+
/** El OTP de firma fue verificado (voluntad de firma — FES). */
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsBoolean()
|
|
42
|
+
otpVerified!: boolean;
|
|
43
|
+
|
|
44
|
+
/** Sello de tiempo NOM-151 (TSA). Ausente hasta firmar (AS del TSA connector). */
|
|
45
|
+
@Expose()
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@IsString()
|
|
48
|
+
nom151Timestamp?: string;
|
|
49
|
+
|
|
50
|
+
@Expose()
|
|
51
|
+
@IsOptional()
|
|
52
|
+
@Matches(regexIso8601)
|
|
53
|
+
signedAt?: string;
|
|
54
|
+
|
|
55
|
+
@Expose()
|
|
56
|
+
@IsString()
|
|
57
|
+
createdBy!: string;
|
|
58
|
+
|
|
59
|
+
@Expose()
|
|
60
|
+
@IsString()
|
|
61
|
+
updatedBy!: string;
|
|
62
|
+
|
|
63
|
+
@Expose()
|
|
64
|
+
@Matches(regexIso8601)
|
|
65
|
+
createdAt!: string;
|
|
66
|
+
|
|
67
|
+
@Expose()
|
|
68
|
+
@Matches(regexIso8601)
|
|
69
|
+
updatedAt!: string;
|
|
70
|
+
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ValidateNested,
|
|
12
12
|
} from 'class-validator';
|
|
13
13
|
import { regexIso8601 } from '../../helpers/constans/regex';
|
|
14
|
-
import { ClientLevelEnum } from '
|
|
14
|
+
import { ClientLevelEnum } from '../../loanScoring/enums/ClientLevelEnum';
|
|
15
15
|
import { LoanCreditStatusEnum } from '../enums/LoanCreditStatusEnum';
|
|
16
16
|
import { ActivationChecklist } from './ActivationChecklist';
|
|
17
17
|
|
|
@@ -91,6 +91,19 @@ export class LoanCredit {
|
|
|
91
91
|
@IsInt()
|
|
92
92
|
totalToPayCents!: number;
|
|
93
93
|
|
|
94
|
+
/** CAT decimal (`3.85` = 385%) — lo calcula el simulador de loan-offerings (C3/AS-01). */
|
|
95
|
+
@Expose()
|
|
96
|
+
@IsOptional()
|
|
97
|
+
@IsNumber()
|
|
98
|
+
@Min(0)
|
|
99
|
+
catAnnual?: number;
|
|
100
|
+
|
|
101
|
+
/** Sesión del wizard que originó — clave de idempotencia del originate (AS-07). */
|
|
102
|
+
@Expose()
|
|
103
|
+
@IsOptional()
|
|
104
|
+
@IsString()
|
|
105
|
+
wizardSessionId?: string;
|
|
106
|
+
|
|
94
107
|
/** IMEI del equipo financiado (se fija en el enrolamiento MDM). */
|
|
95
108
|
@Expose()
|
|
96
109
|
@IsOptional()
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de `POST /private/credits/:creditId/activate-check` (loan-credit-business — M2 §5).
|
|
6
|
+
* Marca condiciones del checklist de activación cumplidas (solo las que cambian, solo a `true`):
|
|
7
|
+
* `downPayment` la reporta el wizard al confirmar el enganche (paso 07); `imeiEnrolled` +
|
|
8
|
+
* `lockVerified` las dispara el paso 09 variante crédito (enrolamiento MDM vía la abstracción de
|
|
9
|
+
* proveedor). `contractSigned` NO se marca por acá — solo la firma FES (endpoint sign).
|
|
10
|
+
*
|
|
11
|
+
* Cuando las 4 condiciones quedan `true` en el mismo request → el crédito pasa a `ACTIVE`:
|
|
12
|
+
* vencimientos `activatedAt + n×7d` (domingo→lunes), `voluntaryCancelDeadline = +7d`, flag de
|
|
13
|
+
* cobro PCF configurado (C7 — solo flag, el débito real requiere adendum).
|
|
14
|
+
*/
|
|
15
|
+
export class ActivationCheckRequest {
|
|
16
|
+
/** Enganche confirmado (efectivo/débito inmediato; SPEI espera confirmación — M2 §5). */
|
|
17
|
+
@Expose()
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@IsBoolean()
|
|
20
|
+
downPayment?: boolean;
|
|
21
|
+
|
|
22
|
+
/** IMEI enrolado en MDM. Dispara el enroll vía `MdmConnectorRouter` si aún no se hizo. */
|
|
23
|
+
@Expose()
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@IsBoolean()
|
|
26
|
+
imeiEnrolled?: boolean;
|
|
27
|
+
|
|
28
|
+
/** Software de bloqueo verificado (el MDM reporta "activo"). */
|
|
29
|
+
@Expose()
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@IsBoolean()
|
|
32
|
+
lockVerified?: boolean;
|
|
33
|
+
|
|
34
|
+
/** IMEI del equipo (paso 09) si no se fijó en el originate. Luhn-validado por el motor. */
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsString()
|
|
38
|
+
imei?: string;
|
|
39
|
+
}
|
|
@@ -3,23 +3,30 @@ import {
|
|
|
3
3
|
IsEnum,
|
|
4
4
|
IsInt,
|
|
5
5
|
IsNotEmpty,
|
|
6
|
-
IsNumber,
|
|
7
6
|
IsOptional,
|
|
8
7
|
IsString,
|
|
9
8
|
Max,
|
|
10
9
|
Min,
|
|
11
10
|
} from 'class-validator';
|
|
12
|
-
import { ClientLevelEnum } from '
|
|
11
|
+
import { ClientLevelEnum } from '../../../loanScoring/enums/ClientLevelEnum';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
|
-
* Body de POST /credits (loan-credit-business
|
|
16
|
-
*
|
|
14
|
+
* Body de `POST /private/credits/originate` (loan-credit-business — wizard, vía api-invoker).
|
|
15
|
+
* Origina el crédito en `PENDING_ACTIVATION`: valida (M2 §4.2: sin otro crédito vivo, plan activo,
|
|
16
|
+
* IMEI libre), invoca el simulador de loan-offerings con `planId+termWeeks+precio+enganche` (la
|
|
17
|
+
* TNA y el CAT los resuelve el PLAN — el caller NO los manda) y persiste crédito + cuotas +
|
|
18
|
+
* contratos draft.
|
|
17
19
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* de cuotas del crédito lo genera y persiste este lambda).
|
|
20
|
+
* **Idempotente por `wizardSessionId`** (el wizard reintenta): mismo wizardSessionId → devuelve el
|
|
21
|
+
* crédito ya originado, no crea otro. El tenant viaja por query `?tenantId=` (convención privados).
|
|
21
22
|
*/
|
|
22
23
|
export class OriginateLoanCreditRequest {
|
|
24
|
+
/** Sesión del wizard que origina — clave de idempotencia (AS-07). */
|
|
25
|
+
@Expose()
|
|
26
|
+
@IsString()
|
|
27
|
+
@IsNotEmpty()
|
|
28
|
+
wizardSessionId!: string;
|
|
29
|
+
|
|
23
30
|
@Expose()
|
|
24
31
|
@IsString()
|
|
25
32
|
@IsNotEmpty()
|
|
@@ -46,14 +53,7 @@ export class OriginateLoanCreditRequest {
|
|
|
46
53
|
@Min(0)
|
|
47
54
|
downPaymentCents!: number;
|
|
48
55
|
|
|
49
|
-
/**
|
|
50
|
-
@Expose()
|
|
51
|
-
@IsNumber()
|
|
52
|
-
@Min(0)
|
|
53
|
-
@Max(10)
|
|
54
|
-
tnaAnnual!: number;
|
|
55
|
-
|
|
56
|
-
/** SCI del cliente al originar (snapshot). */
|
|
56
|
+
/** SCI del cliente al originar (snapshot de la evaluación del paso 05). */
|
|
57
57
|
@Expose()
|
|
58
58
|
@IsOptional()
|
|
59
59
|
@IsInt()
|
|
@@ -66,6 +66,7 @@ export class OriginateLoanCreditRequest {
|
|
|
66
66
|
@IsEnum(ClientLevelEnum)
|
|
67
67
|
clientLevelAtOrigination?: ClientLevelEnum;
|
|
68
68
|
|
|
69
|
+
/** IMEI del equipo si ya se conoce (también puede fijarse en el paso 09 vía activate-check). */
|
|
69
70
|
@Expose()
|
|
70
71
|
@IsOptional()
|
|
71
72
|
@IsString()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsInt, IsOptional, Max, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de `POST /private/credits/:creditId/quote` (loan-credit-business — wizard paso 06).
|
|
6
|
+
* Re-cotiza el crédito en `PENDING_ACTIVATION` con términos nuevos (el cliente itera
|
|
7
|
+
* plazo/enganche en el cotizador) e invoca el simulador de loan-offerings; regenera las cuotas.
|
|
8
|
+
* Campos ausentes = conservar el valor actual del crédito. Rechaza si el crédito no está PENDING
|
|
9
|
+
* o si el contrato ya se firmó (los términos quedan congelados con la firma).
|
|
10
|
+
*/
|
|
11
|
+
export class QuoteLoanCreditRequest {
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsOptional()
|
|
14
|
+
@IsInt()
|
|
15
|
+
@Min(1)
|
|
16
|
+
@Max(104)
|
|
17
|
+
termWeeks?: number;
|
|
18
|
+
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsInt()
|
|
22
|
+
@Min(0)
|
|
23
|
+
downPaymentCents?: number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsOptional, IsString, Length } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de `POST /private/credits/:creditId/sign` (loan-credit-business — wizard paso 08, firma FES
|
|
6
|
+
* M2 §4.4). Endpoint de DOS tiempos sobre el mismo contrato:
|
|
7
|
+
*
|
|
8
|
+
* 1. **SIN `otpCode`** → INICIA la firma: congela términos, genera los 3 PDFs (C4), calcula sus
|
|
9
|
+
* sha256 y dispara el OTP dedicado de firma (4 dígitos, 5 min, vía messages-business — D5;
|
|
10
|
+
* distinto al OTP del paso 01). Responde `otpSent: true`.
|
|
11
|
+
* 2. **CON `otpCode`** → VERIFICA el OTP y firma: marca los contratos `otpVerified` + `signedAt` +
|
|
12
|
+
* NOM-151, y pone `activationChecklist.contractSigned = true`.
|
|
13
|
+
*
|
|
14
|
+
* Errores: `OTP_INVALID` · `OTP_EXPIRED` · `OTP_MAX_ATTEMPTS` · `CREDIT_NOT_PENDING`.
|
|
15
|
+
* (Semántica a ratificar con el contrato del wizard — AS-07.)
|
|
16
|
+
*/
|
|
17
|
+
export class SignLoanCreditRequest {
|
|
18
|
+
/** Código OTP de firma. Ausente = iniciar la firma (generar PDFs + enviar OTP). */
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsString()
|
|
22
|
+
@Length(4, 4)
|
|
23
|
+
otpCode?: string;
|
|
24
|
+
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Min,
|
|
10
10
|
ValidateNested,
|
|
11
11
|
} from 'class-validator';
|
|
12
|
-
import { ClientLevelEnum } from '
|
|
12
|
+
import { ClientLevelEnum } from '../../../loanScoring/enums/ClientLevelEnum';
|
|
13
13
|
import { LoanBeneficiary } from '../LoanBeneficiary';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LoanCreditResponse } from './LoanCreditResponse';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Response de `POST /private/credits/:creditId/activate-check` (loan-credit-business — M2 §5):
|
|
5
|
+
* el crédito con el checklist actualizado. `missingItems` lista las condiciones que faltan
|
|
6
|
+
* (vacío cuando el crédito quedó `ACTIVE`).
|
|
7
|
+
*/
|
|
8
|
+
export interface ActivationCheckResponse {
|
|
9
|
+
credit: LoanCreditResponse;
|
|
10
|
+
missingItems: string[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ContractTypeEnum } from '../../enums/ContractTypeEnum';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Response de un documento del contrato (loan-credit-business). `signedAt` ausente = draft.
|
|
5
|
+
*/
|
|
6
|
+
export interface LoanContractResponse {
|
|
7
|
+
contractId: string;
|
|
8
|
+
creditId: string;
|
|
9
|
+
type: ContractTypeEnum;
|
|
10
|
+
pdfS3Key?: string;
|
|
11
|
+
sha256?: string;
|
|
12
|
+
otpVerified: boolean;
|
|
13
|
+
nom151Timestamp?: string;
|
|
14
|
+
signedAt?: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { LoanContractResponse } from './LoanContractResponse';
|
|
1
2
|
import { LoanCreditResponse } from './LoanCreditResponse';
|
|
2
3
|
import { LoanInstallmentResponse } from './LoanInstallmentResponse';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
* Response de POST /credits (loan-credit-business): el crédito recién
|
|
6
|
-
* `PENDING_ACTIVATION` + su plan de cuotas
|
|
6
|
+
* Response de `POST /private/credits/originate` (loan-credit-business): el crédito recién
|
|
7
|
+
* originado en `PENDING_ACTIVATION` + su plan de cuotas (fechas ausentes hasta activar) + los 3
|
|
8
|
+
* contratos draft (C4 — se firman en el paso 08).
|
|
7
9
|
*/
|
|
8
10
|
export interface OriginateLoanCreditResponse {
|
|
9
11
|
credit: LoanCreditResponse;
|
|
10
12
|
installments: LoanInstallmentResponse[];
|
|
13
|
+
contracts: LoanContractResponse[];
|
|
11
14
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LoanCreditResponse } from './LoanCreditResponse';
|
|
2
|
+
import { LoanInstallmentResponse } from './LoanInstallmentResponse';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Response de `POST /private/credits/:creditId/quote` (loan-credit-business): el crédito con los
|
|
6
|
+
* términos re-cotizados + el plan de cuotas regenerado (fechas ausentes hasta activar).
|
|
7
|
+
*/
|
|
8
|
+
export interface QuoteLoanCreditResponse {
|
|
9
|
+
credit: LoanCreditResponse;
|
|
10
|
+
installments: LoanInstallmentResponse[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LoanContractResponse } from './LoanContractResponse';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Response de `POST /private/credits/:creditId/sign` (loan-credit-business — firma FES en 2
|
|
5
|
+
* tiempos): al INICIAR (`otpSent: true`, contratos con PDF+hash sin firmar); al VERIFICAR
|
|
6
|
+
* (`signed: true`, contratos firmados + checklist con `contractSigned = true`).
|
|
7
|
+
*/
|
|
8
|
+
export interface SignLoanCreditResponse {
|
|
9
|
+
creditId: string;
|
|
10
|
+
/** true cuando el request inició la firma y el OTP fue despachado. */
|
|
11
|
+
otpSent: boolean;
|
|
12
|
+
/** true cuando el OTP fue verificado y los contratos quedaron firmados. */
|
|
13
|
+
signed: boolean;
|
|
14
|
+
contracts: LoanContractResponse[];
|
|
15
|
+
activationChecklist: {
|
|
16
|
+
downPayment: boolean;
|
|
17
|
+
contractSigned: boolean;
|
|
18
|
+
imeiEnrolled: boolean;
|
|
19
|
+
lockVerified: boolean;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de documento del contrato de crédito (M2 §4.3 / C4 — 3 documentos):
|
|
3
|
+
* `CREDIT` = contrato de crédito celular (RECA 16145-439-038506/04-01076-0525) ·
|
|
4
|
+
* `PROMISSORY_NOTE` = pagaré (garantiza el crédito; mismo monto/tasa/plazo) ·
|
|
5
|
+
* `SIC_AUTHORIZATION` = autorización de consulta/reporte a Círculo de Crédito (Art. 28 LRSIC).
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*/
|
|
8
|
+
export enum ContractTypeEnum {
|
|
9
|
+
CREDIT = 'CREDIT',
|
|
10
|
+
PROMISSORY_NOTE = 'PROMISSORY_NOTE',
|
|
11
|
+
SIC_AUTHORIZATION = 'SIC_AUTHORIZATION',
|
|
12
|
+
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Estado de una cuota semanal del crédito (M2 §6.1
|
|
3
|
-
*
|
|
2
|
+
* Estado de una cuota semanal del crédito (M2 §6.1: pendiente · pagado · pagado_adelantado ·
|
|
3
|
+
* vencido · reestructurado). `PAID_IN_ADVANCE` = pago adelantado (cubre cuota futura tal cual,
|
|
4
|
+
* sin recalcular tabla — M2 §3.7). `RESTRUCTURED` = la cuota dejó de aplicar por
|
|
5
|
+
* reestructura o cancelación.
|
|
4
6
|
* @enum {string}
|
|
5
7
|
*/
|
|
6
8
|
export enum LoanInstallmentStatusEnum {
|
|
7
9
|
PENDING = 'PENDING',
|
|
8
10
|
PAID = 'PAID',
|
|
11
|
+
PAID_IN_ADVANCE = 'PAID_IN_ADVANCE',
|
|
9
12
|
OVERDUE = 'OVERDUE',
|
|
10
13
|
RESTRUCTURED = 'RESTRUCTURED',
|
|
11
14
|
}
|
package/src/loanCredit/index.ts
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
// Enums
|
|
2
2
|
export * from './enums/LoanCreditStatusEnum';
|
|
3
3
|
export * from './enums/LoanInstallmentStatusEnum';
|
|
4
|
-
export * from './enums/
|
|
4
|
+
export * from './enums/ContractTypeEnum';
|
|
5
|
+
// Re-export del enum canónico de nivel (owner: loanScoring — un solo origen de verdad).
|
|
6
|
+
export { ClientLevelEnum } from '../loanScoring/enums/ClientLevelEnum';
|
|
5
7
|
|
|
6
8
|
// Entity DTOs
|
|
7
9
|
export * from './dtos/LoanBorrower';
|
|
8
10
|
export * from './dtos/LoanBeneficiary';
|
|
9
11
|
export * from './dtos/LoanCredit';
|
|
10
12
|
export * from './dtos/LoanInstallment';
|
|
13
|
+
export * from './dtos/LoanContract';
|
|
11
14
|
export * from './dtos/ActivationChecklist';
|
|
12
15
|
|
|
13
16
|
// Request DTOs
|
|
14
17
|
export * from './dtos/requests/UpsertLoanBorrowerRequest';
|
|
15
18
|
export * from './dtos/requests/OriginateLoanCreditRequest';
|
|
16
|
-
export * from './dtos/requests/
|
|
19
|
+
export * from './dtos/requests/QuoteLoanCreditRequest';
|
|
20
|
+
export * from './dtos/requests/SignLoanCreditRequest';
|
|
21
|
+
export * from './dtos/requests/ActivationCheckRequest';
|
|
17
22
|
export * from './dtos/requests/ChangeLoanCreditStatusRequest';
|
|
18
23
|
|
|
19
24
|
// Response DTOs
|
|
20
25
|
export * from './dtos/responses/LoanBorrowerResponse';
|
|
21
26
|
export * from './dtos/responses/LoanCreditResponse';
|
|
22
27
|
export * from './dtos/responses/LoanInstallmentResponse';
|
|
28
|
+
export * from './dtos/responses/LoanContractResponse';
|
|
23
29
|
export * from './dtos/responses/OriginateLoanCreditResponse';
|
|
30
|
+
export * from './dtos/responses/QuoteLoanCreditResponse';
|
|
31
|
+
export * from './dtos/responses/SignLoanCreditResponse';
|
|
32
|
+
export * from './dtos/responses/ActivationCheckResponse';
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IsBoolean,
|
|
4
|
+
IsEmail,
|
|
5
|
+
IsEnum,
|
|
6
|
+
IsIn,
|
|
7
|
+
IsNumber,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
Matches,
|
|
11
|
+
ValidateNested,
|
|
12
|
+
} from 'class-validator';
|
|
3
13
|
import { regexIso8601, regexIso8601Date } from '../../helpers/constans/regex';
|
|
4
14
|
import { AddressBase } from '../../address/dtos/AddressBase';
|
|
5
15
|
import { AccountStatusEnum } from '../enums/AccountStatusEnum';
|
|
6
16
|
import { KycModalityEnum } from '../enums/KycModalityEnum';
|
|
17
|
+
import { RetailCustomerStatusEnum } from '../enums/RetailCustomerStatusEnum';
|
|
7
18
|
import { RetailKycStatusEnum } from '../enums/RetailKycStatusEnum';
|
|
8
19
|
import { KycReview } from './KycReview';
|
|
9
20
|
|
|
@@ -22,17 +33,50 @@ export class RetailCustomer {
|
|
|
22
33
|
@IsString()
|
|
23
34
|
retailerId!: string;
|
|
24
35
|
|
|
36
|
+
/** Tienda de alta/origen del cliente — hash del GSI `retailerId-originStoreId-index` (F1 §3.5). */
|
|
25
37
|
@Expose()
|
|
26
38
|
@IsString()
|
|
27
|
-
|
|
39
|
+
originStoreId!: string;
|
|
40
|
+
|
|
41
|
+
/** Nombre(s) de pila. Nombre partido por convención Fiado (`PeopleName` del dominio identity), F1 §3.5. */
|
|
42
|
+
@Expose()
|
|
43
|
+
@IsString()
|
|
44
|
+
names!: string;
|
|
45
|
+
|
|
46
|
+
@Expose()
|
|
47
|
+
@IsString()
|
|
48
|
+
paternalLastName!: string;
|
|
49
|
+
|
|
50
|
+
/** Segundo apellido — nullable (F1 §3.5: "el 2º apellido nullable"). */
|
|
51
|
+
@Expose()
|
|
52
|
+
@IsOptional()
|
|
53
|
+
@IsString()
|
|
54
|
+
maternalLastName!: string | null;
|
|
28
55
|
|
|
29
56
|
@Expose()
|
|
30
57
|
@IsString()
|
|
31
58
|
phone!: string;
|
|
32
59
|
|
|
60
|
+
/** Lo pone el OTP del paso 01 del wizard (F1 §3.5). Default false. */
|
|
33
61
|
@Expose()
|
|
62
|
+
@IsBoolean()
|
|
63
|
+
phoneVerified!: boolean;
|
|
64
|
+
|
|
65
|
+
/** null hasta el KYC (F1 §3.5); al capturarse se crea el centinela `UNIQ#CURP#<curp>` en la misma TX. */
|
|
66
|
+
@Expose()
|
|
67
|
+
@IsOptional()
|
|
34
68
|
@IsString()
|
|
35
|
-
curp!: string;
|
|
69
|
+
curp!: string | null;
|
|
70
|
+
|
|
71
|
+
@Expose()
|
|
72
|
+
@IsOptional()
|
|
73
|
+
@IsString()
|
|
74
|
+
rfc!: string | null;
|
|
75
|
+
|
|
76
|
+
@Expose()
|
|
77
|
+
@IsOptional()
|
|
78
|
+
@IsEmail()
|
|
79
|
+
email!: string | null;
|
|
36
80
|
|
|
37
81
|
/** Fecha de nacimiento (ISO 8601, admite fecha sola); se completa con el OCR del KYC. */
|
|
38
82
|
@Expose()
|
|
@@ -112,6 +156,34 @@ export class RetailCustomer {
|
|
|
112
156
|
@Type(() => KycReview)
|
|
113
157
|
kycReview!: KycReview | null;
|
|
114
158
|
|
|
159
|
+
/** Score de confianza que devuelve Metamap con el resultado del KYC (F1 §3.5). */
|
|
160
|
+
@Expose()
|
|
161
|
+
@IsOptional()
|
|
162
|
+
@IsNumber()
|
|
163
|
+
kycScore!: number | null;
|
|
164
|
+
|
|
165
|
+
/** Referencia a la verificación en `kyc-verifications-business` (INT1, F1 §3.5). */
|
|
166
|
+
@Expose()
|
|
167
|
+
@IsOptional()
|
|
168
|
+
@IsString()
|
|
169
|
+
metamapVerificationId!: string | null;
|
|
170
|
+
|
|
171
|
+
/** Alerta PLD (regulatorio, F1 §3.5). Default false. */
|
|
172
|
+
@Expose()
|
|
173
|
+
@IsBoolean()
|
|
174
|
+
pldFlag!: boolean;
|
|
175
|
+
|
|
176
|
+
/** Notas operativas del BO (F1 §3.5). */
|
|
177
|
+
@Expose()
|
|
178
|
+
@IsOptional()
|
|
179
|
+
@IsString()
|
|
180
|
+
notes!: string | null;
|
|
181
|
+
|
|
182
|
+
/** Soft-delete (F1 §3.5). Default ACTIVE. */
|
|
183
|
+
@Expose()
|
|
184
|
+
@IsEnum(RetailCustomerStatusEnum)
|
|
185
|
+
status!: RetailCustomerStatusEnum;
|
|
186
|
+
|
|
115
187
|
@Expose()
|
|
116
188
|
@IsString()
|
|
117
189
|
@Matches(regexIso8601, { message: 'createdAt debe ser una fecha ISO 8601' })
|