@fiado/type-kit 3.185.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/index.d.ts +1 -0
- package/bin/index.js +4 -1
- 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/package.json +1 -1
- package/src/index.ts +3 -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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Un renglón de la tabla de amortización (M2 §3.3). Todos los montos en cents.
|
|
3
|
+
*/
|
|
4
|
+
export interface AmortizationRowResponse {
|
|
5
|
+
/** Número de cuota semanal (1-based). */
|
|
6
|
+
week: number;
|
|
7
|
+
capitalCents: number;
|
|
8
|
+
interestCents: number;
|
|
9
|
+
/** IVA 16% sobre el interés de la cuota. */
|
|
10
|
+
ivaCents: number;
|
|
11
|
+
/** capital + interés + IVA de la cuota. */
|
|
12
|
+
totalPaymentCents: number;
|
|
13
|
+
/** Saldo insoluto de capital tras aplicar la cuota. */
|
|
14
|
+
remainingBalanceCents: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resultado del simulador de cuota (POST /private/credit-plans/:planId/simulate,
|
|
18
|
+
* GET /credit-plans/:planId/simulator). Amortización francesa + IVA 16% + comisión de apertura + CAT.
|
|
19
|
+
*
|
|
20
|
+
* NOTA (supuesto F1): `catAnnual` se calcula con la metodología estándar CONDUSEF (TIR anualizada)
|
|
21
|
+
* — pendiente de confirmar fórmula/ejemplos oficiales con Jaime/M2.
|
|
22
|
+
*/
|
|
23
|
+
export interface SimulationResultResponse {
|
|
24
|
+
planId: string;
|
|
25
|
+
planCode: string;
|
|
26
|
+
productPriceCents: number;
|
|
27
|
+
downPaymentPct: number;
|
|
28
|
+
downPaymentCents: number;
|
|
29
|
+
/** Capital financiado = precio − enganche (antes de comisión de apertura). */
|
|
30
|
+
financedAmountCents: number;
|
|
31
|
+
openingCommissionCents: number;
|
|
32
|
+
termWeeks: number;
|
|
33
|
+
tnaAnnual: number;
|
|
34
|
+
/** Cuota semanal sin IVA (capital + interés), constante en amortización francesa. */
|
|
35
|
+
weeklyPaymentSinIvaCents: number;
|
|
36
|
+
totalCapitalCents: number;
|
|
37
|
+
totalInterestCents: number;
|
|
38
|
+
totalIvaCents: number;
|
|
39
|
+
/** Total a pagar = capital + interés + IVA (+ comisión de apertura). */
|
|
40
|
+
totalToPayCents: number;
|
|
41
|
+
/** Costo Anual Total (decimal, ej. 2.87 = 287%). Metodología estándar CONDUSEF (supuesto). */
|
|
42
|
+
catAnnual: number;
|
|
43
|
+
schedule: AmortizationRowResponse[];
|
|
44
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nivel de cliente al que aplica un plan de crédito SureKeep (M6 §4/§5 · modelo-datos §6.1).
|
|
3
|
+
* `ALL` = plan que aplica a todos los niveles (Jaime modela EMPLEADO como tipo de venta
|
|
4
|
+
* con nivel "todos", no como un nivel propio — corrección 2026-07-10).
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export declare enum CreditPlanLevelEnum {
|
|
8
|
+
BRONZE = "BRONZE",
|
|
9
|
+
SILVER = "SILVER",
|
|
10
|
+
GOLD = "GOLD",
|
|
11
|
+
ALL = "ALL"
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreditPlanLevelEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Nivel de cliente al que aplica un plan de crédito SureKeep (M6 §4/§5 · modelo-datos §6.1).
|
|
6
|
+
* `ALL` = plan que aplica a todos los niveles (Jaime modela EMPLEADO como tipo de venta
|
|
7
|
+
* con nivel "todos", no como un nivel propio — corrección 2026-07-10).
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*/
|
|
10
|
+
var CreditPlanLevelEnum;
|
|
11
|
+
(function (CreditPlanLevelEnum) {
|
|
12
|
+
CreditPlanLevelEnum["BRONZE"] = "BRONZE";
|
|
13
|
+
CreditPlanLevelEnum["SILVER"] = "SILVER";
|
|
14
|
+
CreditPlanLevelEnum["GOLD"] = "GOLD";
|
|
15
|
+
CreditPlanLevelEnum["ALL"] = "ALL";
|
|
16
|
+
})(CreditPlanLevelEnum || (exports.CreditPlanLevelEnum = CreditPlanLevelEnum = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreditPlanStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estado de un plan de crédito (modelo-datos §6.1). Soft-delete vía status (nunca DELETE físico).
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*/
|
|
8
|
+
var CreditPlanStatusEnum;
|
|
9
|
+
(function (CreditPlanStatusEnum) {
|
|
10
|
+
CreditPlanStatusEnum["ACTIVE"] = "ACTIVE";
|
|
11
|
+
CreditPlanStatusEnum["INACTIVE"] = "INACTIVE";
|
|
12
|
+
})(CreditPlanStatusEnum || (exports.CreditPlanStatusEnum = CreditPlanStatusEnum = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancierStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estado de una financiera (modelo-datos §6.3). Desactivar la quita del wizard sin afectar
|
|
6
|
+
* créditos existentes (M6 §6).
|
|
7
|
+
* @enum {string}
|
|
8
|
+
*/
|
|
9
|
+
var FinancierStatusEnum;
|
|
10
|
+
(function (FinancierStatusEnum) {
|
|
11
|
+
FinancierStatusEnum["ACTIVE"] = "ACTIVE";
|
|
12
|
+
FinancierStatusEnum["INACTIVE"] = "INACTIVE";
|
|
13
|
+
})(FinancierStatusEnum || (exports.FinancierStatusEnum = FinancierStatusEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de financiera (M6 §6 · modelo-datos §6.3). `INTERNAL` = SureKeep (SOFOM propia);
|
|
3
|
+
* `EXTERNAL` = financiera de terceros con derivación por URL (PayJoy / KREDIYA / LESPAGO).
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export declare enum FinancierTypeEnum {
|
|
7
|
+
INTERNAL = "INTERNAL",
|
|
8
|
+
EXTERNAL = "EXTERNAL"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinancierTypeEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Tipo de financiera (M6 §6 · modelo-datos §6.3). `INTERNAL` = SureKeep (SOFOM propia);
|
|
6
|
+
* `EXTERNAL` = financiera de terceros con derivación por URL (PayJoy / KREDIYA / LESPAGO).
|
|
7
|
+
* @enum {string}
|
|
8
|
+
*/
|
|
9
|
+
var FinancierTypeEnum;
|
|
10
|
+
(function (FinancierTypeEnum) {
|
|
11
|
+
FinancierTypeEnum["INTERNAL"] = "INTERNAL";
|
|
12
|
+
FinancierTypeEnum["EXTERNAL"] = "EXTERNAL";
|
|
13
|
+
})(FinancierTypeEnum || (exports.FinancierTypeEnum = FinancierTypeEnum = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gama del equipo (modelo-datos §4.1 `RetailProduct.tier` · §6.1 `eligibleTiers`).
|
|
3
|
+
*
|
|
4
|
+
* NOTA (supuesto F1): conceptualmente esta gama pertenece al dominio de catálogo retail
|
|
5
|
+
* (`retail-catalog-business`), cuyo dominio type-kit aún no existe. Se define aquí para poder
|
|
6
|
+
* tipar `CreditPlan.eligibleTiers` y `Financier.eligibleTiers` sin bloquear. Al publicarse el
|
|
7
|
+
* dominio `retailCatalog`, consolidar allí y reexportar (coordinar con la pista Retail).
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*/
|
|
10
|
+
export declare enum ProductTierEnum {
|
|
11
|
+
LOW = "LOW",
|
|
12
|
+
MID = "MID",
|
|
13
|
+
HIGH = "HIGH",
|
|
14
|
+
PREMIUM = "PREMIUM"
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductTierEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Gama del equipo (modelo-datos §4.1 `RetailProduct.tier` · §6.1 `eligibleTiers`).
|
|
6
|
+
*
|
|
7
|
+
* NOTA (supuesto F1): conceptualmente esta gama pertenece al dominio de catálogo retail
|
|
8
|
+
* (`retail-catalog-business`), cuyo dominio type-kit aún no existe. Se define aquí para poder
|
|
9
|
+
* tipar `CreditPlan.eligibleTiers` y `Financier.eligibleTiers` sin bloquear. Al publicarse el
|
|
10
|
+
* dominio `retailCatalog`, consolidar allí y reexportar (coordinar con la pista Retail).
|
|
11
|
+
* @enum {string}
|
|
12
|
+
*/
|
|
13
|
+
var ProductTierEnum;
|
|
14
|
+
(function (ProductTierEnum) {
|
|
15
|
+
ProductTierEnum["LOW"] = "LOW";
|
|
16
|
+
ProductTierEnum["MID"] = "MID";
|
|
17
|
+
ProductTierEnum["HIGH"] = "HIGH";
|
|
18
|
+
ProductTierEnum["PREMIUM"] = "PREMIUM";
|
|
19
|
+
})(ProductTierEnum || (exports.ProductTierEnum = ProductTierEnum = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de venta al que aplica un plan de crédito (M6 §4 · modelo-datos §6.1).
|
|
3
|
+
* Un plan puede configurarse para uno o más tipos (por eso `CreditPlan.saleTypes` es array).
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export declare enum SaleTypeEnum {
|
|
7
|
+
/** Cliente sin historial previo con SureKeep (primera compra). */
|
|
8
|
+
NEW = "NEW",
|
|
9
|
+
/** Cliente que ya tuvo un crédito con SureKeep (recompra / renovación). */
|
|
10
|
+
REPURCHASE = "REPURCHASE",
|
|
11
|
+
/** Empleado de VentasLuga que compra para uso personal (condiciones preferenciales). */
|
|
12
|
+
EMPLOYEE = "EMPLOYEE"
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SaleTypeEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Tipo de venta al que aplica un plan de crédito (M6 §4 · modelo-datos §6.1).
|
|
6
|
+
* Un plan puede configurarse para uno o más tipos (por eso `CreditPlan.saleTypes` es array).
|
|
7
|
+
* @enum {string}
|
|
8
|
+
*/
|
|
9
|
+
var SaleTypeEnum;
|
|
10
|
+
(function (SaleTypeEnum) {
|
|
11
|
+
/** Cliente sin historial previo con SureKeep (primera compra). */
|
|
12
|
+
SaleTypeEnum["NEW"] = "NEW";
|
|
13
|
+
/** Cliente que ya tuvo un crédito con SureKeep (recompra / renovación). */
|
|
14
|
+
SaleTypeEnum["REPURCHASE"] = "REPURCHASE";
|
|
15
|
+
/** Empleado de VentasLuga que compra para uso personal (condiciones preferenciales). */
|
|
16
|
+
SaleTypeEnum["EMPLOYEE"] = "EMPLOYEE";
|
|
17
|
+
})(SaleTypeEnum || (exports.SaleTypeEnum = SaleTypeEnum = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './enums/CreditPlanLevelEnum';
|
|
2
|
+
export * from './enums/SaleTypeEnum';
|
|
3
|
+
export * from './enums/ProductTierEnum';
|
|
4
|
+
export * from './enums/CreditPlanStatusEnum';
|
|
5
|
+
export * from './enums/FinancierTypeEnum';
|
|
6
|
+
export * from './enums/FinancierStatusEnum';
|
|
7
|
+
export * from './dtos/CreditPlan';
|
|
8
|
+
export * from './dtos/Financier';
|
|
9
|
+
export * from './dtos/RetailerCreditPlan';
|
|
10
|
+
export * from './dtos/requests/CreateCreditPlanRequest';
|
|
11
|
+
export * from './dtos/requests/UpdateCreditPlanRequest';
|
|
12
|
+
export * from './dtos/requests/ChangeCreditPlanStatusRequest';
|
|
13
|
+
export * from './dtos/requests/SimulateCreditPlanRequest';
|
|
14
|
+
export * from './dtos/requests/CreateFinancierRequest';
|
|
15
|
+
export * from './dtos/requests/UpdateFinancierRequest';
|
|
16
|
+
export * from './dtos/requests/ChangeFinancierStatusRequest';
|
|
17
|
+
export * from './dtos/requests/ReorderFinancierRequest';
|
|
18
|
+
export * from './dtos/responses/CreditPlanResponse';
|
|
19
|
+
export * from './dtos/responses/FinancierResponse';
|
|
20
|
+
export * from './dtos/responses/RetailerCreditPlanResponse';
|
|
21
|
+
export * from './dtos/responses/SimulationResultResponse';
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
|
18
|
+
__exportStar(require("./enums/CreditPlanLevelEnum"), exports);
|
|
19
|
+
__exportStar(require("./enums/SaleTypeEnum"), exports);
|
|
20
|
+
__exportStar(require("./enums/ProductTierEnum"), exports);
|
|
21
|
+
__exportStar(require("./enums/CreditPlanStatusEnum"), exports);
|
|
22
|
+
__exportStar(require("./enums/FinancierTypeEnum"), exports);
|
|
23
|
+
__exportStar(require("./enums/FinancierStatusEnum"), exports);
|
|
24
|
+
// Entity DTOs
|
|
25
|
+
__exportStar(require("./dtos/CreditPlan"), exports);
|
|
26
|
+
__exportStar(require("./dtos/Financier"), exports);
|
|
27
|
+
__exportStar(require("./dtos/RetailerCreditPlan"), exports);
|
|
28
|
+
// Request DTOs
|
|
29
|
+
__exportStar(require("./dtos/requests/CreateCreditPlanRequest"), exports);
|
|
30
|
+
__exportStar(require("./dtos/requests/UpdateCreditPlanRequest"), exports);
|
|
31
|
+
__exportStar(require("./dtos/requests/ChangeCreditPlanStatusRequest"), exports);
|
|
32
|
+
__exportStar(require("./dtos/requests/SimulateCreditPlanRequest"), exports);
|
|
33
|
+
__exportStar(require("./dtos/requests/CreateFinancierRequest"), exports);
|
|
34
|
+
__exportStar(require("./dtos/requests/UpdateFinancierRequest"), exports);
|
|
35
|
+
__exportStar(require("./dtos/requests/ChangeFinancierStatusRequest"), exports);
|
|
36
|
+
__exportStar(require("./dtos/requests/ReorderFinancierRequest"), exports);
|
|
37
|
+
// Response DTOs
|
|
38
|
+
__exportStar(require("./dtos/responses/CreditPlanResponse"), exports);
|
|
39
|
+
__exportStar(require("./dtos/responses/FinancierResponse"), exports);
|
|
40
|
+
__exportStar(require("./dtos/responses/RetailerCreditPlanResponse"), exports);
|
|
41
|
+
__exportStar(require("./dtos/responses/SimulationResultResponse"), exports);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -105,5 +105,8 @@ export * as EmailVerification from './emailVerification';
|
|
|
105
105
|
export * as RetailOrg from './retailOrg';
|
|
106
106
|
// LoanConfig: DTOs/enums del lambda loan-config-business (comp 09 — parámetros operativos del SOFOM).
|
|
107
107
|
export * as LoanConfig from './loanConfig';
|
|
108
|
+
// LoanOfferings: DTOs/enums del lambda loan-offerings-business (comp 07 — planes de crédito,
|
|
109
|
+
// financieras, M:N retailer↔plan y simulador de cuota; SureKeep Fase 1 — pista Loan).
|
|
110
|
+
export * as LoanOfferings from './loanOfferings';
|
|
108
111
|
export * from './messaging';
|
|
109
112
|
export * from './complaint';
|
|
@@ -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
|
+
}
|