@fiado/type-kit 3.464.0 → 3.466.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/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/bin/remittance/enums/RemittanceCorridor.d.ts +6 -5
- package/bin/remittance/enums/RemittanceCorridor.js +6 -4
- 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/package.json +1 -1
- package/src/remittance/enums/RemittanceCorridor.ts +6 -4
- 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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransferStateEnum = void 0;
|
|
4
|
+
/** Estado de un traspaso entre tiendas (TRF#); solo uno OPEN se recibe o cancela. */
|
|
5
|
+
var TransferStateEnum;
|
|
6
|
+
(function (TransferStateEnum) {
|
|
7
|
+
TransferStateEnum["OPEN"] = "OPEN";
|
|
8
|
+
TransferStateEnum["RECEIVED"] = "RECEIVED";
|
|
9
|
+
TransferStateEnum["CANCELLED"] = "CANCELLED";
|
|
10
|
+
})(TransferStateEnum || (exports.TransferStateEnum = TransferStateEnum = {}));
|
|
@@ -7,7 +7,10 @@ export * from './enums/InventoryLensFilterEnum';
|
|
|
7
7
|
export * from './enums/InventoryLensUnavailableReasonEnum';
|
|
8
8
|
export * from './enums/InventoryTransferReasonEnum';
|
|
9
9
|
export * from './constants/SkuPattern';
|
|
10
|
+
export * from './constants/NonBundleCategories';
|
|
11
|
+
export * from './constants/AdjustmentReasons';
|
|
10
12
|
export * from './validators/IsMdmCoherentConstraint';
|
|
13
|
+
export * from './validators/IsPieceRefConstraint';
|
|
11
14
|
export * from './dtos/Product';
|
|
12
15
|
export * from './dtos/InventoryItem';
|
|
13
16
|
export * from './dtos/requests/CreateProductRequest';
|
|
@@ -35,6 +38,8 @@ export * from './enums/InventoryLensPeriodEnum';
|
|
|
35
38
|
export * from './dtos/ProductComponent';
|
|
36
39
|
export * from './dtos/requests/ReservationLineRef';
|
|
37
40
|
export * from './dtos/requests/StockLine';
|
|
41
|
+
export * from './dtos/requests/ReturnPieceCondition';
|
|
42
|
+
export * from './dtos/requests/ReturnStockLine';
|
|
38
43
|
export * from './dtos/requests/ReserveStockRequest';
|
|
39
44
|
export * from './dtos/requests/RenewReservationsRequest';
|
|
40
45
|
export * from './dtos/requests/SuggestPiecesQuery';
|
|
@@ -54,3 +59,18 @@ export * from './dtos/responses/StoreCatalogItem';
|
|
|
54
59
|
export * from './dtos/responses/SkuPriceEntry';
|
|
55
60
|
export * from './dtos/responses/GetInventorySkuResponse';
|
|
56
61
|
export * from './dtos/responses/ListSkuPricesResponse';
|
|
62
|
+
export * from './enums/ItemTypeEnum';
|
|
63
|
+
export * from './enums/ReturnConditionEnum';
|
|
64
|
+
export * from './enums/TransferStateEnum';
|
|
65
|
+
export * from './enums/InventoryMovementReasonEnum';
|
|
66
|
+
export * from './dtos/requests/BackofficeCreateProductRequest';
|
|
67
|
+
export * from './dtos/requests/BackofficeCreateKitRequest';
|
|
68
|
+
export * from './dtos/requests/BackofficeCreateServiceRequest';
|
|
69
|
+
export * from './dtos/requests/BackofficeUpdateProductRequest';
|
|
70
|
+
export * from './dtos/requests/BackofficeCreateSkuPriceRequest';
|
|
71
|
+
export * from './dtos/requests/BackofficeRegisterEntryRequest';
|
|
72
|
+
export * from './dtos/requests/BackofficeRegisterAdjustmentRequest';
|
|
73
|
+
export * from './dtos/requests/BackofficeCreateTransferRequest';
|
|
74
|
+
export * from './dtos/requests/BackofficeListTransfersQuery';
|
|
75
|
+
export * from './dtos/responses/TransferResponse';
|
|
76
|
+
export * from './dtos/responses/ListTransfersResponse';
|
|
@@ -25,8 +25,11 @@ __exportStar(require("./enums/InventoryLensUnavailableReasonEnum"), exports);
|
|
|
25
25
|
__exportStar(require("./enums/InventoryTransferReasonEnum"), exports);
|
|
26
26
|
// Constantes del dominio
|
|
27
27
|
__exportStar(require("./constants/SkuPattern"), exports);
|
|
28
|
+
__exportStar(require("./constants/NonBundleCategories"), exports);
|
|
29
|
+
__exportStar(require("./constants/AdjustmentReasons"), exports);
|
|
28
30
|
// Validators custom
|
|
29
31
|
__exportStar(require("./validators/IsMdmCoherentConstraint"), exports);
|
|
32
|
+
__exportStar(require("./validators/IsPieceRefConstraint"), exports);
|
|
30
33
|
// Entity DTOs
|
|
31
34
|
__exportStar(require("./dtos/Product"), exports);
|
|
32
35
|
__exportStar(require("./dtos/InventoryItem"), exports);
|
|
@@ -59,6 +62,8 @@ __exportStar(require("./enums/InventoryLensPeriodEnum"), exports);
|
|
|
59
62
|
__exportStar(require("./dtos/ProductComponent"), exports);
|
|
60
63
|
__exportStar(require("./dtos/requests/ReservationLineRef"), exports);
|
|
61
64
|
__exportStar(require("./dtos/requests/StockLine"), exports);
|
|
65
|
+
__exportStar(require("./dtos/requests/ReturnPieceCondition"), exports);
|
|
66
|
+
__exportStar(require("./dtos/requests/ReturnStockLine"), exports);
|
|
62
67
|
__exportStar(require("./dtos/requests/ReserveStockRequest"), exports);
|
|
63
68
|
__exportStar(require("./dtos/requests/RenewReservationsRequest"), exports);
|
|
64
69
|
__exportStar(require("./dtos/requests/SuggestPiecesQuery"), exports);
|
|
@@ -78,3 +83,19 @@ __exportStar(require("./dtos/responses/StoreCatalogItem"), exports);
|
|
|
78
83
|
__exportStar(require("./dtos/responses/SkuPriceEntry"), exports);
|
|
79
84
|
__exportStar(require("./dtos/responses/GetInventorySkuResponse"), exports);
|
|
80
85
|
__exportStar(require("./dtos/responses/ListSkuPricesResponse"), exports);
|
|
86
|
+
// Operación independiente (ciclo 2)
|
|
87
|
+
__exportStar(require("./enums/ItemTypeEnum"), exports);
|
|
88
|
+
__exportStar(require("./enums/ReturnConditionEnum"), exports);
|
|
89
|
+
__exportStar(require("./enums/TransferStateEnum"), exports);
|
|
90
|
+
__exportStar(require("./enums/InventoryMovementReasonEnum"), exports);
|
|
91
|
+
__exportStar(require("./dtos/requests/BackofficeCreateProductRequest"), exports);
|
|
92
|
+
__exportStar(require("./dtos/requests/BackofficeCreateKitRequest"), exports);
|
|
93
|
+
__exportStar(require("./dtos/requests/BackofficeCreateServiceRequest"), exports);
|
|
94
|
+
__exportStar(require("./dtos/requests/BackofficeUpdateProductRequest"), exports);
|
|
95
|
+
__exportStar(require("./dtos/requests/BackofficeCreateSkuPriceRequest"), exports);
|
|
96
|
+
__exportStar(require("./dtos/requests/BackofficeRegisterEntryRequest"), exports);
|
|
97
|
+
__exportStar(require("./dtos/requests/BackofficeRegisterAdjustmentRequest"), exports);
|
|
98
|
+
__exportStar(require("./dtos/requests/BackofficeCreateTransferRequest"), exports);
|
|
99
|
+
__exportStar(require("./dtos/requests/BackofficeListTransfersQuery"), exports);
|
|
100
|
+
__exportStar(require("./dtos/responses/TransferResponse"), exports);
|
|
101
|
+
__exportStar(require("./dtos/responses/ListTransfersResponse"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ValidationArguments, type ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
/** Exige identifier (pieza con IMEI o serie) o qty (SKU por cantidad), nunca los dos. */
|
|
3
|
+
export declare class IsPieceRefConstraint implements ValidatorConstraintInterface {
|
|
4
|
+
validate(identifier: unknown, args: ValidationArguments): boolean;
|
|
5
|
+
defaultMessage(): string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsPieceRefConstraint = void 0;
|
|
10
|
+
const class_validator_1 = require("class-validator");
|
|
11
|
+
/** Exige identifier (pieza con IMEI o serie) o qty (SKU por cantidad), nunca los dos. */
|
|
12
|
+
let IsPieceRefConstraint = class IsPieceRefConstraint {
|
|
13
|
+
validate(identifier, args) {
|
|
14
|
+
const { qty } = args.object;
|
|
15
|
+
if (qty !== undefined)
|
|
16
|
+
return identifier === undefined;
|
|
17
|
+
return typeof identifier === 'string' && /^\S+$/.test(identifier);
|
|
18
|
+
}
|
|
19
|
+
defaultMessage() {
|
|
20
|
+
return 'identifier (pieza con IMEI o serie) o qty (por cantidad), exactamente uno';
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.IsPieceRefConstraint = IsPieceRefConstraint;
|
|
24
|
+
exports.IsPieceRefConstraint = IsPieceRefConstraint = __decorate([
|
|
25
|
+
(0, class_validator_1.ValidatorConstraint)({ name: 'isPieceRef', async: false })
|
|
26
|
+
], IsPieceRefConstraint);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnPieceCondition } from '../../../retailCatalog/dtos/requests/ReturnPieceCondition';
|
|
1
2
|
/**
|
|
2
3
|
* POST /backoffice/sales/:saleId/cancel — cancelación del Admin VL. SureKeep Fase 3 — pista Retail.
|
|
3
4
|
*
|
|
@@ -23,4 +24,6 @@ export declare class BackofficeCancelSaleRequest {
|
|
|
23
24
|
* la venta YA está fuera de ventana; dentro de ventana se ignora.
|
|
24
25
|
*/
|
|
25
26
|
outOfWindowExceptionId?: string;
|
|
27
|
+
/** Condición de cada pieza que regresa al inventario; las no listadas vuelven GOOD. */
|
|
28
|
+
returnConditions?: ReturnPieceCondition[];
|
|
26
29
|
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.BackofficeCancelSaleRequest = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const ReturnPieceCondition_1 = require("../../../retailCatalog/dtos/requests/ReturnPieceCondition");
|
|
15
16
|
/**
|
|
16
17
|
* POST /backoffice/sales/:saleId/cancel — cancelación del Admin VL. SureKeep Fase 3 — pista Retail.
|
|
17
18
|
*
|
|
@@ -46,3 +47,11 @@ __decorate([
|
|
|
46
47
|
(0, class_validator_1.MaxLength)(64),
|
|
47
48
|
__metadata("design:type", String)
|
|
48
49
|
], BackofficeCancelSaleRequest.prototype, "outOfWindowExceptionId", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_transformer_1.Expose)(),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsArray)(),
|
|
54
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
55
|
+
(0, class_transformer_1.Type)(() => ReturnPieceCondition_1.ReturnPieceCondition),
|
|
56
|
+
__metadata("design:type", Array)
|
|
57
|
+
], BackofficeCancelSaleRequest.prototype, "returnConditions", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnPieceCondition } from '../../../retailCatalog/dtos/requests/ReturnPieceCondition';
|
|
1
2
|
/**
|
|
2
3
|
* POST /sales/:saleId/cancel — cancela una venta (flujo C, solo BO dentro de ventana param). `reason`
|
|
3
4
|
* OBLIGATORIO (AuditTrail). Retorna el IMEI al silo (`SOLD → AVAILABLE`) y emite `SaleCancelledV1`.
|
|
@@ -19,4 +20,6 @@ export declare class CancelSaleRequest {
|
|
|
19
20
|
* que el string `"false"` se rechaza en vez de colarse como truthy.
|
|
20
21
|
*/
|
|
21
22
|
equipmentVerified?: boolean;
|
|
23
|
+
/** Condición de cada pieza que regresa al inventario; las no listadas vuelven GOOD. */
|
|
24
|
+
returnConditions?: ReturnPieceCondition[];
|
|
22
25
|
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CancelSaleRequest = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const ReturnPieceCondition_1 = require("../../../retailCatalog/dtos/requests/ReturnPieceCondition");
|
|
15
16
|
/**
|
|
16
17
|
* POST /sales/:saleId/cancel — cancela una venta (flujo C, solo BO dentro de ventana param). `reason`
|
|
17
18
|
* OBLIGATORIO (AuditTrail). Retorna el IMEI al silo (`SOLD → AVAILABLE`) y emite `SaleCancelledV1`.
|
|
@@ -32,3 +33,11 @@ __decorate([
|
|
|
32
33
|
(0, class_validator_1.IsBoolean)(),
|
|
33
34
|
__metadata("design:type", Boolean)
|
|
34
35
|
], CancelSaleRequest.prototype, "equipmentVerified", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_transformer_1.Expose)(),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsArray)(),
|
|
40
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
41
|
+
(0, class_transformer_1.Type)(() => ReturnPieceCondition_1.ReturnPieceCondition),
|
|
42
|
+
__metadata("design:type", Array)
|
|
43
|
+
], CancelSaleRequest.prototype, "returnConditions", void 0);
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Corredores de remesa soportados (Dashboard Ops · Variables Operativas).
|
|
3
3
|
*
|
|
4
|
-
* D-PB-3: nomenclatura por MONEDA ISO-4217 (`USD-<destino>`). `USD_SVC`
|
|
5
|
-
*
|
|
6
|
-
* como "USD-USD"
|
|
7
|
-
* transacciones usa countryISO (no ambiguo).
|
|
4
|
+
* D-PB-3: nomenclatura por MONEDA ISO-4217 (`USD-<destino>`). `USD_SVC` (El Salvador)
|
|
5
|
+
* y `USD_NIC` (Nicaragua) son símbolos: su payout real es USD y usar la moneda
|
|
6
|
+
* colisionaría como "USD-USD". Por eso el destino real vive en CORRIDOR_INFO y el
|
|
7
|
+
* filtro de transacciones usa countryISO (no ambiguo).
|
|
8
8
|
*/
|
|
9
9
|
export enum RemittanceCorridor {
|
|
10
10
|
USD_GTQ = "USD-GTQ",
|
|
11
11
|
USD_MXN = "USD-MXN",
|
|
12
12
|
USD_HNL = "USD-HNL",
|
|
13
13
|
USD_SVC = "USD-SVC",
|
|
14
|
+
USD_NIC = "USD-NIC",
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
/** Destino real del corredor. El filtro de tx usa countryISO; currencyISO es el payout. */
|
|
@@ -19,4 +20,5 @@ export const CORRIDOR_INFO: Record<RemittanceCorridor, { countryISO: string; cur
|
|
|
19
20
|
[RemittanceCorridor.USD_MXN]: { countryISO: "MX", currencyISO: "MXN" },
|
|
20
21
|
[RemittanceCorridor.USD_HNL]: { countryISO: "HN", currencyISO: "HNL" },
|
|
21
22
|
[RemittanceCorridor.USD_SVC]: { countryISO: "SV", currencyISO: "USD" },
|
|
23
|
+
[RemittanceCorridor.USD_NIC]: { countryISO: "NI", currencyISO: "USD" },
|
|
22
24
|
};
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsBoolean, IsEnum, IsIn, IsOptional, IsString, Matches, Validate, ValidateNested } from 'class-validator';
|
|
3
|
+
import { NON_BUNDLE_CATEGORIES } from '../../constants/NonBundleCategories';
|
|
4
|
+
import { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
5
|
+
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
6
|
+
import { ProductComponent } from '../ProductComponent';
|
|
7
|
+
import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
|
|
8
|
+
import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
9
|
+
import { IsMdmCoherentConstraint } from '../../validators/IsMdmCoherentConstraint';
|
|
10
|
+
|
|
11
|
+
/** Body de PATCH /backoffice/inventory/skus/{sku} (backofficeUpdateProduct); parcial, sin itemType ni trackingMode (inmutables) ni precio. */
|
|
12
|
+
export class BackofficeUpdateProductRequest {
|
|
13
|
+
@IsOptional()
|
|
14
|
+
@IsIn(NON_BUNDLE_CATEGORIES)
|
|
15
|
+
category?: ProductCategoryEnum;
|
|
16
|
+
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsBoolean()
|
|
19
|
+
sellable?: boolean;
|
|
20
|
+
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsBoolean()
|
|
23
|
+
showInSalesFlow?: boolean;
|
|
24
|
+
|
|
25
|
+
/** Solo en kits; reemplaza la lista completa sin tocar los apartados vivos. */
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsArray()
|
|
28
|
+
@ArrayMinSize(1)
|
|
29
|
+
@ValidateNested({ each: true })
|
|
30
|
+
@Type(() => ProductComponent)
|
|
31
|
+
components?: ProductComponent[];
|
|
32
|
+
|
|
33
|
+
@IsOptional()
|
|
34
|
+
@IsEnum(ProductTierEnum)
|
|
35
|
+
tier?: ProductTierEnum;
|
|
36
|
+
|
|
37
|
+
@IsOptional()
|
|
38
|
+
@Matches(/\S/)
|
|
39
|
+
@IsString()
|
|
40
|
+
brand?: string;
|
|
41
|
+
|
|
42
|
+
@IsOptional()
|
|
43
|
+
@Matches(/\S/)
|
|
44
|
+
@IsString()
|
|
45
|
+
model?: string;
|
|
46
|
+
|
|
47
|
+
@IsOptional()
|
|
48
|
+
@Matches(/\S/)
|
|
49
|
+
@IsString()
|
|
50
|
+
capacity?: string;
|
|
51
|
+
|
|
52
|
+
@IsOptional()
|
|
53
|
+
@Matches(/\S/)
|
|
54
|
+
@IsString()
|
|
55
|
+
color?: string;
|
|
56
|
+
|
|
57
|
+
@IsOptional()
|
|
58
|
+
@Matches(/\S/)
|
|
59
|
+
@IsString()
|
|
60
|
+
description?: string;
|
|
61
|
+
|
|
62
|
+
@IsOptional()
|
|
63
|
+
@Matches(/\S/)
|
|
64
|
+
@IsString()
|
|
65
|
+
imageUrl?: string;
|
|
66
|
+
|
|
67
|
+
/** Id del SKU en el sistema del retailer. */
|
|
68
|
+
@IsOptional()
|
|
69
|
+
@Matches(/\S/)
|
|
70
|
+
@IsString()
|
|
71
|
+
externalId?: string;
|
|
72
|
+
|
|
73
|
+
/** Financieras que pueden financiar este SKU; vacío = no financiable. */
|
|
74
|
+
@IsOptional()
|
|
75
|
+
@IsArray()
|
|
76
|
+
@Matches(/\S/, { each: true })
|
|
77
|
+
@IsString({ each: true })
|
|
78
|
+
eligibleFinanciers?: string[];
|
|
79
|
+
|
|
80
|
+
// PATCH parcial: la coherencia contra el producto guardado la valida el dominio.
|
|
81
|
+
@Validate(IsMdmCoherentConstraint)
|
|
82
|
+
@IsOptional()
|
|
83
|
+
@IsBoolean()
|
|
84
|
+
mdmEnabled?: boolean;
|
|
85
|
+
|
|
86
|
+
@IsOptional()
|
|
87
|
+
@IsEnum(MdmProviderEnum)
|
|
88
|
+
mdmProvider?: MdmProviderEnum | null;
|
|
89
|
+
|
|
90
|
+
@IsOptional()
|
|
91
|
+
@IsEnum(MdmLockModeEnum)
|
|
92
|
+
mdmLockMode?: MdmLockModeEnum | null;
|
|
93
|
+
}
|
|
@@ -4,6 +4,7 @@ import { InventoryItemStatusEnum } from '../../enums/InventoryItemStatusEnum';
|
|
|
4
4
|
/**
|
|
5
5
|
* Body de PUT /retailers/:retailerId/inventory/:imei/status — cambio manual de estado.
|
|
6
6
|
* Acotado a RETURNED | DAMAGED (los otros estados los mueve la máquina de venta, no el operador).
|
|
7
|
+
* @deprecated Modelo viejo por IMEI; usar BackofficeRegisterAdjustmentRequest. Se conserva porque otras ramas lo importan.
|
|
7
8
|
*/
|
|
8
9
|
export class ChangeInventoryStatusRequest {
|
|
9
10
|
@IsIn([InventoryItemStatusEnum.RETURNED, InventoryItemStatusEnum.DAMAGED])
|