@fiado/type-kit 3.463.0 → 3.465.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/moneyTransfer/dtos.test.ts +298 -0
- package/_test_/unit/moneyTransfer/enums.test.ts +56 -0
- package/_test_/unit/retailCatalog/backofficeRequests.test.ts +283 -0
- package/_test_/unit/retailCatalog/catalogEnums.test.ts +28 -1
- package/_test_/unit/retailCatalog/responseFields.test.ts +53 -0
- package/_test_/unit/retailCatalog/returnConditions.test.ts +64 -0
- package/_test_/unit/retailWizard/cancelSaleConditions.test.ts +41 -0
- package/_test_/unit/stpSpei/additive.test.ts +84 -0
- package/bin/bankAccount/enums/BeneficiaryAccountTypeEnum.d.ts +20 -0
- package/bin/bankAccount/enums/BeneficiaryAccountTypeEnum.js +24 -0
- package/bin/bankAccount/index.d.ts +1 -0
- package/bin/bankAccount/index.js +1 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +5 -1
- package/bin/moneyTransfer/dtos/BatchScheduleRequest.d.ts +7 -0
- package/bin/moneyTransfer/dtos/BatchScheduleRequest.js +28 -0
- package/bin/moneyTransfer/dtos/CreateSettlementRequest.d.ts +12 -0
- package/bin/moneyTransfer/dtos/CreateSettlementRequest.js +42 -0
- package/bin/moneyTransfer/dtos/MoneyTransferProductRequest.d.ts +37 -0
- package/bin/moneyTransfer/dtos/MoneyTransferProductRequest.js +131 -0
- package/bin/moneyTransfer/dtos/MoneyTransferServiceCreateRequest.d.ts +22 -0
- package/bin/moneyTransfer/dtos/MoneyTransferServiceCreateRequest.js +88 -0
- package/bin/moneyTransfer/dtos/MoneyTransferServiceUpdateRequest.d.ts +22 -0
- package/bin/moneyTransfer/dtos/MoneyTransferServiceUpdateRequest.js +103 -0
- package/bin/moneyTransfer/dtos/PendingDetailsResponse.d.ts +8 -0
- package/bin/moneyTransfer/dtos/PendingDetailsResponse.js +7 -0
- package/bin/moneyTransfer/dtos/RescheduleSettlementRequest.d.ts +5 -0
- package/bin/moneyTransfer/dtos/RescheduleSettlementRequest.js +23 -0
- package/bin/moneyTransfer/dtos/SettlementActionRequest.d.ts +4 -0
- package/bin/moneyTransfer/dtos/SettlementActionRequest.js +21 -0
- package/bin/moneyTransfer/dtos/SettlementListResponse.d.ts +6 -0
- package/bin/moneyTransfer/dtos/SettlementListResponse.js +7 -0
- package/bin/moneyTransfer/dtos/SettlementResponse.d.ts +36 -0
- package/bin/moneyTransfer/dtos/SettlementResponse.js +10 -0
- package/bin/moneyTransfer/dtos/SettlementStatusMessage.d.ts +12 -0
- package/bin/moneyTransfer/dtos/SettlementStatusMessage.js +38 -0
- package/bin/moneyTransfer/dtos/TransactionDetailResponse.d.ts +24 -0
- package/bin/moneyTransfer/dtos/TransactionDetailResponse.js +10 -0
- package/bin/moneyTransfer/enums/SettlementModeEnum.d.ts +5 -0
- package/bin/moneyTransfer/enums/SettlementModeEnum.js +9 -0
- package/bin/moneyTransfer/enums/SettlementStatusEnum.d.ts +11 -0
- package/bin/moneyTransfer/enums/SettlementStatusEnum.js +15 -0
- package/bin/moneyTransfer/enums/SpeiOrderStatusEnum.d.ts +11 -0
- package/bin/moneyTransfer/enums/SpeiOrderStatusEnum.js +15 -0
- package/bin/moneyTransfer/enums/TransactionDetailStatusEnum.d.ts +7 -0
- package/bin/moneyTransfer/enums/TransactionDetailStatusEnum.js +11 -0
- package/bin/moneyTransfer/enums/TransferChannelEnum.d.ts +5 -0
- package/bin/moneyTransfer/enums/TransferChannelEnum.js +9 -0
- package/bin/moneyTransfer/index.d.ts +17 -0
- package/bin/moneyTransfer/index.js +40 -0
- package/bin/productCatalog/enums/ProductTypeEnum.d.ts +6 -1
- package/bin/productCatalog/enums/ProductTypeEnum.js +5 -0
- package/bin/provider/enums/Provider.d.ts +2 -1
- package/bin/provider/enums/Provider.js +1 -0
- package/bin/retailCatalog/constants/AdjustmentReasons.d.ts +3 -0
- package/bin/retailCatalog/constants/AdjustmentReasons.js +10 -0
- package/bin/retailCatalog/constants/NonBundleCategories.d.ts +3 -0
- package/bin/retailCatalog/constants/NonBundleCategories.js +6 -0
- package/bin/retailCatalog/dtos/Product.d.ts +3 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateKitRequest.d.ts +14 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateKitRequest.js +66 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.d.ts +30 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.js +117 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateServiceRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateServiceRequest.js +43 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateSkuPriceRequest.d.ts +7 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateSkuPriceRequest.js +34 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateTransferRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateTransferRequest.js +48 -0
- package/bin/retailCatalog/dtos/requests/BackofficeListTransfersQuery.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/BackofficeListTransfersQuery.js +23 -0
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.d.ts +12 -0
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.js +49 -0
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterEntryRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterEntryRequest.js +43 -0
- package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.d.ts +27 -0
- package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.js +118 -0
- package/bin/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.d.ts +1 -0
- package/bin/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.js +1 -0
- package/bin/retailCatalog/dtos/requests/CreateProductRequest.d.ts +4 -1
- package/bin/retailCatalog/dtos/requests/CreateProductRequest.js +4 -1
- package/bin/retailCatalog/dtos/requests/RegisterInventoryRequest.d.ts +4 -1
- package/bin/retailCatalog/dtos/requests/RegisterInventoryRequest.js +4 -1
- package/bin/retailCatalog/dtos/requests/ReturnPieceCondition.d.ts +11 -0
- package/bin/retailCatalog/dtos/requests/ReturnPieceCondition.js +57 -0
- package/bin/retailCatalog/dtos/requests/ReturnStockLine.d.ts +6 -0
- package/bin/retailCatalog/dtos/requests/ReturnStockLine.js +27 -0
- package/bin/retailCatalog/dtos/requests/ReturnStockRequest.d.ts +2 -2
- package/bin/retailCatalog/dtos/requests/ReturnStockRequest.js +2 -2
- package/bin/retailCatalog/dtos/requests/TransferInventoryRequest.d.ts +4 -1
- package/bin/retailCatalog/dtos/requests/TransferInventoryRequest.js +4 -1
- package/bin/retailCatalog/dtos/requests/UpdateProductRequest.d.ts +4 -1
- package/bin/retailCatalog/dtos/requests/UpdateProductRequest.js +4 -1
- package/bin/retailCatalog/dtos/requests/UpdateProductStatusRequest.d.ts +4 -1
- package/bin/retailCatalog/dtos/requests/UpdateProductStatusRequest.js +4 -1
- package/bin/retailCatalog/dtos/responses/InventoryLensResponse.d.ts +3 -0
- package/bin/retailCatalog/dtos/responses/ListTransfersResponse.d.ts +5 -0
- package/bin/retailCatalog/dtos/responses/ListTransfersResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/ReserveStockResponse.d.ts +2 -0
- package/bin/retailCatalog/dtos/responses/SkuPriceEntry.d.ts +2 -0
- package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +3 -0
- package/bin/retailCatalog/dtos/responses/TransferResponse.d.ts +16 -0
- package/bin/retailCatalog/dtos/responses/TransferResponse.js +2 -0
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.d.ts +3 -1
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.js +2 -0
- package/bin/retailCatalog/enums/InventoryMovementReasonEnum.d.ts +7 -0
- package/bin/retailCatalog/enums/InventoryMovementReasonEnum.js +11 -0
- package/bin/retailCatalog/enums/InventoryMovementTypeEnum.d.ts +4 -1
- package/bin/retailCatalog/enums/InventoryMovementTypeEnum.js +3 -0
- package/bin/retailCatalog/enums/ItemTypeEnum.d.ts +5 -0
- package/bin/retailCatalog/enums/ItemTypeEnum.js +9 -0
- package/bin/retailCatalog/enums/PriceSourceEnum.d.ts +3 -2
- package/bin/retailCatalog/enums/PriceSourceEnum.js +2 -1
- package/bin/retailCatalog/enums/ReturnConditionEnum.d.ts +5 -0
- package/bin/retailCatalog/enums/ReturnConditionEnum.js +9 -0
- package/bin/retailCatalog/enums/TransferStateEnum.d.ts +6 -0
- package/bin/retailCatalog/enums/TransferStateEnum.js +10 -0
- package/bin/retailCatalog/index.d.ts +20 -0
- package/bin/retailCatalog/index.js +21 -0
- package/bin/retailCatalog/validators/IsPieceRefConstraint.d.ts +6 -0
- package/bin/retailCatalog/validators/IsPieceRefConstraint.js +26 -0
- package/bin/retailWizard/dtos/requests/BackofficeCancelSaleRequest.d.ts +3 -0
- package/bin/retailWizard/dtos/requests/BackofficeCancelSaleRequest.js +9 -0
- package/bin/retailWizard/dtos/requests/CancelSaleRequest.d.ts +3 -0
- package/bin/retailWizard/dtos/requests/CancelSaleRequest.js +9 -0
- package/bin/stpSpei/dtos/ConsultStpOrderRequest.d.ts +8 -0
- package/bin/stpSpei/dtos/ConsultStpOrderRequest.js +6 -0
- package/bin/stpSpei/dtos/PutStpOrderRequest.d.ts +16 -8
- package/bin/stpSpei/enums/StpOrderSourceEnum.d.ts +9 -0
- package/bin/stpSpei/enums/StpOrderSourceEnum.js +13 -0
- package/bin/stpSpei/index.d.ts +2 -0
- package/bin/stpSpei/index.js +2 -0
- package/package.json +1 -1
- package/src/bankAccount/enums/BeneficiaryAccountTypeEnum.ts +20 -0
- package/src/bankAccount/index.ts +1 -0
- package/src/index.ts +4 -0
- package/src/moneyTransfer/dtos/BatchScheduleRequest.ts +15 -0
- package/src/moneyTransfer/dtos/CreateSettlementRequest.ts +26 -0
- package/src/moneyTransfer/dtos/MoneyTransferProductRequest.ts +111 -0
- package/src/moneyTransfer/dtos/MoneyTransferServiceCreateRequest.ts +62 -0
- package/src/moneyTransfer/dtos/MoneyTransferServiceUpdateRequest.ts +87 -0
- package/src/moneyTransfer/dtos/PendingDetailsResponse.ts +9 -0
- package/src/moneyTransfer/dtos/RescheduleSettlementRequest.ts +9 -0
- package/src/moneyTransfer/dtos/SettlementActionRequest.ts +7 -0
- package/src/moneyTransfer/dtos/SettlementListResponse.ts +7 -0
- package/src/moneyTransfer/dtos/SettlementResponse.ts +37 -0
- package/src/moneyTransfer/dtos/SettlementStatusMessage.ts +23 -0
- package/src/moneyTransfer/dtos/TransactionDetailResponse.ts +25 -0
- package/src/moneyTransfer/enums/SettlementModeEnum.ts +5 -0
- package/src/moneyTransfer/enums/SettlementStatusEnum.ts +11 -0
- package/src/moneyTransfer/enums/SpeiOrderStatusEnum.ts +11 -0
- package/src/moneyTransfer/enums/TransactionDetailStatusEnum.ts +7 -0
- package/src/moneyTransfer/enums/TransferChannelEnum.ts +5 -0
- package/src/moneyTransfer/index.ts +27 -0
- package/src/productCatalog/enums/ProductTypeEnum.ts +6 -1
- package/src/provider/enums/Provider.ts +2 -1
- package/src/retailCatalog/constants/AdjustmentReasons.ts +8 -0
- package/src/retailCatalog/constants/NonBundleCategories.ts +4 -0
- package/src/retailCatalog/dtos/Product.ts +3 -0
- package/src/retailCatalog/dtos/requests/BackofficeCreateKitRequest.ts +47 -0
- package/src/retailCatalog/dtos/requests/BackofficeCreateProductRequest.ts +92 -0
- package/src/retailCatalog/dtos/requests/BackofficeCreateServiceRequest.ts +26 -0
- package/src/retailCatalog/dtos/requests/BackofficeCreateSkuPriceRequest.ts +19 -0
- package/src/retailCatalog/dtos/requests/BackofficeCreateTransferRequest.ts +31 -0
- package/src/retailCatalog/dtos/requests/BackofficeListTransfersQuery.ts +9 -0
- package/src/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.ts +34 -0
- package/src/retailCatalog/dtos/requests/BackofficeRegisterEntryRequest.ts +28 -0
- package/src/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.ts +93 -0
- package/src/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.ts +1 -0
- package/src/retailCatalog/dtos/requests/CreateProductRequest.ts +4 -1
- package/src/retailCatalog/dtos/requests/RegisterInventoryRequest.ts +4 -1
- package/src/retailCatalog/dtos/requests/ReturnPieceCondition.ts +48 -0
- package/src/retailCatalog/dtos/requests/ReturnStockLine.ts +13 -0
- package/src/retailCatalog/dtos/requests/ReturnStockRequest.ts +3 -3
- package/src/retailCatalog/dtos/requests/TransferInventoryRequest.ts +4 -1
- package/src/retailCatalog/dtos/requests/UpdateProductRequest.ts +4 -1
- package/src/retailCatalog/dtos/requests/UpdateProductStatusRequest.ts +4 -1
- package/src/retailCatalog/dtos/responses/InventoryLensResponse.ts +3 -0
- package/src/retailCatalog/dtos/responses/ListTransfersResponse.ts +6 -0
- package/src/retailCatalog/dtos/responses/ReserveStockResponse.ts +2 -0
- package/src/retailCatalog/dtos/responses/SkuPriceEntry.ts +2 -0
- package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +3 -0
- package/src/retailCatalog/dtos/responses/TransferResponse.ts +17 -0
- package/src/retailCatalog/enums/InventoryItemStatusEnum.ts +2 -0
- package/src/retailCatalog/enums/InventoryMovementReasonEnum.ts +7 -0
- package/src/retailCatalog/enums/InventoryMovementTypeEnum.ts +3 -0
- package/src/retailCatalog/enums/ItemTypeEnum.ts +5 -0
- package/src/retailCatalog/enums/PriceSourceEnum.ts +2 -1
- package/src/retailCatalog/enums/ReturnConditionEnum.ts +5 -0
- package/src/retailCatalog/enums/TransferStateEnum.ts +6 -0
- package/src/retailCatalog/index.ts +22 -0
- package/src/retailCatalog/validators/IsPieceRefConstraint.ts +19 -0
- package/src/retailWizard/dtos/requests/BackofficeCancelSaleRequest.ts +11 -2
- package/src/retailWizard/dtos/requests/CancelSaleRequest.ts +11 -2
- package/src/stpSpei/dtos/ConsultStpOrderRequest.ts +9 -0
- package/src/stpSpei/dtos/PutStpOrderRequest.ts +18 -9
- package/src/stpSpei/enums/StpOrderSourceEnum.ts +9 -0
- package/src/stpSpei/index.ts +2 -0
|
@@ -13,6 +13,7 @@ describe('retailCatalog — enums del inventario multi-item', () => {
|
|
|
13
13
|
it('expone los tipos de movimiento', () => {
|
|
14
14
|
expect(Object.values(RetailCatalog.InventoryMovementTypeEnum)).toEqual([
|
|
15
15
|
'ENTRY', 'RESERVATION', 'RELEASE', 'SALE', 'RETURN', 'ADJUSTMENT',
|
|
16
|
+
'TRANSFER_OUT', 'TRANSFER_IN', 'TRANSFER_CANCEL',
|
|
16
17
|
]);
|
|
17
18
|
});
|
|
18
19
|
|
|
@@ -24,7 +25,7 @@ describe('retailCatalog — enums del inventario multi-item', () => {
|
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
it('expone el origen del precio y los periodos del lente', () => {
|
|
27
|
-
expect(Object.values(RetailCatalog.PriceSourceEnum)).toEqual(['ZENTRAL_SYNC']);
|
|
28
|
+
expect(Object.values(RetailCatalog.PriceSourceEnum)).toEqual(['ZENTRAL_SYNC', 'BACKOFFICE']);
|
|
28
29
|
expect(Object.values(RetailCatalog.InventoryLensPeriodEnum)).toEqual(['7d', '30d', '90d', 'all']);
|
|
29
30
|
});
|
|
30
31
|
|
|
@@ -32,3 +33,29 @@ describe('retailCatalog — enums del inventario multi-item', () => {
|
|
|
32
33
|
expect(Object.values(RetailCatalog.InventoryLensFilterEnum)).toEqual(['critical', 'stale', 'gap', 'transfers', 'list']);
|
|
33
34
|
});
|
|
34
35
|
});
|
|
36
|
+
|
|
37
|
+
describe('retailCatalog — enums de la operación independiente', () => {
|
|
38
|
+
it('expone el tipo de ítem', () => {
|
|
39
|
+
expect(Object.values(RetailCatalog.ItemTypeEnum)).toEqual(['PRODUCT', 'SERVICE']);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('agrega IN_TRANSIT al estado de pieza sin quitar los existentes', () => {
|
|
43
|
+
expect(Object.values(RetailCatalog.InventoryItemStatusEnum)).toEqual([
|
|
44
|
+
'AVAILABLE', 'RESERVED', 'SOLD', 'RETURNED', 'DAMAGED', 'IN_TRANSIT',
|
|
45
|
+
]);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('expone la condición de una devolución', () => {
|
|
49
|
+
expect(Object.values(RetailCatalog.ReturnConditionEnum)).toEqual(['GOOD', 'DAMAGED']);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('expone el estado de un traspaso', () => {
|
|
53
|
+
expect(Object.values(RetailCatalog.TransferStateEnum)).toEqual(['OPEN', 'RECEIVED', 'CANCELLED']);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('expone el motivo de un movimiento', () => {
|
|
57
|
+
expect(Object.values(RetailCatalog.InventoryMovementReasonEnum)).toEqual([
|
|
58
|
+
'SHRINKAGE', 'ADJUSTMENT', 'WARRANTY', 'DAMAGED_RETURN',
|
|
59
|
+
]);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import * as RetailCatalog from '../../../src/retailCatalog';
|
|
3
|
+
|
|
4
|
+
// ts-jest compila con type-check: si un campo nuevo no existe en el tipo, la suite no compila.
|
|
5
|
+
describe('retailCatalog — campos nuevos opcionales en respuestas', () => {
|
|
6
|
+
it('Product y ProductResponse aceptan itemType y siguen válidos sin él', () => {
|
|
7
|
+
const product = new RetailCatalog.Product();
|
|
8
|
+
product.itemType = RetailCatalog.ItemTypeEnum.SERVICE;
|
|
9
|
+
const response: RetailCatalog.ProductResponse = product;
|
|
10
|
+
expect(response.itemType).toBe('SERVICE');
|
|
11
|
+
expect(new RetailCatalog.Product().itemType).toBeUndefined();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('StoreCatalogItem acepta itemType', () => {
|
|
15
|
+
const item: Pick<RetailCatalog.StoreCatalogItem, 'sku' | 'itemType'> = {
|
|
16
|
+
sku: 'SKU-1',
|
|
17
|
+
itemType: RetailCatalog.ItemTypeEnum.PRODUCT,
|
|
18
|
+
};
|
|
19
|
+
expect(item.itemType).toBe('PRODUCT');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('la fila del lente en modo lista acepta itemType', () => {
|
|
23
|
+
const row: Pick<RetailCatalog.InventoryLensListItem, 'sku' | 'itemType'> = {
|
|
24
|
+
sku: 'SKU-1',
|
|
25
|
+
itemType: RetailCatalog.ItemTypeEnum.SERVICE,
|
|
26
|
+
};
|
|
27
|
+
expect(row.itemType).toBe('SERVICE');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('ReservedComponent acepta priceCents y sigue válido sin él', () => {
|
|
31
|
+
const base: RetailCatalog.ReservedComponent = {
|
|
32
|
+
sku: 'SKU-1',
|
|
33
|
+
qty: 1,
|
|
34
|
+
category: RetailCatalog.ProductCategoryEnum.PHONE,
|
|
35
|
+
trackingMode: RetailCatalog.TrackingModeEnum.IMEI,
|
|
36
|
+
};
|
|
37
|
+
const priced: RetailCatalog.ReservedComponent = { ...base, priceCents: 150000 };
|
|
38
|
+
expect(base.priceCents).toBeUndefined();
|
|
39
|
+
expect(priced.priceCents).toBe(150000);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('SkuPriceEntry acepta comboPriceCents y el origen BACKOFFICE', () => {
|
|
43
|
+
const entry: RetailCatalog.SkuPriceEntry = {
|
|
44
|
+
effectiveFrom: '2026-09-24T00:00:00.000Z',
|
|
45
|
+
listPriceCents: null,
|
|
46
|
+
basePriceCents: 200000,
|
|
47
|
+
comboPriceCents: 180000,
|
|
48
|
+
source: RetailCatalog.PriceSourceEnum.BACKOFFICE,
|
|
49
|
+
createdBy: 'system',
|
|
50
|
+
};
|
|
51
|
+
expect(entry.comboPriceCents).toBe(180000);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance, type ClassConstructor } from 'class-transformer';
|
|
3
|
+
import { validateSync, type ValidationError } from 'class-validator';
|
|
4
|
+
import { ReturnConditionEnum, ReturnPieceCondition, ReturnStockLine, ReturnStockRequest } from '../../../src/retailCatalog';
|
|
5
|
+
|
|
6
|
+
function paths(errors: ValidationError[], prefix = ''): string[] {
|
|
7
|
+
return errors.flatMap((e) => {
|
|
8
|
+
const p = prefix ? `${prefix}.${e.property}` : e.property;
|
|
9
|
+
return e.children && e.children.length > 0 ? paths(e.children, p) : [p];
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function errorsOf<T extends object>(cls: ClassConstructor<T>, payload: object): string[] {
|
|
14
|
+
return paths(validateSync(plainToInstance(cls, payload) as object, { whitelist: true, forbidNonWhitelisted: true }));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
describe('ReturnPieceCondition', () => {
|
|
18
|
+
it('una pieza con identificador y sin condición queda GOOD', () => {
|
|
19
|
+
const dto = plainToInstance(ReturnPieceCondition, { sku: 'PH-A15', identifier: '356938035643809' });
|
|
20
|
+
expect(dto.condition).toBe(ReturnConditionEnum.GOOD);
|
|
21
|
+
expect(validateSync(dto)).toEqual([]);
|
|
22
|
+
});
|
|
23
|
+
it('acepta un accesorio por cantidad dañado con motivo', () => {
|
|
24
|
+
expect(errorsOf(ReturnPieceCondition, { sku: 'FUNDA-1', qty: 2, condition: 'DAMAGED', reason: 'Rota' })).toEqual([]);
|
|
25
|
+
});
|
|
26
|
+
it('DAMAGED exige motivo; GOOD no', () => {
|
|
27
|
+
expect(errorsOf(ReturnPieceCondition, { sku: 'FUNDA-1', qty: 1, condition: 'DAMAGED' })).toContain('reason');
|
|
28
|
+
expect(errorsOf(ReturnPieceCondition, { sku: 'FUNDA-1', qty: 1, condition: 'DAMAGED', reason: ' ' })).toContain('reason');
|
|
29
|
+
expect(errorsOf(ReturnPieceCondition, { sku: 'PH-A15', identifier: '356938035643809', condition: 'DAMAGED', reason: 'Pantalla rota' })).toEqual([]);
|
|
30
|
+
expect(errorsOf(ReturnPieceCondition, { sku: 'PH-A15', identifier: '356938035643809', condition: 'GOOD' })).toEqual([]);
|
|
31
|
+
});
|
|
32
|
+
it('rechaza sin sku, sin identifier ni qty, y con ambos', () => {
|
|
33
|
+
expect(errorsOf(ReturnPieceCondition, { identifier: 'A1' })).toContain('sku');
|
|
34
|
+
expect(errorsOf(ReturnPieceCondition, { sku: 'FUNDA-1' })).toContain('identifier');
|
|
35
|
+
expect(errorsOf(ReturnPieceCondition, { sku: 'FUNDA-1', identifier: 'A1', qty: 1 })).toContain('identifier');
|
|
36
|
+
});
|
|
37
|
+
it('rechaza condición desconocida, qty 0, identificador y motivo en blanco', () => {
|
|
38
|
+
const errors = errorsOf(ReturnPieceCondition, { sku: 'FUNDA-1', qty: 0, condition: 'BROKEN', reason: ' ' });
|
|
39
|
+
expect(errors).toEqual(expect.arrayContaining(['qty', 'condition', 'reason']));
|
|
40
|
+
expect(errorsOf(ReturnPieceCondition, { sku: 'PH-1', identifier: ' ' })).toContain('identifier');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('ReturnStockRequest con condición por pieza', () => {
|
|
45
|
+
const line = { lineId: 'L1', sku: 'KIT-1', qty: 1, components: [{ sku: 'PH-A15', qty: 1, identifiers: ['356938035643809'] }, { sku: 'FUNDA-1', qty: 2, identifiers: [] }] };
|
|
46
|
+
const base = { saleId: 'sale', retailerId: 'ret', soldAt: '2026-09-23T10:00:00.000Z' };
|
|
47
|
+
it('un consumidor viejo sin condiciones sigue validando', () => {
|
|
48
|
+
expect(errorsOf(ReturnStockRequest, { ...base, lines: [line] })).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
it('acepta condiciones por pieza y por cantidad', () => {
|
|
51
|
+
const conditions = [
|
|
52
|
+
{ sku: 'PH-A15', identifier: '356938035643809', condition: 'DAMAGED', reason: 'Pantalla rota' },
|
|
53
|
+
{ sku: 'FUNDA-1', qty: 1, condition: 'DAMAGED', reason: 'Descosida' },
|
|
54
|
+
];
|
|
55
|
+
const dto = plainToInstance(ReturnStockRequest, { ...base, lines: [{ ...line, conditions }] });
|
|
56
|
+
expect(dto.lines[0]).toBeInstanceOf(ReturnStockLine);
|
|
57
|
+
expect(dto.lines[0].conditions?.[0]).toBeInstanceOf(ReturnPieceCondition);
|
|
58
|
+
expect(validateSync(dto)).toEqual([]);
|
|
59
|
+
});
|
|
60
|
+
it('valida cada condición anidada', () => {
|
|
61
|
+
const conditions = [{ sku: 'PH-A15', identifier: '356938035643809', condition: 'LOST' }];
|
|
62
|
+
expect(errorsOf(ReturnStockRequest, { ...base, lines: [{ ...line, conditions }] })).toContain('lines.0.conditions.0.condition');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance, type ClassConstructor } from 'class-transformer';
|
|
3
|
+
import { validateSync, type ValidationError } from 'class-validator';
|
|
4
|
+
import { ReturnPieceCondition } from '../../../src/retailCatalog';
|
|
5
|
+
import { BackofficeCancelSaleRequest, CancelSaleRequest } from '../../../src/retailWizard';
|
|
6
|
+
|
|
7
|
+
function paths(errors: ValidationError[], prefix = ''): string[] {
|
|
8
|
+
return errors.flatMap((e) => {
|
|
9
|
+
const p = prefix ? `${prefix}.${e.property}` : e.property;
|
|
10
|
+
return e.children && e.children.length > 0 ? paths(e.children, p) : [p];
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function errorsOf<T extends object>(cls: ClassConstructor<T>, payload: object): string[] {
|
|
15
|
+
return paths(validateSync(plainToInstance(cls, payload, { excludeExtraneousValues: true }) as object));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const conditions = [
|
|
19
|
+
{ sku: 'PH-A15', identifier: '356938035643809', condition: 'DAMAGED', reason: 'Pantalla rota' },
|
|
20
|
+
{ sku: 'FUNDA-1', qty: 1 },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
describe.each([
|
|
24
|
+
['CancelSaleRequest', CancelSaleRequest, { reason: 'Cliente se arrepintió' }],
|
|
25
|
+
['BackofficeCancelSaleRequest', BackofficeCancelSaleRequest, { reason: 'Cliente se arrepintió' }],
|
|
26
|
+
] as const)('%s con condición por pieza', (_name, cls, base) => {
|
|
27
|
+
it('sin returnConditions sigue validando', () => expect(errorsOf(cls, base)).toEqual([]));
|
|
28
|
+
it('acepta condiciones y las hidrata aun con excludeExtraneousValues', () => {
|
|
29
|
+
const dto = plainToInstance(cls, { ...base, returnConditions: conditions }, { excludeExtraneousValues: true });
|
|
30
|
+
expect(validateSync(dto)).toEqual([]);
|
|
31
|
+
expect(dto.returnConditions?.[0]).toBeInstanceOf(ReturnPieceCondition);
|
|
32
|
+
expect(dto.returnConditions?.[0].reason).toBe('Pantalla rota');
|
|
33
|
+
expect(dto.returnConditions?.[1].condition).toBe('GOOD');
|
|
34
|
+
});
|
|
35
|
+
it('valida cada condición y rechaza un no-arreglo', () => {
|
|
36
|
+
expect(errorsOf(cls, { ...base, returnConditions: [{ sku: 'FUNDA-1', condition: 'LOST' }] })).toEqual(
|
|
37
|
+
expect.arrayContaining(['returnConditions.0.condition', 'returnConditions.0.identifier']),
|
|
38
|
+
);
|
|
39
|
+
expect(errorsOf(cls, { ...base, returnConditions: 'GOOD' })).toContain('returnConditions');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import { Provider } from "../../../src/provider/enums/Provider";
|
|
3
|
+
import { ProductTypeEnum } from "../../../src/productCatalog/enums/ProductTypeEnum";
|
|
4
|
+
import {
|
|
5
|
+
BusinessNameEnum,
|
|
6
|
+
ConsultStpOrderRequest,
|
|
7
|
+
PutStpOrderRequest,
|
|
8
|
+
StpOrderSourceEnum,
|
|
9
|
+
} from "../../../src/stpSpei";
|
|
10
|
+
|
|
11
|
+
describe("stpSpei — cambios aditivos para money-transfer-connector (DEC-013 / DEC-037)", () => {
|
|
12
|
+
it("Provider expone MONEY_TRANSFER", () => {
|
|
13
|
+
expect(Provider.MONEY_TRANSFER).toBe("MONEY_TRANSFER");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("ProductTypeEnum expone MONEY_TRANSFER_SA", () => {
|
|
17
|
+
expect(ProductTypeEnum.MONEY_TRANSFER_SA).toBe("MONEY_TRANSFER_SA");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("StpOrderSourceEnum expone USER_TRANSFER y BENEFITS_SETTLEMENT", () => {
|
|
21
|
+
expect(StpOrderSourceEnum.USER_TRANSFER).toBe("USER_TRANSFER");
|
|
22
|
+
expect(StpOrderSourceEnum.BENEFITS_SETTLEMENT).toBe("BENEFITS_SETTLEMENT");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("PutStpOrderRequest compila sin los campos de usuario y acepta source + beneficiaryRfc", () => {
|
|
26
|
+
const request: PutStpOrderRequest = {
|
|
27
|
+
amount: 150.5,
|
|
28
|
+
transactionNumber: "TX-0001",
|
|
29
|
+
numericReference: 1234567,
|
|
30
|
+
concept: "Liquidación de beneficios",
|
|
31
|
+
beneficiaryAccount: "646180110400000007",
|
|
32
|
+
beneficiaryName: "EMPRESA SA DE CV",
|
|
33
|
+
bankCode: "90646",
|
|
34
|
+
source: StpOrderSourceEnum.BENEFITS_SETTLEMENT,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
expect(request.source).toBe("BENEFITS_SETTLEMENT");
|
|
38
|
+
expect(request.directoryId).toBeUndefined();
|
|
39
|
+
expect(request.beneficiaryRfc).toBeUndefined();
|
|
40
|
+
|
|
41
|
+
const withRfc: PutStpOrderRequest = { ...request, beneficiaryRfc: "XAXX010101000" };
|
|
42
|
+
expect(withRfc.beneficiaryRfc).toBe("XAXX010101000");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("PutStpOrderRequest sigue aceptando el shape completo actual (USER_TRANSFER)", () => {
|
|
46
|
+
const request: PutStpOrderRequest = {
|
|
47
|
+
processorObject: null,
|
|
48
|
+
directoryId: "dir-1",
|
|
49
|
+
phoneNumber: "+525500000000",
|
|
50
|
+
indexName: "idx",
|
|
51
|
+
amount: 10,
|
|
52
|
+
transactionNumber: "TX-0002",
|
|
53
|
+
numericReference: 1,
|
|
54
|
+
concept: null,
|
|
55
|
+
beneficiaryAccount: "646180110400000007",
|
|
56
|
+
beneficiaryName: "JUAN PEREZ",
|
|
57
|
+
bankName: "STP",
|
|
58
|
+
bankCode: "90646",
|
|
59
|
+
originatorAccountNumber: "646180110400000008",
|
|
60
|
+
originatorCurp: "XAXX010101HDFXXX01",
|
|
61
|
+
originatorName: "FIADO",
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
expect(request.source).toBeUndefined();
|
|
65
|
+
expect(request.transactionNumber).toBe("TX-0002");
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("ConsultStpOrderRequest acepta businessName opcional (DEC-037)", () => {
|
|
69
|
+
const sinEmpresa: ConsultStpOrderRequest = {
|
|
70
|
+
transactionNumber: "TX-0003",
|
|
71
|
+
orderType: "E",
|
|
72
|
+
operationDate: "20260924",
|
|
73
|
+
};
|
|
74
|
+
expect(sinEmpresa.businessName).toBeUndefined();
|
|
75
|
+
|
|
76
|
+
const conEmpresa: ConsultStpOrderRequest = {
|
|
77
|
+
...sinEmpresa,
|
|
78
|
+
orderType: "R",
|
|
79
|
+
businessName: BusinessNameEnum.PAGO_CONFIADO,
|
|
80
|
+
};
|
|
81
|
+
expect(conEmpresa.businessName).toBe("PAGO_CONFIADO");
|
|
82
|
+
expect(conEmpresa.orderType).toBe("R");
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de identificador con el que se reconoce la cuenta destino de una
|
|
3
|
+
* transferencia SPEI.
|
|
4
|
+
*
|
|
5
|
+
* Banxico admite tres (Circular 17/2010) y STP los distingue con el campo
|
|
6
|
+
* `tipoCuentaBeneficiario` del servicio registraOrden. El valor numerico de
|
|
7
|
+
* cada uno vive en el lambda que arma la orden; aqui solo se nombra el
|
|
8
|
+
* concepto.
|
|
9
|
+
*
|
|
10
|
+
* No confundir con `ExternalAccountTypeEnum`, que describe la naturaleza de la
|
|
11
|
+
* cuenta (cheques, ahorro), no como se identifica.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum BeneficiaryAccountTypeEnum {
|
|
14
|
+
/** CLABE de 18 digitos, con digito verificador Banxico. */
|
|
15
|
+
CLABE = "CLABE",
|
|
16
|
+
/** Numero de tarjeta de debito de 16 digitos, con verificacion Luhn. */
|
|
17
|
+
DEBIT_CARD = "DEBIT_CARD",
|
|
18
|
+
/** Linea movil de 10 digitos. Sin verificador: habilitar con cuidado. */
|
|
19
|
+
MOBILE_PHONE = "MOBILE_PHONE"
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BeneficiaryAccountTypeEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Tipo de identificador con el que se reconoce la cuenta destino de una
|
|
6
|
+
* transferencia SPEI.
|
|
7
|
+
*
|
|
8
|
+
* Banxico admite tres (Circular 17/2010) y STP los distingue con el campo
|
|
9
|
+
* `tipoCuentaBeneficiario` del servicio registraOrden. El valor numerico de
|
|
10
|
+
* cada uno vive en el lambda que arma la orden; aqui solo se nombra el
|
|
11
|
+
* concepto.
|
|
12
|
+
*
|
|
13
|
+
* No confundir con `ExternalAccountTypeEnum`, que describe la naturaleza de la
|
|
14
|
+
* cuenta (cheques, ahorro), no como se identifica.
|
|
15
|
+
*/
|
|
16
|
+
var BeneficiaryAccountTypeEnum;
|
|
17
|
+
(function (BeneficiaryAccountTypeEnum) {
|
|
18
|
+
/** CLABE de 18 digitos, con digito verificador Banxico. */
|
|
19
|
+
BeneficiaryAccountTypeEnum["CLABE"] = "CLABE";
|
|
20
|
+
/** Numero de tarjeta de debito de 16 digitos, con verificacion Luhn. */
|
|
21
|
+
BeneficiaryAccountTypeEnum["DEBIT_CARD"] = "DEBIT_CARD";
|
|
22
|
+
/** Linea movil de 10 digitos. Sin verificador: habilitar con cuidado. */
|
|
23
|
+
BeneficiaryAccountTypeEnum["MOBILE_PHONE"] = "MOBILE_PHONE";
|
|
24
|
+
})(BeneficiaryAccountTypeEnum || (exports.BeneficiaryAccountTypeEnum = BeneficiaryAccountTypeEnum = {}));
|
|
@@ -4,6 +4,7 @@ export * from './dtos/GetExternalBankAccountResponse';
|
|
|
4
4
|
export * from './dtos/GetExternalBankResponse';
|
|
5
5
|
export * from './dtos/CreateExternalBankAccountRequest';
|
|
6
6
|
export * from './dtos/CreateExternalBankAccountResponse';
|
|
7
|
+
export * from './enums/BeneficiaryAccountTypeEnum';
|
|
7
8
|
export * from './enums/ExternalAccountOwnershipEnum';
|
|
8
9
|
export * from './enums/ExternalAccountStatusEnum';
|
|
9
10
|
export * from './enums/ExternalAccountTypeEnum';
|
package/bin/bankAccount/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./dtos/GetExternalBankAccountResponse"), exports);
|
|
|
20
20
|
__exportStar(require("./dtos/GetExternalBankResponse"), exports);
|
|
21
21
|
__exportStar(require("./dtos/CreateExternalBankAccountRequest"), exports);
|
|
22
22
|
__exportStar(require("./dtos/CreateExternalBankAccountResponse"), exports);
|
|
23
|
+
__exportStar(require("./enums/BeneficiaryAccountTypeEnum"), exports);
|
|
23
24
|
__exportStar(require("./enums/ExternalAccountOwnershipEnum"), exports);
|
|
24
25
|
__exportStar(require("./enums/ExternalAccountStatusEnum"), exports);
|
|
25
26
|
__exportStar(require("./enums/ExternalAccountTypeEnum"), exports);
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -38,7 +38,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.IssuanceBusiness = exports.Blacklist = exports.CentralPayments = exports.Helpdesk = exports.FiadoApiResponse = exports.Auth = exports.LegalDocumentsBusiness = exports.Role = exports.STPAccount = exports.RiskProfile = exports.FraudPreventionEngine = exports.BBVARst = exports.Stp = exports.BenefitCenter = exports.BankAccount = exports.P2pContact = exports.CreditContract = exports.Contract = exports.ProductCatalog = exports.ContactInfo = exports.TransactionAnalytics = exports.Transaction = exports.TransactionProcessor = exports.GenericMessage = exports.EventBridgeMessage = exports.SessionActivity = exports.NotificationMessages = exports.ServicePayment = exports.Header = exports.Identity = exports.UserTags = exports.Group = exports.File = exports.ExchangeRate = exports.Directory = exports.Currency = exports.Country = exports.Card = exports.Authentication = exports.AppContent = exports.App = exports.Offices = exports.Places = exports.Address = exports.Beneficiary = exports.Activity = exports.Biometrics = exports.MetamapConnector = exports.Account = exports.Crypto = void 0;
|
|
40
40
|
exports.DatalakeQuery = exports.RetailWizard = exports.RetailCustomer = exports.RetailCards = exports.RetailCatalog = exports.RetailCommission = exports.RetailOrg = exports.EmailVerification = exports.NetworkConnector = exports.Modelias = exports.TotpSecurity = exports.Passport = exports.WalletFunding = exports.Remittance = exports.PlatformRbac = exports.CognitoBackofficeConnector = exports.WhatsappConnector = exports.TwilioConnector = exports.MessagesConnector = exports.Mdm = exports.MilestoneBusiness = exports.CirculoCredito = exports.CreditStatements = exports.Sentry = exports.AiEngine = exports.Funnel = exports.TeamsConnector = exports.PlatformErrorEvents = exports.CustomerFile = exports.CreditBackoffice = exports.CreditDashboard = exports.CreditEngine = exports.Credit = exports.ComissionBusiness = exports.ReferralBusiness = exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = exports.Collector = exports.Pricelist = exports.Company = exports.Services = exports.AccountIssuanceBusiness = exports.AppSelectionData = exports.Device = exports.Observations = void 0;
|
|
41
|
-
exports.RetailLoan = exports.Membership = exports.WebhookBusiness = exports.PeopleBusiness = exports.UserConfirmations = exports.Collection = exports.Shipping = exports.PhoneSales = exports.Onboarding = exports.Kyc = exports.LoanScoring = exports.LoanCredit = exports.LoanCollectorAssignment = exports.LoanOfferings = exports.Shortlink = exports.LoanConfig = void 0;
|
|
41
|
+
exports.MoneyTransfer = exports.RetailLoan = exports.Membership = exports.WebhookBusiness = exports.PeopleBusiness = exports.UserConfirmations = exports.Collection = exports.Shipping = exports.PhoneSales = exports.Onboarding = exports.Kyc = exports.LoanScoring = exports.LoanCredit = exports.LoanCollectorAssignment = exports.LoanOfferings = exports.Shortlink = exports.LoanConfig = void 0;
|
|
42
42
|
exports.Crypto = __importStar(require("./crypto"));
|
|
43
43
|
exports.Account = __importStar(require("./account"));
|
|
44
44
|
exports.MetamapConnector = __importStar(require("./metamapConnector"));
|
|
@@ -222,3 +222,7 @@ exports.Membership = __importStar(require("./membership"));
|
|
|
222
222
|
// RetailLoan: contrato público de retail-loan-business (I1), la puerta de la App Fiado
|
|
223
223
|
// hacia las suites FiadoLend/FiadoRetail. Montos en pesos; el lambda convierte desde centavos.
|
|
224
224
|
exports.RetailLoan = __importStar(require("./retailLoan"));
|
|
225
|
+
// MoneyTransfer: contrato del money-transfer-connector (Centro de Beneficios) — catálogo de
|
|
226
|
+
// servicios/productos con riel SPEI/ACH y liquidación inmediata o en lote, liquidaciones
|
|
227
|
+
// (settlements) y estado de órdenes SPEI. Reusa AmountTypeEnum/ReferenceTypeEnum de servicePayment.
|
|
228
|
+
exports.MoneyTransfer = __importStar(require("./moneyTransfer"));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Programación del lote para productos con `settlementMode = BATCH`. */
|
|
2
|
+
export declare class BatchScheduleRequest {
|
|
3
|
+
/** Expresión cron (5 campos) evaluada en `timezone`. */
|
|
4
|
+
cron: string;
|
|
5
|
+
/** Zona horaria IANA, ej. `America/Mexico_City`. */
|
|
6
|
+
timezone: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BatchScheduleRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/** Programación del lote para productos con `settlementMode = BATCH`. */
|
|
15
|
+
class BatchScheduleRequest {
|
|
16
|
+
}
|
|
17
|
+
exports.BatchScheduleRequest = BatchScheduleRequest;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
+
(0, class_validator_1.MaxLength)(64),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], BatchScheduleRequest.prototype, "cron", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], BatchScheduleRequest.prototype, "timezone", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Crea una liquidación agrupando folios pendientes (`transactionNumbers`) de un mismo producto.
|
|
3
|
+
* `sendNow = true` la envía al riel de inmediato; en caso contrario queda en `CREATED` o
|
|
4
|
+
* `SCHEDULED` (si viene `scheduledAt`, epoch ms).
|
|
5
|
+
*/
|
|
6
|
+
export declare class CreateSettlementRequest {
|
|
7
|
+
idempotencyKey: string;
|
|
8
|
+
transactionNumbers: string[];
|
|
9
|
+
sendNow: boolean;
|
|
10
|
+
/** Epoch ms del envío programado. */
|
|
11
|
+
scheduledAt?: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateSettlementRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/**
|
|
15
|
+
* Crea una liquidación agrupando folios pendientes (`transactionNumbers`) de un mismo producto.
|
|
16
|
+
* `sendNow = true` la envía al riel de inmediato; en caso contrario queda en `CREATED` o
|
|
17
|
+
* `SCHEDULED` (si viene `scheduledAt`, epoch ms).
|
|
18
|
+
*/
|
|
19
|
+
class CreateSettlementRequest {
|
|
20
|
+
}
|
|
21
|
+
exports.CreateSettlementRequest = CreateSettlementRequest;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsUUID)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CreateSettlementRequest.prototype, "idempotencyKey", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsArray)(),
|
|
28
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
29
|
+
(0, class_validator_1.ArrayMaxSize)(1000),
|
|
30
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
31
|
+
__metadata("design:type", Array)
|
|
32
|
+
], CreateSettlementRequest.prototype, "transactionNumbers", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsBoolean)(),
|
|
35
|
+
__metadata("design:type", Boolean)
|
|
36
|
+
], CreateSettlementRequest.prototype, "sendNow", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsInt)(),
|
|
40
|
+
(0, class_validator_1.Min)(0),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], CreateSettlementRequest.prototype, "scheduledAt", void 0);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AmountTypeEnum } from "../../servicePayment/enums/AmountTypeEnum";
|
|
2
|
+
import { ReferenceTypeEnum } from "../../servicePayment/enums/ReferenceTypeEnum";
|
|
3
|
+
import { SettlementModeEnum } from "../enums/SettlementModeEnum";
|
|
4
|
+
import { TransferChannelEnum } from "../enums/TransferChannelEnum";
|
|
5
|
+
import { BatchScheduleRequest } from "./BatchScheduleRequest";
|
|
6
|
+
/**
|
|
7
|
+
* Producto de un servicio de transferencia de dinero (Centro de Beneficios). Los campos en
|
|
8
|
+
* español espejan el catálogo legacy de pago de servicios; los campos en inglés son la
|
|
9
|
+
* configuración propia del riel (canal, modo de liquidación, beneficiario, lote).
|
|
10
|
+
*/
|
|
11
|
+
export declare class MoneyTransferProductRequest {
|
|
12
|
+
idProducto: string;
|
|
13
|
+
producto: string;
|
|
14
|
+
precio: number;
|
|
15
|
+
amountType: AmountTypeEnum;
|
|
16
|
+
fee: number;
|
|
17
|
+
tipoReferencia: ReferenceTypeEnum;
|
|
18
|
+
verificateReference: boolean;
|
|
19
|
+
hasDigitoVerificador: boolean;
|
|
20
|
+
showAyuda: boolean;
|
|
21
|
+
legend: string;
|
|
22
|
+
logoSrc: string;
|
|
23
|
+
refSrc: string;
|
|
24
|
+
tipoFront: number;
|
|
25
|
+
idCatTipoServicio: number;
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
channel: TransferChannelEnum;
|
|
28
|
+
settlementMode: SettlementModeEnum;
|
|
29
|
+
/** Nombre del beneficiario tal como viaja al riel (SPEI acepta máx. 40 chars). */
|
|
30
|
+
beneficiaryName: string;
|
|
31
|
+
/** RFC del beneficiario: 12 chars persona moral, 13 persona física. */
|
|
32
|
+
beneficiaryRfc?: string;
|
|
33
|
+
minAmount?: number;
|
|
34
|
+
maxAmount?: number;
|
|
35
|
+
/** Requerido operativamente cuando `settlementMode = BATCH`; lo valida el conector. */
|
|
36
|
+
batchSchedule?: BatchScheduleRequest;
|
|
37
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MoneyTransferProductRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const AmountTypeEnum_1 = require("../../servicePayment/enums/AmountTypeEnum");
|
|
16
|
+
const ReferenceTypeEnum_1 = require("../../servicePayment/enums/ReferenceTypeEnum");
|
|
17
|
+
const SettlementModeEnum_1 = require("../enums/SettlementModeEnum");
|
|
18
|
+
const TransferChannelEnum_1 = require("../enums/TransferChannelEnum");
|
|
19
|
+
const BatchScheduleRequest_1 = require("./BatchScheduleRequest");
|
|
20
|
+
/**
|
|
21
|
+
* Producto de un servicio de transferencia de dinero (Centro de Beneficios). Los campos en
|
|
22
|
+
* español espejan el catálogo legacy de pago de servicios; los campos en inglés son la
|
|
23
|
+
* configuración propia del riel (canal, modo de liquidación, beneficiario, lote).
|
|
24
|
+
*/
|
|
25
|
+
class MoneyTransferProductRequest {
|
|
26
|
+
}
|
|
27
|
+
exports.MoneyTransferProductRequest = MoneyTransferProductRequest;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
(0, class_validator_1.MaxLength)(34),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], MoneyTransferProductRequest.prototype, "idProducto", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
37
|
+
(0, class_validator_1.MaxLength)(120),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], MoneyTransferProductRequest.prototype, "producto", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsNumber)(),
|
|
42
|
+
(0, class_validator_1.Min)(0),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], MoneyTransferProductRequest.prototype, "precio", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsEnum)(AmountTypeEnum_1.AmountTypeEnum),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], MoneyTransferProductRequest.prototype, "amountType", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsNumber)(),
|
|
51
|
+
(0, class_validator_1.Min)(0),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], MoneyTransferProductRequest.prototype, "fee", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_validator_1.IsEnum)(ReferenceTypeEnum_1.ReferenceTypeEnum),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], MoneyTransferProductRequest.prototype, "tipoReferencia", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsBoolean)(),
|
|
60
|
+
__metadata("design:type", Boolean)
|
|
61
|
+
], MoneyTransferProductRequest.prototype, "verificateReference", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_validator_1.IsBoolean)(),
|
|
64
|
+
__metadata("design:type", Boolean)
|
|
65
|
+
], MoneyTransferProductRequest.prototype, "hasDigitoVerificador", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsBoolean)(),
|
|
68
|
+
__metadata("design:type", Boolean)
|
|
69
|
+
], MoneyTransferProductRequest.prototype, "showAyuda", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsString)(),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], MoneyTransferProductRequest.prototype, "legend", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_validator_1.IsString)(),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], MoneyTransferProductRequest.prototype, "logoSrc", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsString)(),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], MoneyTransferProductRequest.prototype, "refSrc", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, class_validator_1.IsInt)(),
|
|
84
|
+
__metadata("design:type", Number)
|
|
85
|
+
], MoneyTransferProductRequest.prototype, "tipoFront", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsInt)(),
|
|
88
|
+
__metadata("design:type", Number)
|
|
89
|
+
], MoneyTransferProductRequest.prototype, "idCatTipoServicio", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, class_validator_1.IsBoolean)(),
|
|
92
|
+
__metadata("design:type", Boolean)
|
|
93
|
+
], MoneyTransferProductRequest.prototype, "enabled", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, class_validator_1.IsEnum)(TransferChannelEnum_1.TransferChannelEnum),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], MoneyTransferProductRequest.prototype, "channel", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, class_validator_1.IsEnum)(SettlementModeEnum_1.SettlementModeEnum),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], MoneyTransferProductRequest.prototype, "settlementMode", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, class_validator_1.IsString)(),
|
|
104
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
105
|
+
(0, class_validator_1.MaxLength)(40),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], MoneyTransferProductRequest.prototype, "beneficiaryName", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, class_validator_1.IsOptional)(),
|
|
110
|
+
(0, class_validator_1.IsString)(),
|
|
111
|
+
(0, class_validator_1.Length)(12, 13),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], MoneyTransferProductRequest.prototype, "beneficiaryRfc", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, class_validator_1.IsOptional)(),
|
|
116
|
+
(0, class_validator_1.IsNumber)(),
|
|
117
|
+
(0, class_validator_1.Min)(0),
|
|
118
|
+
__metadata("design:type", Number)
|
|
119
|
+
], MoneyTransferProductRequest.prototype, "minAmount", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, class_validator_1.IsOptional)(),
|
|
122
|
+
(0, class_validator_1.IsNumber)(),
|
|
123
|
+
(0, class_validator_1.Min)(0),
|
|
124
|
+
__metadata("design:type", Number)
|
|
125
|
+
], MoneyTransferProductRequest.prototype, "maxAmount", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, class_validator_1.IsOptional)(),
|
|
128
|
+
(0, class_validator_1.ValidateNested)(),
|
|
129
|
+
(0, class_transformer_1.Type)(() => BatchScheduleRequest_1.BatchScheduleRequest),
|
|
130
|
+
__metadata("design:type", BatchScheduleRequest_1.BatchScheduleRequest)
|
|
131
|
+
], MoneyTransferProductRequest.prototype, "batchSchedule", void 0);
|