@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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Type } from "class-transformer";
|
|
2
|
+
import {
|
|
3
|
+
ArrayMinSize,
|
|
4
|
+
IsArray,
|
|
5
|
+
IsBoolean,
|
|
6
|
+
IsInt,
|
|
7
|
+
IsNotEmpty,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
Length,
|
|
11
|
+
Min,
|
|
12
|
+
ValidateNested,
|
|
13
|
+
} from "class-validator";
|
|
14
|
+
import { MoneyTransferProductRequest } from "./MoneyTransferProductRequest";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Actualización parcial de un servicio de transferencia de dinero. Mismos campos que
|
|
18
|
+
* `MoneyTransferServiceCreateRequest`, todos opcionales (el repo no cuenta con `PartialType`,
|
|
19
|
+
* por eso se declara a mano). Si viene `productoDTOList` reemplaza la lista completa.
|
|
20
|
+
*/
|
|
21
|
+
export class MoneyTransferServiceUpdateRequest {
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@IsInt()
|
|
24
|
+
@Min(90000)
|
|
25
|
+
idServicio?: number;
|
|
26
|
+
|
|
27
|
+
@IsOptional()
|
|
28
|
+
@IsString()
|
|
29
|
+
@IsNotEmpty()
|
|
30
|
+
servicio?: string;
|
|
31
|
+
|
|
32
|
+
@IsOptional()
|
|
33
|
+
@IsString()
|
|
34
|
+
@IsNotEmpty()
|
|
35
|
+
categoria?: string;
|
|
36
|
+
|
|
37
|
+
@IsOptional()
|
|
38
|
+
@IsString()
|
|
39
|
+
@IsNotEmpty()
|
|
40
|
+
subcategoria?: string;
|
|
41
|
+
|
|
42
|
+
@IsOptional()
|
|
43
|
+
@IsInt()
|
|
44
|
+
categoryOrder?: number;
|
|
45
|
+
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@IsInt()
|
|
48
|
+
subcategoryOrder?: number;
|
|
49
|
+
|
|
50
|
+
@IsOptional()
|
|
51
|
+
@IsInt()
|
|
52
|
+
serviceOrder?: number;
|
|
53
|
+
|
|
54
|
+
@IsOptional()
|
|
55
|
+
@IsString()
|
|
56
|
+
@IsNotEmpty()
|
|
57
|
+
beneficeId?: string;
|
|
58
|
+
|
|
59
|
+
@IsOptional()
|
|
60
|
+
@IsBoolean()
|
|
61
|
+
enabled?: boolean;
|
|
62
|
+
|
|
63
|
+
@IsOptional()
|
|
64
|
+
@IsString()
|
|
65
|
+
@Length(3, 3)
|
|
66
|
+
currencyId?: string;
|
|
67
|
+
|
|
68
|
+
@IsOptional()
|
|
69
|
+
@IsString()
|
|
70
|
+
@IsNotEmpty()
|
|
71
|
+
serviceCountryId?: string;
|
|
72
|
+
|
|
73
|
+
@IsOptional()
|
|
74
|
+
@IsString()
|
|
75
|
+
logoSrc?: string;
|
|
76
|
+
|
|
77
|
+
@IsOptional()
|
|
78
|
+
@IsInt()
|
|
79
|
+
idCatTipoServicio?: number;
|
|
80
|
+
|
|
81
|
+
@IsOptional()
|
|
82
|
+
@ValidateNested({ each: true })
|
|
83
|
+
@Type(() => MoneyTransferProductRequest)
|
|
84
|
+
@IsArray()
|
|
85
|
+
@ArrayMinSize(1)
|
|
86
|
+
productoDTOList?: MoneyTransferProductRequest[];
|
|
87
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TransactionDetailResponse } from "./TransactionDetailResponse";
|
|
2
|
+
|
|
3
|
+
/** Página de folios pendientes de liquidar, con totales agregados de la página. */
|
|
4
|
+
export class PendingDetailsResponse {
|
|
5
|
+
items!: TransactionDetailResponse[];
|
|
6
|
+
count!: number;
|
|
7
|
+
totalAmount!: number;
|
|
8
|
+
nextToken?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IsInt, Min } from "class-validator";
|
|
2
|
+
import { SettlementActionRequest } from "./SettlementActionRequest";
|
|
3
|
+
|
|
4
|
+
/** Reprograma una liquidación en `SCHEDULED`; `scheduledAt` es epoch ms. */
|
|
5
|
+
export class RescheduleSettlementRequest extends SettlementActionRequest {
|
|
6
|
+
@IsInt()
|
|
7
|
+
@Min(0)
|
|
8
|
+
scheduledAt!: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SettlementStatusEnum } from "../enums/SettlementStatusEnum";
|
|
2
|
+
import { TransferChannelEnum } from "../enums/TransferChannelEnum";
|
|
3
|
+
import { TransactionDetailResponse } from "./TransactionDetailResponse";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Liquidación (lote de folios de un producto enviado al riel). Sin decoradores
|
|
7
|
+
* `class-validator`: el consumidor la lee tal cual viene por la red. Timestamps en epoch ms.
|
|
8
|
+
*/
|
|
9
|
+
export class SettlementResponse {
|
|
10
|
+
settlementId!: string;
|
|
11
|
+
tenantId!: string;
|
|
12
|
+
productId!: string;
|
|
13
|
+
serviceId!: number;
|
|
14
|
+
channel!: TransferChannelEnum;
|
|
15
|
+
currency!: string;
|
|
16
|
+
beneficiaryName!: string;
|
|
17
|
+
totalAmount!: number;
|
|
18
|
+
itemCount!: number;
|
|
19
|
+
status!: SettlementStatusEnum;
|
|
20
|
+
scheduledAt?: number;
|
|
21
|
+
/** Id de la transacción en el riel (ACH) o clave de rastreo (SPEI). */
|
|
22
|
+
achTransactionId?: string;
|
|
23
|
+
returnReason?: string;
|
|
24
|
+
lastError?: string;
|
|
25
|
+
/** `true` cuando el envío no obtuvo respuesta concluyente del riel (posible duplicado). */
|
|
26
|
+
uncertain?: boolean;
|
|
27
|
+
attempts!: number;
|
|
28
|
+
attemptedAt?: number;
|
|
29
|
+
sentAt?: number;
|
|
30
|
+
settledAt?: number;
|
|
31
|
+
createdBy!: string;
|
|
32
|
+
sentBy?: string;
|
|
33
|
+
createdAt!: number;
|
|
34
|
+
updatedAt!: number;
|
|
35
|
+
/** Folios incluidos; solo viene en el detalle, no en el listado. */
|
|
36
|
+
details?: TransactionDetailResponse[];
|
|
37
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IsEnum, IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";
|
|
2
|
+
import { SpeiOrderStatusEnum } from "../enums/SpeiOrderStatusEnum";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Mensaje asíncrono con el estado de una orden SPEI (lo emite el conector STP y lo consume
|
|
6
|
+
* `money-transfer-connector` para cerrar la liquidación). `claveRastreo` es la clave de
|
|
7
|
+
* rastreo SPEI (máx. 30 chars según STP).
|
|
8
|
+
*/
|
|
9
|
+
export class SettlementStatusMessage {
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
@MaxLength(30)
|
|
13
|
+
claveRastreo!: string;
|
|
14
|
+
|
|
15
|
+
@IsEnum(SpeiOrderStatusEnum)
|
|
16
|
+
status!: SpeiOrderStatusEnum;
|
|
17
|
+
|
|
18
|
+
/** Motivo reportado por el riel (devolución / cancelación). */
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@IsString()
|
|
21
|
+
@MaxLength(256)
|
|
22
|
+
reason?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SettlementModeEnum } from "../enums/SettlementModeEnum";
|
|
2
|
+
import { TransactionDetailStatusEnum } from "../enums/TransactionDetailStatusEnum";
|
|
3
|
+
import { TransferChannelEnum } from "../enums/TransferChannelEnum";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Folio cobrado al usuario pendiente de (o ya incluido en) una liquidación.
|
|
7
|
+
* Sin decoradores `class-validator`: el consumidor la lee tal cual viene por la red.
|
|
8
|
+
*/
|
|
9
|
+
export class TransactionDetailResponse {
|
|
10
|
+
transactionNumber!: string;
|
|
11
|
+
directoryId!: string;
|
|
12
|
+
tenantId!: string;
|
|
13
|
+
serviceId!: number;
|
|
14
|
+
productId!: string;
|
|
15
|
+
channel!: TransferChannelEnum;
|
|
16
|
+
amount!: number;
|
|
17
|
+
currency!: string;
|
|
18
|
+
reference!: string;
|
|
19
|
+
settlementMode!: SettlementModeEnum;
|
|
20
|
+
status!: TransactionDetailStatusEnum;
|
|
21
|
+
/** Presente cuando el folio ya fue agrupado en una liquidación. */
|
|
22
|
+
settlementId?: string;
|
|
23
|
+
/** Epoch ms. */
|
|
24
|
+
createdAt!: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Ciclo de vida de una liquidación (lote de folios enviado al riel). */
|
|
2
|
+
export enum SettlementStatusEnum {
|
|
3
|
+
CREATED = 'CREATED',
|
|
4
|
+
SCHEDULED = 'SCHEDULED',
|
|
5
|
+
SENDING = 'SENDING',
|
|
6
|
+
SENT = 'SENT',
|
|
7
|
+
SETTLED = 'SETTLED',
|
|
8
|
+
RETURNED = 'RETURNED',
|
|
9
|
+
FAILED = 'FAILED',
|
|
10
|
+
CANCELLED = 'CANCELLED',
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de una orden SPEI tal como lo reporta STP (LQ liquidada, D devuelta, CN cancelada),
|
|
3
|
+
* más los estados internos PENDING (sin respuesta aún) y UNKNOWN (código no mapeado).
|
|
4
|
+
*/
|
|
5
|
+
export enum SpeiOrderStatusEnum {
|
|
6
|
+
LQ = 'LQ',
|
|
7
|
+
D = 'D',
|
|
8
|
+
CN = 'CN',
|
|
9
|
+
PENDING = 'PENDING',
|
|
10
|
+
UNKNOWN = 'UNKNOWN',
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// moneyTransfer — money-transfer-connector (Centro de Beneficios)
|
|
2
|
+
// Contrato del conector de transferencias de dinero: catálogo de servicios/productos con riel
|
|
3
|
+
// (SPEI/ACH) y modo de liquidación (inmediata/lote), liquidaciones y estado de órdenes SPEI.
|
|
4
|
+
|
|
5
|
+
//Enums
|
|
6
|
+
export * from './enums/TransferChannelEnum';
|
|
7
|
+
export * from './enums/SettlementModeEnum';
|
|
8
|
+
export * from './enums/SettlementStatusEnum';
|
|
9
|
+
export * from './enums/TransactionDetailStatusEnum';
|
|
10
|
+
export * from './enums/SpeiOrderStatusEnum';
|
|
11
|
+
|
|
12
|
+
//Mensajes async (SQS FIFO money-transfer-settlement-status, DEC-013)
|
|
13
|
+
export * from './dtos/SettlementStatusMessage';
|
|
14
|
+
//DTOs — requests
|
|
15
|
+
export * from './dtos/BatchScheduleRequest';
|
|
16
|
+
export * from './dtos/MoneyTransferProductRequest';
|
|
17
|
+
export * from './dtos/MoneyTransferServiceCreateRequest';
|
|
18
|
+
export * from './dtos/MoneyTransferServiceUpdateRequest';
|
|
19
|
+
export * from './dtos/CreateSettlementRequest';
|
|
20
|
+
export * from './dtos/SettlementActionRequest';
|
|
21
|
+
export * from './dtos/RescheduleSettlementRequest';
|
|
22
|
+
|
|
23
|
+
//DTOs — responses
|
|
24
|
+
export * from './dtos/TransactionDetailResponse';
|
|
25
|
+
export * from './dtos/SettlementResponse';
|
|
26
|
+
export * from './dtos/PendingDetailsResponse';
|
|
27
|
+
export * from './dtos/SettlementListResponse';
|
|
@@ -58,5 +58,10 @@ export enum ProductTypeEnum {
|
|
|
58
58
|
* Reversa de un reembolso anterior — se devuelve el dinero del reembolso al cliente
|
|
59
59
|
* cuando el dictamen fue incorrecto o se detectó fraude post-reembolso.
|
|
60
60
|
*/
|
|
61
|
-
REFUND_PCF_REVERSE = "REFUND_PCF_REVERSE"
|
|
61
|
+
REFUND_PCF_REVERSE = "REFUND_PCF_REVERSE",
|
|
62
|
+
/**
|
|
63
|
+
* Dispersión SPEI de liquidaciones de beneficios (money-transfer-connector).
|
|
64
|
+
* Producto del catálogo para la orden STP que sale con `source=BENEFITS_SETTLEMENT`.
|
|
65
|
+
*/
|
|
66
|
+
MONEY_TRANSFER_SA = "MONEY_TRANSFER_SA"
|
|
62
67
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InventoryMovementReasonEnum } from '../enums/InventoryMovementReasonEnum';
|
|
2
|
+
|
|
3
|
+
/** Motivos que el admin puede registrar en un ajuste; DAMAGED_RETURN lo genera la devolución. */
|
|
4
|
+
export const ADJUSTMENT_REASONS = [
|
|
5
|
+
InventoryMovementReasonEnum.SHRINKAGE,
|
|
6
|
+
InventoryMovementReasonEnum.ADJUSTMENT,
|
|
7
|
+
InventoryMovementReasonEnum.WARRANTY,
|
|
8
|
+
];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ProductCategoryEnum } from '../enums/ProductCategoryEnum';
|
|
2
|
+
|
|
3
|
+
/** Categorías que admite el alta y la edición de producto; el kit (BUNDLE) tiene su propio endpoint. */
|
|
4
|
+
export const NON_BUNDLE_CATEGORIES = Object.values(ProductCategoryEnum).filter((c) => c !== ProductCategoryEnum.BUNDLE);
|
|
@@ -4,6 +4,7 @@ import { ProductStatusEnum } from '../enums/ProductStatusEnum';
|
|
|
4
4
|
import { ProductTierEnum } from '../enums/ProductTierEnum';
|
|
5
5
|
import { ProductCategoryEnum } from '../enums/ProductCategoryEnum';
|
|
6
6
|
import { TrackingModeEnum } from '../enums/TrackingModeEnum';
|
|
7
|
+
import { ItemTypeEnum } from '../enums/ItemTypeEnum';
|
|
7
8
|
import { ProductComponent } from './ProductComponent';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -48,4 +49,6 @@ export class Product {
|
|
|
48
49
|
components?: ProductComponent[] | null;
|
|
49
50
|
/** Llave del registro PRICE# del que salen basePriceCents y listPriceCents. */
|
|
50
51
|
currentPriceSk?: string | null;
|
|
52
|
+
/** Producto físico o servicio; inmutable tras el alta. Ausente = PRODUCT. */
|
|
53
|
+
itemType?: ItemTypeEnum;
|
|
51
54
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsBoolean, IsOptional, IsString, Length, Matches, ValidateNested } from 'class-validator';
|
|
3
|
+
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
4
|
+
import { ProductComponent } from '../ProductComponent';
|
|
5
|
+
|
|
6
|
+
/** Body de POST /backoffice/catalog/kits (backofficeCreateKit); category BUNDLE y origen BACKOFFICE los fija el servidor. */
|
|
7
|
+
export class BackofficeCreateKitRequest {
|
|
8
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
9
|
+
@Length(1, 64)
|
|
10
|
+
@IsString()
|
|
11
|
+
sku!: string;
|
|
12
|
+
|
|
13
|
+
@IsBoolean()
|
|
14
|
+
sellable!: boolean;
|
|
15
|
+
|
|
16
|
+
@IsBoolean()
|
|
17
|
+
showInSalesFlow!: boolean;
|
|
18
|
+
|
|
19
|
+
@IsArray()
|
|
20
|
+
@ArrayMinSize(1)
|
|
21
|
+
@ValidateNested({ each: true })
|
|
22
|
+
@Type(() => ProductComponent)
|
|
23
|
+
components!: ProductComponent[];
|
|
24
|
+
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@Matches(/\S/)
|
|
27
|
+
@IsString()
|
|
28
|
+
description?: string;
|
|
29
|
+
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@Matches(/\S/)
|
|
32
|
+
@IsString()
|
|
33
|
+
imageUrl?: string;
|
|
34
|
+
|
|
35
|
+
/** Id del SKU en el sistema del retailer. */
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@Matches(/\S/)
|
|
38
|
+
@IsString()
|
|
39
|
+
externalId?: string;
|
|
40
|
+
|
|
41
|
+
/** Financieras que pueden financiar este SKU; vacío = no financiable. */
|
|
42
|
+
@IsOptional()
|
|
43
|
+
@IsArray()
|
|
44
|
+
@Matches(/\S/, { each: true })
|
|
45
|
+
@IsString({ each: true })
|
|
46
|
+
eligibleFinanciers?: string[];
|
|
47
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { IsArray, IsBoolean, IsEnum, IsIn, IsOptional, IsString, Length, Matches, Validate, ValidateIf } from 'class-validator';
|
|
2
|
+
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
|
+
import { NON_BUNDLE_CATEGORIES } from '../../constants/NonBundleCategories';
|
|
4
|
+
import { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
5
|
+
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
6
|
+
import { TrackingModeEnum } from '../../enums/TrackingModeEnum';
|
|
7
|
+
import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
|
|
8
|
+
import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
9
|
+
import { IsMdmCoherentConstraint } from '../../validators/IsMdmCoherentConstraint';
|
|
10
|
+
|
|
11
|
+
/** Body de POST /backoffice/catalog/products (backofficeCreateProduct); itemType PRODUCT y origen BACKOFFICE los fija el servidor. */
|
|
12
|
+
export class BackofficeCreateProductRequest {
|
|
13
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
14
|
+
@Length(1, 64)
|
|
15
|
+
@IsString()
|
|
16
|
+
sku!: string;
|
|
17
|
+
|
|
18
|
+
/** El kit (BUNDLE) se da de alta en backofficeCreateKit. */
|
|
19
|
+
@IsIn(NON_BUNDLE_CATEGORIES)
|
|
20
|
+
category!: ProductCategoryEnum;
|
|
21
|
+
|
|
22
|
+
/** Inmutable tras el alta. */
|
|
23
|
+
@IsEnum(TrackingModeEnum)
|
|
24
|
+
trackingMode!: TrackingModeEnum;
|
|
25
|
+
|
|
26
|
+
@IsBoolean()
|
|
27
|
+
sellable!: boolean;
|
|
28
|
+
|
|
29
|
+
@IsBoolean()
|
|
30
|
+
showInSalesFlow!: boolean;
|
|
31
|
+
|
|
32
|
+
@IsOptional()
|
|
33
|
+
@IsEnum(ProductTierEnum)
|
|
34
|
+
tier?: ProductTierEnum;
|
|
35
|
+
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@Matches(/\S/)
|
|
38
|
+
@IsString()
|
|
39
|
+
brand?: string;
|
|
40
|
+
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@Matches(/\S/)
|
|
43
|
+
@IsString()
|
|
44
|
+
model?: string;
|
|
45
|
+
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@Matches(/\S/)
|
|
48
|
+
@IsString()
|
|
49
|
+
capacity?: string;
|
|
50
|
+
|
|
51
|
+
@IsOptional()
|
|
52
|
+
@Matches(/\S/)
|
|
53
|
+
@IsString()
|
|
54
|
+
color?: string;
|
|
55
|
+
|
|
56
|
+
@IsOptional()
|
|
57
|
+
@Matches(/\S/)
|
|
58
|
+
@IsString()
|
|
59
|
+
description?: string;
|
|
60
|
+
|
|
61
|
+
@IsOptional()
|
|
62
|
+
@Matches(/\S/)
|
|
63
|
+
@IsString()
|
|
64
|
+
imageUrl?: string;
|
|
65
|
+
|
|
66
|
+
/** Id del SKU en el sistema del retailer. */
|
|
67
|
+
@IsOptional()
|
|
68
|
+
@Matches(/\S/)
|
|
69
|
+
@IsString()
|
|
70
|
+
externalId?: string;
|
|
71
|
+
|
|
72
|
+
/** Financieras que pueden financiar este SKU; vacío = no financiable. */
|
|
73
|
+
@IsOptional()
|
|
74
|
+
@IsArray()
|
|
75
|
+
@Matches(/\S/, { each: true })
|
|
76
|
+
@IsString({ each: true })
|
|
77
|
+
eligibleFinanciers?: string[];
|
|
78
|
+
|
|
79
|
+
/** En el alta se evalúa aunque falte: si vienen mdmProvider o mdmLockMode, exige mdmEnabled=true. */
|
|
80
|
+
@Validate(IsMdmCoherentConstraint)
|
|
81
|
+
@ValidateIf((o: BackofficeCreateProductRequest) => o.mdmEnabled != null || o.mdmProvider != null || o.mdmLockMode != null)
|
|
82
|
+
@IsBoolean()
|
|
83
|
+
mdmEnabled?: boolean;
|
|
84
|
+
|
|
85
|
+
@IsOptional()
|
|
86
|
+
@IsEnum(MdmProviderEnum)
|
|
87
|
+
mdmProvider?: MdmProviderEnum | null;
|
|
88
|
+
|
|
89
|
+
@IsOptional()
|
|
90
|
+
@IsEnum(MdmLockModeEnum)
|
|
91
|
+
mdmLockMode?: MdmLockModeEnum | null;
|
|
92
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IsBoolean, IsOptional, IsString, Length, Matches } from 'class-validator';
|
|
2
|
+
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
|
+
|
|
4
|
+
/** Body de POST /backoffice/catalog/services (backofficeCreateService); itemType SERVICE y trackingMode QUANTITY los fija el servidor. */
|
|
5
|
+
export class BackofficeCreateServiceRequest {
|
|
6
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
7
|
+
@Length(1, 64)
|
|
8
|
+
@IsString()
|
|
9
|
+
sku!: string;
|
|
10
|
+
|
|
11
|
+
@Matches(/\S/)
|
|
12
|
+
@IsString()
|
|
13
|
+
description!: string;
|
|
14
|
+
|
|
15
|
+
@IsBoolean()
|
|
16
|
+
sellable!: boolean;
|
|
17
|
+
|
|
18
|
+
@IsBoolean()
|
|
19
|
+
showInSalesFlow!: boolean;
|
|
20
|
+
|
|
21
|
+
/** Id del SKU en el sistema del retailer. */
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@Matches(/\S/)
|
|
24
|
+
@IsString()
|
|
25
|
+
externalId?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IsInt, IsOptional, Min } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/** Body de POST /backoffice/inventory/skus/{sku}/prices (backofficeCreateSkuPrice); crea un PRICE# nuevo con origen BACKOFFICE. */
|
|
4
|
+
export class BackofficeCreateSkuPriceRequest {
|
|
5
|
+
@IsInt()
|
|
6
|
+
@Min(0)
|
|
7
|
+
basePriceCents!: number;
|
|
8
|
+
|
|
9
|
+
@IsOptional()
|
|
10
|
+
@IsInt()
|
|
11
|
+
@Min(0)
|
|
12
|
+
listPriceCents?: number | null;
|
|
13
|
+
|
|
14
|
+
/** Precio dentro de un kit; se guarda, ninguna venta lo aplica. */
|
|
15
|
+
@IsOptional()
|
|
16
|
+
@IsInt()
|
|
17
|
+
@Min(0)
|
|
18
|
+
comboPriceCents?: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ArrayMinSize, ArrayUnique, IsArray, IsInt, IsOptional, IsString, Length, Matches, Min } from 'class-validator';
|
|
2
|
+
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
|
+
|
|
4
|
+
/** Body de POST /backoffice/inventory/transfers (backofficeCreateTransfer); origen = destino lo rechaza el dominio. */
|
|
5
|
+
export class BackofficeCreateTransferRequest {
|
|
6
|
+
@Matches(/^\S+$/)
|
|
7
|
+
@IsString()
|
|
8
|
+
fromStoreId!: string;
|
|
9
|
+
|
|
10
|
+
@Matches(/^\S+$/)
|
|
11
|
+
@IsString()
|
|
12
|
+
toStoreId!: string;
|
|
13
|
+
|
|
14
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
15
|
+
@Length(1, 64)
|
|
16
|
+
@IsString()
|
|
17
|
+
sku!: string;
|
|
18
|
+
|
|
19
|
+
@IsInt()
|
|
20
|
+
@Min(1)
|
|
21
|
+
qty!: number;
|
|
22
|
+
|
|
23
|
+
/** IMEI o serie de cada pieza; ausente si el SKU se rastrea por cantidad. */
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@IsArray()
|
|
26
|
+
@ArrayMinSize(1)
|
|
27
|
+
@ArrayUnique()
|
|
28
|
+
@Matches(/^\S+$/, { each: true })
|
|
29
|
+
@IsString({ each: true })
|
|
30
|
+
identifiers?: string[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IsEnum, IsOptional } from 'class-validator';
|
|
2
|
+
import { TransferStateEnum } from '../../enums/TransferStateEnum';
|
|
3
|
+
|
|
4
|
+
/** Query de GET /backoffice/inventory/transfers (backofficeListTransfers); el retailer sale del token. */
|
|
5
|
+
export class BackofficeListTransfersQuery {
|
|
6
|
+
@IsOptional()
|
|
7
|
+
@IsEnum(TransferStateEnum)
|
|
8
|
+
state?: TransferStateEnum;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ArrayMinSize, ArrayUnique, IsArray, IsIn, IsInt, IsOptional, IsString, Length, Matches, Min } from 'class-validator';
|
|
2
|
+
import { ADJUSTMENT_REASONS } from '../../constants/AdjustmentReasons';
|
|
3
|
+
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
4
|
+
import { InventoryMovementReasonEnum } from '../../enums/InventoryMovementReasonEnum';
|
|
5
|
+
|
|
6
|
+
/** Body de POST /backoffice/inventory/adjustments (backofficeRegisterAdjustment); resta del disponible con motivo. */
|
|
7
|
+
export class BackofficeRegisterAdjustmentRequest {
|
|
8
|
+
/** Debe pertenecer al retailer del token. */
|
|
9
|
+
@Matches(/^\S+$/)
|
|
10
|
+
@IsString()
|
|
11
|
+
storeId!: string;
|
|
12
|
+
|
|
13
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
14
|
+
@Length(1, 64)
|
|
15
|
+
@IsString()
|
|
16
|
+
sku!: string;
|
|
17
|
+
|
|
18
|
+
@IsInt()
|
|
19
|
+
@Min(1)
|
|
20
|
+
qty!: number;
|
|
21
|
+
|
|
22
|
+
/** DAMAGED_RETURN no aplica: lo genera la devolución, no el admin. */
|
|
23
|
+
@IsIn(ADJUSTMENT_REASONS)
|
|
24
|
+
reason!: InventoryMovementReasonEnum;
|
|
25
|
+
|
|
26
|
+
/** IMEI o serie de cada pieza; ausente si el SKU se rastrea por cantidad. */
|
|
27
|
+
@IsOptional()
|
|
28
|
+
@IsArray()
|
|
29
|
+
@ArrayMinSize(1)
|
|
30
|
+
@ArrayUnique()
|
|
31
|
+
@Matches(/^\S+$/, { each: true })
|
|
32
|
+
@IsString({ each: true })
|
|
33
|
+
identifiers?: string[];
|
|
34
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ArrayMinSize, ArrayUnique, IsArray, IsInt, IsOptional, IsString, Length, Matches, Min } from 'class-validator';
|
|
2
|
+
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
3
|
+
|
|
4
|
+
/** Body de POST /backoffice/inventory/entries (backofficeRegisterEntry); suma al saldo de la tienda con un MOV# ENTRY. */
|
|
5
|
+
export class BackofficeRegisterEntryRequest {
|
|
6
|
+
/** Debe pertenecer al retailer del token. */
|
|
7
|
+
@Matches(/^\S+$/)
|
|
8
|
+
@IsString()
|
|
9
|
+
storeId!: string;
|
|
10
|
+
|
|
11
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
12
|
+
@Length(1, 64)
|
|
13
|
+
@IsString()
|
|
14
|
+
sku!: string;
|
|
15
|
+
|
|
16
|
+
@IsInt()
|
|
17
|
+
@Min(1)
|
|
18
|
+
qty!: number;
|
|
19
|
+
|
|
20
|
+
/** IMEI o serie de cada pieza; ausente si el SKU se rastrea por cantidad. */
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsArray()
|
|
23
|
+
@ArrayMinSize(1)
|
|
24
|
+
@ArrayUnique()
|
|
25
|
+
@Matches(/^\S+$/, { each: true })
|
|
26
|
+
@IsString({ each: true })
|
|
27
|
+
identifiers?: string[];
|
|
28
|
+
}
|