@fiado/type-kit 3.498.0 → 3.499.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.
@@ -65,7 +65,11 @@ describe('CreateCustomerPaymentRequest', () => {
65
65
  expect(await errorProperties({ ...VALID, type: LoanCustomerPaymentTypeEnum.ADVANCE, installmentCount: 3 })).toEqual([]);
66
66
  });
67
67
 
68
- it.each([[1], [0], [2.5], ['3']])('rechaza el número de cuotas %p', async installmentCount => {
68
+ it('acepta adelantar una sola cuota', async () => {
69
+ expect(await errorProperties({ ...VALID, type: LoanCustomerPaymentTypeEnum.ADVANCE, installmentCount: 1 })).toEqual([]);
70
+ });
71
+
72
+ it.each([[0], [2.5], ['3']])('rechaza el número de cuotas %p', async installmentCount => {
69
73
  expect(await errorProperties({ ...VALID, type: LoanCustomerPaymentTypeEnum.ADVANCE, installmentCount })).toEqual([
70
74
  'installmentCount',
71
75
  ]);
@@ -51,9 +51,9 @@ describe('CreateSellerPaymentRequest', () => {
51
51
  expect(await errorPaths({ ...BASE, idempotencyKey: 'no-uuid' })).toEqual(['idempotencyKey']);
52
52
  });
53
53
 
54
- it('cuotas solo de 2 en adelante', async () => {
55
- expect(await errorPaths({ ...BASE, type: 'ADVANCE', installmentCount: 1 })).toEqual(['installmentCount']);
56
- expect(await errorPaths({ ...BASE, type: 'ADVANCE', installmentCount: 2 })).toEqual([]);
54
+ it('cuotas desde 1', async () => {
55
+ expect(await errorPaths({ ...BASE, type: 'ADVANCE', installmentCount: 0 })).toEqual(['installmentCount']);
56
+ expect(await errorPaths({ ...BASE, type: 'ADVANCE', installmentCount: 1 })).toEqual([]);
57
57
  });
58
58
 
59
59
  it('no declara CLABE: con whitelist se descarta y nunca llega al dominio', () => {
@@ -72,6 +72,13 @@ describe('CreateMyPaymentRequest', () => {
72
72
  it.each([[0], [-1050], [10.123], ['1050']])('rechaza el monto %p', async expectedAmount => {
73
73
  expect(await errorProperties({ type: MyPaymentTypeEnum.SETTLEMENT, expectedAmount })).toEqual(['expectedAmount']);
74
74
  });
75
+
76
+ it('pagar por adelantado acepta desde una cuota', async () => {
77
+ expect(await errorProperties({ type: MyPaymentTypeEnum.ADVANCE, expectedAmount: 1050, installmentCount: 1 })).toEqual([]);
78
+ expect(await errorProperties({ type: MyPaymentTypeEnum.ADVANCE, expectedAmount: 1050, installmentCount: 0 })).toEqual([
79
+ 'installmentCount',
80
+ ]);
81
+ });
75
82
  });
76
83
 
77
84
  describe('retailLoan — opciones y respuesta del pago', () => {
@@ -37,6 +37,6 @@ __decorate([
37
37
  (0, class_transformer_1.Expose)(),
38
38
  (0, class_validator_1.IsOptional)(),
39
39
  (0, class_validator_1.IsInt)(),
40
- (0, class_validator_1.Min)(2),
40
+ (0, class_validator_1.Min)(1),
41
41
  __metadata("design:type", Number)
42
42
  ], CreateCustomerPaymentRequest.prototype, "installmentCount", void 0);
@@ -34,7 +34,7 @@ __decorate([
34
34
  (0, class_transformer_1.Expose)(),
35
35
  (0, class_validator_1.IsOptional)(),
36
36
  (0, class_validator_1.IsInt)(),
37
- (0, class_validator_1.Min)(2),
37
+ (0, class_validator_1.Min)(1),
38
38
  __metadata("design:type", Number)
39
39
  ], CreateSellerPaymentRequest.prototype, "installmentCount", void 0);
40
40
  __decorate([
@@ -32,6 +32,6 @@ __decorate([
32
32
  (0, class_transformer_1.Expose)(),
33
33
  (0, class_validator_1.IsOptional)(),
34
34
  (0, class_validator_1.IsInt)(),
35
- (0, class_validator_1.Min)(2),
35
+ (0, class_validator_1.Min)(1),
36
36
  __metadata("design:type", Number)
37
37
  ], CreateMyPaymentRequest.prototype, "installmentCount", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.498.0",
3
+ "version": "3.499.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -23,6 +23,6 @@ export class CreateCustomerPaymentRequest {
23
23
  @Expose()
24
24
  @IsOptional()
25
25
  @IsInt()
26
- @Min(2)
26
+ @Min(1)
27
27
  installmentCount?: number;
28
28
  }
@@ -20,7 +20,7 @@ export class CreateSellerPaymentRequest {
20
20
  @Expose()
21
21
  @IsOptional()
22
22
  @IsInt()
23
- @Min(2)
23
+ @Min(1)
24
24
  installmentCount?: number;
25
25
 
26
26
  @Expose()
@@ -18,6 +18,6 @@ export class CreateMyPaymentRequest {
18
18
  @Expose()
19
19
  @IsOptional()
20
20
  @IsInt()
21
- @Min(2)
21
+ @Min(1)
22
22
  installmentCount?: number;
23
23
  }