@fiado/type-kit 3.599.0 → 3.601.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/remittance/RemittanceProviderCost.test.ts +13 -0
- package/bin/collection/dtos/ApplyCollectionResultRequest.d.ts +8 -0
- package/bin/collection/dtos/ApplyCollectionResultRequest.js +11 -0
- package/bin/collection/dtos/AuthorizeCollectionMovementResponse.d.ts +5 -0
- package/bin/collection/dtos/AuthorizeCollectionMovementResponse.js +5 -0
- package/bin/remittance/dtos/RemittancePayerConfig.d.ts +6 -0
- package/bin/remittance/dtos/RemittancePayerConfig.js +8 -0
- package/package.json +1 -1
- package/src/collection/dtos/ApplyCollectionResultRequest.ts +8 -0
- package/src/collection/dtos/AuthorizeCollectionMovementResponse.ts +5 -0
- package/src/remittance/dtos/RemittancePayerConfig.ts +12 -1
|
@@ -4,6 +4,7 @@ import { validateSync } from "class-validator";
|
|
|
4
4
|
import { ProviderCostUpdateRequest } from "../../../src/remittance/dtos/RemittanceProviderCost";
|
|
5
5
|
import { SimulatePricingRequest, UpdatePricingRequest } from "../../../src/remittance/dtos/RemittancePricing";
|
|
6
6
|
import { PricingResolveRequest } from "../../../src/remittance/dtos/internal/RemittancePricingResolve";
|
|
7
|
+
import { RemittancePayerConfigUpdateRequest } from "../../../src/remittance/dtos/RemittancePayerConfig";
|
|
7
8
|
|
|
8
9
|
const errorsOf = <T extends object>(cls: new () => T, plain: object) =>
|
|
9
10
|
validateSync(plainToInstance(cls, plain), { whitelist: true, forbidNonWhitelisted: true });
|
|
@@ -76,3 +77,15 @@ describe("PricingResolveRequest", () => {
|
|
|
76
77
|
})).not.toHaveLength(0);
|
|
77
78
|
});
|
|
78
79
|
});
|
|
80
|
+
|
|
81
|
+
describe("RemittancePayerConfigUpdateRequest.disabledMethods", () => {
|
|
82
|
+
it("acepta métodos válidos y lista vacía", () => {
|
|
83
|
+
expect(errorsOf(RemittancePayerConfigUpdateRequest, { disabledMethods: ["CASH_PICKUP"] })).toHaveLength(0);
|
|
84
|
+
expect(errorsOf(RemittancePayerConfigUpdateRequest, { disabledMethods: [] })).toHaveLength(0);
|
|
85
|
+
expect(errorsOf(RemittancePayerConfigUpdateRequest, { enabled: true })).toHaveLength(0);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("rechaza un método que no existe", () => {
|
|
89
|
+
expect(errorsOf(RemittancePayerConfigUpdateRequest, { disabledMethods: ["CARRIER_PIGEON"] })).not.toHaveLength(0);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CollectionResultStatus } from '../enums/CollectionResultStatus';
|
|
2
2
|
import { MechanismType } from '../enums/MechanismType';
|
|
3
|
+
import { CurrencyId } from '../../currency/enums/CurrencyId';
|
|
3
4
|
/**
|
|
4
5
|
* Resultado de un intento de cobro, tal como el motor se lo entrega al dominio dueño de la deuda.
|
|
5
6
|
*
|
|
@@ -19,4 +20,11 @@ export declare class ApplyCollectionResultRequest {
|
|
|
19
20
|
amountReserved: number;
|
|
20
21
|
mechanism: MechanismType;
|
|
21
22
|
holdTxId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Monto que salió de la wallet, en `walletCurrency`. Sólo viene cuando se retuvo o debitó dinero
|
|
25
|
+
* (ausente en NONE); en USD_PREAUTH son los USD retenidos, que el dominio usa como `amountBlocked`.
|
|
26
|
+
*/
|
|
27
|
+
walletAmount?: number;
|
|
28
|
+
/** Moneda de `walletAmount`. Viene junto con él, sólo cuando se retuvo o debitó dinero. */
|
|
29
|
+
walletCurrency?: CurrencyId;
|
|
22
30
|
}
|
|
@@ -13,6 +13,7 @@ exports.ApplyCollectionResultRequest = void 0;
|
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const CollectionResultStatus_1 = require("../enums/CollectionResultStatus");
|
|
15
15
|
const MechanismType_1 = require("../enums/MechanismType");
|
|
16
|
+
const CurrencyId_1 = require("../../currency/enums/CurrencyId");
|
|
16
17
|
/**
|
|
17
18
|
* Resultado de un intento de cobro, tal como el motor se lo entrega al dominio dueño de la deuda.
|
|
18
19
|
*
|
|
@@ -65,3 +66,13 @@ __decorate([
|
|
|
65
66
|
(0, class_validator_1.IsString)(),
|
|
66
67
|
__metadata("design:type", String)
|
|
67
68
|
], ApplyCollectionResultRequest.prototype, "holdTxId", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
(0, class_validator_1.IsNumber)(),
|
|
72
|
+
__metadata("design:type", Number)
|
|
73
|
+
], ApplyCollectionResultRequest.prototype, "walletAmount", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
(0, class_validator_1.IsEnum)(CurrencyId_1.CurrencyId),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], ApplyCollectionResultRequest.prototype, "walletCurrency", void 0);
|
|
@@ -10,4 +10,9 @@ export declare class AuthorizeCollectionMovementResponse {
|
|
|
10
10
|
amount: number;
|
|
11
11
|
holdTxId?: string;
|
|
12
12
|
transactionId?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Lo que realmente salió de la cuenta, en la moneda de la wallet y con comisiones incluidas.
|
|
15
|
+
* Sólo viene cuando se retuvo o debitó dinero (ausente en NONE); en USD_PREAUTH son los USD retenidos.
|
|
16
|
+
*/
|
|
17
|
+
amountDebited?: number;
|
|
13
18
|
}
|
|
@@ -39,3 +39,8 @@ __decorate([
|
|
|
39
39
|
(0, class_validator_1.IsString)(),
|
|
40
40
|
__metadata("design:type", String)
|
|
41
41
|
], AuthorizeCollectionMovementResponse.prototype, "transactionId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsNumber)(),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], AuthorizeCollectionMovementResponse.prototype, "amountDebited", void 0);
|
|
@@ -21,6 +21,8 @@ export declare class RemittancePayerConfigItem {
|
|
|
21
21
|
logoUrl?: string;
|
|
22
22
|
/** Grupo de costo UniTeller de cada método (solo lectura aquí; se edita en Costos UniTeller). */
|
|
23
23
|
costGroupByMethod?: CostGroupByMethod;
|
|
24
|
+
/** Métodos apagados por Ops; ausente o vacío = todos prendidos. */
|
|
25
|
+
disabledMethods?: ReceptionMethod[];
|
|
24
26
|
}
|
|
25
27
|
/** Response de GET /backoffice/config/payers (config chica, sin paginación). */
|
|
26
28
|
export declare class RemittancePayerConfigListResponse {
|
|
@@ -30,6 +32,8 @@ export declare class RemittancePayerConfigListResponse {
|
|
|
30
32
|
export declare class RemittancePayerConfigUpdateRequest {
|
|
31
33
|
enabled?: boolean;
|
|
32
34
|
name?: string | null;
|
|
35
|
+
/** Métodos a apagar; reemplaza la lista guardada. [] = todos prendidos. */
|
|
36
|
+
disabledMethods?: ReceptionMethod[];
|
|
33
37
|
}
|
|
34
38
|
/** Fila cruda de config (endpoint privado → connector, que la mergea al servir el catálogo). */
|
|
35
39
|
export declare class RemittancePayerConfigEntry {
|
|
@@ -37,5 +41,7 @@ export declare class RemittancePayerConfigEntry {
|
|
|
37
41
|
countryISO: string;
|
|
38
42
|
enabled: boolean;
|
|
39
43
|
name?: string;
|
|
44
|
+
/** Métodos apagados por Ops; ausente o vacío = todos prendidos. */
|
|
45
|
+
disabledMethods?: ReceptionMethod[];
|
|
40
46
|
updatedAt: string;
|
|
41
47
|
}
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RemittancePayerConfigEntry = exports.RemittancePayerConfigUpdateRequest = exports.RemittancePayerConfigListResponse = exports.RemittancePayerConfigItem = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
+
const ReceptionMethod_1 = require("../enums/ReceptionMethod");
|
|
14
15
|
/**
|
|
15
16
|
* DTOs de la administración de payers desde el backoffice (v1: enabled + override de nombre).
|
|
16
17
|
* La lista de payers la dicta el catálogo UniTeller; la config es un overlay por payerCode.
|
|
@@ -39,6 +40,13 @@ __decorate([
|
|
|
39
40
|
(0, class_validator_1.Length)(1, 60),
|
|
40
41
|
__metadata("design:type", String)
|
|
41
42
|
], RemittancePayerConfigUpdateRequest.prototype, "name", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsOptional)(),
|
|
45
|
+
(0, class_validator_1.IsArray)(),
|
|
46
|
+
(0, class_validator_1.ArrayMaxSize)(3),
|
|
47
|
+
(0, class_validator_1.IsEnum)(ReceptionMethod_1.ReceptionMethod, { each: true }),
|
|
48
|
+
__metadata("design:type", Array)
|
|
49
|
+
], RemittancePayerConfigUpdateRequest.prototype, "disabledMethods", void 0);
|
|
42
50
|
/** Fila cruda de config (endpoint privado → connector, que la mergea al servir el catálogo). */
|
|
43
51
|
class RemittancePayerConfigEntry {
|
|
44
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IsString, IsEnum, IsOptional, IsNumber } from 'class-validator';
|
|
2
2
|
import { CollectionResultStatus } from '../enums/CollectionResultStatus';
|
|
3
3
|
import { MechanismType } from '../enums/MechanismType';
|
|
4
|
+
import { CurrencyId } from '../../currency/enums/CurrencyId';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Resultado de un intento de cobro, tal como el motor se lo entrega al dominio dueño de la deuda.
|
|
@@ -21,4 +22,11 @@ export class ApplyCollectionResultRequest {
|
|
|
21
22
|
@IsNumber() amountReserved!: number;
|
|
22
23
|
@IsEnum(MechanismType) mechanism!: MechanismType;
|
|
23
24
|
@IsOptional() @IsString() holdTxId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Monto que salió de la wallet, en `walletCurrency`. Sólo viene cuando se retuvo o debitó dinero
|
|
27
|
+
* (ausente en NONE); en USD_PREAUTH son los USD retenidos, que el dominio usa como `amountBlocked`.
|
|
28
|
+
*/
|
|
29
|
+
@IsOptional() @IsNumber() walletAmount?: number;
|
|
30
|
+
/** Moneda de `walletAmount`. Viene junto con él, sólo cuando se retuvo o debitó dinero. */
|
|
31
|
+
@IsOptional() @IsEnum(CurrencyId) walletCurrency?: CurrencyId;
|
|
24
32
|
}
|
|
@@ -12,4 +12,9 @@ export class AuthorizeCollectionMovementResponse {
|
|
|
12
12
|
@IsNumber() amount!: number; // reservado o cobrado
|
|
13
13
|
@IsOptional() @IsString() holdTxId?: string;
|
|
14
14
|
@IsOptional() @IsString() transactionId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Lo que realmente salió de la cuenta, en la moneda de la wallet y con comisiones incluidas.
|
|
17
|
+
* Sólo viene cuando se retuvo o debitó dinero (ausente en NONE); en USD_PREAUTH son los USD retenidos.
|
|
18
|
+
*/
|
|
19
|
+
@IsOptional() @IsNumber() amountDebited?: number;
|
|
15
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsBoolean, IsOptional, IsString, Length } from "class-validator";
|
|
1
|
+
import { ArrayMaxSize, IsArray, IsBoolean, IsEnum, IsOptional, IsString, Length } from "class-validator";
|
|
2
2
|
import { ReceptionMethod } from "../enums/ReceptionMethod";
|
|
3
3
|
import { CostGroupByMethod } from "./RemittanceProviderCost";
|
|
4
4
|
|
|
@@ -24,6 +24,8 @@ export class RemittancePayerConfigItem {
|
|
|
24
24
|
logoUrl?: string;
|
|
25
25
|
/** Grupo de costo UniTeller de cada método (solo lectura aquí; se edita en Costos UniTeller). */
|
|
26
26
|
costGroupByMethod?: CostGroupByMethod;
|
|
27
|
+
/** Métodos apagados por Ops; ausente o vacío = todos prendidos. */
|
|
28
|
+
disabledMethods?: ReceptionMethod[];
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
/** Response de GET /backoffice/config/payers (config chica, sin paginación). */
|
|
@@ -41,6 +43,13 @@ export class RemittancePayerConfigUpdateRequest {
|
|
|
41
43
|
@IsString()
|
|
42
44
|
@Length(1, 60)
|
|
43
45
|
name?: string | null;
|
|
46
|
+
|
|
47
|
+
/** Métodos a apagar; reemplaza la lista guardada. [] = todos prendidos. */
|
|
48
|
+
@IsOptional()
|
|
49
|
+
@IsArray()
|
|
50
|
+
@ArrayMaxSize(3)
|
|
51
|
+
@IsEnum(ReceptionMethod, { each: true })
|
|
52
|
+
disabledMethods?: ReceptionMethod[];
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
/** Fila cruda de config (endpoint privado → connector, que la mergea al servir el catálogo). */
|
|
@@ -49,5 +58,7 @@ export class RemittancePayerConfigEntry {
|
|
|
49
58
|
countryISO!: string;
|
|
50
59
|
enabled!: boolean;
|
|
51
60
|
name?: string;
|
|
61
|
+
/** Métodos apagados por Ops; ausente o vacío = todos prendidos. */
|
|
62
|
+
disabledMethods?: ReceptionMethod[];
|
|
52
63
|
updatedAt!: string;
|
|
53
64
|
}
|