@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
|
@@ -17,7 +17,10 @@ import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
|
17
17
|
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
18
18
|
import { IsMdmCoherentConstraint } from '../../validators/IsMdmCoherentConstraint';
|
|
19
19
|
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Body de POST /retailers/:retailerId/products — alta de producto (retailerId/status/audit son server-set).
|
|
22
|
+
* @deprecated Modelo viejo por IMEI; usar BackofficeCreateProductRequest. Se conserva porque otras ramas lo importan.
|
|
23
|
+
*/
|
|
21
24
|
export class CreateProductRequest {
|
|
22
25
|
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
23
26
|
@Length(1, 64)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ArrayNotEmpty, IsArray, IsString } from 'class-validator';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Body de POST /retailers/:retailerId/stores/:storeId/inventory — registrar IMEIs nuevos (lote).
|
|
5
|
+
* @deprecated Modelo viejo por IMEI; usar BackofficeRegisterEntryRequest. Se conserva porque otras ramas lo importan.
|
|
6
|
+
*/
|
|
4
7
|
export class RegisterInventoryRequest {
|
|
5
8
|
@IsString()
|
|
6
9
|
productSku!: string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Expose, Transform } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
IsEnum,
|
|
4
|
+
IsInt,
|
|
5
|
+
IsString,
|
|
6
|
+
Length,
|
|
7
|
+
Matches,
|
|
8
|
+
MaxLength,
|
|
9
|
+
Min,
|
|
10
|
+
Validate,
|
|
11
|
+
ValidateIf,
|
|
12
|
+
} from 'class-validator';
|
|
13
|
+
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
14
|
+
import { ReturnConditionEnum } from '../../enums/ReturnConditionEnum';
|
|
15
|
+
import { IsPieceRefConstraint } from '../../validators/IsPieceRefConstraint';
|
|
16
|
+
|
|
17
|
+
/** Condición de una pieza devuelta; ausente = GOOD. Un accesorio por cantidad se declara con sku + qty. */
|
|
18
|
+
export class ReturnPieceCondition {
|
|
19
|
+
@Expose()
|
|
20
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
21
|
+
@Length(1, 64)
|
|
22
|
+
@IsString()
|
|
23
|
+
sku!: string;
|
|
24
|
+
|
|
25
|
+
@Expose()
|
|
26
|
+
@Validate(IsPieceRefConstraint)
|
|
27
|
+
identifier?: string;
|
|
28
|
+
|
|
29
|
+
/** Unidades del SKU por cantidad con esta condición; las no declaradas vuelven GOOD. */
|
|
30
|
+
@Expose()
|
|
31
|
+
@ValidateIf((o: ReturnPieceCondition) => o.qty !== undefined)
|
|
32
|
+
@IsInt()
|
|
33
|
+
@Min(1)
|
|
34
|
+
qty?: number;
|
|
35
|
+
|
|
36
|
+
@Expose()
|
|
37
|
+
@Transform(({ value }) => value ?? ReturnConditionEnum.GOOD)
|
|
38
|
+
@IsEnum(ReturnConditionEnum)
|
|
39
|
+
condition: ReturnConditionEnum = ReturnConditionEnum.GOOD;
|
|
40
|
+
|
|
41
|
+
/** Motivo del daño; obligatorio con DAMAGED, opcional con GOOD. */
|
|
42
|
+
@Expose()
|
|
43
|
+
@ValidateIf((o: ReturnPieceCondition) => o.condition === ReturnConditionEnum.DAMAGED || o.reason != null)
|
|
44
|
+
@MaxLength(200)
|
|
45
|
+
@Matches(/\S/)
|
|
46
|
+
@IsString()
|
|
47
|
+
reason?: string;
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsOptional, ValidateNested } from 'class-validator';
|
|
3
|
+
import { ReturnPieceCondition } from './ReturnPieceCondition';
|
|
4
|
+
import { StockLine } from './StockLine';
|
|
5
|
+
|
|
6
|
+
/** Línea de devolución: la línea vendida más la condición de sus piezas; las no listadas vuelven GOOD. */
|
|
7
|
+
export class ReturnStockLine extends StockLine {
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsArray()
|
|
10
|
+
@ValidateNested({ each: true })
|
|
11
|
+
@Type(() => ReturnPieceCondition)
|
|
12
|
+
conditions?: ReturnPieceCondition[];
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from 'class-transformer';
|
|
2
2
|
import { ArrayMinSize, IsArray, IsISO8601, IsString, ValidateNested } from 'class-validator';
|
|
3
|
-
import {
|
|
3
|
+
import { ReturnStockLine } from './ReturnStockLine';
|
|
4
4
|
|
|
5
5
|
/** Body de PUT /private/stores/{storeId}/returns (privateReturnStock); componentes guardados en la venta. */
|
|
6
6
|
export class ReturnStockRequest {
|
|
@@ -17,6 +17,6 @@ export class ReturnStockRequest {
|
|
|
17
17
|
@IsArray()
|
|
18
18
|
@ArrayMinSize(1)
|
|
19
19
|
@ValidateNested({ each: true })
|
|
20
|
-
@Type(() =>
|
|
21
|
-
lines!:
|
|
20
|
+
@Type(() => ReturnStockLine)
|
|
21
|
+
lines!: ReturnStockLine[];
|
|
22
22
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { IsString } from 'class-validator';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Body de PUT /retailers/:retailerId/inventory/:imei/transfer — mover IMEI a otro store.
|
|
5
|
+
* @deprecated Modelo viejo por IMEI; usar BackofficeCreateTransferRequest. Se conserva porque otras ramas lo importan.
|
|
6
|
+
*/
|
|
4
7
|
export class TransferInventoryRequest {
|
|
5
8
|
@IsString()
|
|
6
9
|
newStoreId!: string;
|
|
@@ -14,7 +14,10 @@ import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
|
14
14
|
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
15
15
|
import { IsMdmCoherentConstraint } from '../../validators/IsMdmCoherentConstraint';
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Body de PUT /retailers/:retailerId/products/:sku — actualización parcial (sku y status son inmutables acá).
|
|
19
|
+
* @deprecated Modelo viejo por IMEI; usar BackofficeUpdateProductRequest. Se conserva porque otras ramas lo importan.
|
|
20
|
+
*/
|
|
18
21
|
export class UpdateProductRequest {
|
|
19
22
|
@IsOptional()
|
|
20
23
|
@IsString()
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { IsEnum } from 'class-validator';
|
|
2
2
|
import { ProductStatusEnum } from '../../enums/ProductStatusEnum';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Body de PUT /retailers/:retailerId/products/:sku/status — ACTIVE | DISCONTINUED.
|
|
6
|
+
* @deprecated Modelo viejo por IMEI; usar backofficeDeactivateProduct (sin body). Se conserva porque otras ramas lo importan.
|
|
7
|
+
*/
|
|
5
8
|
export class UpdateProductStatusRequest {
|
|
6
9
|
@IsEnum(ProductStatusEnum)
|
|
7
10
|
status!: ProductStatusEnum;
|
|
@@ -4,6 +4,7 @@ import type { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
|
4
4
|
import type { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
5
5
|
import type { InventoryLensUnavailableReasonEnum } from '../../enums/InventoryLensUnavailableReasonEnum';
|
|
6
6
|
import type { InventoryTransferReasonEnum } from '../../enums/InventoryTransferReasonEnum';
|
|
7
|
+
import type { ItemTypeEnum } from '../../enums/ItemTypeEnum';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Los contadores que la pantalla «Inventario» del Admin VL pinta arriba, siempre — los cuatro viajan
|
|
@@ -127,6 +128,8 @@ export interface InventoryLensListItem {
|
|
|
127
128
|
coverage: InventoryLensCoverage;
|
|
128
129
|
alerts: InventoryLensAlerts;
|
|
129
130
|
sold30d: number;
|
|
131
|
+
/** Producto físico o servicio. Ausente = PRODUCT. */
|
|
132
|
+
itemType?: ItemTypeEnum;
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
/** Fila del lente — el tipo depende del tab pedido. */
|
|
@@ -8,6 +8,8 @@ export interface ReservedComponent {
|
|
|
8
8
|
qty: number;
|
|
9
9
|
category: ProductCategoryEnum;
|
|
10
10
|
trackingMode: TrackingModeEnum;
|
|
11
|
+
/** Precio vigente del componente, para repartir el precio del kit. */
|
|
12
|
+
priceCents?: number;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
/** Response de privateReserveStock; el precio de la línea es `basePriceCents`. */
|
|
@@ -5,6 +5,8 @@ export interface SkuPriceEntry {
|
|
|
5
5
|
effectiveFrom: string;
|
|
6
6
|
listPriceCents: number | null;
|
|
7
7
|
basePriceCents: number;
|
|
8
|
+
/** Precio del SKU dentro de un kit; informativo, no se aplica. */
|
|
9
|
+
comboPriceCents?: number;
|
|
8
10
|
source: PriceSourceEnum;
|
|
9
11
|
createdBy: string;
|
|
10
12
|
}
|
|
@@ -3,6 +3,7 @@ import type { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
|
3
3
|
import type { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
4
4
|
import type { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
5
5
|
import type { TrackingModeEnum } from '../../enums/TrackingModeEnum';
|
|
6
|
+
import type { ItemTypeEnum } from '../../enums/ItemTypeEnum';
|
|
6
7
|
import type { ProductComponent } from '../ProductComponent';
|
|
7
8
|
|
|
8
9
|
/** Fila por SKU del catálogo de venta de una tienda (privateGetStoreStockCatalog). */
|
|
@@ -25,6 +26,8 @@ export interface StoreCatalogItem {
|
|
|
25
26
|
mdmLockMode: MdmLockModeEnum | null;
|
|
26
27
|
/** Solo si es kit. */
|
|
27
28
|
components?: ProductComponent[];
|
|
29
|
+
/** Producto físico o servicio. Ausente = PRODUCT. */
|
|
30
|
+
itemType?: ItemTypeEnum;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
/** Response de privateGetStoreStockCatalog. */
|
|
@@ -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
|
}
|