@fiado/type-kit 3.460.0 → 3.461.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/catalogEnums.test.ts +34 -0
- package/_test_/unit/retailCatalog/stockRequests.test.ts +156 -0
- package/_test_/unit/retailWizard/multiItemRequests.test.ts +114 -0
- package/_test_/unit/retailWizard/multiItemShapes.test.ts +126 -0
- package/bin/retailCatalog/dtos/Product.d.ts +15 -1
- package/bin/retailCatalog/dtos/ProductComponent.d.ts +5 -0
- package/bin/retailCatalog/dtos/ProductComponent.js +29 -0
- package/bin/retailCatalog/dtos/requests/GetInventorySkuQuery.d.ts +10 -0
- package/bin/retailCatalog/dtos/requests/GetInventorySkuQuery.js +42 -0
- package/bin/retailCatalog/dtos/requests/InventoryLensQuery.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/InventoryLensQuery.js +11 -0
- package/bin/retailCatalog/dtos/requests/ReleaseStockRequest.d.ts +8 -0
- package/bin/retailCatalog/dtos/requests/ReleaseStockRequest.js +34 -0
- package/bin/retailCatalog/dtos/requests/RenewReservationsRequest.d.ts +6 -0
- package/bin/retailCatalog/dtos/requests/RenewReservationsRequest.js +30 -0
- package/bin/retailCatalog/dtos/requests/ReservationLineRef.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/ReservationLineRef.js +25 -0
- package/bin/retailCatalog/dtos/requests/ReserveStockRequest.d.ts +10 -0
- package/bin/retailCatalog/dtos/requests/ReserveStockRequest.js +42 -0
- package/bin/retailCatalog/dtos/requests/ReturnStockRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/ReturnStockRequest.js +38 -0
- package/bin/retailCatalog/dtos/requests/SellStockRequest.d.ts +7 -0
- package/bin/retailCatalog/dtos/requests/SellStockRequest.js +34 -0
- package/bin/retailCatalog/dtos/requests/StockLine.d.ts +14 -0
- package/bin/retailCatalog/dtos/requests/StockLine.js +56 -0
- package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.js +26 -0
- package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.d.ts +47 -0
- package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.js +173 -0
- package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.d.ts +34 -0
- package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/InventoryLensResponse.d.ts +43 -2
- package/bin/retailCatalog/dtos/responses/ListSkuPricesResponse.d.ts +6 -0
- package/bin/retailCatalog/dtos/responses/ListSkuPricesResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/ReleaseStockResponse.d.ts +10 -0
- package/bin/retailCatalog/dtos/responses/ReleaseStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/RenewReservationsResponse.d.ts +10 -0
- package/bin/retailCatalog/dtos/responses/RenewReservationsResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/ReserveStockResponse.d.ts +25 -0
- package/bin/retailCatalog/dtos/responses/ReserveStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/ReturnStockResponse.d.ts +4 -0
- package/bin/retailCatalog/dtos/responses/ReturnStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/SellStockResponse.d.ts +18 -0
- package/bin/retailCatalog/dtos/responses/SellStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/SkuPriceEntry.d.ts +9 -0
- package/bin/retailCatalog/dtos/responses/SkuPriceEntry.js +2 -0
- package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +29 -0
- package/bin/retailCatalog/dtos/responses/StoreCatalogItem.js +2 -0
- package/bin/retailCatalog/dtos/responses/SuggestPiecesResponse.d.ts +6 -0
- package/bin/retailCatalog/dtos/responses/SuggestPiecesResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/SyncInventoryResponse.d.ts +13 -0
- package/bin/retailCatalog/dtos/responses/SyncInventoryResponse.js +2 -0
- package/bin/retailCatalog/dtos/validation/ValidateProductResponse.d.ts +6 -1
- package/bin/retailCatalog/enums/InventoryLensFilterEnum.d.ts +3 -1
- package/bin/retailCatalog/enums/InventoryLensFilterEnum.js +2 -0
- package/bin/retailCatalog/enums/InventoryLensPeriodEnum.d.ts +7 -0
- package/bin/retailCatalog/enums/InventoryLensPeriodEnum.js +11 -0
- package/bin/retailCatalog/enums/InventoryMovementTypeEnum.d.ts +9 -0
- package/bin/retailCatalog/enums/InventoryMovementTypeEnum.js +13 -0
- package/bin/retailCatalog/enums/InventorySyncRejectionCodeEnum.d.ts +9 -0
- package/bin/retailCatalog/enums/InventorySyncRejectionCodeEnum.js +13 -0
- package/bin/retailCatalog/enums/InventorySyncResultStatusEnum.d.ts +6 -0
- package/bin/retailCatalog/enums/InventorySyncResultStatusEnum.js +10 -0
- package/bin/retailCatalog/enums/PriceSourceEnum.d.ts +4 -0
- package/bin/retailCatalog/enums/PriceSourceEnum.js +8 -0
- package/bin/retailCatalog/enums/ProductCategoryEnum.d.ts +9 -0
- package/bin/retailCatalog/enums/ProductCategoryEnum.js +13 -0
- package/bin/retailCatalog/enums/TrackingModeEnum.d.ts +6 -0
- package/bin/retailCatalog/enums/TrackingModeEnum.js +10 -0
- package/bin/retailCatalog/index.d.ts +29 -0
- package/bin/retailCatalog/index.js +30 -0
- package/bin/retailWizard/dtos/Sale.d.ts +7 -0
- package/bin/retailWizard/dtos/SaleLine.d.ts +16 -0
- package/bin/retailWizard/dtos/SaleLine.js +2 -0
- package/bin/retailWizard/dtos/WizardLineIdentifiers.d.ts +5 -0
- package/bin/retailWizard/dtos/WizardLineIdentifiers.js +2 -0
- package/bin/retailWizard/dtos/WizardLineProduct.d.ts +15 -0
- package/bin/retailWizard/dtos/WizardLineProduct.js +2 -0
- package/bin/retailWizard/dtos/WizardProduct.d.ts +6 -0
- package/bin/retailWizard/dtos/WizardReservedLine.d.ts +35 -0
- package/bin/retailWizard/dtos/WizardReservedLine.js +2 -0
- package/bin/retailWizard/dtos/WizardSession.d.ts +5 -0
- package/bin/retailWizard/dtos/requests/AddProductRequest.d.ts +4 -8
- package/bin/retailWizard/dtos/requests/AddProductRequest.js +9 -8
- package/bin/retailWizard/dtos/requests/CompleteSaleRequest.d.ts +16 -0
- package/bin/retailWizard/dtos/requests/CompleteSaleRequest.js +59 -0
- package/bin/retailWizard/dtos/requests/DeleteProductRequest.d.ts +3 -1
- package/bin/retailWizard/dtos/requests/DeleteProductRequest.js +7 -1
- package/bin/retailWizard/dtos/requests/QuoteRequest.d.ts +2 -0
- package/bin/retailWizard/dtos/requests/QuoteRequest.js +7 -0
- package/bin/retailWizard/dtos/requests/SuggestIdentifiersQuery.d.ts +5 -0
- package/bin/retailWizard/dtos/requests/SuggestIdentifiersQuery.js +30 -0
- package/bin/retailWizard/enums/LinePaymentTypeEnum.d.ts +7 -0
- package/bin/retailWizard/enums/LinePaymentTypeEnum.js +11 -0
- package/bin/retailWizard/enums/WizardLineStatusEnum.d.ts +9 -0
- package/bin/retailWizard/enums/WizardLineStatusEnum.js +13 -0
- package/bin/retailWizard/index.d.ts +8 -0
- package/bin/retailWizard/index.js +8 -0
- package/package.json +1 -1
- package/src/retailCatalog/dtos/Product.ts +17 -1
- package/src/retailCatalog/dtos/ProductComponent.ts +14 -0
- package/src/retailCatalog/dtos/requests/GetInventorySkuQuery.ts +27 -0
- package/src/retailCatalog/dtos/requests/InventoryLensQuery.ts +12 -1
- package/src/retailCatalog/dtos/requests/ReleaseStockRequest.ts +19 -0
- package/src/retailCatalog/dtos/requests/RenewReservationsRequest.ts +15 -0
- package/src/retailCatalog/dtos/requests/ReservationLineRef.ts +10 -0
- package/src/retailCatalog/dtos/requests/ReserveStockRequest.ts +24 -0
- package/src/retailCatalog/dtos/requests/ReturnStockRequest.ts +22 -0
- package/src/retailCatalog/dtos/requests/SellStockRequest.ts +18 -0
- package/src/retailCatalog/dtos/requests/StockLine.ts +36 -0
- package/src/retailCatalog/dtos/requests/SuggestPiecesQuery.ts +11 -0
- package/src/retailCatalog/dtos/requests/SyncInventoryRequest.ts +145 -0
- package/src/retailCatalog/dtos/responses/GetInventorySkuResponse.ts +38 -0
- package/src/retailCatalog/dtos/responses/InventoryLensResponse.ts +48 -2
- package/src/retailCatalog/dtos/responses/ListSkuPricesResponse.ts +7 -0
- package/src/retailCatalog/dtos/responses/ReleaseStockResponse.ts +11 -0
- package/src/retailCatalog/dtos/responses/RenewReservationsResponse.ts +11 -0
- package/src/retailCatalog/dtos/responses/ReserveStockResponse.ts +27 -0
- package/src/retailCatalog/dtos/responses/ReturnStockResponse.ts +4 -0
- package/src/retailCatalog/dtos/responses/SellStockResponse.ts +20 -0
- package/src/retailCatalog/dtos/responses/SkuPriceEntry.ts +10 -0
- package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +31 -0
- package/src/retailCatalog/dtos/responses/SuggestPiecesResponse.ts +7 -0
- package/src/retailCatalog/dtos/responses/SyncInventoryResponse.ts +15 -0
- package/src/retailCatalog/dtos/validation/ValidateProductResponse.ts +6 -1
- package/src/retailCatalog/enums/InventoryLensFilterEnum.ts +2 -0
- package/src/retailCatalog/enums/InventoryLensPeriodEnum.ts +7 -0
- package/src/retailCatalog/enums/InventoryMovementTypeEnum.ts +9 -0
- package/src/retailCatalog/enums/InventorySyncRejectionCodeEnum.ts +9 -0
- package/src/retailCatalog/enums/InventorySyncResultStatusEnum.ts +6 -0
- package/src/retailCatalog/enums/PriceSourceEnum.ts +4 -0
- package/src/retailCatalog/enums/ProductCategoryEnum.ts +9 -0
- package/src/retailCatalog/enums/TrackingModeEnum.ts +6 -0
- package/src/retailCatalog/index.ts +31 -0
- package/src/retailWizard/dtos/Sale.ts +7 -0
- package/src/retailWizard/dtos/SaleLine.ts +17 -0
- package/src/retailWizard/dtos/WizardLineIdentifiers.ts +5 -0
- package/src/retailWizard/dtos/WizardLineProduct.ts +16 -0
- package/src/retailWizard/dtos/WizardProduct.ts +7 -0
- package/src/retailWizard/dtos/WizardReservedLine.ts +36 -0
- package/src/retailWizard/dtos/WizardSession.ts +5 -0
- package/src/retailWizard/dtos/requests/AddProductRequest.ts +9 -8
- package/src/retailWizard/dtos/requests/CompleteSaleRequest.ts +41 -0
- package/src/retailWizard/dtos/requests/DeleteProductRequest.ts +7 -1
- package/src/retailWizard/dtos/requests/QuoteRequest.ts +8 -1
- package/src/retailWizard/dtos/requests/SuggestIdentifiersQuery.ts +15 -0
- package/src/retailWizard/enums/LinePaymentTypeEnum.ts +7 -0
- package/src/retailWizard/enums/WizardLineStatusEnum.ts +9 -0
- package/src/retailWizard/index.ts +8 -0
|
@@ -13,14 +13,8 @@ exports.AddProductRequest = void 0;
|
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
/**
|
|
16
|
-
* POST /wizard/sessions/:id/product —
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `imei` y `cashPriceCents` son OPCIONALES a propósito: la unidad física y el precio son AUTORIDAD DEL
|
|
20
|
-
* SERVIDOR. Con solo el `sku`, el wizard elige una unidad disponible del catálogo y toma su precio (el
|
|
21
|
-
* cliente NUNCA dicta el monto a cobrar — `cashPriceCents` ancla el cobro con `amountCents == cashPrice`).
|
|
22
|
-
* Si el caller manda `imei`, el server puede honrar esa unidad, pero el precio SIEMPRE sale del catálogo.
|
|
23
|
-
* SureKeep Fase 2 — pista Retail.
|
|
16
|
+
* POST /wizard/sessions/:id/product — agrega una línea a la venta y reserva sus piezas en el catálogo.
|
|
17
|
+
* `imei` y `cashPriceCents` son opcionales: la pieza y el precio los decide el servidor.
|
|
24
18
|
*/
|
|
25
19
|
class AddProductRequest {
|
|
26
20
|
}
|
|
@@ -43,3 +37,10 @@ __decorate([
|
|
|
43
37
|
(0, class_validator_1.Min)(0),
|
|
44
38
|
__metadata("design:type", Number)
|
|
45
39
|
], AddProductRequest.prototype, "cashPriceCents", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Expose)(),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
(0, class_validator_1.IsInt)(),
|
|
44
|
+
(0, class_validator_1.Min)(1),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], AddProductRequest.prototype, "qty", void 0);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Identificadores capturados en la entrega para un SKU de la línea (componente si es kit). */
|
|
2
|
+
export declare class CompleteSaleLineComponent {
|
|
3
|
+
sku: string;
|
|
4
|
+
/** Vacío si el SKU se rastrea por cantidad. */
|
|
5
|
+
identifiers: string[];
|
|
6
|
+
}
|
|
7
|
+
/** Línea de la sesión con los identificadores de sus piezas. */
|
|
8
|
+
export declare class CompleteSaleLine {
|
|
9
|
+
lineId: string;
|
|
10
|
+
components: CompleteSaleLineComponent[];
|
|
11
|
+
}
|
|
12
|
+
/** POST /wizard/sessions/:id/complete-sale — cierra la venta con los identificadores de cada línea. */
|
|
13
|
+
export declare class CompleteSaleRequest {
|
|
14
|
+
/** Opcional: el front previo cierra sin body; el wizard exige los identificadores que falten. */
|
|
15
|
+
lines?: CompleteSaleLine[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.CompleteSaleRequest = exports.CompleteSaleLine = exports.CompleteSaleLineComponent = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/** Identificadores capturados en la entrega para un SKU de la línea (componente si es kit). */
|
|
16
|
+
class CompleteSaleLineComponent {
|
|
17
|
+
}
|
|
18
|
+
exports.CompleteSaleLineComponent = CompleteSaleLineComponent;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_transformer_1.Expose)(),
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.MinLength)(1),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CompleteSaleLineComponent.prototype, "sku", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsArray)(),
|
|
28
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
29
|
+
__metadata("design:type", Array)
|
|
30
|
+
], CompleteSaleLineComponent.prototype, "identifiers", void 0);
|
|
31
|
+
/** Línea de la sesión con los identificadores de sus piezas. */
|
|
32
|
+
class CompleteSaleLine {
|
|
33
|
+
}
|
|
34
|
+
exports.CompleteSaleLine = CompleteSaleLine;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
(0, class_validator_1.MinLength)(1),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], CompleteSaleLine.prototype, "lineId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
(0, class_validator_1.IsArray)(),
|
|
44
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
45
|
+
(0, class_transformer_1.Type)(() => CompleteSaleLineComponent),
|
|
46
|
+
__metadata("design:type", Array)
|
|
47
|
+
], CompleteSaleLine.prototype, "components", void 0);
|
|
48
|
+
/** POST /wizard/sessions/:id/complete-sale — cierra la venta con los identificadores de cada línea. */
|
|
49
|
+
class CompleteSaleRequest {
|
|
50
|
+
}
|
|
51
|
+
exports.CompleteSaleRequest = CompleteSaleRequest;
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_transformer_1.Expose)(),
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, class_validator_1.IsArray)(),
|
|
56
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
57
|
+
(0, class_transformer_1.Type)(() => CompleteSaleLine),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], CompleteSaleRequest.prototype, "lines", void 0);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
/** DELETE /wizard/sessions/:id/product —
|
|
1
|
+
/** DELETE /wizard/sessions/:id/product — quita una línea de la venta y libera su reserva en el catálogo. */
|
|
2
2
|
export declare class DeleteProductRequest {
|
|
3
3
|
/** Opcional a propósito: exigirlo rompe a los callers que liberan la reserva sin mandar el imei. */
|
|
4
4
|
imei?: string;
|
|
5
|
+
/** Línea a quitar de la venta. */
|
|
6
|
+
lineId?: string;
|
|
5
7
|
}
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.DeleteProductRequest = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
-
/** DELETE /wizard/sessions/:id/product —
|
|
15
|
+
/** DELETE /wizard/sessions/:id/product — quita una línea de la venta y libera su reserva en el catálogo. */
|
|
16
16
|
class DeleteProductRequest {
|
|
17
17
|
}
|
|
18
18
|
exports.DeleteProductRequest = DeleteProductRequest;
|
|
@@ -22,3 +22,9 @@ __decorate([
|
|
|
22
22
|
(0, class_validator_1.IsString)(),
|
|
23
23
|
__metadata("design:type", String)
|
|
24
24
|
], DeleteProductRequest.prototype, "imei", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], DeleteProductRequest.prototype, "lineId", void 0);
|
|
@@ -34,3 +34,10 @@ __decorate([
|
|
|
34
34
|
(0, class_validator_1.Min)(1),
|
|
35
35
|
__metadata("design:type", Number)
|
|
36
36
|
], QuoteRequest.prototype, "termWeeks", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_transformer_1.Expose)(),
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.MinLength)(1),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], QuoteRequest.prototype, "financedLineId", void 0);
|
|
@@ -0,0 +1,30 @@
|
|
|
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.SuggestIdentifiersQuery = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/** Query de GET /wizard/sessions/:id/lines/:lineId/identifiers; sku es el componente si la línea es kit. */
|
|
16
|
+
class SuggestIdentifiersQuery {
|
|
17
|
+
}
|
|
18
|
+
exports.SuggestIdentifiersQuery = SuggestIdentifiersQuery;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_transformer_1.Expose)(),
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.MinLength)(1),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], SuggestIdentifiersQuery.prototype, "sku", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.MinLength)(4),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], SuggestIdentifiersQuery.prototype, "prefix", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinePaymentTypeEnum = void 0;
|
|
4
|
+
/** Forma de pago de una línea de la venta. */
|
|
5
|
+
var LinePaymentTypeEnum;
|
|
6
|
+
(function (LinePaymentTypeEnum) {
|
|
7
|
+
/** Financiada con crédito SureKeep. */
|
|
8
|
+
LinePaymentTypeEnum["CREDIT"] = "CREDIT";
|
|
9
|
+
/** De contado (o con tarjeta), junto con el enganche. */
|
|
10
|
+
LinePaymentTypeEnum["CASH"] = "CASH";
|
|
11
|
+
})(LinePaymentTypeEnum || (exports.LinePaymentTypeEnum = LinePaymentTypeEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Estado de una línea reservada de la sesión. */
|
|
2
|
+
export declare enum WizardLineStatusEnum {
|
|
3
|
+
/** Escrita con su reservationId, antes de que el catálogo confirme la reserva. */
|
|
4
|
+
PENDING = "PENDING",
|
|
5
|
+
/** El catálogo confirmó la reserva y fijó precio. */
|
|
6
|
+
RESERVED = "RESERVED",
|
|
7
|
+
/** Marcada para liberar; pago y enganche la rechazan. */
|
|
8
|
+
RELEASING = "RELEASING"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WizardLineStatusEnum = void 0;
|
|
4
|
+
/** Estado de una línea reservada de la sesión. */
|
|
5
|
+
var WizardLineStatusEnum;
|
|
6
|
+
(function (WizardLineStatusEnum) {
|
|
7
|
+
/** Escrita con su reservationId, antes de que el catálogo confirme la reserva. */
|
|
8
|
+
WizardLineStatusEnum["PENDING"] = "PENDING";
|
|
9
|
+
/** El catálogo confirmó la reserva y fijó precio. */
|
|
10
|
+
WizardLineStatusEnum["RESERVED"] = "RESERVED";
|
|
11
|
+
/** Marcada para liberar; pago y enganche la rechazan. */
|
|
12
|
+
WizardLineStatusEnum["RELEASING"] = "RELEASING";
|
|
13
|
+
})(WizardLineStatusEnum || (exports.WizardLineStatusEnum = WizardLineStatusEnum = {}));
|
|
@@ -21,6 +21,8 @@ export * from './enums/AppOnboardingStepEnum';
|
|
|
21
21
|
export * from './enums/AppOnboardingStepStatusEnum';
|
|
22
22
|
export * from './enums/BlockedReasonEnum';
|
|
23
23
|
export * from './enums/BlockedCategoryEnum';
|
|
24
|
+
export * from './enums/WizardLineStatusEnum';
|
|
25
|
+
export * from './enums/LinePaymentTypeEnum';
|
|
24
26
|
export * from './dtos/WizardConsents';
|
|
25
27
|
export * from './dtos/WizardPayment';
|
|
26
28
|
export * from './dtos/WizardProduct';
|
|
@@ -34,6 +36,10 @@ export * from './dtos/AccountStep';
|
|
|
34
36
|
export * from './dtos/AppOnboardingStep';
|
|
35
37
|
export * from './dtos/WizardResumeTarget';
|
|
36
38
|
export * from './dtos/WizardBlocked';
|
|
39
|
+
export * from './dtos/WizardLineProduct';
|
|
40
|
+
export * from './dtos/WizardLineIdentifiers';
|
|
41
|
+
export * from './dtos/WizardReservedLine';
|
|
42
|
+
export * from './dtos/SaleLine';
|
|
37
43
|
export * from './dtos/WizardSession';
|
|
38
44
|
export * from './dtos/OtpVerification';
|
|
39
45
|
export * from './dtos/Sale';
|
|
@@ -69,6 +75,8 @@ export * from './dtos/requests/QuoteRequest';
|
|
|
69
75
|
export * from './dtos/requests/DownPaymentRequest';
|
|
70
76
|
export * from './dtos/requests/SignatureSignRequest';
|
|
71
77
|
export * from './dtos/requests/RegisterDeviceRequest';
|
|
78
|
+
export * from './dtos/requests/CompleteSaleRequest';
|
|
79
|
+
export * from './dtos/requests/SuggestIdentifiersQuery';
|
|
72
80
|
export * from './dtos/responses/KycPrepareResponse';
|
|
73
81
|
export * from './dtos/responses/ProofOfAddressPrepareResponse';
|
|
74
82
|
export * from './dtos/responses/SessionFinanciersResponse';
|
|
@@ -39,6 +39,8 @@ __exportStar(require("./enums/AppOnboardingStepEnum"), exports);
|
|
|
39
39
|
__exportStar(require("./enums/AppOnboardingStepStatusEnum"), exports);
|
|
40
40
|
__exportStar(require("./enums/BlockedReasonEnum"), exports);
|
|
41
41
|
__exportStar(require("./enums/BlockedCategoryEnum"), exports);
|
|
42
|
+
__exportStar(require("./enums/WizardLineStatusEnum"), exports);
|
|
43
|
+
__exportStar(require("./enums/LinePaymentTypeEnum"), exports);
|
|
42
44
|
// DTOs anidados
|
|
43
45
|
__exportStar(require("./dtos/WizardConsents"), exports);
|
|
44
46
|
__exportStar(require("./dtos/WizardPayment"), exports);
|
|
@@ -53,6 +55,10 @@ __exportStar(require("./dtos/AccountStep"), exports);
|
|
|
53
55
|
__exportStar(require("./dtos/AppOnboardingStep"), exports);
|
|
54
56
|
__exportStar(require("./dtos/WizardResumeTarget"), exports);
|
|
55
57
|
__exportStar(require("./dtos/WizardBlocked"), exports);
|
|
58
|
+
__exportStar(require("./dtos/WizardLineProduct"), exports);
|
|
59
|
+
__exportStar(require("./dtos/WizardLineIdentifiers"), exports);
|
|
60
|
+
__exportStar(require("./dtos/WizardReservedLine"), exports);
|
|
61
|
+
__exportStar(require("./dtos/SaleLine"), exports);
|
|
56
62
|
// Entidades principales (shapes de estado/persistencia — planas)
|
|
57
63
|
__exportStar(require("./dtos/WizardSession"), exports);
|
|
58
64
|
__exportStar(require("./dtos/OtpVerification"), exports);
|
|
@@ -91,6 +97,8 @@ __exportStar(require("./dtos/requests/QuoteRequest"), exports);
|
|
|
91
97
|
__exportStar(require("./dtos/requests/DownPaymentRequest"), exports);
|
|
92
98
|
__exportStar(require("./dtos/requests/SignatureSignRequest"), exports);
|
|
93
99
|
__exportStar(require("./dtos/requests/RegisterDeviceRequest"), exports);
|
|
100
|
+
__exportStar(require("./dtos/requests/CompleteSaleRequest"), exports);
|
|
101
|
+
__exportStar(require("./dtos/requests/SuggestIdentifiersQuery"), exports);
|
|
94
102
|
// Response DTOs (output tipado por endpoint)
|
|
95
103
|
__exportStar(require("./dtos/responses/KycPrepareResponse"), exports);
|
|
96
104
|
__exportStar(require("./dtos/responses/ProofOfAddressPrepareResponse"), exports);
|
package/package.json
CHANGED
|
@@ -2,6 +2,9 @@ import { MdmLockModeEnum } from '../enums/MdmLockModeEnum';
|
|
|
2
2
|
import { MdmProviderEnum } from '../enums/MdmProviderEnum';
|
|
3
3
|
import { ProductStatusEnum } from '../enums/ProductStatusEnum';
|
|
4
4
|
import { ProductTierEnum } from '../enums/ProductTierEnum';
|
|
5
|
+
import { ProductCategoryEnum } from '../enums/ProductCategoryEnum';
|
|
6
|
+
import { TrackingModeEnum } from '../enums/TrackingModeEnum';
|
|
7
|
+
import { ProductComponent } from './ProductComponent';
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Product — aggregate root del catálogo del dominio `retailCatalog`
|
|
@@ -20,7 +23,8 @@ export class Product {
|
|
|
20
23
|
description!: string;
|
|
21
24
|
specs!: Record<string, unknown> | null;
|
|
22
25
|
imageUrl!: string | null;
|
|
23
|
-
|
|
26
|
+
/** `null` = Sin gama. */
|
|
27
|
+
tier!: ProductTierEnum | null;
|
|
24
28
|
basePriceCents!: number;
|
|
25
29
|
listPriceCents!: number | null;
|
|
26
30
|
eligibleFinanciers!: string[];
|
|
@@ -32,4 +36,16 @@ export class Product {
|
|
|
32
36
|
updatedBy!: string;
|
|
33
37
|
createdAt!: string;
|
|
34
38
|
updatedAt!: string;
|
|
39
|
+
|
|
40
|
+
// Campos del inventario multi-item; opcionales hasta que todo producto pase por la puerta de entrada.
|
|
41
|
+
category?: ProductCategoryEnum;
|
|
42
|
+
trackingMode?: TrackingModeEnum;
|
|
43
|
+
/** Se puede vender suelto (fuera de un kit). */
|
|
44
|
+
sellable?: boolean;
|
|
45
|
+
/** Aparece en el catálogo del flujo de venta. */
|
|
46
|
+
showInSalesFlow?: boolean;
|
|
47
|
+
/** Solo en BUNDLE. */
|
|
48
|
+
components?: ProductComponent[] | null;
|
|
49
|
+
/** Llave del registro PRICE# del que salen basePriceCents y listPriceCents. */
|
|
50
|
+
currentPriceSk?: string | null;
|
|
35
51
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsInt, IsString, Length, Matches, Min } from 'class-validator';
|
|
2
|
+
import { SKU_PATTERN } from '../constants/SkuPattern';
|
|
3
|
+
|
|
4
|
+
/** Componente de un kit (BUNDLE): qué SKU consume y cuántas piezas por kit. */
|
|
5
|
+
export class ProductComponent {
|
|
6
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
7
|
+
@Length(1, 64)
|
|
8
|
+
@IsString()
|
|
9
|
+
sku!: string;
|
|
10
|
+
|
|
11
|
+
@IsInt()
|
|
12
|
+
@Min(1)
|
|
13
|
+
qty!: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
3
|
+
import { InventoryLensPeriodEnum } from '../../enums/InventoryLensPeriodEnum';
|
|
4
|
+
|
|
5
|
+
/** Query de GET /backoffice/inventory/skus/{sku} (backofficeGetInventorySku); el retailer sale del token. */
|
|
6
|
+
export class GetInventorySkuQuery {
|
|
7
|
+
@IsOptional()
|
|
8
|
+
@IsEnum(InventoryLensPeriodEnum)
|
|
9
|
+
period?: InventoryLensPeriodEnum;
|
|
10
|
+
|
|
11
|
+
/** Debe pertenecer al retailer del token. */
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsString()
|
|
14
|
+
storeId?: string;
|
|
15
|
+
|
|
16
|
+
/** Tamaño de página del libro de movimientos. */
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@Type(() => Number)
|
|
19
|
+
@IsInt()
|
|
20
|
+
@Min(1)
|
|
21
|
+
@Max(100)
|
|
22
|
+
limit?: number;
|
|
23
|
+
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@IsString()
|
|
26
|
+
nextToken?: string;
|
|
27
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IsEnum } from 'class-validator';
|
|
1
|
+
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
|
2
2
|
import { InventoryLensFilterEnum } from '../../enums/InventoryLensFilterEnum';
|
|
3
|
+
import { InventoryLensPeriodEnum } from '../../enums/InventoryLensPeriodEnum';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Query string de `GET /backoffice/inventory/lens`. SureKeep Fase 3 — pista Retail.
|
|
@@ -13,4 +14,14 @@ import { InventoryLensFilterEnum } from '../../enums/InventoryLensFilterEnum';
|
|
|
13
14
|
export class InventoryLensQuery {
|
|
14
15
|
@IsEnum(InventoryLensFilterEnum)
|
|
15
16
|
filter!: InventoryLensFilterEnum;
|
|
17
|
+
|
|
18
|
+
/** Solo `filter=list`: periodo de ventas y cobertura. */
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@IsEnum(InventoryLensPeriodEnum)
|
|
21
|
+
period?: InventoryLensPeriodEnum;
|
|
22
|
+
|
|
23
|
+
/** Solo `filter=list`: una tienda del retailer del token; ausente = consolidado. */
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@IsString()
|
|
26
|
+
storeId?: string;
|
|
16
27
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
|
|
3
|
+
import { ReservationLineRef } from './ReservationLineRef';
|
|
4
|
+
|
|
5
|
+
/** Body de PUT /private/stores/{storeId}/reservations/release (privateReleaseStock). */
|
|
6
|
+
export class ReleaseStockRequest {
|
|
7
|
+
@IsString()
|
|
8
|
+
sessionId!: string;
|
|
9
|
+
|
|
10
|
+
@IsArray()
|
|
11
|
+
@ArrayMinSize(1)
|
|
12
|
+
@ValidateNested({ each: true })
|
|
13
|
+
@Type(() => ReservationLineRef)
|
|
14
|
+
lines!: ReservationLineRef[];
|
|
15
|
+
|
|
16
|
+
/** `true` = solo libera las reservas ya vencidas (barrido). */
|
|
17
|
+
@IsBoolean()
|
|
18
|
+
onlyExpired!: boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsString, ValidateNested } from 'class-validator';
|
|
3
|
+
import { ReservationLineRef } from './ReservationLineRef';
|
|
4
|
+
|
|
5
|
+
/** Body de PUT /private/stores/{storeId}/reservations/renew (privateRenewReservations). */
|
|
6
|
+
export class RenewReservationsRequest {
|
|
7
|
+
@IsString()
|
|
8
|
+
sessionId!: string;
|
|
9
|
+
|
|
10
|
+
@IsArray()
|
|
11
|
+
@ArrayMinSize(1)
|
|
12
|
+
@ValidateNested({ each: true })
|
|
13
|
+
@Type(() => ReservationLineRef)
|
|
14
|
+
lines!: ReservationLineRef[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IsInt, IsString, Min } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/** Body de PUT /private/stores/{storeId}/reservations (privateReserveStock); reserva una línea, kit completo. */
|
|
4
|
+
export class ReserveStockRequest {
|
|
5
|
+
@IsString()
|
|
6
|
+
sessionId!: string;
|
|
7
|
+
|
|
8
|
+
@IsString()
|
|
9
|
+
lineId!: string;
|
|
10
|
+
|
|
11
|
+
/** Llave de idempotencia; un id nuevo por cada intento de reserva. */
|
|
12
|
+
@IsString()
|
|
13
|
+
reservationId!: string;
|
|
14
|
+
|
|
15
|
+
@IsString()
|
|
16
|
+
retailerId!: string;
|
|
17
|
+
|
|
18
|
+
@IsString()
|
|
19
|
+
sku!: string;
|
|
20
|
+
|
|
21
|
+
@IsInt()
|
|
22
|
+
@Min(1)
|
|
23
|
+
qty!: number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsISO8601, IsString, ValidateNested } from 'class-validator';
|
|
3
|
+
import { StockLine } from './StockLine';
|
|
4
|
+
|
|
5
|
+
/** Body de PUT /private/stores/{storeId}/returns (privateReturnStock); componentes guardados en la venta. */
|
|
6
|
+
export class ReturnStockRequest {
|
|
7
|
+
@IsString()
|
|
8
|
+
saleId!: string;
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
retailerId!: string;
|
|
12
|
+
|
|
13
|
+
/** Fecha de la venta; fija el día de negocio del contador DAY# que se descuenta. */
|
|
14
|
+
@IsISO8601()
|
|
15
|
+
soldAt!: string;
|
|
16
|
+
|
|
17
|
+
@IsArray()
|
|
18
|
+
@ArrayMinSize(1)
|
|
19
|
+
@ValidateNested({ each: true })
|
|
20
|
+
@Type(() => StockLine)
|
|
21
|
+
lines!: StockLine[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsString, ValidateNested } from 'class-validator';
|
|
3
|
+
import { StockLine } from './StockLine';
|
|
4
|
+
|
|
5
|
+
/** Body de PUT /private/stores/{storeId}/sales (privateSellStock); una TX de venta. */
|
|
6
|
+
export class SellStockRequest {
|
|
7
|
+
@IsString()
|
|
8
|
+
sessionId!: string;
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
retailerId!: string;
|
|
12
|
+
|
|
13
|
+
@IsArray()
|
|
14
|
+
@ArrayMinSize(1)
|
|
15
|
+
@ValidateNested({ each: true })
|
|
16
|
+
@Type(() => StockLine)
|
|
17
|
+
lines!: StockLine[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsInt, IsString, Min, ValidateNested } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Componente de una línea con las piezas que se entregan; un producto suelto es un solo componente. */
|
|
5
|
+
export class StockLineComponent {
|
|
6
|
+
@IsString()
|
|
7
|
+
sku!: string;
|
|
8
|
+
|
|
9
|
+
@IsInt()
|
|
10
|
+
@Min(1)
|
|
11
|
+
qty!: number;
|
|
12
|
+
|
|
13
|
+
/** IMEI o serie de cada pieza; vacío si el SKU se rastrea por cantidad. */
|
|
14
|
+
@IsArray()
|
|
15
|
+
@IsString({ each: true })
|
|
16
|
+
identifiers!: string[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Línea de venta o devolución con sus componentes; la usan sell y return. */
|
|
20
|
+
export class StockLine {
|
|
21
|
+
@IsString()
|
|
22
|
+
lineId!: string;
|
|
23
|
+
|
|
24
|
+
@IsString()
|
|
25
|
+
sku!: string;
|
|
26
|
+
|
|
27
|
+
@IsInt()
|
|
28
|
+
@Min(1)
|
|
29
|
+
qty!: number;
|
|
30
|
+
|
|
31
|
+
@IsArray()
|
|
32
|
+
@ArrayMinSize(1)
|
|
33
|
+
@ValidateNested({ each: true })
|
|
34
|
+
@Type(() => StockLineComponent)
|
|
35
|
+
components!: StockLineComponent[];
|
|
36
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IsString, MinLength } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/** Query de GET /private/stores/{storeId}/pieces (privateSuggestPieces); sku es el componente si es kit. */
|
|
4
|
+
export class SuggestPiecesQuery {
|
|
5
|
+
@IsString()
|
|
6
|
+
sku!: string;
|
|
7
|
+
|
|
8
|
+
@IsString()
|
|
9
|
+
@MinLength(4)
|
|
10
|
+
prefix!: string;
|
|
11
|
+
}
|