@fiado/type-kit 3.184.0 → 3.186.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/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +7 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.js +36 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +20 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +11 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +4 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +6 -0
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +17 -0
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +39 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +6 -1
- package/bin/loanConfig/dtos/Parameter.d.ts +23 -0
- package/bin/loanConfig/dtos/Parameter.js +93 -0
- package/bin/loanConfig/dtos/requests/BulkGetParametersRequest.d.ts +9 -0
- package/bin/{platformRbac/dtos/ResendSelfRegisterOtpRequest.js → loanConfig/dtos/requests/BulkGetParametersRequest.js} +20 -16
- package/bin/loanConfig/dtos/requests/BulkUpdateParametersRequest.d.ts +11 -0
- package/bin/loanConfig/dtos/requests/BulkUpdateParametersRequest.js +52 -0
- package/bin/loanConfig/dtos/requests/UpdateParameterRequest.d.ts +8 -0
- package/bin/{platformRbac/dtos/ResendOtpRequest.js → loanConfig/dtos/requests/UpdateParameterRequest.js} +10 -13
- package/bin/loanConfig/dtos/responses/ParameterResponse.d.ts +28 -0
- package/bin/loanConfig/dtos/responses/ParameterResponse.js +2 -0
- package/bin/loanConfig/enums/ModifiableByRoleEnum.d.ts +11 -0
- package/bin/loanConfig/enums/ModifiableByRoleEnum.js +15 -0
- package/bin/loanConfig/enums/ParameterTypeEnum.d.ts +20 -0
- package/bin/loanConfig/enums/ParameterTypeEnum.js +24 -0
- package/bin/loanConfig/enums/ParameterValueTypeEnum.d.ts +11 -0
- package/bin/loanConfig/enums/ParameterValueTypeEnum.js +15 -0
- package/bin/loanConfig/index.d.ts +8 -0
- package/bin/loanConfig/index.js +27 -0
- package/bin/loanOfferings/dtos/CreditPlan.d.ts +52 -0
- package/bin/loanOfferings/dtos/CreditPlan.js +184 -0
- package/bin/loanOfferings/dtos/Financier.d.ts +30 -0
- package/bin/loanOfferings/dtos/Financier.js +103 -0
- package/bin/loanOfferings/dtos/RetailerCreditPlan.d.ts +15 -0
- package/bin/loanOfferings/dtos/RetailerCreditPlan.js +71 -0
- package/bin/loanOfferings/dtos/requests/ChangeCreditPlanStatusRequest.d.ts +8 -0
- package/bin/loanOfferings/dtos/requests/ChangeCreditPlanStatusRequest.js +27 -0
- package/bin/loanOfferings/dtos/requests/ChangeFinancierStatusRequest.d.ts +8 -0
- package/bin/loanOfferings/dtos/requests/ChangeFinancierStatusRequest.js +27 -0
- package/bin/loanOfferings/dtos/requests/CreateCreditPlanRequest.d.ts +27 -0
- package/bin/loanOfferings/dtos/requests/CreateCreditPlanRequest.js +137 -0
- package/bin/loanOfferings/dtos/requests/CreateFinancierRequest.d.ts +17 -0
- package/bin/loanOfferings/dtos/requests/CreateFinancierRequest.js +70 -0
- package/bin/loanOfferings/dtos/requests/ReorderFinancierRequest.d.ts +7 -0
- package/bin/loanOfferings/dtos/requests/ReorderFinancierRequest.js +27 -0
- package/bin/loanOfferings/dtos/requests/SimulateCreditPlanRequest.d.ts +11 -0
- package/bin/loanOfferings/dtos/requests/SimulateCreditPlanRequest.js +49 -0
- package/bin/loanOfferings/dtos/requests/UpdateCreditPlanRequest.d.ts +25 -0
- package/bin/loanOfferings/dtos/requests/UpdateCreditPlanRequest.js +134 -0
- package/bin/loanOfferings/dtos/requests/UpdateFinancierRequest.d.ts +12 -0
- package/bin/loanOfferings/dtos/requests/UpdateFinancierRequest.js +53 -0
- package/bin/loanOfferings/dtos/responses/CreditPlanResponse.d.ts +35 -0
- package/bin/loanOfferings/dtos/responses/CreditPlanResponse.js +2 -0
- package/bin/loanOfferings/dtos/responses/FinancierResponse.d.ts +23 -0
- package/bin/loanOfferings/dtos/responses/FinancierResponse.js +2 -0
- package/bin/loanOfferings/dtos/responses/RetailerCreditPlanResponse.d.ts +14 -0
- package/bin/loanOfferings/dtos/responses/RetailerCreditPlanResponse.js +2 -0
- package/bin/loanOfferings/dtos/responses/SimulationResultResponse.d.ts +44 -0
- package/bin/loanOfferings/dtos/responses/SimulationResultResponse.js +2 -0
- package/bin/loanOfferings/enums/CreditPlanLevelEnum.d.ts +12 -0
- package/bin/loanOfferings/enums/CreditPlanLevelEnum.js +16 -0
- package/bin/loanOfferings/enums/CreditPlanStatusEnum.d.ts +8 -0
- package/bin/loanOfferings/enums/CreditPlanStatusEnum.js +12 -0
- package/bin/loanOfferings/enums/FinancierStatusEnum.d.ts +9 -0
- package/bin/loanOfferings/enums/FinancierStatusEnum.js +13 -0
- package/bin/loanOfferings/enums/FinancierTypeEnum.d.ts +9 -0
- package/bin/loanOfferings/enums/FinancierTypeEnum.js +13 -0
- package/bin/loanOfferings/enums/ProductTierEnum.d.ts +15 -0
- package/bin/loanOfferings/enums/ProductTierEnum.js +19 -0
- package/bin/loanOfferings/enums/SaleTypeEnum.d.ts +13 -0
- package/bin/loanOfferings/enums/SaleTypeEnum.js +17 -0
- package/bin/loanOfferings/index.d.ts +21 -0
- package/bin/loanOfferings/index.js +41 -0
- package/bin/rbac/enums/PoolKind.d.ts +16 -0
- package/bin/rbac/enums/PoolKind.js +20 -0
- package/bin/rbac/index.d.ts +1 -0
- package/bin/rbac/index.js +17 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +5 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +31 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +6 -0
- package/bin/walletFunding/dtos/CancelFundingRequest.d.ts +11 -0
- package/bin/walletFunding/dtos/CancelFundingRequest.js +33 -0
- package/bin/walletFunding/dtos/CancelFundingResponse.d.ts +14 -0
- package/bin/walletFunding/dtos/CancelFundingResponse.js +12 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +3 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +21 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +6 -0
- package/package.json +1 -1
- package/src/index.ts +5 -0
- package/src/loanConfig/dtos/Parameter.ts +68 -0
- package/src/loanConfig/dtos/requests/BulkGetParametersRequest.ts +23 -0
- package/src/loanConfig/dtos/requests/BulkUpdateParametersRequest.ts +33 -0
- package/src/loanConfig/dtos/requests/UpdateParameterRequest.ts +18 -0
- package/src/loanConfig/dtos/responses/ParameterResponse.ts +28 -0
- package/src/loanConfig/enums/ModifiableByRoleEnum.ts +11 -0
- package/src/loanConfig/enums/ParameterTypeEnum.ts +20 -0
- package/src/loanConfig/enums/ParameterValueTypeEnum.ts +11 -0
- package/src/loanConfig/index.ts +14 -0
- package/src/loanOfferings/dtos/CreditPlan.ts +171 -0
- package/src/loanOfferings/dtos/Financier.ts +91 -0
- package/src/loanOfferings/dtos/RetailerCreditPlan.ts +49 -0
- package/src/loanOfferings/dtos/requests/ChangeCreditPlanStatusRequest.ts +13 -0
- package/src/loanOfferings/dtos/requests/ChangeFinancierStatusRequest.ts +13 -0
- package/src/loanOfferings/dtos/requests/CreateCreditPlanRequest.ts +118 -0
- package/src/loanOfferings/dtos/requests/CreateFinancierRequest.ts +57 -0
- package/src/loanOfferings/dtos/requests/ReorderFinancierRequest.ts +13 -0
- package/src/loanOfferings/dtos/requests/SimulateCreditPlanRequest.ts +32 -0
- package/src/loanOfferings/dtos/requests/UpdateCreditPlanRequest.ts +117 -0
- package/src/loanOfferings/dtos/requests/UpdateFinancierRequest.ts +41 -0
- package/src/loanOfferings/dtos/responses/CreditPlanResponse.ts +36 -0
- package/src/loanOfferings/dtos/responses/FinancierResponse.ts +24 -0
- package/src/loanOfferings/dtos/responses/RetailerCreditPlanResponse.ts +14 -0
- package/src/loanOfferings/dtos/responses/SimulationResultResponse.ts +45 -0
- package/src/loanOfferings/enums/CreditPlanLevelEnum.ts +12 -0
- package/src/loanOfferings/enums/CreditPlanStatusEnum.ts +8 -0
- package/src/loanOfferings/enums/FinancierStatusEnum.ts +9 -0
- package/src/loanOfferings/enums/FinancierTypeEnum.ts +9 -0
- package/src/loanOfferings/enums/ProductTierEnum.ts +15 -0
- package/src/loanOfferings/enums/SaleTypeEnum.ts +13 -0
- package/src/loanOfferings/index.ts +28 -0
- package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +0 -22
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +0 -11
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { ArrayNotEmpty, IsArray, IsEnum, IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
3
|
+
import { ParameterTypeEnum } from '../../enums/ParameterTypeEnum';
|
|
4
|
+
|
|
5
|
+
export class BulkUpdateParameterItem {
|
|
6
|
+
@Expose()
|
|
7
|
+
@IsEnum(ParameterTypeEnum)
|
|
8
|
+
paramType!: ParameterTypeEnum;
|
|
9
|
+
|
|
10
|
+
@Expose()
|
|
11
|
+
@IsString()
|
|
12
|
+
key!: string;
|
|
13
|
+
|
|
14
|
+
@Expose()
|
|
15
|
+
@IsOptional()
|
|
16
|
+
@IsString()
|
|
17
|
+
value!: string | null;
|
|
18
|
+
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsString()
|
|
22
|
+
reason?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Body de POST /parameters/bulk-update — carga inicial / ajuste masivo. */
|
|
26
|
+
export class BulkUpdateParametersRequest {
|
|
27
|
+
@Expose()
|
|
28
|
+
@IsArray()
|
|
29
|
+
@ArrayNotEmpty()
|
|
30
|
+
@ValidateNested({ each: true })
|
|
31
|
+
@Type(() => BulkUpdateParameterItem)
|
|
32
|
+
parameters!: BulkUpdateParameterItem[];
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsOptional, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de PUT /parameters/:paramType/:key. `value` puede ser null (parámetro pendiente).
|
|
6
|
+
* `reason` opcional en F1; el manager lo exigirá para cambios críticos (modelo-datos §10).
|
|
7
|
+
*/
|
|
8
|
+
export class UpdateParameterRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsOptional()
|
|
11
|
+
@IsString()
|
|
12
|
+
value!: string | null;
|
|
13
|
+
|
|
14
|
+
@Expose()
|
|
15
|
+
@IsOptional()
|
|
16
|
+
@IsString()
|
|
17
|
+
reason?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ModifiableByRoleEnum } from '../../enums/ModifiableByRoleEnum';
|
|
2
|
+
import { ParameterTypeEnum } from '../../enums/ParameterTypeEnum';
|
|
3
|
+
import { ParameterValueTypeEnum } from '../../enums/ParameterValueTypeEnum';
|
|
4
|
+
|
|
5
|
+
/** Shape de salida de un parámetro. `effectiveValue` = value ?? defaultValue. */
|
|
6
|
+
export interface ParameterResponse {
|
|
7
|
+
parameterId: string;
|
|
8
|
+
paramType: ParameterTypeEnum;
|
|
9
|
+
key: string;
|
|
10
|
+
value: string | null;
|
|
11
|
+
effectiveValue: string;
|
|
12
|
+
valueType: ParameterValueTypeEnum;
|
|
13
|
+
defaultValue: string;
|
|
14
|
+
description: string;
|
|
15
|
+
modifiableBy: ModifiableByRoleEnum;
|
|
16
|
+
lastModifiedByUserId: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Respuesta de GET /parameters — agrupado por paramType (flow 08.1). */
|
|
22
|
+
export type ParametersByTypeResponse = Partial<Record<ParameterTypeEnum, ParameterResponse[]>>;
|
|
23
|
+
|
|
24
|
+
/** Respuesta de POST /private/parameters/bulk-get. */
|
|
25
|
+
export interface BulkGetParametersResponse {
|
|
26
|
+
parameters: ParameterResponse[];
|
|
27
|
+
notFound: { paramType: ParameterTypeEnum; key: string }[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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 enum ModifiableByRoleEnum {
|
|
8
|
+
SUPER_ADMIN = 'super_admin',
|
|
9
|
+
SOFOM_ADMIN = 'sofom_admin',
|
|
10
|
+
RETAILER_ADMIN = 'retailer_admin',
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-tipos de parámetro operativo del SOFOM (M6 §8 = 13 + SCORING de §5 = 14).
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export enum ParameterTypeEnum {
|
|
6
|
+
CREDIT = 'CREDIT',
|
|
7
|
+
WARRANTY = 'WARRANTY',
|
|
8
|
+
WELCOME_BONUS = 'WELCOME_BONUS',
|
|
9
|
+
MORA_BLOCK = 'MORA_BLOCK',
|
|
10
|
+
UNBLOCK = 'UNBLOCK',
|
|
11
|
+
PAY_INVESTIGATION = 'PAY_INVESTIGATION',
|
|
12
|
+
COLLECTIONS = 'COLLECTIONS',
|
|
13
|
+
ANTI_FRAUD = 'ANTI_FRAUD',
|
|
14
|
+
REMITTANCE = 'REMITTANCE',
|
|
15
|
+
NOTIFICATIONS = 'NOTIFICATIONS',
|
|
16
|
+
CROSS_BORDER = 'CROSS_BORDER',
|
|
17
|
+
WIZARD = 'WIZARD',
|
|
18
|
+
INTEGRATIONS = 'INTEGRATIONS',
|
|
19
|
+
SCORING = 'SCORING',
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo lógico del `value` (siempre persistido como string; el consumer parsea según esto).
|
|
3
|
+
* Valores en minúscula por contrato del modelo (modelo-datos §8).
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export enum ParameterValueTypeEnum {
|
|
7
|
+
STRING = 'string',
|
|
8
|
+
NUMBER = 'number',
|
|
9
|
+
BOOLEAN = 'boolean',
|
|
10
|
+
JSON = 'json',
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './enums/ParameterTypeEnum';
|
|
2
|
+
export * from './enums/ParameterValueTypeEnum';
|
|
3
|
+
export * from './enums/ModifiableByRoleEnum';
|
|
4
|
+
|
|
5
|
+
// Entity DTOs
|
|
6
|
+
export * from './dtos/Parameter';
|
|
7
|
+
|
|
8
|
+
// Request DTOs
|
|
9
|
+
export * from './dtos/requests/UpdateParameterRequest';
|
|
10
|
+
export * from './dtos/requests/BulkUpdateParametersRequest';
|
|
11
|
+
export * from './dtos/requests/BulkGetParametersRequest';
|
|
12
|
+
|
|
13
|
+
// Response DTOs
|
|
14
|
+
export * from './dtos/responses/ParameterResponse';
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
ArrayNotEmpty,
|
|
4
|
+
IsArray,
|
|
5
|
+
IsBoolean,
|
|
6
|
+
IsEnum,
|
|
7
|
+
IsInt,
|
|
8
|
+
IsNumber,
|
|
9
|
+
IsOptional,
|
|
10
|
+
IsString,
|
|
11
|
+
Matches,
|
|
12
|
+
Max,
|
|
13
|
+
Min,
|
|
14
|
+
} from 'class-validator';
|
|
15
|
+
import { regexIso8601 } from '../../helpers/constans/regex';
|
|
16
|
+
import { CreditPlanLevelEnum } from '../enums/CreditPlanLevelEnum';
|
|
17
|
+
import { CreditPlanStatusEnum } from '../enums/CreditPlanStatusEnum';
|
|
18
|
+
import { ProductTierEnum } from '../enums/ProductTierEnum';
|
|
19
|
+
import { SaleTypeEnum } from '../enums/SaleTypeEnum';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* CreditPlan — plan de crédito del catálogo SOFOM SureKeep (modelo-datos §6.1 · M6 §4).
|
|
23
|
+
* Entidad completa del dominio `loan-offerings-business` (SureKeep Fase 1 — pista Loan).
|
|
24
|
+
*
|
|
25
|
+
* Convenciones: montos en **cents** (entero); porcentajes **decimal sobre 1** (`0.40` = 40%);
|
|
26
|
+
* TNA decimal (`2.60` = 260%). El PLAN es dueño de los umbrales SCI por nivel
|
|
27
|
+
* (`minSciScore`/`maxSciScore`, resolución 2026-07-15) y del techo de enganche `maxDownPaymentPct`.
|
|
28
|
+
*/
|
|
29
|
+
export class CreditPlan {
|
|
30
|
+
@Expose()
|
|
31
|
+
@IsString()
|
|
32
|
+
planId!: string;
|
|
33
|
+
|
|
34
|
+
/** Código único por tenant: `BRONZE_NEW` | `SILVER_NEW` | `GOLD_NEW` | `EMPLOYEE`. */
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsString()
|
|
37
|
+
code!: string;
|
|
38
|
+
|
|
39
|
+
@Expose()
|
|
40
|
+
@IsString()
|
|
41
|
+
name!: string;
|
|
42
|
+
|
|
43
|
+
@Expose()
|
|
44
|
+
@IsString()
|
|
45
|
+
description!: string;
|
|
46
|
+
|
|
47
|
+
@Expose()
|
|
48
|
+
@IsEnum(CreditPlanLevelEnum)
|
|
49
|
+
level!: CreditPlanLevelEnum;
|
|
50
|
+
|
|
51
|
+
/** Array: un plan puede aplicar a varios tipos de venta (M6 §4). */
|
|
52
|
+
@Expose()
|
|
53
|
+
@IsArray()
|
|
54
|
+
@ArrayNotEmpty()
|
|
55
|
+
@IsEnum(SaleTypeEnum, { each: true })
|
|
56
|
+
saleTypes!: SaleTypeEnum[];
|
|
57
|
+
|
|
58
|
+
/** Gamas elegibles del plan; `null` = todas. */
|
|
59
|
+
@Expose()
|
|
60
|
+
@IsOptional()
|
|
61
|
+
@IsArray()
|
|
62
|
+
@IsEnum(ProductTierEnum, { each: true })
|
|
63
|
+
eligibleTiers!: ProductTierEnum[] | null;
|
|
64
|
+
|
|
65
|
+
/** Enganche MÍNIMO como decimal sobre 1 (`0.40` = 40%). */
|
|
66
|
+
@Expose()
|
|
67
|
+
@IsNumber()
|
|
68
|
+
@Min(0)
|
|
69
|
+
@Max(1)
|
|
70
|
+
minDownPaymentPct!: number;
|
|
71
|
+
|
|
72
|
+
/** Techo de enganche (decimal sobre 1); `null` = sin techo definido (F1: TBD). */
|
|
73
|
+
@Expose()
|
|
74
|
+
@IsOptional()
|
|
75
|
+
@IsNumber()
|
|
76
|
+
@Min(0)
|
|
77
|
+
@Max(1)
|
|
78
|
+
maxDownPaymentPct!: number | null;
|
|
79
|
+
|
|
80
|
+
/** Plazos válidos en semanas (subconjunto del catálogo maestro). */
|
|
81
|
+
@Expose()
|
|
82
|
+
@IsArray()
|
|
83
|
+
@ArrayNotEmpty()
|
|
84
|
+
@IsInt({ each: true })
|
|
85
|
+
@Min(1, { each: true })
|
|
86
|
+
termWeeksOptions!: number[];
|
|
87
|
+
|
|
88
|
+
@Expose()
|
|
89
|
+
@IsInt()
|
|
90
|
+
@Min(0)
|
|
91
|
+
maxFinancedAmountCents!: number;
|
|
92
|
+
|
|
93
|
+
/** Tasa Nominal Anual como decimal (`2.60` = 260%); rango de negocio [2.00, 2.60]. */
|
|
94
|
+
@Expose()
|
|
95
|
+
@IsNumber()
|
|
96
|
+
@Min(0)
|
|
97
|
+
tnaAnnual!: number;
|
|
98
|
+
|
|
99
|
+
/** IVA sobre intereses (decimal); fijo `0.16` en México. */
|
|
100
|
+
@Expose()
|
|
101
|
+
@IsNumber()
|
|
102
|
+
@Min(0)
|
|
103
|
+
@Max(1)
|
|
104
|
+
ivaOnInterest!: number;
|
|
105
|
+
|
|
106
|
+
/** Comisión de apertura (decimal sobre 1); default `0`. */
|
|
107
|
+
@Expose()
|
|
108
|
+
@IsNumber()
|
|
109
|
+
@Min(0)
|
|
110
|
+
@Max(1)
|
|
111
|
+
openingCommissionPct!: number;
|
|
112
|
+
|
|
113
|
+
/** Corrimiento de cuotas al pagar fuera de fecha (M6 §4 "Corrimiento"). */
|
|
114
|
+
@Expose()
|
|
115
|
+
@IsBoolean()
|
|
116
|
+
paymentShift!: boolean;
|
|
117
|
+
|
|
118
|
+
/** Cota inferior del rango SCI del nivel (0-100); `null` mientras TBD. */
|
|
119
|
+
@Expose()
|
|
120
|
+
@IsOptional()
|
|
121
|
+
@IsInt()
|
|
122
|
+
@Min(0)
|
|
123
|
+
@Max(100)
|
|
124
|
+
minSciScore!: number | null;
|
|
125
|
+
|
|
126
|
+
/** Cota superior del rango SCI del nivel (0-100); `null` mientras TBD. */
|
|
127
|
+
@Expose()
|
|
128
|
+
@IsOptional()
|
|
129
|
+
@IsInt()
|
|
130
|
+
@Min(0)
|
|
131
|
+
@Max(100)
|
|
132
|
+
maxSciScore!: number | null;
|
|
133
|
+
|
|
134
|
+
/** Versión del plan; incrementa en cada publicación de cambios. */
|
|
135
|
+
@Expose()
|
|
136
|
+
@IsInt()
|
|
137
|
+
@Min(1)
|
|
138
|
+
version!: number;
|
|
139
|
+
|
|
140
|
+
@Expose()
|
|
141
|
+
@IsOptional()
|
|
142
|
+
@IsString()
|
|
143
|
+
validFrom!: string | null;
|
|
144
|
+
|
|
145
|
+
@Expose()
|
|
146
|
+
@IsOptional()
|
|
147
|
+
@IsString()
|
|
148
|
+
validUntil!: string | null;
|
|
149
|
+
|
|
150
|
+
@Expose()
|
|
151
|
+
@IsEnum(CreditPlanStatusEnum)
|
|
152
|
+
status!: CreditPlanStatusEnum;
|
|
153
|
+
|
|
154
|
+
@Expose()
|
|
155
|
+
@IsString()
|
|
156
|
+
createdBy!: string;
|
|
157
|
+
|
|
158
|
+
@Expose()
|
|
159
|
+
@IsString()
|
|
160
|
+
updatedBy!: string;
|
|
161
|
+
|
|
162
|
+
@Expose()
|
|
163
|
+
@IsString()
|
|
164
|
+
@Matches(regexIso8601, { message: 'createdAt debe ser una fecha ISO 8601' })
|
|
165
|
+
createdAt!: string;
|
|
166
|
+
|
|
167
|
+
@Expose()
|
|
168
|
+
@IsString()
|
|
169
|
+
@Matches(regexIso8601, { message: 'updatedAt debe ser una fecha ISO 8601' })
|
|
170
|
+
updatedAt!: string;
|
|
171
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
IsArray,
|
|
4
|
+
IsEnum,
|
|
5
|
+
IsInt,
|
|
6
|
+
IsObject,
|
|
7
|
+
IsOptional,
|
|
8
|
+
IsString,
|
|
9
|
+
Matches,
|
|
10
|
+
Min,
|
|
11
|
+
} from 'class-validator';
|
|
12
|
+
import { regexIso8601 } from '../../helpers/constans/regex';
|
|
13
|
+
import { FinancierStatusEnum } from '../enums/FinancierStatusEnum';
|
|
14
|
+
import { FinancierTypeEnum } from '../enums/FinancierTypeEnum';
|
|
15
|
+
import { ProductTierEnum } from '../enums/ProductTierEnum';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Financier — financiera del catálogo mostrado al cliente (modelo-datos §6.3 · M6 §6).
|
|
19
|
+
* Entidad completa del dominio `loan-offerings-business` (SureKeep Fase 1 — pista Loan).
|
|
20
|
+
* SureKeep (INTERNAL) va primero (`displayOrder=1`); las externas después.
|
|
21
|
+
*/
|
|
22
|
+
export class Financier {
|
|
23
|
+
@Expose()
|
|
24
|
+
@IsString()
|
|
25
|
+
financierId!: string;
|
|
26
|
+
|
|
27
|
+
/** Grafía canónica: `SUREKEEP` | `PAYJOY` | `KREDIYA` | `LESPAGO`. */
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsString()
|
|
30
|
+
code!: string;
|
|
31
|
+
|
|
32
|
+
@Expose()
|
|
33
|
+
@IsString()
|
|
34
|
+
name!: string;
|
|
35
|
+
|
|
36
|
+
@Expose()
|
|
37
|
+
@IsEnum(FinancierTypeEnum)
|
|
38
|
+
type!: FinancierTypeEnum;
|
|
39
|
+
|
|
40
|
+
/** Orden de presentación en el wizard (M1 paso 4). Reorder renumera. */
|
|
41
|
+
@Expose()
|
|
42
|
+
@IsInt()
|
|
43
|
+
@Min(1)
|
|
44
|
+
displayOrder!: number;
|
|
45
|
+
|
|
46
|
+
/** Texto mostrado en el wizard (ej. "RECOMENDADO"). */
|
|
47
|
+
@Expose()
|
|
48
|
+
@IsString()
|
|
49
|
+
label!: string;
|
|
50
|
+
|
|
51
|
+
/** Solo EXTERNAL: URL de derivación; `null` para INTERNAL. */
|
|
52
|
+
@Expose()
|
|
53
|
+
@IsOptional()
|
|
54
|
+
@IsString()
|
|
55
|
+
externalRedirectUrl!: string | null;
|
|
56
|
+
|
|
57
|
+
/** Gamas que la financiera acepta por defecto; `null` = todas. */
|
|
58
|
+
@Expose()
|
|
59
|
+
@IsOptional()
|
|
60
|
+
@IsArray()
|
|
61
|
+
@IsEnum(ProductTierEnum, { each: true })
|
|
62
|
+
eligibleTiers!: ProductTierEnum[] | null;
|
|
63
|
+
|
|
64
|
+
/** Configuración específica por financiera; `null` si no aplica. */
|
|
65
|
+
@Expose()
|
|
66
|
+
@IsOptional()
|
|
67
|
+
@IsObject()
|
|
68
|
+
config!: Record<string, unknown> | null;
|
|
69
|
+
|
|
70
|
+
@Expose()
|
|
71
|
+
@IsEnum(FinancierStatusEnum)
|
|
72
|
+
status!: FinancierStatusEnum;
|
|
73
|
+
|
|
74
|
+
@Expose()
|
|
75
|
+
@IsString()
|
|
76
|
+
createdBy!: string;
|
|
77
|
+
|
|
78
|
+
@Expose()
|
|
79
|
+
@IsString()
|
|
80
|
+
updatedBy!: string;
|
|
81
|
+
|
|
82
|
+
@Expose()
|
|
83
|
+
@IsString()
|
|
84
|
+
@Matches(regexIso8601, { message: 'createdAt debe ser una fecha ISO 8601' })
|
|
85
|
+
createdAt!: string;
|
|
86
|
+
|
|
87
|
+
@Expose()
|
|
88
|
+
@IsString()
|
|
89
|
+
@Matches(regexIso8601, { message: 'updatedAt debe ser una fecha ISO 8601' })
|
|
90
|
+
updatedAt!: string;
|
|
91
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsOptional, IsString, Matches } from 'class-validator';
|
|
3
|
+
import { regexIso8601 } from '../../helpers/constans/regex';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* RetailerCreditPlan — enlace M:N "qué planes ofrece cada retailer" (modelo-datos §6.2).
|
|
7
|
+
* Activación explícita e idempotente por retailer. Entidad del dominio `loan-offerings-business`.
|
|
8
|
+
*/
|
|
9
|
+
export class RetailerCreditPlan {
|
|
10
|
+
@Expose()
|
|
11
|
+
@IsString()
|
|
12
|
+
retailerId!: string;
|
|
13
|
+
|
|
14
|
+
@Expose()
|
|
15
|
+
@IsString()
|
|
16
|
+
planId!: string;
|
|
17
|
+
|
|
18
|
+
@Expose()
|
|
19
|
+
@IsBoolean()
|
|
20
|
+
active!: boolean;
|
|
21
|
+
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
@IsString()
|
|
25
|
+
activatedAt!: string | null;
|
|
26
|
+
|
|
27
|
+
@Expose()
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsString()
|
|
30
|
+
deactivatedAt!: string | null;
|
|
31
|
+
|
|
32
|
+
@Expose()
|
|
33
|
+
@IsString()
|
|
34
|
+
createdBy!: string;
|
|
35
|
+
|
|
36
|
+
@Expose()
|
|
37
|
+
@IsString()
|
|
38
|
+
updatedBy!: string;
|
|
39
|
+
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsString()
|
|
42
|
+
@Matches(regexIso8601, { message: 'createdAt debe ser una fecha ISO 8601' })
|
|
43
|
+
createdAt!: string;
|
|
44
|
+
|
|
45
|
+
@Expose()
|
|
46
|
+
@IsString()
|
|
47
|
+
@Matches(regexIso8601, { message: 'updatedAt debe ser una fecha ISO 8601' })
|
|
48
|
+
updatedAt!: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEnum } from 'class-validator';
|
|
3
|
+
import { CreditPlanStatusEnum } from '../../enums/CreditPlanStatusEnum';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Body de PUT /credit-plans/:planId/status — activar / inactivar un plan.
|
|
7
|
+
* Desactivar no afecta créditos existentes; solo deja de estar disponible para nuevas ventas.
|
|
8
|
+
*/
|
|
9
|
+
export class ChangeCreditPlanStatusRequest {
|
|
10
|
+
@Expose()
|
|
11
|
+
@IsEnum(CreditPlanStatusEnum)
|
|
12
|
+
status!: CreditPlanStatusEnum;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEnum } from 'class-validator';
|
|
3
|
+
import { FinancierStatusEnum } from '../../enums/FinancierStatusEnum';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Body de PUT /financiers/:financierId/status — activar / inactivar una financiera.
|
|
7
|
+
* Desactivar la quita del wizard sin afectar créditos existentes (M6 §6).
|
|
8
|
+
*/
|
|
9
|
+
export class ChangeFinancierStatusRequest {
|
|
10
|
+
@Expose()
|
|
11
|
+
@IsEnum(FinancierStatusEnum)
|
|
12
|
+
status!: FinancierStatusEnum;
|
|
13
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
ArrayNotEmpty,
|
|
4
|
+
IsArray,
|
|
5
|
+
IsBoolean,
|
|
6
|
+
IsEnum,
|
|
7
|
+
IsInt,
|
|
8
|
+
IsNumber,
|
|
9
|
+
IsOptional,
|
|
10
|
+
IsString,
|
|
11
|
+
Max,
|
|
12
|
+
Min,
|
|
13
|
+
} from 'class-validator';
|
|
14
|
+
import { CreditPlanLevelEnum } from '../../enums/CreditPlanLevelEnum';
|
|
15
|
+
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
16
|
+
import { SaleTypeEnum } from '../../enums/SaleTypeEnum';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Body de POST /credit-plans — alta de un plan (SureKeep Fase 1 — pista Loan).
|
|
20
|
+
* Campos server-assigned (`planId`, `version`, `ivaOnInterest`=0.16, `status`, auditoría) NO viajan
|
|
21
|
+
* en el request: los asigna el lambda. `tnaAnnual` en decimal; rango de negocio [2.00, 2.60].
|
|
22
|
+
*/
|
|
23
|
+
export class CreateCreditPlanRequest {
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsString()
|
|
26
|
+
code!: string;
|
|
27
|
+
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsString()
|
|
30
|
+
name!: string;
|
|
31
|
+
|
|
32
|
+
@Expose()
|
|
33
|
+
@IsString()
|
|
34
|
+
description!: string;
|
|
35
|
+
|
|
36
|
+
@Expose()
|
|
37
|
+
@IsEnum(CreditPlanLevelEnum)
|
|
38
|
+
level!: CreditPlanLevelEnum;
|
|
39
|
+
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsArray()
|
|
42
|
+
@ArrayNotEmpty()
|
|
43
|
+
@IsEnum(SaleTypeEnum, { each: true })
|
|
44
|
+
saleTypes!: SaleTypeEnum[];
|
|
45
|
+
|
|
46
|
+
@Expose()
|
|
47
|
+
@IsOptional()
|
|
48
|
+
@IsArray()
|
|
49
|
+
@IsEnum(ProductTierEnum, { each: true })
|
|
50
|
+
eligibleTiers?: ProductTierEnum[] | null;
|
|
51
|
+
|
|
52
|
+
@Expose()
|
|
53
|
+
@IsNumber()
|
|
54
|
+
@Min(0)
|
|
55
|
+
@Max(1)
|
|
56
|
+
minDownPaymentPct!: number;
|
|
57
|
+
|
|
58
|
+
@Expose()
|
|
59
|
+
@IsOptional()
|
|
60
|
+
@IsNumber()
|
|
61
|
+
@Min(0)
|
|
62
|
+
@Max(1)
|
|
63
|
+
maxDownPaymentPct?: number | null;
|
|
64
|
+
|
|
65
|
+
@Expose()
|
|
66
|
+
@IsArray()
|
|
67
|
+
@ArrayNotEmpty()
|
|
68
|
+
@IsInt({ each: true })
|
|
69
|
+
@Min(1, { each: true })
|
|
70
|
+
termWeeksOptions!: number[];
|
|
71
|
+
|
|
72
|
+
@Expose()
|
|
73
|
+
@IsInt()
|
|
74
|
+
@Min(0)
|
|
75
|
+
maxFinancedAmountCents!: number;
|
|
76
|
+
|
|
77
|
+
@Expose()
|
|
78
|
+
@IsNumber()
|
|
79
|
+
@Min(2.0)
|
|
80
|
+
@Max(2.6)
|
|
81
|
+
tnaAnnual!: number;
|
|
82
|
+
|
|
83
|
+
@Expose()
|
|
84
|
+
@IsOptional()
|
|
85
|
+
@IsNumber()
|
|
86
|
+
@Min(0)
|
|
87
|
+
@Max(1)
|
|
88
|
+
openingCommissionPct?: number;
|
|
89
|
+
|
|
90
|
+
@Expose()
|
|
91
|
+
@IsOptional()
|
|
92
|
+
@IsBoolean()
|
|
93
|
+
paymentShift?: boolean;
|
|
94
|
+
|
|
95
|
+
@Expose()
|
|
96
|
+
@IsOptional()
|
|
97
|
+
@IsInt()
|
|
98
|
+
@Min(0)
|
|
99
|
+
@Max(100)
|
|
100
|
+
minSciScore?: number | null;
|
|
101
|
+
|
|
102
|
+
@Expose()
|
|
103
|
+
@IsOptional()
|
|
104
|
+
@IsInt()
|
|
105
|
+
@Min(0)
|
|
106
|
+
@Max(100)
|
|
107
|
+
maxSciScore?: number | null;
|
|
108
|
+
|
|
109
|
+
@Expose()
|
|
110
|
+
@IsOptional()
|
|
111
|
+
@IsString()
|
|
112
|
+
validFrom?: string | null;
|
|
113
|
+
|
|
114
|
+
@Expose()
|
|
115
|
+
@IsOptional()
|
|
116
|
+
@IsString()
|
|
117
|
+
validUntil?: string | null;
|
|
118
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
IsArray,
|
|
4
|
+
IsEnum,
|
|
5
|
+
IsInt,
|
|
6
|
+
IsObject,
|
|
7
|
+
IsOptional,
|
|
8
|
+
IsString,
|
|
9
|
+
Min,
|
|
10
|
+
} from 'class-validator';
|
|
11
|
+
import { FinancierTypeEnum } from '../../enums/FinancierTypeEnum';
|
|
12
|
+
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Body de POST /financiers — alta de una financiera (SureKeep Fase 1 — pista Loan).
|
|
16
|
+
* `financierId` y auditoría los asigna el lambda; `status` default ACTIVE. `displayOrder` opcional
|
|
17
|
+
* (si no viene, se coloca al final del catálogo).
|
|
18
|
+
*/
|
|
19
|
+
export class CreateFinancierRequest {
|
|
20
|
+
@Expose()
|
|
21
|
+
@IsString()
|
|
22
|
+
code!: string;
|
|
23
|
+
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsString()
|
|
26
|
+
name!: string;
|
|
27
|
+
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsEnum(FinancierTypeEnum)
|
|
30
|
+
type!: FinancierTypeEnum;
|
|
31
|
+
|
|
32
|
+
@Expose()
|
|
33
|
+
@IsOptional()
|
|
34
|
+
@IsInt()
|
|
35
|
+
@Min(1)
|
|
36
|
+
displayOrder?: number;
|
|
37
|
+
|
|
38
|
+
@Expose()
|
|
39
|
+
@IsString()
|
|
40
|
+
label!: string;
|
|
41
|
+
|
|
42
|
+
@Expose()
|
|
43
|
+
@IsOptional()
|
|
44
|
+
@IsString()
|
|
45
|
+
externalRedirectUrl?: string | null;
|
|
46
|
+
|
|
47
|
+
@Expose()
|
|
48
|
+
@IsOptional()
|
|
49
|
+
@IsArray()
|
|
50
|
+
@IsEnum(ProductTierEnum, { each: true })
|
|
51
|
+
eligibleTiers?: ProductTierEnum[] | null;
|
|
52
|
+
|
|
53
|
+
@Expose()
|
|
54
|
+
@IsOptional()
|
|
55
|
+
@IsObject()
|
|
56
|
+
config?: Record<string, unknown> | null;
|
|
57
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsInt, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de PUT /financiers/:financierId/reorder — nueva posición en el catálogo.
|
|
6
|
+
* El lambda renumera el resto de forma contigua (M6 §6 · flow 06 §6.2.1).
|
|
7
|
+
*/
|
|
8
|
+
export class ReorderFinancierRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsInt()
|
|
11
|
+
@Min(1)
|
|
12
|
+
displayOrder!: number;
|
|
13
|
+
}
|