@fiado/type-kit 3.460.0 → 3.462.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/loanCredit/customerPaymentDtos.test.ts +87 -0
- package/_test_/unit/loanCredit/dtos/createCustomerPaymentRequest.test.ts +78 -0
- package/_test_/unit/retailCatalog/catalogEnums.test.ts +34 -0
- package/_test_/unit/retailCatalog/stockRequests.test.ts +156 -0
- package/_test_/unit/retailLoan/paymentContract.test.ts +128 -0
- package/_test_/unit/retailWizard/multiItemRequests.test.ts +114 -0
- package/_test_/unit/retailWizard/multiItemShapes.test.ts +126 -0
- package/bin/loanCredit/dtos/requests/CreateCustomerPaymentRequest.d.ts +9 -0
- package/bin/loanCredit/dtos/requests/CreateCustomerPaymentRequest.js +35 -0
- package/bin/loanCredit/dtos/responses/LoanAdHocChargeRequested.d.ts +6 -0
- package/bin/loanCredit/dtos/responses/LoanCustomerPaymentOptions.d.ts +33 -0
- package/bin/loanCredit/dtos/responses/LoanCustomerPaymentOptions.js +2 -0
- package/bin/loanCredit/dtos/responses/LoanCustomerPaymentResult.d.ts +14 -0
- package/bin/loanCredit/dtos/responses/LoanCustomerPaymentResult.js +2 -0
- package/bin/loanCredit/enums/LoanCustomerPaymentTypeEnum.d.ts +5 -0
- package/bin/loanCredit/enums/LoanCustomerPaymentTypeEnum.js +9 -0
- package/bin/loanCredit/enums/LoanNextInstallmentModeEnum.d.ts +7 -0
- package/bin/loanCredit/enums/LoanNextInstallmentModeEnum.js +11 -0
- package/bin/loanCredit/enums/LoanPaymentOptionUnavailableReasonEnum.d.ts +13 -0
- package/bin/loanCredit/enums/LoanPaymentOptionUnavailableReasonEnum.js +17 -0
- package/bin/loanCredit/index.d.ts +6 -0
- package/bin/loanCredit/index.js +7 -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/retailLoan/dtos/CreateMyPaymentRequest.d.ts +7 -0
- package/bin/retailLoan/dtos/CreateMyPaymentRequest.js +30 -0
- package/bin/retailLoan/dtos/CreateMyPaymentResponse.d.ts +9 -0
- package/bin/retailLoan/dtos/CreateMyPaymentResponse.js +2 -0
- package/bin/retailLoan/dtos/MyPaymentOptions.d.ts +34 -0
- package/bin/retailLoan/dtos/MyPaymentOptions.js +2 -0
- package/bin/retailLoan/enums/MyCollectionOutcomeEnum.d.ts +11 -0
- package/bin/retailLoan/enums/MyCollectionOutcomeEnum.js +15 -0
- package/bin/retailLoan/enums/MyNextInstallmentModeEnum.d.ts +5 -0
- package/bin/retailLoan/enums/MyNextInstallmentModeEnum.js +9 -0
- package/bin/retailLoan/enums/MyPaymentTypeEnum.d.ts +6 -0
- package/bin/retailLoan/enums/MyPaymentTypeEnum.js +10 -0
- package/bin/retailLoan/enums/MyPaymentUnavailableReasonEnum.d.ts +8 -0
- package/bin/retailLoan/enums/MyPaymentUnavailableReasonEnum.js +12 -0
- package/bin/retailLoan/index.d.ts +7 -0
- package/bin/retailLoan/index.js +8 -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/loanCredit/dtos/requests/CreateCustomerPaymentRequest.ts +21 -0
- package/src/loanCredit/dtos/responses/LoanAdHocChargeRequested.ts +3 -0
- package/src/loanCredit/dtos/responses/LoanCustomerPaymentOptions.ts +32 -0
- package/src/loanCredit/dtos/responses/LoanCustomerPaymentResult.ts +12 -0
- package/src/loanCredit/enums/LoanCustomerPaymentTypeEnum.ts +5 -0
- package/src/loanCredit/enums/LoanNextInstallmentModeEnum.ts +7 -0
- package/src/loanCredit/enums/LoanPaymentOptionUnavailableReasonEnum.ts +13 -0
- package/src/loanCredit/index.ts +8 -0
- 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/retailLoan/dtos/CreateMyPaymentRequest.ts +16 -0
- package/src/retailLoan/dtos/CreateMyPaymentResponse.ts +10 -0
- package/src/retailLoan/dtos/MyPaymentOptions.ts +28 -0
- package/src/retailLoan/enums/MyCollectionOutcomeEnum.ts +11 -0
- package/src/retailLoan/enums/MyNextInstallmentModeEnum.ts +5 -0
- package/src/retailLoan/enums/MyPaymentTypeEnum.ts +6 -0
- package/src/retailLoan/enums/MyPaymentUnavailableReasonEnum.ts +8 -0
- package/src/retailLoan/index.ts +9 -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
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import {
|
|
3
|
+
LinePaymentTypeEnum,
|
|
4
|
+
WizardLineStatusEnum,
|
|
5
|
+
type Sale,
|
|
6
|
+
type SaleLine,
|
|
7
|
+
type WizardProduct,
|
|
8
|
+
type WizardReservedLine,
|
|
9
|
+
type WizardSession,
|
|
10
|
+
} from '../../../src/retailWizard';
|
|
11
|
+
import { MdmProviderEnum, ProductCategoryEnum, TrackingModeEnum } from '../../../src/retailCatalog';
|
|
12
|
+
|
|
13
|
+
describe('enums del inventario multi-item', () => {
|
|
14
|
+
it('WizardLineStatusEnum tiene los 3 estados de la línea', () => {
|
|
15
|
+
expect(Object.values(WizardLineStatusEnum)).toEqual(['PENDING', 'RESERVED', 'RELEASING']);
|
|
16
|
+
});
|
|
17
|
+
it('LinePaymentTypeEnum distingue crédito y contado', () => {
|
|
18
|
+
expect(Object.values(LinePaymentTypeEnum)).toEqual(['CREDIT', 'CASH']);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('formas de sesión, línea y venta', () => {
|
|
23
|
+
const kitLine: WizardReservedLine = {
|
|
24
|
+
lineId: 'L1',
|
|
25
|
+
sku: 'KIT-1',
|
|
26
|
+
qty: 1,
|
|
27
|
+
status: WizardLineStatusEnum.RESERVED,
|
|
28
|
+
reservationId: 'r-1',
|
|
29
|
+
expiresAt: '2026-09-23T20:30:00.000Z',
|
|
30
|
+
basePriceCents: 500000,
|
|
31
|
+
listPriceCents: 550000,
|
|
32
|
+
priceSk: '2026-09-01T00:00:00.000Z',
|
|
33
|
+
eligibleFinanciers: ['SUREKEEP'],
|
|
34
|
+
financeable: true,
|
|
35
|
+
paymentType: LinePaymentTypeEnum.CREDIT,
|
|
36
|
+
sellItemCost: 2,
|
|
37
|
+
mdmEnabled: true,
|
|
38
|
+
mdmProvider: MdmProviderEnum.TRUSTONIC,
|
|
39
|
+
components: [
|
|
40
|
+
{ sku: 'PHONE-1', qty: 1, category: ProductCategoryEnum.PHONE, trackingMode: TrackingModeEnum.IMEI },
|
|
41
|
+
{ sku: 'SIM-1', qty: 1, category: ProductCategoryEnum.SIM, trackingMode: TrackingModeEnum.SERIAL },
|
|
42
|
+
],
|
|
43
|
+
identifiers: [
|
|
44
|
+
{ sku: 'PHONE-1', identifiers: ['356938035643809'] },
|
|
45
|
+
{ sku: 'SIM-1', identifiers: ['8952140'] },
|
|
46
|
+
],
|
|
47
|
+
product: {
|
|
48
|
+
brand: 'Moto',
|
|
49
|
+
model: 'G',
|
|
50
|
+
capacity: '128GB',
|
|
51
|
+
color: 'Negro',
|
|
52
|
+
imageUrl: null,
|
|
53
|
+
tier: null,
|
|
54
|
+
category: ProductCategoryEnum.BUNDLE,
|
|
55
|
+
trackingMode: TrackingModeEnum.QUANTITY,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const pendingLine: WizardReservedLine = {
|
|
60
|
+
lineId: 'L2',
|
|
61
|
+
sku: 'CASE-1',
|
|
62
|
+
qty: 2,
|
|
63
|
+
status: WizardLineStatusEnum.PENDING,
|
|
64
|
+
reservationId: 'r-2',
|
|
65
|
+
expiresAt: '2026-09-23T20:30:00.000Z',
|
|
66
|
+
basePriceCents: null,
|
|
67
|
+
listPriceCents: null,
|
|
68
|
+
priceSk: null,
|
|
69
|
+
eligibleFinanciers: [],
|
|
70
|
+
financeable: false,
|
|
71
|
+
paymentType: null,
|
|
72
|
+
sellItemCost: null,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
it('la sesión acepta reservedLines y financedLineId sin tocar los campos espejo', () => {
|
|
76
|
+
const session: Pick<WizardSession, 'reservedLines' | 'financedLineId' | 'reservedSku' | 'reservedImei'> = {
|
|
77
|
+
reservedLines: [kitLine, pendingLine],
|
|
78
|
+
financedLineId: 'L1',
|
|
79
|
+
reservedSku: 'PHONE-1',
|
|
80
|
+
reservedImei: '356938035643809',
|
|
81
|
+
};
|
|
82
|
+
expect(session.reservedLines).toHaveLength(2);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('WizardProduct acepta lineId, categoría y rastreo como espejo', () => {
|
|
86
|
+
const product: WizardProduct = {
|
|
87
|
+
sku: 'PHONE-1',
|
|
88
|
+
imei: '356938035643809',
|
|
89
|
+
cashPriceCents: 500000,
|
|
90
|
+
brand: 'Moto',
|
|
91
|
+
model: 'G',
|
|
92
|
+
capacity: '128GB',
|
|
93
|
+
color: 'Negro',
|
|
94
|
+
imageUrl: null,
|
|
95
|
+
tier: 'MID',
|
|
96
|
+
eligibleFinanciers: ['SUREKEEP'],
|
|
97
|
+
lineId: 'L1',
|
|
98
|
+
category: ProductCategoryEnum.PHONE,
|
|
99
|
+
trackingMode: TrackingModeEnum.IMEI,
|
|
100
|
+
};
|
|
101
|
+
expect(product.lineId).toBe('L1');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('la venta acepta lines, skus e inventoryReturnPending', () => {
|
|
105
|
+
const line: SaleLine = {
|
|
106
|
+
lineId: 'L1',
|
|
107
|
+
sku: 'KIT-1',
|
|
108
|
+
qty: 1,
|
|
109
|
+
basePriceCents: 500000,
|
|
110
|
+
listPriceCents: 550000,
|
|
111
|
+
priceSk: '2026-09-01T00:00:00.000Z',
|
|
112
|
+
paymentType: LinePaymentTypeEnum.CREDIT,
|
|
113
|
+
components: [
|
|
114
|
+
{ sku: 'PHONE-1', qty: 1, identifiers: ['356938035643809'] },
|
|
115
|
+
{ sku: 'SIM-1', qty: 1, identifiers: ['8952140'] },
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
const sale: Pick<Sale, 'lines' | 'skus' | 'inventoryReturnPending' | 'sku'> = {
|
|
119
|
+
lines: [line],
|
|
120
|
+
skus: ['KIT-1', 'PHONE-1', 'SIM-1'],
|
|
121
|
+
inventoryReturnPending: false,
|
|
122
|
+
sku: 'PHONE-1',
|
|
123
|
+
};
|
|
124
|
+
expect(sale.lines?.[0].components).toHaveLength(2);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LoanCustomerPaymentTypeEnum } from '../../enums/LoanCustomerPaymentTypeEnum';
|
|
2
|
+
/** Body de `POST /private/customers/:directoryId/credits/:creditId/payments` (loan-credit-business). */
|
|
3
|
+
export declare class CreateCustomerPaymentRequest {
|
|
4
|
+
type: LoanCustomerPaymentTypeEnum;
|
|
5
|
+
/** Monto que vio el cliente; si ya no coincide, responde 409 CUSTOMER_PAYMENT_AMOUNT_CHANGED. */
|
|
6
|
+
expectedAmountCents: number;
|
|
7
|
+
/** Llave del reintento: la misma llave con el mismo cuerpo devuelve la misma respuesta. */
|
|
8
|
+
idempotencyKey: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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.CreateCustomerPaymentRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const LoanCustomerPaymentTypeEnum_1 = require("../../enums/LoanCustomerPaymentTypeEnum");
|
|
16
|
+
/** Body de `POST /private/customers/:directoryId/credits/:creditId/payments` (loan-credit-business). */
|
|
17
|
+
class CreateCustomerPaymentRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.CreateCustomerPaymentRequest = CreateCustomerPaymentRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_transformer_1.Expose)(),
|
|
22
|
+
(0, class_validator_1.IsEnum)(LoanCustomerPaymentTypeEnum_1.LoanCustomerPaymentTypeEnum),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CreateCustomerPaymentRequest.prototype, "type", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsInt)(),
|
|
28
|
+
(0, class_validator_1.Min)(1),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], CreateCustomerPaymentRequest.prototype, "expectedAmountCents", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, class_validator_1.IsUUID)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], CreateCustomerPaymentRequest.prototype, "idempotencyKey", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CollectionResultStatus } from '../../../collection/enums/CollectionResultStatus';
|
|
1
2
|
import { LoanAdHocChargeKindEnum } from '../../enums/LoanAdHocChargeKindEnum';
|
|
2
3
|
/** Response 202 de recovery-collection, prepayments y advances. El 202 no mueve el libro; lo mueve el apply-result. */
|
|
3
4
|
export interface LoanAdHocChargeRequested {
|
|
@@ -6,4 +7,9 @@ export interface LoanAdHocChargeRequested {
|
|
|
6
7
|
/** `<creditId>#<chargeKind>#<n>`. */
|
|
7
8
|
chargeId: string;
|
|
8
9
|
amountCents: number;
|
|
10
|
+
/** Respuesta síncrona del motor; ausente si no contestó a tiempo. */
|
|
11
|
+
collection?: {
|
|
12
|
+
status: CollectionResultStatus;
|
|
13
|
+
amountCollectedCents: number;
|
|
14
|
+
};
|
|
9
15
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LoanAdHocChargeKindEnum } from '../../enums/LoanAdHocChargeKindEnum';
|
|
2
|
+
import { LoanNextInstallmentModeEnum } from '../../enums/LoanNextInstallmentModeEnum';
|
|
3
|
+
import { LoanPaymentOptionUnavailableReasonEnum } from '../../enums/LoanPaymentOptionUnavailableReasonEnum';
|
|
4
|
+
import { LoanSettlementQuote } from './LoanSettlementQuote';
|
|
5
|
+
/** Una opción de pago. `amountCents` solo viene si está disponible. */
|
|
6
|
+
export interface LoanCustomerPaymentOption {
|
|
7
|
+
available: boolean;
|
|
8
|
+
unavailableReason?: LoanPaymentOptionUnavailableReasonEnum;
|
|
9
|
+
amountCents?: number;
|
|
10
|
+
}
|
|
11
|
+
/** Response de `GET /private/customers/:directoryId/credits/:creditId/payment-options`. Montos en cents. */
|
|
12
|
+
export interface LoanCustomerPaymentOptions {
|
|
13
|
+
creditId: string;
|
|
14
|
+
/** Cargo ad hoc en curso; mientras exista, ninguna opción está disponible. */
|
|
15
|
+
pendingCharge?: {
|
|
16
|
+
kind: LoanAdHocChargeKindEnum;
|
|
17
|
+
amountCents: number;
|
|
18
|
+
};
|
|
19
|
+
nextInstallment: LoanCustomerPaymentOption & {
|
|
20
|
+
mode?: LoanNextInstallmentModeEnum;
|
|
21
|
+
installmentNumber?: number;
|
|
22
|
+
/** `YYYY-MM-DD`. */
|
|
23
|
+
dueDate?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Varias cuotas: hoy siempre `available: false` con `NOT_AVAILABLE_YET`. */
|
|
26
|
+
advance: LoanCustomerPaymentOption;
|
|
27
|
+
settlement: LoanCustomerPaymentOption & {
|
|
28
|
+
/** La cotización de hoy; su `settlementAmountCents` es el `amountCents`. */
|
|
29
|
+
quote?: LoanSettlementQuote;
|
|
30
|
+
/** Lo que deben las cuotas abiertas menos `settlementAmountCents`. */
|
|
31
|
+
savingsCents?: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CollectionResultStatus } from '../../../collection/enums/CollectionResultStatus';
|
|
2
|
+
import { LoanCustomerPaymentTypeEnum } from '../../enums/LoanCustomerPaymentTypeEnum';
|
|
3
|
+
/** Response 202 de `POST /private/customers/:directoryId/credits/:creditId/payments`. */
|
|
4
|
+
export interface LoanCustomerPaymentResult {
|
|
5
|
+
creditId: string;
|
|
6
|
+
type: LoanCustomerPaymentTypeEnum;
|
|
7
|
+
chargeId: string;
|
|
8
|
+
amountCents: number;
|
|
9
|
+
/** Respuesta síncrona del motor; ausente si no contestó a tiempo. */
|
|
10
|
+
collection?: {
|
|
11
|
+
status: CollectionResultStatus;
|
|
12
|
+
amountCollectedCents: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoanCustomerPaymentTypeEnum = void 0;
|
|
4
|
+
/** Pago que el cliente puede pedir desde la app. */
|
|
5
|
+
var LoanCustomerPaymentTypeEnum;
|
|
6
|
+
(function (LoanCustomerPaymentTypeEnum) {
|
|
7
|
+
LoanCustomerPaymentTypeEnum["NEXT_INSTALLMENT"] = "NEXT_INSTALLMENT";
|
|
8
|
+
LoanCustomerPaymentTypeEnum["SETTLEMENT"] = "SETTLEMENT";
|
|
9
|
+
})(LoanCustomerPaymentTypeEnum || (exports.LoanCustomerPaymentTypeEnum = LoanCustomerPaymentTypeEnum = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Cómo se cobra la siguiente cuota. */
|
|
2
|
+
export declare enum LoanNextInstallmentModeEnum {
|
|
3
|
+
/** La cuota aún no está registrada en el motor: se adelanta. */
|
|
4
|
+
ADVANCE = "ADVANCE",
|
|
5
|
+
/** Vence hoy o hay vencidas: se cobra lo exigible. */
|
|
6
|
+
COLLECT_DUE = "COLLECT_DUE"
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoanNextInstallmentModeEnum = void 0;
|
|
4
|
+
/** Cómo se cobra la siguiente cuota. */
|
|
5
|
+
var LoanNextInstallmentModeEnum;
|
|
6
|
+
(function (LoanNextInstallmentModeEnum) {
|
|
7
|
+
/** La cuota aún no está registrada en el motor: se adelanta. */
|
|
8
|
+
LoanNextInstallmentModeEnum["ADVANCE"] = "ADVANCE";
|
|
9
|
+
/** Vence hoy o hay vencidas: se cobra lo exigible. */
|
|
10
|
+
LoanNextInstallmentModeEnum["COLLECT_DUE"] = "COLLECT_DUE";
|
|
11
|
+
})(LoanNextInstallmentModeEnum || (exports.LoanNextInstallmentModeEnum = LoanNextInstallmentModeEnum = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Por qué una opción de pago no está disponible. */
|
|
2
|
+
export declare enum LoanPaymentOptionUnavailableReasonEnum {
|
|
3
|
+
/** Hay un cargo ad hoc en curso. */
|
|
4
|
+
PAYMENT_IN_PROGRESS = "PAYMENT_IN_PROGRESS",
|
|
5
|
+
/** El crédito todavía no está activo. */
|
|
6
|
+
CREDIT_NOT_CURRENT = "CREDIT_NOT_CURRENT",
|
|
7
|
+
/** Adelantar cubriría todo lo abierto: se liquida. */
|
|
8
|
+
USE_SETTLEMENT = "USE_SETTLEMENT",
|
|
9
|
+
/** La opción aún no está habilitada. */
|
|
10
|
+
NOT_AVAILABLE_YET = "NOT_AVAILABLE_YET",
|
|
11
|
+
/** SETTLED, WRITTEN_OFF, CANCELLED o DISCARDED. */
|
|
12
|
+
CREDIT_CLOSED = "CREDIT_CLOSED"
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoanPaymentOptionUnavailableReasonEnum = void 0;
|
|
4
|
+
/** Por qué una opción de pago no está disponible. */
|
|
5
|
+
var LoanPaymentOptionUnavailableReasonEnum;
|
|
6
|
+
(function (LoanPaymentOptionUnavailableReasonEnum) {
|
|
7
|
+
/** Hay un cargo ad hoc en curso. */
|
|
8
|
+
LoanPaymentOptionUnavailableReasonEnum["PAYMENT_IN_PROGRESS"] = "PAYMENT_IN_PROGRESS";
|
|
9
|
+
/** El crédito todavía no está activo. */
|
|
10
|
+
LoanPaymentOptionUnavailableReasonEnum["CREDIT_NOT_CURRENT"] = "CREDIT_NOT_CURRENT";
|
|
11
|
+
/** Adelantar cubriría todo lo abierto: se liquida. */
|
|
12
|
+
LoanPaymentOptionUnavailableReasonEnum["USE_SETTLEMENT"] = "USE_SETTLEMENT";
|
|
13
|
+
/** La opción aún no está habilitada. */
|
|
14
|
+
LoanPaymentOptionUnavailableReasonEnum["NOT_AVAILABLE_YET"] = "NOT_AVAILABLE_YET";
|
|
15
|
+
/** SETTLED, WRITTEN_OFF, CANCELLED o DISCARDED. */
|
|
16
|
+
LoanPaymentOptionUnavailableReasonEnum["CREDIT_CLOSED"] = "CREDIT_CLOSED";
|
|
17
|
+
})(LoanPaymentOptionUnavailableReasonEnum || (exports.LoanPaymentOptionUnavailableReasonEnum = LoanPaymentOptionUnavailableReasonEnum = {}));
|
|
@@ -131,3 +131,9 @@ export * from './dtos/responses/LoanPrepaymentQuote';
|
|
|
131
131
|
export * from './dtos/responses/LoanPaymentReviewItem';
|
|
132
132
|
export * from './dtos/responses/LoanPaymentReviewListResponse';
|
|
133
133
|
export * from './dtos/responses/LoanPaymentReviewResolution';
|
|
134
|
+
export * from './enums/LoanCustomerPaymentTypeEnum';
|
|
135
|
+
export * from './enums/LoanNextInstallmentModeEnum';
|
|
136
|
+
export * from './enums/LoanPaymentOptionUnavailableReasonEnum';
|
|
137
|
+
export * from './dtos/requests/CreateCustomerPaymentRequest';
|
|
138
|
+
export * from './dtos/responses/LoanCustomerPaymentOptions';
|
|
139
|
+
export * from './dtos/responses/LoanCustomerPaymentResult';
|
package/bin/loanCredit/index.js
CHANGED
|
@@ -172,3 +172,10 @@ __exportStar(require("./dtos/responses/LoanPrepaymentQuote"), exports);
|
|
|
172
172
|
__exportStar(require("./dtos/responses/LoanPaymentReviewItem"), exports);
|
|
173
173
|
__exportStar(require("./dtos/responses/LoanPaymentReviewListResponse"), exports);
|
|
174
174
|
__exportStar(require("./dtos/responses/LoanPaymentReviewResolution"), exports);
|
|
175
|
+
// Pagos del cliente: contrato privado con retail-loan-business
|
|
176
|
+
__exportStar(require("./enums/LoanCustomerPaymentTypeEnum"), exports);
|
|
177
|
+
__exportStar(require("./enums/LoanNextInstallmentModeEnum"), exports);
|
|
178
|
+
__exportStar(require("./enums/LoanPaymentOptionUnavailableReasonEnum"), exports);
|
|
179
|
+
__exportStar(require("./dtos/requests/CreateCustomerPaymentRequest"), exports);
|
|
180
|
+
__exportStar(require("./dtos/responses/LoanCustomerPaymentOptions"), exports);
|
|
181
|
+
__exportStar(require("./dtos/responses/LoanCustomerPaymentResult"), exports);
|
|
@@ -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
|
* Product — aggregate root del catálogo del dominio `retailCatalog`
|
|
7
10
|
* (lambda retail-catalog-business, SureKeep Fase 1 — pista Retail).
|
|
@@ -19,7 +22,8 @@ export declare class Product {
|
|
|
19
22
|
description: string;
|
|
20
23
|
specs: Record<string, unknown> | null;
|
|
21
24
|
imageUrl: string | null;
|
|
22
|
-
|
|
25
|
+
/** `null` = Sin gama. */
|
|
26
|
+
tier: ProductTierEnum | null;
|
|
23
27
|
basePriceCents: number;
|
|
24
28
|
listPriceCents: number | null;
|
|
25
29
|
eligibleFinanciers: string[];
|
|
@@ -31,4 +35,14 @@ export declare class Product {
|
|
|
31
35
|
updatedBy: string;
|
|
32
36
|
createdAt: string;
|
|
33
37
|
updatedAt: string;
|
|
38
|
+
category?: ProductCategoryEnum;
|
|
39
|
+
trackingMode?: TrackingModeEnum;
|
|
40
|
+
/** Se puede vender suelto (fuera de un kit). */
|
|
41
|
+
sellable?: boolean;
|
|
42
|
+
/** Aparece en el catálogo del flujo de venta. */
|
|
43
|
+
showInSalesFlow?: boolean;
|
|
44
|
+
/** Solo en BUNDLE. */
|
|
45
|
+
components?: ProductComponent[] | null;
|
|
46
|
+
/** Llave del registro PRICE# del que salen basePriceCents y listPriceCents. */
|
|
47
|
+
currentPriceSk?: string | null;
|
|
34
48
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.ProductComponent = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const SkuPattern_1 = require("../constants/SkuPattern");
|
|
15
|
+
/** Componente de un kit (BUNDLE): qué SKU consume y cuántas piezas por kit. */
|
|
16
|
+
class ProductComponent {
|
|
17
|
+
}
|
|
18
|
+
exports.ProductComponent = ProductComponent;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.Matches)(SkuPattern_1.SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' }),
|
|
21
|
+
(0, class_validator_1.Length)(1, 64),
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], ProductComponent.prototype, "sku", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsInt)(),
|
|
27
|
+
(0, class_validator_1.Min)(1),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], ProductComponent.prototype, "qty", void 0);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InventoryLensPeriodEnum } from '../../enums/InventoryLensPeriodEnum';
|
|
2
|
+
/** Query de GET /backoffice/inventory/skus/{sku} (backofficeGetInventorySku); el retailer sale del token. */
|
|
3
|
+
export declare class GetInventorySkuQuery {
|
|
4
|
+
period?: InventoryLensPeriodEnum;
|
|
5
|
+
/** Debe pertenecer al retailer del token. */
|
|
6
|
+
storeId?: string;
|
|
7
|
+
/** Tamaño de página del libro de movimientos. */
|
|
8
|
+
limit?: number;
|
|
9
|
+
nextToken?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.GetInventorySkuQuery = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const InventoryLensPeriodEnum_1 = require("../../enums/InventoryLensPeriodEnum");
|
|
16
|
+
/** Query de GET /backoffice/inventory/skus/{sku} (backofficeGetInventorySku); el retailer sale del token. */
|
|
17
|
+
class GetInventorySkuQuery {
|
|
18
|
+
}
|
|
19
|
+
exports.GetInventorySkuQuery = GetInventorySkuQuery;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsOptional)(),
|
|
22
|
+
(0, class_validator_1.IsEnum)(InventoryLensPeriodEnum_1.InventoryLensPeriodEnum),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], GetInventorySkuQuery.prototype, "period", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], GetInventorySkuQuery.prototype, "storeId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
33
|
+
(0, class_validator_1.IsInt)(),
|
|
34
|
+
(0, class_validator_1.Min)(1),
|
|
35
|
+
(0, class_validator_1.Max)(100),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], GetInventorySkuQuery.prototype, "limit", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], GetInventorySkuQuery.prototype, "nextToken", void 0);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InventoryLensFilterEnum } from '../../enums/InventoryLensFilterEnum';
|
|
2
|
+
import { InventoryLensPeriodEnum } from '../../enums/InventoryLensPeriodEnum';
|
|
2
3
|
/**
|
|
3
4
|
* Query string de `GET /backoffice/inventory/lens`. SureKeep Fase 3 — pista Retail.
|
|
4
5
|
*
|
|
@@ -10,4 +11,8 @@ import { InventoryLensFilterEnum } from '../../enums/InventoryLensFilterEnum';
|
|
|
10
11
|
*/
|
|
11
12
|
export declare class InventoryLensQuery {
|
|
12
13
|
filter: InventoryLensFilterEnum;
|
|
14
|
+
/** Solo `filter=list`: periodo de ventas y cobertura. */
|
|
15
|
+
period?: InventoryLensPeriodEnum;
|
|
16
|
+
/** Solo `filter=list`: una tienda del retailer del token; ausente = consolidado. */
|
|
17
|
+
storeId?: string;
|
|
13
18
|
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.InventoryLensQuery = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const InventoryLensFilterEnum_1 = require("../../enums/InventoryLensFilterEnum");
|
|
15
|
+
const InventoryLensPeriodEnum_1 = require("../../enums/InventoryLensPeriodEnum");
|
|
15
16
|
/**
|
|
16
17
|
* Query string de `GET /backoffice/inventory/lens`. SureKeep Fase 3 — pista Retail.
|
|
17
18
|
*
|
|
@@ -28,3 +29,13 @@ __decorate([
|
|
|
28
29
|
(0, class_validator_1.IsEnum)(InventoryLensFilterEnum_1.InventoryLensFilterEnum),
|
|
29
30
|
__metadata("design:type", String)
|
|
30
31
|
], InventoryLensQuery.prototype, "filter", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_validator_1.IsEnum)(InventoryLensPeriodEnum_1.InventoryLensPeriodEnum),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], InventoryLensQuery.prototype, "period", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], InventoryLensQuery.prototype, "storeId", void 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReservationLineRef } from './ReservationLineRef';
|
|
2
|
+
/** Body de PUT /private/stores/{storeId}/reservations/release (privateReleaseStock). */
|
|
3
|
+
export declare class ReleaseStockRequest {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
lines: ReservationLineRef[];
|
|
6
|
+
/** `true` = solo libera las reservas ya vencidas (barrido). */
|
|
7
|
+
onlyExpired: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.ReleaseStockRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const ReservationLineRef_1 = require("./ReservationLineRef");
|
|
16
|
+
/** Body de PUT /private/stores/{storeId}/reservations/release (privateReleaseStock). */
|
|
17
|
+
class ReleaseStockRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.ReleaseStockRequest = ReleaseStockRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], ReleaseStockRequest.prototype, "sessionId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsArray)(),
|
|
26
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
27
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
28
|
+
(0, class_transformer_1.Type)(() => ReservationLineRef_1.ReservationLineRef),
|
|
29
|
+
__metadata("design:type", Array)
|
|
30
|
+
], ReleaseStockRequest.prototype, "lines", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsBoolean)(),
|
|
33
|
+
__metadata("design:type", Boolean)
|
|
34
|
+
], ReleaseStockRequest.prototype, "onlyExpired", 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.RenewReservationsRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const ReservationLineRef_1 = require("./ReservationLineRef");
|
|
16
|
+
/** Body de PUT /private/stores/{storeId}/reservations/renew (privateRenewReservations). */
|
|
17
|
+
class RenewReservationsRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.RenewReservationsRequest = RenewReservationsRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], RenewReservationsRequest.prototype, "sessionId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsArray)(),
|
|
26
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
27
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
28
|
+
(0, class_transformer_1.Type)(() => ReservationLineRef_1.ReservationLineRef),
|
|
29
|
+
__metadata("design:type", Array)
|
|
30
|
+
], RenewReservationsRequest.prototype, "lines", void 0);
|
|
@@ -0,0 +1,25 @@
|
|
|
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.ReservationLineRef = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
/** Una línea de la venta y la reserva que la respalda; la usan renew y release. */
|
|
15
|
+
class ReservationLineRef {
|
|
16
|
+
}
|
|
17
|
+
exports.ReservationLineRef = ReservationLineRef;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], ReservationLineRef.prototype, "lineId", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], ReservationLineRef.prototype, "reservationId", void 0);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Body de PUT /private/stores/{storeId}/reservations (privateReserveStock); reserva una línea, kit completo. */
|
|
2
|
+
export declare class ReserveStockRequest {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
lineId: string;
|
|
5
|
+
/** Llave de idempotencia; un id nuevo por cada intento de reserva. */
|
|
6
|
+
reservationId: string;
|
|
7
|
+
retailerId: string;
|
|
8
|
+
sku: string;
|
|
9
|
+
qty: number;
|
|
10
|
+
}
|