@fiado/type-kit 3.437.0 → 3.439.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 +8 -1
- package/_test_/unit/loanCredit/dtos/creditLifecycleRequests.test.ts +6 -2
- package/_test_/unit/messagesConnector/messageLogListContract.test.ts +16 -0
- package/bin/loanCredit/dtos/requests/BackofficeWriteOffCreditRequest.js +0 -1
- package/bin/loanCredit/enums/PaymentReviewReasonEnum.d.ts +3 -1
- package/bin/loanCredit/enums/PaymentReviewReasonEnum.js +2 -0
- package/bin/messagesConnector/dtos/MessageLogItem.d.ts +2 -1
- package/package.json +1 -1
- package/src/loanCredit/dtos/requests/BackofficeWriteOffCreditRequest.ts +1 -2
- package/src/loanCredit/enums/PaymentReviewReasonEnum.ts +2 -0
- package/src/messagesConnector/dtos/MessageLogItem.ts +2 -1
|
@@ -41,7 +41,14 @@ describe.each([
|
|
|
41
41
|
[
|
|
42
42
|
'PaymentReviewReasonEnum',
|
|
43
43
|
PaymentReviewReasonEnum,
|
|
44
|
-
[
|
|
44
|
+
[
|
|
45
|
+
'OVERPAYMENT',
|
|
46
|
+
'INSTALLMENT_CLOSED',
|
|
47
|
+
'CREDIT_NOT_COLLECTIBLE',
|
|
48
|
+
'LEGACY_INSTALLMENT_WITH_PAYMENT',
|
|
49
|
+
'UNCAPTURED_HOLD',
|
|
50
|
+
'AD_HOC_CHARGE_INCOMPLETE',
|
|
51
|
+
],
|
|
45
52
|
],
|
|
46
53
|
['PaymentReviewActionEnum', PaymentReviewActionEnum, ['APPLY', 'REFUND', 'RECONCILE']],
|
|
47
54
|
['RefundDestinationEnum', RefundDestinationEnum, ['CUSTOMER_ACCOUNT', 'PCF_CLABE']],
|
|
@@ -60,8 +60,12 @@ describe('BackofficeWriteOffCreditRequest', () => {
|
|
|
60
60
|
expect(await errorPaths(BackofficeWriteOffCreditRequest, body)).toEqual([]);
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
it('
|
|
64
|
-
|
|
63
|
+
it('deja pasar el motivo vacío para que el lambda responda WRITE_OFF_REASON_REQUIRED', async () => {
|
|
64
|
+
expect(await errorPaths(BackofficeWriteOffCreditRequest, { reason: '' })).toEqual([]);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('rechaza un motivo que no es texto y una confirmación que no es booleana', async () => {
|
|
68
|
+
const body = { reason: 42, confirmations: { recoveryResourcesExhausted: 'yes' } };
|
|
65
69
|
|
|
66
70
|
expect(await errorPaths(BackofficeWriteOffCreditRequest, body)).toEqual(
|
|
67
71
|
expect.arrayContaining(['reason', 'confirmations.recoveryResourcesExhausted']),
|
|
@@ -87,6 +87,22 @@ describe('MessageLogListResponse', () => {
|
|
|
87
87
|
]);
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
+
it('el aviso MDM no trae plantilla del catálogo: templatePk admite null', () => {
|
|
91
|
+
const item: MessageLogItem = {
|
|
92
|
+
id: 'b3c1f0a2-0000-4000-8000-000000000002',
|
|
93
|
+
channelType: DeliveryChannelExtendedEnum.MDM,
|
|
94
|
+
messageType: 'PAYMENT_OVERDUE',
|
|
95
|
+
templatePk: null,
|
|
96
|
+
referenceMessageId: 'mdm#01M0B5D7FQA3T06K4REEVPRM33',
|
|
97
|
+
status: MessageLogStatusEnum.COMPLETED,
|
|
98
|
+
renderedMessage: null,
|
|
99
|
+
failureCode: null,
|
|
100
|
+
createdAt: '2026-09-14T15:00:00.000Z',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
expect(item.templatePk).toBeNull();
|
|
104
|
+
});
|
|
105
|
+
|
|
90
106
|
it('el enum de estado trae los estados que escribe messages-business', () => {
|
|
91
107
|
expect(Object.values(MessageLogStatusEnum).sort()).toEqual(
|
|
92
108
|
['CANCEL', 'COMPLETED', 'CREATED', 'PENDING', 'REJECTED', 'VALIDATED'],
|
|
@@ -21,7 +21,6 @@ __decorate([
|
|
|
21
21
|
(0, class_transformer_1.Expose)(),
|
|
22
22
|
(0, class_validator_1.IsOptional)(),
|
|
23
23
|
(0, class_validator_1.IsString)(),
|
|
24
|
-
(0, class_validator_1.MinLength)(1),
|
|
25
24
|
__metadata("design:type", String)
|
|
26
25
|
], BackofficeWriteOffCreditRequest.prototype, "reason", void 0);
|
|
27
26
|
__decorate([
|
|
@@ -12,5 +12,7 @@ export declare enum PaymentReviewReasonEnum {
|
|
|
12
12
|
/** Cuota con abonos previos sin desglose. */
|
|
13
13
|
LEGACY_INSTALLMENT_WITH_PAYMENT = "LEGACY_INSTALLMENT_WITH_PAYMENT",
|
|
14
14
|
/** Lo retenido sin capturar. */
|
|
15
|
-
UNCAPTURED_HOLD = "UNCAPTURED_HOLD"
|
|
15
|
+
UNCAPTURED_HOLD = "UNCAPTURED_HOLD",
|
|
16
|
+
/** Cobro ad hoc PREPAYMENT, ADVANCE o RECOVERY que no fue completo. */
|
|
17
|
+
AD_HOC_CHARGE_INCOMPLETE = "AD_HOC_CHARGE_INCOMPLETE"
|
|
16
18
|
}
|
|
@@ -17,4 +17,6 @@ var PaymentReviewReasonEnum;
|
|
|
17
17
|
PaymentReviewReasonEnum["LEGACY_INSTALLMENT_WITH_PAYMENT"] = "LEGACY_INSTALLMENT_WITH_PAYMENT";
|
|
18
18
|
/** Lo retenido sin capturar. */
|
|
19
19
|
PaymentReviewReasonEnum["UNCAPTURED_HOLD"] = "UNCAPTURED_HOLD";
|
|
20
|
+
/** Cobro ad hoc PREPAYMENT, ADVANCE o RECOVERY que no fue completo. */
|
|
21
|
+
PaymentReviewReasonEnum["AD_HOC_CHARGE_INCOMPLETE"] = "AD_HOC_CHARGE_INCOMPLETE";
|
|
20
22
|
})(PaymentReviewReasonEnum || (exports.PaymentReviewReasonEnum = PaymentReviewReasonEnum = {}));
|
|
@@ -6,7 +6,8 @@ export declare class MessageLogItem {
|
|
|
6
6
|
channelType: DeliveryChannelExtendedEnum;
|
|
7
7
|
/** Momento del catálogo o tipo de aviso MDM; cada canal trae el suyo. */
|
|
8
8
|
messageType: string;
|
|
9
|
-
|
|
9
|
+
/** Null cuando la fila no guarda plantilla, como los avisos MDM. */
|
|
10
|
+
templatePk: string | null;
|
|
10
11
|
referenceMessageId: string | null;
|
|
11
12
|
status: MessageLogStatusEnum;
|
|
12
13
|
/** Texto que recibió el destinatario. */
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
|
-
import { IsOptional, IsString,
|
|
2
|
+
import { IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
3
3
|
import { WriteOffConfirmations } from '../WriteOffConfirmations';
|
|
4
4
|
|
|
5
5
|
/** Body de `POST /backoffice/credits/:creditId/write-off`. Los faltantes los responde el lambda con su code. */
|
|
@@ -8,7 +8,6 @@ export class BackofficeWriteOffCreditRequest {
|
|
|
8
8
|
@Expose()
|
|
9
9
|
@IsOptional()
|
|
10
10
|
@IsString()
|
|
11
|
-
@MinLength(1)
|
|
12
11
|
reason?: string;
|
|
13
12
|
|
|
14
13
|
@Expose()
|
|
@@ -13,4 +13,6 @@ export enum PaymentReviewReasonEnum {
|
|
|
13
13
|
LEGACY_INSTALLMENT_WITH_PAYMENT = 'LEGACY_INSTALLMENT_WITH_PAYMENT',
|
|
14
14
|
/** Lo retenido sin capturar. */
|
|
15
15
|
UNCAPTURED_HOLD = 'UNCAPTURED_HOLD',
|
|
16
|
+
/** Cobro ad hoc PREPAYMENT, ADVANCE o RECOVERY que no fue completo. */
|
|
17
|
+
AD_HOC_CHARGE_INCOMPLETE = 'AD_HOC_CHARGE_INCOMPLETE',
|
|
16
18
|
}
|
|
@@ -7,7 +7,8 @@ export class MessageLogItem {
|
|
|
7
7
|
channelType!: DeliveryChannelExtendedEnum;
|
|
8
8
|
/** Momento del catálogo o tipo de aviso MDM; cada canal trae el suyo. */
|
|
9
9
|
messageType!: string;
|
|
10
|
-
|
|
10
|
+
/** Null cuando la fila no guarda plantilla, como los avisos MDM. */
|
|
11
|
+
templatePk!: string | null;
|
|
11
12
|
referenceMessageId!: string | null;
|
|
12
13
|
status!: MessageLogStatusEnum;
|
|
13
14
|
/** Texto que recibió el destinatario. */
|