@fiado/type-kit 3.646.0 → 3.648.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/collection/costCenter.test.ts +23 -4
- package/_test_/unit/collection/tenantCostCenters.test.ts +15 -0
- package/_test_/unit/reconciliation/reconciliationRequests.test.ts +11 -0
- package/_test_/unit/transactionProcessor/reconciliationAdjustment.test.ts +8 -0
- package/bin/collection/dtos/CollectRequest.d.ts +6 -0
- package/bin/collection/dtos/CollectRequest.js +6 -0
- package/bin/collection/dtos/CollectionProductConfigDto.d.ts +0 -2
- package/bin/collection/dtos/CollectionProductConfigDto.js +0 -6
- package/bin/collection/dtos/RegisterCollectibleRequest.d.ts +6 -0
- package/bin/collection/dtos/RegisterCollectibleRequest.js +6 -0
- package/bin/collection/dtos/UpsertProductConfigRequest.d.ts +0 -2
- package/bin/collection/dtos/UpsertProductConfigRequest.js +0 -6
- package/bin/collection/index.d.ts +1 -0
- package/bin/collection/index.js +2 -0
- package/bin/collection/interfaces/TenantCostCenters.d.ts +14 -0
- package/bin/collection/interfaces/TenantCostCenters.js +2 -0
- package/bin/reconciliation/dtos/requests/ReconciliationFeedRequests.d.ts +5 -0
- package/bin/reconciliation/dtos/requests/ReconciliationFeedRequests.js +9 -0
- package/bin/transactionProcessor/dtos/AuthorizeAdjustmentTransactionRequest.d.ts +2 -0
- package/bin/transactionProcessor/dtos/AuthorizeRewardTopupRequest.d.ts +2 -0
- package/bin/transactionProcessor/dtos/AuthorizeRewardTopupRequest.js +6 -0
- package/bin/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentRequest.d.ts +2 -0
- package/bin/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentRequest.js +7 -0
- package/package.json +1 -1
- package/src/collection/dtos/CollectRequest.ts +8 -1
- package/src/collection/dtos/CollectionProductConfigDto.ts +1 -3
- package/src/collection/dtos/RegisterCollectibleRequest.ts +8 -1
- package/src/collection/dtos/UpsertProductConfigRequest.ts +1 -3
- package/src/collection/index.ts +3 -0
- package/src/collection/interfaces/TenantCostCenters.ts +14 -0
- package/src/reconciliation/dtos/requests/ReconciliationFeedRequests.ts +12 -0
- package/src/transactionProcessor/dtos/AuthorizeAdjustmentTransactionRequest.ts +2 -0
- package/src/transactionProcessor/dtos/AuthorizeRewardTopupRequest.ts +7 -1
- package/src/transactionProcessor/dtos/PrivateAuthorizeReconciliationAdjustmentRequest.ts +7 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import { plainToInstance } from 'class-transformer';
|
|
3
3
|
import { validate } from 'class-validator';
|
|
4
|
-
import { CollectionProductConfigDto, UpsertProductConfigRequest } from '../../../src/collection/index';
|
|
5
|
-
import { AuthorizeBonusRequest } from '../../../src/transactionProcessor/index';
|
|
4
|
+
import { CollectRequest, CollectionProductConfigDto, RegisterCollectibleRequest, UpsertProductConfigRequest } from '../../../src/collection/index';
|
|
5
|
+
import { AuthorizeBonusRequest, AuthorizeRewardTopupRequest } from '../../../src/transactionProcessor/index';
|
|
6
6
|
|
|
7
7
|
async function invalidProperties<T extends object>(cls: new () => T, body: Record<string, unknown>): Promise<string[]> {
|
|
8
8
|
return (await validate(plainToInstance(cls, body) as object)).map((e) => e.property);
|
|
@@ -24,6 +24,13 @@ const CONFIG = {
|
|
|
24
24
|
updatedBy: 'system',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
const REGISTER = { directoryId: 'dir-1', tenantId: 'surekeep', domain: 'loan-credit', productId: 'loan', chargeId: 'c-1' };
|
|
28
|
+
const COLLECT = { ...REGISTER, amount: 150.25 };
|
|
29
|
+
const TOPUP = {
|
|
30
|
+
idempotencyKey: 'RW-1', directoryId: 'dir-1', phone: '5512345678', moduleName: 'm', benefitId: 'b1', leafId: 'l1',
|
|
31
|
+
productId: 'p1', amount: 15, concept: 'Recarga',
|
|
32
|
+
};
|
|
33
|
+
|
|
27
34
|
const BONUS = {
|
|
28
35
|
idempotencyKey: 'bonus-1',
|
|
29
36
|
productCatalogId: 'cat-1',
|
|
@@ -33,9 +40,10 @@ const BONUS = {
|
|
|
33
40
|
};
|
|
34
41
|
|
|
35
42
|
describe.each([
|
|
36
|
-
['
|
|
37
|
-
['
|
|
43
|
+
['RegisterCollectibleRequest', RegisterCollectibleRequest, REGISTER],
|
|
44
|
+
['CollectRequest', CollectRequest, COLLECT],
|
|
38
45
|
['AuthorizeBonusRequest', AuthorizeBonusRequest, BONUS],
|
|
46
|
+
['AuthorizeRewardTopupRequest', AuthorizeRewardTopupRequest, TOPUP],
|
|
39
47
|
] as const)('%s.costCenterId', (_name, cls, valid) => {
|
|
40
48
|
const klass = cls as unknown as new () => object;
|
|
41
49
|
|
|
@@ -52,3 +60,14 @@ describe.each([
|
|
|
52
60
|
expect(await invalidProperties(klass, { ...valid, costCenterId: 3 })).toEqual(['costCenterId']);
|
|
53
61
|
});
|
|
54
62
|
});
|
|
63
|
+
|
|
64
|
+
describe.each([
|
|
65
|
+
['CollectionProductConfigDto', CollectionProductConfigDto, CONFIG],
|
|
66
|
+
['UpsertProductConfigRequest', UpsertProductConfigRequest, UPSERT],
|
|
67
|
+
] as const)('%s sin centro de costo', (_name, cls, valid) => {
|
|
68
|
+
it('el centro de costo lo manda el originador en cada cobro, no la configuración del producto', async () => {
|
|
69
|
+
const dto = plainToInstance(cls as unknown as new () => object, { ...valid, costCenterId: 'SK-COBRANZA' });
|
|
70
|
+
const errors = await validate(dto as object, { whitelist: true, forbidNonWhitelisted: true });
|
|
71
|
+
expect(errors.map((e) => e.property)).toEqual(['costCenterId']);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TenantCostCenters } from '../../../src/collection/index';
|
|
2
|
+
|
|
3
|
+
describe('TenantCostCenters', () => {
|
|
4
|
+
it('cada movimiento del tenant tiene su centro de costo opcional', () => {
|
|
5
|
+
const all: TenantCostCenters = {
|
|
6
|
+
welcomeBonus: 'SK-BONO-BIENVENIDA',
|
|
7
|
+
creditPromotion: 'SK-PROMO-CREDITO',
|
|
8
|
+
salePromotion: 'SK-PROMO-VENTA',
|
|
9
|
+
commission: 'SK-COMISIONES',
|
|
10
|
+
};
|
|
11
|
+
const none: TenantCostCenters = {};
|
|
12
|
+
expect(Object.keys(all)).toEqual(['welcomeBonus', 'creditPromotion', 'salePromotion', 'commission']);
|
|
13
|
+
expect(none).toEqual({});
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -235,6 +235,17 @@ describe('feed genérico de los dueños', () => {
|
|
|
235
235
|
expect(errorsOf(PrivateGetReconciliationFeedRecordQuery, { tenantId: 'surekeep' })).toContain('author');
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
+
it('el registro por recordId acepta costCenterIds opcionales en csv o arreglo', () => {
|
|
239
|
+
const base = { tenantId: 'surekeep', author: 'reconciliation-engine-business' };
|
|
240
|
+
expect(errorsOf(PrivateGetReconciliationFeedRecordQuery, { ...base, costCenterIds: 'SK-COBRANZA, SK-BONOS' })).toEqual([]);
|
|
241
|
+
const dto = plainToInstance(PrivateGetReconciliationFeedRecordQuery, { ...base, costCenterIds: 'SK-COBRANZA, SK-BONOS' }, { excludeExtraneousValues: true });
|
|
242
|
+
expect(dto.costCenterIds).toEqual(['SK-COBRANZA', 'SK-BONOS']);
|
|
243
|
+
expect(errorsOf(PrivateGetReconciliationFeedRecordQuery, { ...base, costCenterIds: ['SK-COBRANZA'] })).toEqual([]);
|
|
244
|
+
expect(errorsOf(PrivateGetReconciliationFeedRecordQuery, { ...base, costCenterIds: 'SK-COBRANZA,' })).toContain('costCenterIds');
|
|
245
|
+
expect(errorsOf(PrivateGetReconciliationFeedRecordQuery, { ...base, costCenterIds: '' })).toContain('costCenterIds');
|
|
246
|
+
expect(errorsOf(PrivateGetReconciliationFeedRecordQuery, { ...base, costCenterIds: [7] })).toContain('costCenterIds');
|
|
247
|
+
});
|
|
248
|
+
|
|
238
249
|
it('el concepto del path es del catálogo de feeds', () => {
|
|
239
250
|
expect(errorsOf(ReconciliationFeedPathParams, { concept: ReconciliationFeedConceptEnum.SIGNED_CREDIT })).toEqual([]);
|
|
240
251
|
expect(errorsOf(ReconciliationFeedPathParams, { concept: 'ADJUSTMENT' })).toContain('concept');
|
|
@@ -37,6 +37,14 @@ describe('PrivateAuthorizeReconciliationAdjustmentRequest', () => {
|
|
|
37
37
|
expect(errorsOf(rest)).toEqual([]);
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
it('costCenterId es opcional y, si llega, es texto no vacío', () => {
|
|
41
|
+
expect(errorsOf({ ...valid, costCenterId: 'SK-COBRANZA' })).toEqual([]);
|
|
42
|
+
expect(errorsOf({ ...valid, costCenterId: '' })).toContain('costCenterId');
|
|
43
|
+
expect(errorsOf({ ...valid, costCenterId: 7 })).toContain('costCenterId');
|
|
44
|
+
const dto = plainToInstance(PrivateAuthorizeReconciliationAdjustmentRequest, { ...valid, costCenterId: 'SK-COBRANZA' }, { excludeExtraneousValues: true });
|
|
45
|
+
expect(dto.costCenterId).toBe('SK-COBRANZA');
|
|
46
|
+
});
|
|
47
|
+
|
|
40
48
|
it('la llave debe empezar con el tenantId', () => {
|
|
41
49
|
expect(errorsOf({ ...valid, adjustmentKey: 'otro#INSTALLMENT_COLLECTION_L1#exec-1#1' })).toEqual(['adjustmentKey']);
|
|
42
50
|
expect(errorsOf({ ...valid, adjustmentKey: 'INSTALLMENT_COLLECTION_L1#exec-1#1' })).toEqual(['adjustmentKey']);
|
|
@@ -20,4 +20,10 @@ export declare class CollectRequest {
|
|
|
20
20
|
* lo normal; se manda sólo cuando este cobro tiene condiciones propias.
|
|
21
21
|
*/
|
|
22
22
|
pricing?: CollectionPricingDto;
|
|
23
|
+
/**
|
|
24
|
+
* Centro de costo con que el ledger asienta el cobro; lo decide la plataforma originadora por tipo de
|
|
25
|
+
* transacción. El motor lo guarda en la intención y lo reenvía al processor en cada intento. Ausente,
|
|
26
|
+
* el ledger lo asienta como `UNASSIGNED`.
|
|
27
|
+
*/
|
|
28
|
+
costCenterId?: string;
|
|
23
29
|
}
|
|
@@ -55,3 +55,9 @@ __decorate([
|
|
|
55
55
|
(0, class_transformer_1.Type)(() => CollectionPricingDto_1.CollectionPricingDto),
|
|
56
56
|
__metadata("design:type", CollectionPricingDto_1.CollectionPricingDto)
|
|
57
57
|
], CollectRequest.prototype, "pricing", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], CollectRequest.prototype, "costCenterId", void 0);
|
|
@@ -17,8 +17,6 @@ export declare class CollectionProductConfigDto {
|
|
|
17
17
|
allowPartial: boolean;
|
|
18
18
|
retryPolicy: RetryPolicyDto;
|
|
19
19
|
reportTargets: string[];
|
|
20
|
-
/** Centro de costo con el que el ledger registra los cobros de este producto. */
|
|
21
|
-
costCenterId?: string;
|
|
22
20
|
createdBy: string;
|
|
23
21
|
updatedBy: string;
|
|
24
22
|
}
|
|
@@ -58,12 +58,6 @@ __decorate([
|
|
|
58
58
|
(0, class_validator_1.IsString)({ each: true }),
|
|
59
59
|
__metadata("design:type", Array)
|
|
60
60
|
], CollectionProductConfigDto.prototype, "reportTargets", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, class_validator_1.IsOptional)(),
|
|
63
|
-
(0, class_validator_1.IsString)(),
|
|
64
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
65
|
-
__metadata("design:type", String)
|
|
66
|
-
], CollectionProductConfigDto.prototype, "costCenterId", void 0);
|
|
67
61
|
__decorate([
|
|
68
62
|
(0, class_validator_1.IsString)(),
|
|
69
63
|
__metadata("design:type", String)
|
|
@@ -23,4 +23,10 @@ export declare class RegisterCollectibleRequest {
|
|
|
23
23
|
* cobro. Si un cargo se puede cobrar más de una vez, el ciclo va codificado aquí dentro.
|
|
24
24
|
*/
|
|
25
25
|
chargeId: string;
|
|
26
|
+
/**
|
|
27
|
+
* Centro de costo con que el ledger asienta el cobro; lo decide la plataforma originadora por tipo de
|
|
28
|
+
* transacción. El motor lo guarda en la intención y lo reenvía al processor en cada intento. Ausente,
|
|
29
|
+
* el ledger lo asienta como `UNASSIGNED`.
|
|
30
|
+
*/
|
|
31
|
+
costCenterId?: string;
|
|
26
32
|
}
|
|
@@ -41,3 +41,9 @@ __decorate([
|
|
|
41
41
|
(0, class_validator_1.IsString)(),
|
|
42
42
|
__metadata("design:type", String)
|
|
43
43
|
], RegisterCollectibleRequest.prototype, "chargeId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
47
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], RegisterCollectibleRequest.prototype, "costCenterId", void 0);
|
|
@@ -41,9 +41,3 @@ __decorate([
|
|
|
41
41
|
(0, class_validator_1.IsString)({ each: true }),
|
|
42
42
|
__metadata("design:type", Array)
|
|
43
43
|
], UpsertProductConfigRequest.prototype, "reportTargets", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, class_validator_1.IsOptional)(),
|
|
46
|
-
(0, class_validator_1.IsString)(),
|
|
47
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
48
|
-
__metadata("design:type", String)
|
|
49
|
-
], UpsertProductConfigRequest.prototype, "costCenterId", void 0);
|
|
@@ -13,6 +13,7 @@ export * from './enums/RedriveOutboxStatus';
|
|
|
13
13
|
export * from './enums/DisbursementType';
|
|
14
14
|
export * from './constants/CollectionResultLimits';
|
|
15
15
|
export * from './validators/IsCentPrecision';
|
|
16
|
+
export * from './interfaces/TenantCostCenters';
|
|
16
17
|
export * from './dtos/PendingChargeDto';
|
|
17
18
|
export * from './dtos/CollectRequest';
|
|
18
19
|
export * from './dtos/CollectResponse';
|
package/bin/collection/index.js
CHANGED
|
@@ -31,6 +31,8 @@ __exportStar(require("./enums/DisbursementType"), exports);
|
|
|
31
31
|
// Constantes y validadores
|
|
32
32
|
__exportStar(require("./constants/CollectionResultLimits"), exports);
|
|
33
33
|
__exportStar(require("./validators/IsCentPrecision"), exports);
|
|
34
|
+
// Interfaces
|
|
35
|
+
__exportStar(require("./interfaces/TenantCostCenters"), exports);
|
|
34
36
|
// DTOs
|
|
35
37
|
__exportStar(require("./dtos/PendingChargeDto"), exports);
|
|
36
38
|
__exportStar(require("./dtos/CollectRequest"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centros de costo de un tenant para los movimientos que paga desde su bolsa. Cada servicio que
|
|
3
|
+
* dispersa lee el suyo de la configuración del tenant; si falta, el ledger lo asienta como no asignado.
|
|
4
|
+
*/
|
|
5
|
+
export interface TenantCostCenters {
|
|
6
|
+
/** Bono de bienvenida al alta del cliente. */
|
|
7
|
+
welcomeBonus?: string;
|
|
8
|
+
/** Promociones ligadas al crédito. */
|
|
9
|
+
creditPromotion?: string;
|
|
10
|
+
/** Promociones ligadas a la venta. */
|
|
11
|
+
salePromotion?: string;
|
|
12
|
+
/** Comisiones a vendedores. */
|
|
13
|
+
commission?: string;
|
|
14
|
+
}
|
|
@@ -25,4 +25,9 @@ export declare class PrivateGetReconciliationFeedRecordQuery {
|
|
|
25
25
|
author: string;
|
|
26
26
|
/** Email del operador cuando la lectura sale del detalle de una partida. */
|
|
27
27
|
actor?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Centros de costo de la fuente, en csv (`a,b`) o repetidos. El dueño del feed del ledger solo
|
|
30
|
+
* devuelve el registro si pertenece a uno de ellos.
|
|
31
|
+
*/
|
|
32
|
+
costCenterIds?: string[];
|
|
28
33
|
}
|
|
@@ -78,3 +78,12 @@ __decorate([
|
|
|
78
78
|
(0, reconciliationRequestDecorators_1.OptionalEmail)(),
|
|
79
79
|
__metadata("design:type", String)
|
|
80
80
|
], PrivateGetReconciliationFeedRecordQuery.prototype, "actor", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_transformer_1.Expose)(),
|
|
83
|
+
(0, class_validator_1.IsOptional)(),
|
|
84
|
+
(0, class_transformer_1.Transform)(({ value }) => (typeof value === 'string' ? value.split(',').map((id) => id.trim()) : value)),
|
|
85
|
+
(0, class_validator_1.IsArray)(),
|
|
86
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
87
|
+
(0, class_validator_1.IsNotEmpty)({ each: true }),
|
|
88
|
+
__metadata("design:type", Array)
|
|
89
|
+
], PrivateGetReconciliationFeedRecordQuery.prototype, "costCenterIds", void 0);
|
|
@@ -11,4 +11,6 @@ export declare class AuthorizeAdjustmentTransactionRequest {
|
|
|
11
11
|
relatedTransactionNumber: string;
|
|
12
12
|
operation: OperationEnum;
|
|
13
13
|
concept: string;
|
|
14
|
+
/** Centro de costo del asiento del ajuste en el ledger; ausente, el ledger escribe `UNASSIGNED`. */
|
|
15
|
+
costCenterId?: string;
|
|
14
16
|
}
|
|
@@ -17,5 +17,7 @@ export declare class AuthorizeRewardTopupRequest {
|
|
|
17
17
|
/** En PESOS, no centavos. */
|
|
18
18
|
amount: number;
|
|
19
19
|
concept: string;
|
|
20
|
+
/** Centro de costo del asiento de la recarga en el ledger; ausente, el processor escribe `UNASSIGNED`. */
|
|
21
|
+
costCenterId?: string;
|
|
20
22
|
}
|
|
21
23
|
export default AuthorizeRewardTopupRequest;
|
|
@@ -71,4 +71,10 @@ __decorate([
|
|
|
71
71
|
(0, class_validator_1.MaxLength)(120),
|
|
72
72
|
__metadata("design:type", String)
|
|
73
73
|
], AuthorizeRewardTopupRequest.prototype, "concept", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
(0, class_validator_1.IsString)(),
|
|
77
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], AuthorizeRewardTopupRequest.prototype, "costCenterId", void 0);
|
|
74
80
|
exports.default = AuthorizeRewardTopupRequest;
|
|
@@ -21,6 +21,8 @@ export declare class PrivateAuthorizeReconciliationAdjustmentRequest {
|
|
|
21
21
|
originalTransactionId: string;
|
|
22
22
|
/** Intento del cobro original, si lo hubo. */
|
|
23
23
|
executionId?: string;
|
|
24
|
+
/** Centro de costo de la fuente ejecutada de la partida; el processor lo asienta en el ledger. */
|
|
25
|
+
costCenterId?: string;
|
|
24
26
|
reference: ReconciliationAdjustmentReference;
|
|
25
27
|
reason: string;
|
|
26
28
|
/** Email del operador que resolvió la partida. */
|
|
@@ -81,6 +81,13 @@ __decorate([
|
|
|
81
81
|
(0, class_validator_1.IsNotEmpty)(),
|
|
82
82
|
__metadata("design:type", String)
|
|
83
83
|
], PrivateAuthorizeReconciliationAdjustmentRequest.prototype, "executionId", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, class_transformer_1.Expose)(),
|
|
86
|
+
(0, class_validator_1.IsOptional)(),
|
|
87
|
+
(0, class_validator_1.IsString)(),
|
|
88
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], PrivateAuthorizeReconciliationAdjustmentRequest.prototype, "costCenterId", void 0);
|
|
84
91
|
__decorate([
|
|
85
92
|
(0, class_transformer_1.Expose)(),
|
|
86
93
|
(0, class_validator_1.ValidateNested)(),
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsString, IsNumber, IsOptional, ValidateNested } from 'class-validator';
|
|
1
|
+
import { IsNotEmpty, IsString, IsNumber, IsOptional, ValidateNested } from 'class-validator';
|
|
2
2
|
import { Type } from 'class-transformer';
|
|
3
3
|
import { CollectionPricingDto } from './CollectionPricingDto';
|
|
4
4
|
|
|
@@ -24,4 +24,11 @@ export class CollectRequest {
|
|
|
24
24
|
* lo normal; se manda sólo cuando este cobro tiene condiciones propias.
|
|
25
25
|
*/
|
|
26
26
|
@IsOptional() @ValidateNested() @Type(() => CollectionPricingDto) pricing?: CollectionPricingDto;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Centro de costo con que el ledger asienta el cobro; lo decide la plataforma originadora por tipo de
|
|
30
|
+
* transacción. El motor lo guarda en la intención y lo reenvía al processor en cada intento. Ausente,
|
|
31
|
+
* el ledger lo asienta como `UNASSIGNED`.
|
|
32
|
+
*/
|
|
33
|
+
@IsOptional() @IsString() @IsNotEmpty() costCenterId?: string;
|
|
27
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsString, IsInt, IsArray, IsBoolean,
|
|
1
|
+
import { IsString, IsInt, IsArray, IsBoolean, ValidateNested } from 'class-validator';
|
|
2
2
|
import { Type } from 'class-transformer';
|
|
3
3
|
import { CollectionSourceDto } from './CollectionSourceDto';
|
|
4
4
|
import { RetryPolicyDto } from './RetryPolicyDto';
|
|
@@ -20,8 +20,6 @@ export class CollectionProductConfigDto {
|
|
|
20
20
|
@IsBoolean() allowPartial!: boolean;
|
|
21
21
|
@ValidateNested() @Type(() => RetryPolicyDto) retryPolicy!: RetryPolicyDto;
|
|
22
22
|
@IsArray() @IsString({ each: true }) reportTargets!: string[];
|
|
23
|
-
/** Centro de costo con el que el ledger registra los cobros de este producto. */
|
|
24
|
-
@IsOptional() @IsString() @IsNotEmpty() costCenterId?: string;
|
|
25
23
|
@IsString() createdBy!: string;
|
|
26
24
|
@IsString() updatedBy!: string;
|
|
27
25
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsString } from 'class-validator';
|
|
1
|
+
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Alta de un cargo cobrable: el dominio avisa de que hay algo que cobrar y el motor se encarga de
|
|
@@ -29,4 +29,11 @@ export class RegisterCollectibleRequest {
|
|
|
29
29
|
* cobro. Si un cargo se puede cobrar más de una vez, el ciclo va codificado aquí dentro.
|
|
30
30
|
*/
|
|
31
31
|
@IsString() chargeId!: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Centro de costo con que el ledger asienta el cobro; lo decide la plataforma originadora por tipo de
|
|
35
|
+
* transacción. El motor lo guarda en la intención y lo reenvía al processor en cada intento. Ausente,
|
|
36
|
+
* el ledger lo asienta como `UNASSIGNED`.
|
|
37
|
+
*/
|
|
38
|
+
@IsOptional() @IsString() @IsNotEmpty() costCenterId?: string;
|
|
32
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsString, IsArray, IsBoolean,
|
|
1
|
+
import { IsString, IsArray, IsBoolean, ValidateNested } from 'class-validator';
|
|
2
2
|
import { Type } from 'class-transformer';
|
|
3
3
|
import { CollectionSourceDto } from './CollectionSourceDto';
|
|
4
4
|
import { RetryPolicyDto } from './RetryPolicyDto';
|
|
@@ -12,6 +12,4 @@ export class UpsertProductConfigRequest {
|
|
|
12
12
|
@IsBoolean() allowPartial!: boolean;
|
|
13
13
|
@ValidateNested() @Type(() => RetryPolicyDto) retryPolicy!: RetryPolicyDto;
|
|
14
14
|
@IsArray() @IsString({ each: true }) reportTargets!: string[];
|
|
15
|
-
/** Centro de costo con el que el ledger registra los cobros de este producto. */
|
|
16
|
-
@IsOptional() @IsString() @IsNotEmpty() costCenterId?: string;
|
|
17
15
|
}
|
package/src/collection/index.ts
CHANGED
|
@@ -17,6 +17,9 @@ export * from './enums/DisbursementType';
|
|
|
17
17
|
export * from './constants/CollectionResultLimits';
|
|
18
18
|
export * from './validators/IsCentPrecision';
|
|
19
19
|
|
|
20
|
+
// Interfaces
|
|
21
|
+
export * from './interfaces/TenantCostCenters';
|
|
22
|
+
|
|
20
23
|
// DTOs
|
|
21
24
|
export * from './dtos/PendingChargeDto';
|
|
22
25
|
export * from './dtos/CollectRequest';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centros de costo de un tenant para los movimientos que paga desde su bolsa. Cada servicio que
|
|
3
|
+
* dispersa lee el suyo de la configuración del tenant; si falta, el ledger lo asienta como no asignado.
|
|
4
|
+
*/
|
|
5
|
+
export interface TenantCostCenters {
|
|
6
|
+
/** Bono de bienvenida al alta del cliente. */
|
|
7
|
+
welcomeBonus?: string;
|
|
8
|
+
/** Promociones ligadas al crédito. */
|
|
9
|
+
creditPromotion?: string;
|
|
10
|
+
/** Promociones ligadas a la venta. */
|
|
11
|
+
salePromotion?: string;
|
|
12
|
+
/** Comisiones a vendedores. */
|
|
13
|
+
commission?: string;
|
|
14
|
+
}
|
|
@@ -56,4 +56,16 @@ export class PrivateGetReconciliationFeedRecordQuery {
|
|
|
56
56
|
/** Email del operador cuando la lectura sale del detalle de una partida. */
|
|
57
57
|
@OptionalEmail()
|
|
58
58
|
actor?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Centros de costo de la fuente, en csv (`a,b`) o repetidos. El dueño del feed del ledger solo
|
|
62
|
+
* devuelve el registro si pertenece a uno de ellos.
|
|
63
|
+
*/
|
|
64
|
+
@Expose()
|
|
65
|
+
@IsOptional()
|
|
66
|
+
@Transform(({ value }) => (typeof value === 'string' ? value.split(',').map((id) => id.trim()) : value))
|
|
67
|
+
@IsArray()
|
|
68
|
+
@IsString({ each: true })
|
|
69
|
+
@IsNotEmpty({ each: true })
|
|
70
|
+
costCenterIds?: string[];
|
|
59
71
|
}
|
|
@@ -12,4 +12,6 @@ export class AuthorizeAdjustmentTransactionRequest {
|
|
|
12
12
|
relatedTransactionNumber: string;
|
|
13
13
|
operation: OperationEnum;
|
|
14
14
|
concept: string;
|
|
15
|
+
/** Centro de costo del asiento del ajuste en el ledger; ausente, el ledger escribe `UNASSIGNED`. */
|
|
16
|
+
costCenterId?: string;
|
|
15
17
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsNotEmpty, IsNumber, IsPositive, IsString, Matches, MaxLength } from 'class-validator';
|
|
1
|
+
import { IsNotEmpty, IsNumber, IsOptional, IsPositive, IsString, Matches, MaxLength } from 'class-validator';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Pago de una recarga Bait de recompensa (`MEX_REWARD_TOPUP`). No toca ninguna wallet.
|
|
@@ -39,6 +39,12 @@ export class AuthorizeRewardTopupRequest {
|
|
|
39
39
|
@IsString()
|
|
40
40
|
@MaxLength(120)
|
|
41
41
|
concept: string;
|
|
42
|
+
|
|
43
|
+
/** Centro de costo del asiento de la recarga en el ledger; ausente, el processor escribe `UNASSIGNED`. */
|
|
44
|
+
@IsOptional()
|
|
45
|
+
@IsString()
|
|
46
|
+
@IsNotEmpty()
|
|
47
|
+
costCenterId?: string;
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
export default AuthorizeRewardTopupRequest;
|
|
@@ -77,6 +77,13 @@ export class PrivateAuthorizeReconciliationAdjustmentRequest {
|
|
|
77
77
|
@IsNotEmpty()
|
|
78
78
|
executionId?: string;
|
|
79
79
|
|
|
80
|
+
/** Centro de costo de la fuente ejecutada de la partida; el processor lo asienta en el ledger. */
|
|
81
|
+
@Expose()
|
|
82
|
+
@IsOptional()
|
|
83
|
+
@IsString()
|
|
84
|
+
@IsNotEmpty()
|
|
85
|
+
costCenterId?: string;
|
|
86
|
+
|
|
80
87
|
@Expose()
|
|
81
88
|
@ValidateNested()
|
|
82
89
|
@Type(() => ReconciliationAdjustmentReference)
|