@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
|
@@ -9,6 +9,7 @@ import type { WizardConsents } from './WizardConsents';
|
|
|
9
9
|
import type { WizardLoan } from './WizardLoan';
|
|
10
10
|
import type { WizardPayment } from './WizardPayment';
|
|
11
11
|
import type { WizardProduct } from './WizardProduct';
|
|
12
|
+
import type { WizardReservedLine } from './WizardReservedLine';
|
|
12
13
|
import type { WizardResumeTarget } from './WizardResumeTarget';
|
|
13
14
|
import type { WizardWelcome } from './WizardWelcome';
|
|
14
15
|
|
|
@@ -112,6 +113,10 @@ export interface WizardSession {
|
|
|
112
113
|
*/
|
|
113
114
|
product: WizardProduct | null;
|
|
114
115
|
reservationExpiresAt: string | null;
|
|
116
|
+
/** Líneas de la venta; `reservedSku`, `reservedImei` y `product` espejan la financiada o la principal. */
|
|
117
|
+
reservedLines?: WizardReservedLine[];
|
|
118
|
+
/** Línea elegida para financiar; `null` si la venta es de contado o aún no se elige. */
|
|
119
|
+
financedLineId?: string | null;
|
|
115
120
|
paymentMethod: PaymentMethodEnum | null;
|
|
116
121
|
externalProvider: ExternalProviderEnum | null;
|
|
117
122
|
/** Folio de cobro server-side (D11), idempotente, sobrevive al volver atrás. */
|
|
@@ -2,14 +2,8 @@ import { Expose } from 'class-transformer';
|
|
|
2
2
|
import { IsInt, IsOptional, IsString, Min } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* POST /wizard/sessions/:id/product —
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `imei` y `cashPriceCents` son OPCIONALES a propósito: la unidad física y el precio son AUTORIDAD DEL
|
|
9
|
-
* SERVIDOR. Con solo el `sku`, el wizard elige una unidad disponible del catálogo y toma su precio (el
|
|
10
|
-
* cliente NUNCA dicta el monto a cobrar — `cashPriceCents` ancla el cobro con `amountCents == cashPrice`).
|
|
11
|
-
* Si el caller manda `imei`, el server puede honrar esa unidad, pero el precio SIEMPRE sale del catálogo.
|
|
12
|
-
* SureKeep Fase 2 — pista Retail.
|
|
5
|
+
* POST /wizard/sessions/:id/product — agrega una línea a la venta y reserva sus piezas en el catálogo.
|
|
6
|
+
* `imei` y `cashPriceCents` son opcionales: la pieza y el precio los decide el servidor.
|
|
13
7
|
*/
|
|
14
8
|
export class AddProductRequest {
|
|
15
9
|
@Expose()
|
|
@@ -26,4 +20,11 @@ export class AddProductRequest {
|
|
|
26
20
|
@IsInt()
|
|
27
21
|
@Min(0)
|
|
28
22
|
cashPriceCents?: number;
|
|
23
|
+
|
|
24
|
+
/** Piezas de la línea; ausente = 1. */
|
|
25
|
+
@Expose()
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsInt()
|
|
28
|
+
@Min(1)
|
|
29
|
+
qty?: number;
|
|
29
30
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsOptional, IsString, MinLength, ValidateNested } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Identificadores capturados en la entrega para un SKU de la línea (componente si es kit). */
|
|
5
|
+
export class CompleteSaleLineComponent {
|
|
6
|
+
@Expose()
|
|
7
|
+
@IsString()
|
|
8
|
+
@MinLength(1)
|
|
9
|
+
sku!: string;
|
|
10
|
+
|
|
11
|
+
/** Vacío si el SKU se rastrea por cantidad. */
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsArray()
|
|
14
|
+
@IsString({ each: true })
|
|
15
|
+
identifiers!: string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Línea de la sesión con los identificadores de sus piezas. */
|
|
19
|
+
export class CompleteSaleLine {
|
|
20
|
+
@Expose()
|
|
21
|
+
@IsString()
|
|
22
|
+
@MinLength(1)
|
|
23
|
+
lineId!: string;
|
|
24
|
+
|
|
25
|
+
@Expose()
|
|
26
|
+
@IsArray()
|
|
27
|
+
@ValidateNested({ each: true })
|
|
28
|
+
@Type(() => CompleteSaleLineComponent)
|
|
29
|
+
components!: CompleteSaleLineComponent[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** POST /wizard/sessions/:id/complete-sale — cierra la venta con los identificadores de cada línea. */
|
|
33
|
+
export class CompleteSaleRequest {
|
|
34
|
+
/** Opcional: el front previo cierra sin body; el wizard exige los identificadores que falten. */
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsArray()
|
|
38
|
+
@ValidateNested({ each: true })
|
|
39
|
+
@Type(() => CompleteSaleLine)
|
|
40
|
+
lines?: CompleteSaleLine[];
|
|
41
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
2
|
import { IsOptional, IsString } from 'class-validator';
|
|
3
3
|
|
|
4
|
-
/** DELETE /wizard/sessions/:id/product —
|
|
4
|
+
/** DELETE /wizard/sessions/:id/product — quita una línea de la venta y libera su reserva en el catálogo. */
|
|
5
5
|
export class DeleteProductRequest {
|
|
6
6
|
/** Opcional a propósito: exigirlo rompe a los callers que liberan la reserva sin mandar el imei. */
|
|
7
7
|
@Expose()
|
|
8
8
|
@IsOptional()
|
|
9
9
|
@IsString()
|
|
10
10
|
imei?: string;
|
|
11
|
+
|
|
12
|
+
/** Línea a quitar de la venta. */
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
lineId?: string;
|
|
11
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsInt, Min } from 'class-validator';
|
|
2
|
+
import { IsInt, IsOptional, IsString, Min, MinLength } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* POST /wizard/sessions/:id/quote — términos elegidos en el cotizador del paso 06 (slider de
|
|
@@ -18,4 +18,11 @@ export class QuoteRequest {
|
|
|
18
18
|
@IsInt()
|
|
19
19
|
@Min(1)
|
|
20
20
|
termWeeks!: number;
|
|
21
|
+
|
|
22
|
+
/** Línea que se financia; su precio fijado es el del crédito. */
|
|
23
|
+
@Expose()
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@IsString()
|
|
26
|
+
@MinLength(1)
|
|
27
|
+
financedLineId?: string;
|
|
21
28
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsString, MinLength } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Query de GET /wizard/sessions/:id/lines/:lineId/identifiers; sku es el componente si la línea es kit. */
|
|
5
|
+
export class SuggestIdentifiersQuery {
|
|
6
|
+
@Expose()
|
|
7
|
+
@IsString()
|
|
8
|
+
@MinLength(1)
|
|
9
|
+
sku!: string;
|
|
10
|
+
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsString()
|
|
13
|
+
@MinLength(4)
|
|
14
|
+
prefix!: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Estado de una línea reservada de la sesión. */
|
|
2
|
+
export 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
|
+
}
|
|
@@ -24,6 +24,8 @@ export * from './enums/AppOnboardingStepEnum';
|
|
|
24
24
|
export * from './enums/AppOnboardingStepStatusEnum';
|
|
25
25
|
export * from './enums/BlockedReasonEnum';
|
|
26
26
|
export * from './enums/BlockedCategoryEnum';
|
|
27
|
+
export * from './enums/WizardLineStatusEnum';
|
|
28
|
+
export * from './enums/LinePaymentTypeEnum';
|
|
27
29
|
|
|
28
30
|
// DTOs anidados
|
|
29
31
|
export * from './dtos/WizardConsents';
|
|
@@ -39,6 +41,10 @@ export * from './dtos/AccountStep';
|
|
|
39
41
|
export * from './dtos/AppOnboardingStep';
|
|
40
42
|
export * from './dtos/WizardResumeTarget';
|
|
41
43
|
export * from './dtos/WizardBlocked';
|
|
44
|
+
export * from './dtos/WizardLineProduct';
|
|
45
|
+
export * from './dtos/WizardLineIdentifiers';
|
|
46
|
+
export * from './dtos/WizardReservedLine';
|
|
47
|
+
export * from './dtos/SaleLine';
|
|
42
48
|
|
|
43
49
|
// Entidades principales (shapes de estado/persistencia — planas)
|
|
44
50
|
export * from './dtos/WizardSession';
|
|
@@ -80,6 +86,8 @@ export * from './dtos/requests/QuoteRequest';
|
|
|
80
86
|
export * from './dtos/requests/DownPaymentRequest';
|
|
81
87
|
export * from './dtos/requests/SignatureSignRequest';
|
|
82
88
|
export * from './dtos/requests/RegisterDeviceRequest';
|
|
89
|
+
export * from './dtos/requests/CompleteSaleRequest';
|
|
90
|
+
export * from './dtos/requests/SuggestIdentifiersQuery';
|
|
83
91
|
|
|
84
92
|
// Response DTOs (output tipado por endpoint)
|
|
85
93
|
export * from './dtos/responses/KycPrepareResponse';
|