@fiado/type-kit 3.464.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/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/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/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,17 @@
|
|
|
1
|
+
import type { TransferStateEnum } from '../../enums/TransferStateEnum';
|
|
2
|
+
|
|
3
|
+
/** Un traspaso entre tiendas (TRF#); response de crear, recibir y cancelar. */
|
|
4
|
+
export interface TransferResponse {
|
|
5
|
+
transferId: string;
|
|
6
|
+
fromStoreId: string;
|
|
7
|
+
toStoreId: string;
|
|
8
|
+
sku: string;
|
|
9
|
+
qty: number;
|
|
10
|
+
/** IMEI o serie de cada pieza; vacío si el SKU se rastrea por cantidad. */
|
|
11
|
+
identifiers: string[];
|
|
12
|
+
state: TransferStateEnum;
|
|
13
|
+
createdBy: string;
|
|
14
|
+
updatedBy: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @property {string} SOLD - Vendida.
|
|
9
9
|
* @property {string} RETURNED - Devuelta por el cliente.
|
|
10
10
|
* @property {string} DAMAGED - Dañada, fuera de stock vendible.
|
|
11
|
+
* @property {string} IN_TRANSIT - En traspaso entre tiendas, fuera de stock vendible.
|
|
11
12
|
*/
|
|
12
13
|
export enum InventoryItemStatusEnum {
|
|
13
14
|
AVAILABLE = 'AVAILABLE',
|
|
@@ -15,4 +16,5 @@ export enum InventoryItemStatusEnum {
|
|
|
15
16
|
SOLD = 'SOLD',
|
|
16
17
|
RETURNED = 'RETURNED',
|
|
17
18
|
DAMAGED = 'DAMAGED',
|
|
19
|
+
IN_TRANSIT = 'IN_TRANSIT',
|
|
18
20
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Motivo de un movimiento manual de inventario (MOV#): merma, ajuste, garantía o devolución dañada. */
|
|
2
|
+
export enum InventoryMovementReasonEnum {
|
|
3
|
+
SHRINKAGE = 'SHRINKAGE',
|
|
4
|
+
ADJUSTMENT = 'ADJUSTMENT',
|
|
5
|
+
WARRANTY = 'WARRANTY',
|
|
6
|
+
DAMAGED_RETURN = 'DAMAGED_RETURN',
|
|
7
|
+
}
|
|
@@ -11,9 +11,12 @@ export * from './enums/InventoryTransferReasonEnum';
|
|
|
11
11
|
|
|
12
12
|
// Constantes del dominio
|
|
13
13
|
export * from './constants/SkuPattern';
|
|
14
|
+
export * from './constants/NonBundleCategories';
|
|
15
|
+
export * from './constants/AdjustmentReasons';
|
|
14
16
|
|
|
15
17
|
// Validators custom
|
|
16
18
|
export * from './validators/IsMdmCoherentConstraint';
|
|
19
|
+
export * from './validators/IsPieceRefConstraint';
|
|
17
20
|
|
|
18
21
|
// Entity DTOs
|
|
19
22
|
export * from './dtos/Product';
|
|
@@ -51,6 +54,8 @@ export * from './enums/InventoryLensPeriodEnum';
|
|
|
51
54
|
export * from './dtos/ProductComponent';
|
|
52
55
|
export * from './dtos/requests/ReservationLineRef';
|
|
53
56
|
export * from './dtos/requests/StockLine';
|
|
57
|
+
export * from './dtos/requests/ReturnPieceCondition';
|
|
58
|
+
export * from './dtos/requests/ReturnStockLine';
|
|
54
59
|
export * from './dtos/requests/ReserveStockRequest';
|
|
55
60
|
export * from './dtos/requests/RenewReservationsRequest';
|
|
56
61
|
export * from './dtos/requests/SuggestPiecesQuery';
|
|
@@ -70,3 +75,20 @@ export * from './dtos/responses/StoreCatalogItem';
|
|
|
70
75
|
export * from './dtos/responses/SkuPriceEntry';
|
|
71
76
|
export * from './dtos/responses/GetInventorySkuResponse';
|
|
72
77
|
export * from './dtos/responses/ListSkuPricesResponse';
|
|
78
|
+
|
|
79
|
+
// Operación independiente (ciclo 2)
|
|
80
|
+
export * from './enums/ItemTypeEnum';
|
|
81
|
+
export * from './enums/ReturnConditionEnum';
|
|
82
|
+
export * from './enums/TransferStateEnum';
|
|
83
|
+
export * from './enums/InventoryMovementReasonEnum';
|
|
84
|
+
export * from './dtos/requests/BackofficeCreateProductRequest';
|
|
85
|
+
export * from './dtos/requests/BackofficeCreateKitRequest';
|
|
86
|
+
export * from './dtos/requests/BackofficeCreateServiceRequest';
|
|
87
|
+
export * from './dtos/requests/BackofficeUpdateProductRequest';
|
|
88
|
+
export * from './dtos/requests/BackofficeCreateSkuPriceRequest';
|
|
89
|
+
export * from './dtos/requests/BackofficeRegisterEntryRequest';
|
|
90
|
+
export * from './dtos/requests/BackofficeRegisterAdjustmentRequest';
|
|
91
|
+
export * from './dtos/requests/BackofficeCreateTransferRequest';
|
|
92
|
+
export * from './dtos/requests/BackofficeListTransfersQuery';
|
|
93
|
+
export * from './dtos/responses/TransferResponse';
|
|
94
|
+
export * from './dtos/responses/ListTransfersResponse';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ValidatorConstraint,
|
|
3
|
+
type ValidationArguments,
|
|
4
|
+
type ValidatorConstraintInterface,
|
|
5
|
+
} from 'class-validator';
|
|
6
|
+
|
|
7
|
+
/** Exige identifier (pieza con IMEI o serie) o qty (SKU por cantidad), nunca los dos. */
|
|
8
|
+
@ValidatorConstraint({ name: 'isPieceRef', async: false })
|
|
9
|
+
export class IsPieceRefConstraint implements ValidatorConstraintInterface {
|
|
10
|
+
validate(identifier: unknown, args: ValidationArguments): boolean {
|
|
11
|
+
const { qty } = args.object as { qty?: unknown };
|
|
12
|
+
if (qty !== undefined) return identifier === undefined;
|
|
13
|
+
return typeof identifier === 'string' && /^\S+$/.test(identifier);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
defaultMessage(): string {
|
|
17
|
+
return 'identifier (pieza con IMEI o serie) o qty (por cantidad), exactamente uno';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsBoolean, IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsBoolean, IsOptional, IsString, MaxLength, MinLength, ValidateNested } from 'class-validator';
|
|
3
|
+
import { ReturnPieceCondition } from '../../../retailCatalog/dtos/requests/ReturnPieceCondition';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* POST /backoffice/sales/:saleId/cancel — cancelación del Admin VL. SureKeep Fase 3 — pista Retail.
|
|
@@ -39,4 +40,12 @@ export class BackofficeCancelSaleRequest {
|
|
|
39
40
|
@IsString()
|
|
40
41
|
@MaxLength(64)
|
|
41
42
|
outOfWindowExceptionId?: string;
|
|
43
|
+
|
|
44
|
+
/** Condición de cada pieza que regresa al inventario; las no listadas vuelven GOOD. */
|
|
45
|
+
@Expose()
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@IsArray()
|
|
48
|
+
@ValidateNested({ each: true })
|
|
49
|
+
@Type(() => ReturnPieceCondition)
|
|
50
|
+
returnConditions?: ReturnPieceCondition[];
|
|
42
51
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsBoolean, IsOptional, IsString, MaxLength } from 'class-validator';
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsBoolean, IsOptional, IsString, MaxLength, ValidateNested } from 'class-validator';
|
|
3
|
+
import { ReturnPieceCondition } from '../../../retailCatalog/dtos/requests/ReturnPieceCondition';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* POST /sales/:saleId/cancel — cancela una venta (flujo C, solo BO dentro de ventana param). `reason`
|
|
@@ -29,4 +30,12 @@ export class CancelSaleRequest {
|
|
|
29
30
|
@IsOptional()
|
|
30
31
|
@IsBoolean()
|
|
31
32
|
equipmentVerified?: boolean;
|
|
33
|
+
|
|
34
|
+
/** Condición de cada pieza que regresa al inventario; las no listadas vuelven GOOD. */
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsArray()
|
|
38
|
+
@ValidateNested({ each: true })
|
|
39
|
+
@Type(() => ReturnPieceCondition)
|
|
40
|
+
returnConditions?: ReturnPieceCondition[];
|
|
32
41
|
}
|