@fiado/type-kit 3.650.0 → 3.652.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_test_/unit/loanConfig/recentParameterChanges.test.ts +6 -1
- package/_test_/unit/loanCredit/creditLifecycleEnums.test.ts +1 -1
- package/_test_/unit/loanCredit/customerPaymentDtos.test.ts +25 -0
- package/_test_/unit/retailLoan/contract.test.ts +13 -0
- package/_test_/unit/retailLoan/paymentContract.test.ts +24 -0
- package/bin/loanConfig/enums/ParameterTypeEnum.d.ts +4 -2
- package/bin/loanConfig/enums/ParameterTypeEnum.js +3 -1
- package/bin/loanCredit/dtos/responses/LoanCustomerPaymentOptions.d.ts +5 -1
- package/bin/loanCredit/enums/LoanAdHocChargeKindEnum.d.ts +3 -1
- package/bin/loanCredit/enums/LoanAdHocChargeKindEnum.js +2 -0
- package/bin/retailLoan/dtos/MyLegalDocument.d.ts +9 -0
- package/bin/retailLoan/dtos/MyLegalDocument.js +2 -0
- package/bin/retailLoan/dtos/MyPaymentOptions.d.ts +5 -1
- package/bin/retailLoan/index.d.ts +1 -0
- package/bin/retailLoan/index.js +1 -0
- package/package.json +1 -1
- package/src/loanConfig/enums/ParameterTypeEnum.ts +3 -1
- package/src/loanCredit/dtos/responses/LoanCustomerPaymentOptions.ts +5 -1
- package/src/loanCredit/enums/LoanAdHocChargeKindEnum.ts +2 -0
- package/src/retailLoan/dtos/MyLegalDocument.ts +9 -0
- package/src/retailLoan/dtos/MyPaymentOptions.ts +5 -1
- package/src/retailLoan/index.ts +1 -0
|
@@ -22,7 +22,12 @@ const validateQuery = (query: object) => {
|
|
|
22
22
|
describe('ParameterTypeEnum', () => {
|
|
23
23
|
it('incluye FEATURE_FLAG como el paramType 15', () => {
|
|
24
24
|
expect(ParameterTypeEnum.FEATURE_FLAG).toBe('FEATURE_FLAG');
|
|
25
|
-
expect(Object.values(ParameterTypeEnum)).
|
|
25
|
+
expect(Object.values(ParameterTypeEnum).indexOf(ParameterTypeEnum.FEATURE_FLAG)).toBe(14);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('incluye LEGAL como el paramType 16', () => {
|
|
29
|
+
expect(ParameterTypeEnum.LEGAL).toBe('LEGAL');
|
|
30
|
+
expect(Object.values(ParameterTypeEnum)).toHaveLength(16);
|
|
26
31
|
});
|
|
27
32
|
});
|
|
28
33
|
|
|
@@ -35,7 +35,7 @@ describe('ContractTypeEnum', () => {
|
|
|
35
35
|
|
|
36
36
|
describe.each([
|
|
37
37
|
['LoanSettlementStatusEnum', LoanSettlementStatusEnum, ['PENDING']],
|
|
38
|
-
['LoanAdHocChargeKindEnum', LoanAdHocChargeKindEnum, ['SETTLEMENT', 'RECOVERY', 'PREPAYMENT', 'ADVANCE']],
|
|
38
|
+
['LoanAdHocChargeKindEnum', LoanAdHocChargeKindEnum, ['SETTLEMENT', 'RECOVERY', 'PREPAYMENT', 'ADVANCE', 'DUE']],
|
|
39
39
|
['WrittenOffRecoveryTypeEnum', WrittenOffRecoveryTypeEnum, ['OVERDUE', 'SETTLEMENT']],
|
|
40
40
|
['LoanRestructureStatusEnum', LoanRestructureStatusEnum, ['PROPOSED', 'APPROVED', 'REJECTED', 'PENDING_REGISTRATION', 'EXECUTED', 'CANCELLED']],
|
|
41
41
|
['LoanChargeKindEnum', LoanChargeKindEnum, ['INSTALLMENT', 'SETTLEMENT', 'RECOVERY', 'PREPAYMENT', 'ADVANCE']],
|
|
@@ -45,6 +45,31 @@ describe('loanCredit — opciones y resultado del pago del cliente', () => {
|
|
|
45
45
|
expect(options.pendingCharge).toBeUndefined();
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
+
it('en mora la siguiente cuota cobra lo exigible y trae su desglose', () => {
|
|
49
|
+
const blocked = { available: false, unavailableReason: LoanPaymentOptionUnavailableReasonEnum.CREDIT_NOT_CURRENT };
|
|
50
|
+
const options: LoanCustomerPaymentOptions = {
|
|
51
|
+
creditId: 'CR-1',
|
|
52
|
+
nextInstallment: {
|
|
53
|
+
available: true,
|
|
54
|
+
amountCents: 120_136,
|
|
55
|
+
mode: LoanNextInstallmentModeEnum.COLLECT_DUE,
|
|
56
|
+
installmentNumber: 4,
|
|
57
|
+
dueDate: '2026-11-02',
|
|
58
|
+
installments: [
|
|
59
|
+
{ installmentNumber: 4, dueDate: '2026-11-02', amountCents: 60_068 },
|
|
60
|
+
{ installmentNumber: 5, dueDate: '2026-11-09', amountCents: 60_068 },
|
|
61
|
+
],
|
|
62
|
+
overdueCount: 1,
|
|
63
|
+
},
|
|
64
|
+
advance: blocked,
|
|
65
|
+
prepayment: blocked,
|
|
66
|
+
settlement: blocked,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
expect(options.nextInstallment.installments?.map((one) => one.amountCents).reduce((a, b) => a + b, 0)).toBe(options.nextInstallment.amountCents);
|
|
70
|
+
expect(options.nextInstallment.overdueCount).toBe(1);
|
|
71
|
+
});
|
|
72
|
+
|
|
48
73
|
it('un cargo en curso se informa con su tipo y su monto', () => {
|
|
49
74
|
const blocked = { available: false, unavailableReason: LoanPaymentOptionUnavailableReasonEnum.PAYMENT_IN_PROGRESS };
|
|
50
75
|
const options: LoanCustomerPaymentOptions = {
|
|
@@ -7,11 +7,13 @@ import {
|
|
|
7
7
|
MyDocumentStatusEnum,
|
|
8
8
|
MyInstallment,
|
|
9
9
|
MyInstallmentDisplayStatusEnum,
|
|
10
|
+
MyLegalDocument,
|
|
10
11
|
MyPaymentFrequencyEnum,
|
|
11
12
|
MyPaymentMethodEnum,
|
|
12
13
|
MyPaymentPage,
|
|
13
14
|
} from '../../../src/retailLoan/index';
|
|
14
15
|
import { LoanCreditStatusEnum, LoanInstallmentStatusEnum } from '../../../src/loanCredit/index';
|
|
16
|
+
import { ParameterTypeEnum } from '../../../src/loanConfig/index';
|
|
15
17
|
import { CollectionResultStatus } from '../../../src/collection/enums/CollectionResultStatus';
|
|
16
18
|
|
|
17
19
|
describe('retailLoan — contrato app ↔ retail-loan-business (I1)', () => {
|
|
@@ -25,6 +27,17 @@ describe('retailLoan — contrato app ↔ retail-loan-business (I1)', () => {
|
|
|
25
27
|
expect(MyDocumentKindEnum.PAYMENT_RECEIPT).toBe('PAYMENT_RECEIPT');
|
|
26
28
|
});
|
|
27
29
|
|
|
30
|
+
it('la lista de Legal sale de un parámetro LEGAL de loan-config', () => {
|
|
31
|
+
const doc: MyLegalDocument = {
|
|
32
|
+
id: 'privacy-notice',
|
|
33
|
+
title: 'Aviso de Privacidad SureKeep',
|
|
34
|
+
revisedAt: '2026-10-17',
|
|
35
|
+
url: 'https://develop.d1nwd14q1nl8b0.amplifyapp.com/docs/aviso-privacidad-surekeep.pdf',
|
|
36
|
+
};
|
|
37
|
+
expect(ParameterTypeEnum.LEGAL).toBe('LEGAL');
|
|
38
|
+
expect(doc.revisedAt).toBe('2026-10-17');
|
|
39
|
+
});
|
|
40
|
+
|
|
28
41
|
it('el detalle del crédito va en pesos y con frecuencia semanal', () => {
|
|
29
42
|
const detail: MyCreditDetail = {
|
|
30
43
|
creditId: 'CR-1',
|
|
@@ -82,6 +82,30 @@ describe('CreateMyPaymentRequest', () => {
|
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
describe('retailLoan — opciones y respuesta del pago', () => {
|
|
85
|
+
it('en mora la siguiente cuota trae lo exigible en pesos y cuántas vencieron', () => {
|
|
86
|
+
const blocked = { available: false, unavailableReason: MyPaymentUnavailableReasonEnum.CREDIT_NOT_CURRENT };
|
|
87
|
+
const options: MyPaymentOptions = {
|
|
88
|
+
nextInstallment: {
|
|
89
|
+
available: true,
|
|
90
|
+
amount: 1201.36,
|
|
91
|
+
mode: MyNextInstallmentModeEnum.COLLECT_DUE,
|
|
92
|
+
installmentNumber: 4,
|
|
93
|
+
dueDate: '2026-11-02',
|
|
94
|
+
installments: [
|
|
95
|
+
{ installmentNumber: 4, dueDate: '2026-11-02', amount: 600.68 },
|
|
96
|
+
{ installmentNumber: 5, dueDate: '2026-11-09', amount: 600.68 },
|
|
97
|
+
],
|
|
98
|
+
overdueCount: 1,
|
|
99
|
+
},
|
|
100
|
+
advance: blocked,
|
|
101
|
+
prepayment: blocked,
|
|
102
|
+
settlement: blocked,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
expect(options.nextInstallment.installments).toHaveLength(2);
|
|
106
|
+
expect(options.nextInstallment.overdueCount).toBe(1);
|
|
107
|
+
});
|
|
108
|
+
|
|
85
109
|
it('la liquidación trae su desglose y su ahorro en pesos', () => {
|
|
86
110
|
const options: MyPaymentOptions = {
|
|
87
111
|
nextInstallment: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sub-tipos de parámetro operativo del SOFOM (M6 §8 = 13 + SCORING de §5 + FEATURE_FLAG =
|
|
2
|
+
* Sub-tipos de parámetro operativo del SOFOM (M6 §8 = 13 + SCORING de §5 + FEATURE_FLAG + LEGAL = 16).
|
|
3
3
|
* @enum {string}
|
|
4
4
|
*/
|
|
5
5
|
export declare enum ParameterTypeEnum {
|
|
@@ -17,5 +17,7 @@ export declare enum ParameterTypeEnum {
|
|
|
17
17
|
WIZARD = "WIZARD",
|
|
18
18
|
INTEGRATIONS = "INTEGRATIONS",
|
|
19
19
|
SCORING = "SCORING",
|
|
20
|
-
FEATURE_FLAG = "FEATURE_FLAG"
|
|
20
|
+
FEATURE_FLAG = "FEATURE_FLAG",
|
|
21
|
+
/** Documentos que la App muestra en la sección Legal del módulo. */
|
|
22
|
+
LEGAL = "LEGAL"
|
|
21
23
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ParameterTypeEnum = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Sub-tipos de parámetro operativo del SOFOM (M6 §8 = 13 + SCORING de §5 + FEATURE_FLAG =
|
|
5
|
+
* Sub-tipos de parámetro operativo del SOFOM (M6 §8 = 13 + SCORING de §5 + FEATURE_FLAG + LEGAL = 16).
|
|
6
6
|
* @enum {string}
|
|
7
7
|
*/
|
|
8
8
|
var ParameterTypeEnum;
|
|
@@ -22,4 +22,6 @@ var ParameterTypeEnum;
|
|
|
22
22
|
ParameterTypeEnum["INTEGRATIONS"] = "INTEGRATIONS";
|
|
23
23
|
ParameterTypeEnum["SCORING"] = "SCORING";
|
|
24
24
|
ParameterTypeEnum["FEATURE_FLAG"] = "FEATURE_FLAG";
|
|
25
|
+
/** Documentos que la App muestra en la sección Legal del módulo. */
|
|
26
|
+
ParameterTypeEnum["LEGAL"] = "LEGAL";
|
|
25
27
|
})(ParameterTypeEnum || (exports.ParameterTypeEnum = ParameterTypeEnum = {}));
|
|
@@ -22,7 +22,7 @@ export interface LoanCustomerPaymentOptions {
|
|
|
22
22
|
pendingCharge?: {
|
|
23
23
|
kind: LoanAdHocChargeKindEnum;
|
|
24
24
|
amountCents: number;
|
|
25
|
-
/**
|
|
25
|
+
/** En un adelanto o en lo exigible (`DUE`): las cuotas que cubre. */
|
|
26
26
|
installmentNumbers?: number[];
|
|
27
27
|
};
|
|
28
28
|
nextInstallment: LoanCustomerPaymentOption & {
|
|
@@ -30,6 +30,10 @@ export interface LoanCustomerPaymentOptions {
|
|
|
30
30
|
installmentNumber?: number;
|
|
31
31
|
/** `YYYY-MM-DD`. */
|
|
32
32
|
dueDate?: string;
|
|
33
|
+
/** Solo con `COLLECT_DUE`: lo exigible (vencidas y la de hoy), de la más vieja a la más nueva; suma `amountCents`. */
|
|
34
|
+
installments?: LoanCustomerAdvanceInstallment[];
|
|
35
|
+
/** Solo con `COLLECT_DUE`: cuántas de `installments` ya vencieron. */
|
|
36
|
+
overdueCount?: number;
|
|
33
37
|
};
|
|
34
38
|
/** Varias cuotas. `installments` trae las `maxInstallments` que se pueden adelantar, en orden. */
|
|
35
39
|
advance: LoanCustomerPaymentOption & {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tipo de cobro fuera del calendario. Hay un solo cargo pendiente por tipo.
|
|
3
|
+
* `DUE`: lo exigible (vencidas y la de hoy) que el cliente paga desde la app; sus cuotas se dan de baja en el motor.
|
|
3
4
|
* @enum {string}
|
|
4
5
|
*/
|
|
5
6
|
export declare enum LoanAdHocChargeKindEnum {
|
|
6
7
|
SETTLEMENT = "SETTLEMENT",
|
|
7
8
|
RECOVERY = "RECOVERY",
|
|
8
9
|
PREPAYMENT = "PREPAYMENT",
|
|
9
|
-
ADVANCE = "ADVANCE"
|
|
10
|
+
ADVANCE = "ADVANCE",
|
|
11
|
+
DUE = "DUE"
|
|
10
12
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LoanAdHocChargeKindEnum = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Tipo de cobro fuera del calendario. Hay un solo cargo pendiente por tipo.
|
|
6
|
+
* `DUE`: lo exigible (vencidas y la de hoy) que el cliente paga desde la app; sus cuotas se dan de baja en el motor.
|
|
6
7
|
* @enum {string}
|
|
7
8
|
*/
|
|
8
9
|
var LoanAdHocChargeKindEnum;
|
|
@@ -11,4 +12,5 @@ var LoanAdHocChargeKindEnum;
|
|
|
11
12
|
LoanAdHocChargeKindEnum["RECOVERY"] = "RECOVERY";
|
|
12
13
|
LoanAdHocChargeKindEnum["PREPAYMENT"] = "PREPAYMENT";
|
|
13
14
|
LoanAdHocChargeKindEnum["ADVANCE"] = "ADVANCE";
|
|
15
|
+
LoanAdHocChargeKindEnum["DUE"] = "DUE";
|
|
14
16
|
})(LoanAdHocChargeKindEnum || (exports.LoanAdHocChargeKindEnum = LoanAdHocChargeKindEnum = {}));
|
|
@@ -20,7 +20,7 @@ export interface MyPaymentOptions {
|
|
|
20
20
|
pendingPayment?: {
|
|
21
21
|
type: MyPaymentTypeEnum;
|
|
22
22
|
amount: number;
|
|
23
|
-
/** Solo en varias cuotas: las cuotas que cubre. */
|
|
23
|
+
/** Solo en varias cuotas o en lo exigible: las cuotas que cubre. */
|
|
24
24
|
installmentNumbers?: number[];
|
|
25
25
|
};
|
|
26
26
|
nextInstallment: MyPaymentOption & {
|
|
@@ -28,6 +28,10 @@ export interface MyPaymentOptions {
|
|
|
28
28
|
installmentNumber?: number;
|
|
29
29
|
/** `YYYY-MM-DD`. */
|
|
30
30
|
dueDate?: string;
|
|
31
|
+
/** Solo con `COLLECT_DUE`: lo exigible (vencidas y la de hoy), de la más vieja a la más nueva; suma `amount`. */
|
|
32
|
+
installments?: MyAdvanceInstallment[];
|
|
33
|
+
/** Solo con `COLLECT_DUE`: cuántas de `installments` ya vencieron. */
|
|
34
|
+
overdueCount?: number;
|
|
31
35
|
};
|
|
32
36
|
/** Varias cuotas. `installments` trae las `maxInstallments` que se pueden adelantar, en orden. */
|
|
33
37
|
advance: MyPaymentOption & {
|
|
@@ -10,6 +10,7 @@ export * from './dtos/MyInstallment';
|
|
|
10
10
|
export * from './dtos/MyPayment';
|
|
11
11
|
export * from './dtos/MyDocument';
|
|
12
12
|
export * from './dtos/MyDocumentUrl';
|
|
13
|
+
export * from './dtos/MyLegalDocument';
|
|
13
14
|
export * from './enums/MyPaymentTypeEnum';
|
|
14
15
|
export * from './enums/MyNextInstallmentModeEnum';
|
|
15
16
|
export * from './enums/MyPaymentUnavailableReasonEnum';
|
package/bin/retailLoan/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __exportStar(require("./dtos/MyInstallment"), exports);
|
|
|
28
28
|
__exportStar(require("./dtos/MyPayment"), exports);
|
|
29
29
|
__exportStar(require("./dtos/MyDocument"), exports);
|
|
30
30
|
__exportStar(require("./dtos/MyDocumentUrl"), exports);
|
|
31
|
+
__exportStar(require("./dtos/MyLegalDocument"), exports);
|
|
31
32
|
// Pagos
|
|
32
33
|
__exportStar(require("./enums/MyPaymentTypeEnum"), exports);
|
|
33
34
|
__exportStar(require("./enums/MyNextInstallmentModeEnum"), exports);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sub-tipos de parámetro operativo del SOFOM (M6 §8 = 13 + SCORING de §5 + FEATURE_FLAG =
|
|
2
|
+
* Sub-tipos de parámetro operativo del SOFOM (M6 §8 = 13 + SCORING de §5 + FEATURE_FLAG + LEGAL = 16).
|
|
3
3
|
* @enum {string}
|
|
4
4
|
*/
|
|
5
5
|
export enum ParameterTypeEnum {
|
|
@@ -18,4 +18,6 @@ export enum ParameterTypeEnum {
|
|
|
18
18
|
INTEGRATIONS = 'INTEGRATIONS',
|
|
19
19
|
SCORING = 'SCORING',
|
|
20
20
|
FEATURE_FLAG = 'FEATURE_FLAG',
|
|
21
|
+
/** Documentos que la App muestra en la sección Legal del módulo. */
|
|
22
|
+
LEGAL = 'LEGAL',
|
|
21
23
|
}
|
|
@@ -25,7 +25,7 @@ export interface LoanCustomerPaymentOptions {
|
|
|
25
25
|
pendingCharge?: {
|
|
26
26
|
kind: LoanAdHocChargeKindEnum;
|
|
27
27
|
amountCents: number;
|
|
28
|
-
/**
|
|
28
|
+
/** En un adelanto o en lo exigible (`DUE`): las cuotas que cubre. */
|
|
29
29
|
installmentNumbers?: number[];
|
|
30
30
|
};
|
|
31
31
|
nextInstallment: LoanCustomerPaymentOption & {
|
|
@@ -33,6 +33,10 @@ export interface LoanCustomerPaymentOptions {
|
|
|
33
33
|
installmentNumber?: number;
|
|
34
34
|
/** `YYYY-MM-DD`. */
|
|
35
35
|
dueDate?: string;
|
|
36
|
+
/** Solo con `COLLECT_DUE`: lo exigible (vencidas y la de hoy), de la más vieja a la más nueva; suma `amountCents`. */
|
|
37
|
+
installments?: LoanCustomerAdvanceInstallment[];
|
|
38
|
+
/** Solo con `COLLECT_DUE`: cuántas de `installments` ya vencieron. */
|
|
39
|
+
overdueCount?: number;
|
|
36
40
|
};
|
|
37
41
|
/** Varias cuotas. `installments` trae las `maxInstallments` que se pueden adelantar, en orden. */
|
|
38
42
|
advance: LoanCustomerPaymentOption & {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tipo de cobro fuera del calendario. Hay un solo cargo pendiente por tipo.
|
|
3
|
+
* `DUE`: lo exigible (vencidas y la de hoy) que el cliente paga desde la app; sus cuotas se dan de baja en el motor.
|
|
3
4
|
* @enum {string}
|
|
4
5
|
*/
|
|
5
6
|
export enum LoanAdHocChargeKindEnum {
|
|
@@ -7,4 +8,5 @@ export enum LoanAdHocChargeKindEnum {
|
|
|
7
8
|
RECOVERY = 'RECOVERY',
|
|
8
9
|
PREPAYMENT = 'PREPAYMENT',
|
|
9
10
|
ADVANCE = 'ADVANCE',
|
|
11
|
+
DUE = 'DUE',
|
|
10
12
|
}
|
|
@@ -23,7 +23,7 @@ export interface MyPaymentOptions {
|
|
|
23
23
|
pendingPayment?: {
|
|
24
24
|
type: MyPaymentTypeEnum;
|
|
25
25
|
amount: number;
|
|
26
|
-
/** Solo en varias cuotas: las cuotas que cubre. */
|
|
26
|
+
/** Solo en varias cuotas o en lo exigible: las cuotas que cubre. */
|
|
27
27
|
installmentNumbers?: number[];
|
|
28
28
|
};
|
|
29
29
|
nextInstallment: MyPaymentOption & {
|
|
@@ -31,6 +31,10 @@ export interface MyPaymentOptions {
|
|
|
31
31
|
installmentNumber?: number;
|
|
32
32
|
/** `YYYY-MM-DD`. */
|
|
33
33
|
dueDate?: string;
|
|
34
|
+
/** Solo con `COLLECT_DUE`: lo exigible (vencidas y la de hoy), de la más vieja a la más nueva; suma `amount`. */
|
|
35
|
+
installments?: MyAdvanceInstallment[];
|
|
36
|
+
/** Solo con `COLLECT_DUE`: cuántas de `installments` ya vencieron. */
|
|
37
|
+
overdueCount?: number;
|
|
34
38
|
};
|
|
35
39
|
/** Varias cuotas. `installments` trae las `maxInstallments` que se pueden adelantar, en orden. */
|
|
36
40
|
advance: MyPaymentOption & {
|
package/src/retailLoan/index.ts
CHANGED