@fiado/type-kit 3.649.0 → 3.651.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/loanCredit/creditLifecycleEnums.test.ts +1 -1
- package/_test_/unit/loanCredit/customerPaymentDtos.test.ts +25 -0
- package/_test_/unit/retailLoan/paymentContract.test.ts +24 -0
- 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/MyPaymentOptions.d.ts +5 -1
- package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +2 -0
- package/package.json +1 -1
- package/src/loanCredit/dtos/responses/LoanCustomerPaymentOptions.ts +5 -1
- package/src/loanCredit/enums/LoanAdHocChargeKindEnum.ts +2 -0
- package/src/retailLoan/dtos/MyPaymentOptions.ts +5 -1
- package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +2 -0
|
@@ -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 = {
|
|
@@ -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: {
|
|
@@ -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 & {
|
|
@@ -91,6 +91,8 @@ export interface EvaluatedDiscountCode {
|
|
|
91
91
|
rejectionCode: RetailPromotionsErrorCodeEnum | null;
|
|
92
92
|
lines: LinePromotionDiscount[];
|
|
93
93
|
totalDiscountCents: number;
|
|
94
|
+
/** Formas de pago con las que vale el código; null = cualquiera (o código inexistente). */
|
|
95
|
+
paymentOptions: PromotionPaymentOptionEnum[] | null;
|
|
94
96
|
}
|
|
95
97
|
/** Lo que gana el recomendado en una promo de referido vigente. */
|
|
96
98
|
export interface EvaluatedReferredReward {
|
package/package.json
CHANGED
|
@@ -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 & {
|
|
@@ -98,6 +98,8 @@ export interface EvaluatedDiscountCode {
|
|
|
98
98
|
rejectionCode: RetailPromotionsErrorCodeEnum | null;
|
|
99
99
|
lines: LinePromotionDiscount[];
|
|
100
100
|
totalDiscountCents: number;
|
|
101
|
+
/** Formas de pago con las que vale el código; null = cualquiera (o código inexistente). */
|
|
102
|
+
paymentOptions: PromotionPaymentOptionEnum[] | null;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
/** Lo que gana el recomendado en una promo de referido vigente. */
|