@fiado/type-kit 3.471.0 → 3.473.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/common/IsStringValueRecord.test.ts +25 -0
- package/_test_/unit/platformRbac/dtos/tenantUserCustomFields.test.ts +55 -0
- package/_test_/unit/retailCatalog/catalogDebt.test.ts +123 -0
- package/_test_/unit/retailCatalog/catalogEnums.test.ts +2 -2
- package/_test_/unit/retailCatalog/ventaSaga.test.ts +152 -0
- package/_test_/unit/retailPromotions/computeBudgetUsedBps.test.ts +30 -0
- package/_test_/unit/retailPromotions/constants.test.ts +71 -0
- package/_test_/unit/retailPromotions/discountCodeAndWizardRequests.test.ts +84 -0
- package/_test_/unit/retailPromotions/salePromotionRequests.test.ts +151 -0
- package/_test_/unit/retailWizard/promotionM2mRequests.test.ts +189 -0
- package/_test_/unit/retailWizard/ventaSagaMessages.test.ts +163 -0
- package/_test_/unit/retailWizard/ventaSagaRequests.test.ts +59 -0
- package/_test_/unit/retailWizard/ventaSagaShapes.test.ts +99 -0
- package/bin/common/index.d.ts +1 -0
- package/bin/common/index.js +2 -0
- package/bin/common/validators/IsStringValueRecord.d.ts +5 -0
- package/bin/common/validators/IsStringValueRecord.js +25 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +5 -2
- package/bin/messagesConnector/validators/IsStringValueRecord.d.ts +1 -5
- package/bin/messagesConnector/validators/IsStringValueRecord.js +3 -21
- package/bin/platformRbac/dtos/CreateTenantUserRequest.d.ts +4 -0
- package/bin/platformRbac/dtos/CreateTenantUserRequest.js +9 -0
- package/bin/platformRbac/dtos/UpdateTenantUserRequest.d.ts +5 -2
- package/bin/platformRbac/dtos/UpdateTenantUserRequest.js +10 -2
- package/bin/retailCatalog/dtos/Product.d.ts +6 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.js +30 -0
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.d.ts +2 -0
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.js +6 -0
- package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.js +30 -0
- package/bin/retailCatalog/dtos/requests/HoldStockRequest.d.ts +12 -0
- package/bin/retailCatalog/dtos/requests/HoldStockRequest.js +47 -0
- package/bin/retailCatalog/dtos/requests/ReserveStockRequest.d.ts +3 -0
- package/bin/retailCatalog/dtos/requests/ReserveStockRequest.js +6 -0
- package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.d.ts +2 -0
- package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.js +6 -0
- package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.d.ts +3 -0
- package/bin/retailCatalog/dtos/responses/HoldStockResponse.d.ts +8 -0
- package/bin/retailCatalog/dtos/responses/HoldStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +5 -1
- package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.d.ts +5 -0
- package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.js +9 -0
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.d.ts +4 -2
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.js +3 -1
- package/bin/retailCatalog/enums/ReservePurposeEnum.d.ts +4 -0
- package/bin/retailCatalog/enums/ReservePurposeEnum.js +8 -0
- package/bin/retailCatalog/events/InventoryInboundMessage.d.ts +4 -0
- package/bin/retailCatalog/events/InventoryInboundMessage.js +2 -0
- package/bin/retailCatalog/events/InventoryReturnMessage.d.ts +12 -0
- package/bin/retailCatalog/events/InventoryReturnMessage.js +42 -0
- package/bin/retailCatalog/events/InventorySaleAppliedMessage.d.ts +12 -0
- package/bin/retailCatalog/events/InventorySaleAppliedMessage.js +42 -0
- package/bin/retailCatalog/index.d.ts +7 -0
- package/bin/retailCatalog/index.js +8 -0
- package/bin/retailPromotions/constants/bonusPreMoney.d.ts +7 -0
- package/bin/retailPromotions/constants/bonusPreMoney.js +21 -0
- package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.d.ts +3 -0
- package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +23 -0
- package/bin/retailPromotions/constants/salePromotionTransitions.d.ts +7 -0
- package/bin/retailPromotions/constants/salePromotionTransitions.js +13 -0
- package/bin/retailPromotions/dtos/DiscountCode.d.ts +35 -0
- package/bin/retailPromotions/dtos/DiscountCode.js +2 -0
- package/bin/retailPromotions/dtos/DiscountValue.d.ts +7 -0
- package/bin/retailPromotions/dtos/DiscountValue.js +2 -0
- package/bin/retailPromotions/dtos/LinePromotionDiscount.d.ts +10 -0
- package/bin/retailPromotions/dtos/LinePromotionDiscount.js +2 -0
- package/bin/retailPromotions/dtos/SalePromotion.d.ts +35 -0
- package/bin/retailPromotions/dtos/SalePromotion.js +2 -0
- package/bin/retailPromotions/dtos/SalePromotionLevers.d.ts +58 -0
- package/bin/retailPromotions/dtos/SalePromotionLevers.js +2 -0
- package/bin/retailPromotions/dtos/SalePromotionLogEntry.d.ts +18 -0
- package/bin/retailPromotions/dtos/SalePromotionLogEntry.js +2 -0
- package/bin/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.d.ts +6 -0
- package/bin/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.js +30 -0
- package/bin/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.d.ts +6 -0
- package/bin/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.js +30 -0
- package/bin/retailPromotions/dtos/requests/CreateDiscountCodeRequest.d.ts +17 -0
- package/bin/retailPromotions/dtos/requests/CreateDiscountCodeRequest.js +78 -0
- package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.d.ts +19 -0
- package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.js +83 -0
- package/bin/retailPromotions/dtos/requests/DiscountValueInput.d.ts +8 -0
- package/bin/retailPromotions/dtos/requests/DiscountValueInput.js +36 -0
- package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.d.ts +5 -0
- package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.js +31 -0
- package/bin/retailPromotions/dtos/requests/HoldSalePromotionRequest.d.ts +11 -0
- package/bin/retailPromotions/dtos/requests/HoldSalePromotionRequest.js +48 -0
- package/bin/retailPromotions/dtos/requests/ListDiscountCodesQuery.d.ts +10 -0
- package/bin/retailPromotions/dtos/requests/ListDiscountCodesQuery.js +49 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionLogQuery.d.ts +8 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionLogQuery.js +46 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.d.ts +7 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.js +40 -0
- package/bin/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.d.ts +4 -0
- package/bin/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.js +24 -0
- package/bin/retailPromotions/dtos/requests/SalePromotionLeversInput.d.ts +40 -0
- package/bin/retailPromotions/dtos/requests/SalePromotionLeversInput.js +166 -0
- package/bin/retailPromotions/dtos/requests/SalePromotionScopeInput.d.ts +14 -0
- package/bin/retailPromotions/dtos/requests/SalePromotionScopeInput.js +65 -0
- package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.d.ts +19 -0
- package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.js +85 -0
- package/bin/retailPromotions/dtos/responses/DiscountCodeResponses.d.ts +7 -0
- package/bin/retailPromotions/dtos/responses/DiscountCodeResponses.js +2 -0
- package/bin/retailPromotions/dtos/responses/SalePromotionCrudResponses.d.ts +30 -0
- package/bin/retailPromotions/dtos/responses/SalePromotionCrudResponses.js +2 -0
- package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +102 -0
- package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.js +2 -0
- package/bin/retailPromotions/enums/CouponScopeEnum.d.ts +11 -0
- package/bin/retailPromotions/enums/CouponScopeEnum.js +15 -0
- package/bin/retailPromotions/enums/CouponStatusEnum.d.ts +11 -0
- package/bin/retailPromotions/enums/CouponStatusEnum.js +15 -0
- package/bin/retailPromotions/enums/DiscountCodeOriginEnum.d.ts +8 -0
- package/bin/retailPromotions/enums/DiscountCodeOriginEnum.js +12 -0
- package/bin/retailPromotions/enums/DiscountCodeStatusEnum.d.ts +11 -0
- package/bin/retailPromotions/enums/DiscountCodeStatusEnum.js +15 -0
- package/bin/retailPromotions/enums/DiscountCodeTransitionEnum.d.ts +7 -0
- package/bin/retailPromotions/enums/DiscountCodeTransitionEnum.js +11 -0
- package/bin/retailPromotions/enums/DiscountTypeEnum.d.ts +8 -0
- package/bin/retailPromotions/enums/DiscountTypeEnum.js +12 -0
- package/bin/retailPromotions/enums/EntitlementKindEnum.d.ts +9 -0
- package/bin/retailPromotions/enums/EntitlementKindEnum.js +13 -0
- package/bin/retailPromotions/enums/EntitlementStateEnum.d.ts +13 -0
- package/bin/retailPromotions/enums/EntitlementStateEnum.js +17 -0
- package/bin/retailPromotions/enums/GiftModeEnum.d.ts +8 -0
- package/bin/retailPromotions/enums/GiftModeEnum.js +12 -0
- package/bin/retailPromotions/enums/PromotionAppliesToEnum.d.ts +9 -0
- package/bin/retailPromotions/enums/PromotionAppliesToEnum.js +13 -0
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +23 -0
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +27 -0
- package/bin/retailPromotions/enums/SaleCouponAvailabilityEnum.d.ts +10 -0
- package/bin/retailPromotions/enums/SaleCouponAvailabilityEnum.js +14 -0
- package/bin/retailPromotions/enums/SalePromotionLeverEnum.d.ts +13 -0
- package/bin/retailPromotions/enums/SalePromotionLeverEnum.js +17 -0
- package/bin/retailPromotions/enums/SalePromotionLogEventEnum.d.ts +14 -0
- package/bin/retailPromotions/enums/SalePromotionLogEventEnum.js +18 -0
- package/bin/retailPromotions/enums/SalePromotionLogFormatEnum.d.ts +5 -0
- package/bin/retailPromotions/enums/SalePromotionLogFormatEnum.js +9 -0
- package/bin/retailPromotions/enums/SalePromotionPhaseEnum.d.ts +11 -0
- package/bin/retailPromotions/enums/SalePromotionPhaseEnum.js +15 -0
- package/bin/retailPromotions/enums/SalePromotionStatusEnum.d.ts +12 -0
- package/bin/retailPromotions/enums/SalePromotionStatusEnum.js +16 -0
- package/bin/retailPromotions/enums/SalePromotionTransitionEnum.d.ts +13 -0
- package/bin/retailPromotions/enums/SalePromotionTransitionEnum.js +17 -0
- package/bin/retailPromotions/helpers/computeBudgetUsedBps.d.ts +3 -0
- package/bin/retailPromotions/helpers/computeBudgetUsedBps.js +15 -0
- package/bin/retailPromotions/helpers/resolveSalePromotionTransition.d.ts +4 -0
- package/bin/retailPromotions/helpers/resolveSalePromotionTransition.js +9 -0
- package/bin/retailPromotions/index.d.ts +46 -0
- package/bin/retailPromotions/index.js +67 -0
- package/bin/retailWizard/dtos/Sale.d.ts +8 -8
- package/bin/retailWizard/dtos/SaleLine.d.ts +4 -1
- package/bin/retailWizard/dtos/WizardFinancingPreview.d.ts +11 -0
- package/bin/retailWizard/dtos/WizardFinancingPreview.js +2 -0
- package/bin/retailWizard/dtos/WizardGiftLine.d.ts +8 -0
- package/bin/retailWizard/dtos/WizardGiftLine.js +2 -0
- package/bin/retailWizard/dtos/WizardLinePromotionFields.d.ts +15 -0
- package/bin/retailWizard/dtos/WizardLinePromotionFields.js +2 -0
- package/bin/retailWizard/dtos/WizardReservedLine.d.ts +4 -1
- package/bin/retailWizard/dtos/WizardSession.d.ts +10 -0
- package/bin/retailWizard/dtos/requests/AddProductRequest.d.ts +2 -0
- package/bin/retailWizard/dtos/requests/AddProductRequest.js +7 -0
- package/bin/retailWizard/dtos/requests/ApplyLinePromotionRequest.d.ts +15 -0
- package/bin/retailWizard/dtos/requests/ApplyLinePromotionRequest.js +58 -0
- package/bin/retailWizard/dtos/requests/ApplySalePromotionRequest.d.ts +9 -0
- package/bin/retailWizard/dtos/requests/ApplySalePromotionRequest.js +36 -0
- package/bin/retailWizard/dtos/requests/PinSessionPiecesRequest.d.ts +14 -0
- package/bin/retailWizard/dtos/requests/PinSessionPiecesRequest.js +60 -0
- package/bin/retailWizard/dtos/requests/QuoteRequest.d.ts +1 -1
- package/bin/retailWizard/dtos/requests/SetAnchorGiftsRequest.d.ts +14 -0
- package/bin/retailWizard/dtos/requests/SetAnchorGiftsRequest.js +56 -0
- package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.d.ts +29 -0
- package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.js +2 -0
- package/bin/retailWizard/dtos/responses/SetAnchorGiftsResponse.d.ts +5 -0
- package/bin/retailWizard/dtos/responses/SetAnchorGiftsResponse.js +2 -0
- package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.d.ts +5 -0
- package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.js +9 -0
- package/bin/retailWizard/enums/WizardLineRoleEnum.d.ts +4 -0
- package/bin/retailWizard/enums/WizardLineRoleEnum.js +8 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.d.ts +19 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.js +78 -0
- package/bin/retailWizard/events/RetailPromotionInboundMessage.d.ts +40 -0
- package/bin/retailWizard/events/RetailPromotionInboundMessage.js +160 -0
- package/bin/retailWizard/events/SaleCompletedV1.d.ts +2 -3
- package/bin/retailWizard/index.d.ts +13 -0
- package/bin/retailWizard/index.js +14 -0
- package/package.json +1 -1
- package/src/common/index.ts +3 -0
- package/src/common/validators/IsStringValueRecord.ts +13 -0
- package/src/index.ts +3 -0
- package/src/messagesConnector/validators/IsStringValueRecord.ts +2 -12
- package/src/platformRbac/dtos/CreateTenantUserRequest.ts +8 -1
- package/src/platformRbac/dtos/UpdateTenantUserRequest.ts +9 -3
- package/src/retailCatalog/dtos/Product.ts +6 -0
- package/src/retailCatalog/dtos/requests/BackofficeCreateProductRequest.ts +30 -1
- package/src/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.ts +6 -0
- package/src/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.ts +30 -1
- package/src/retailCatalog/dtos/requests/HoldStockRequest.ts +28 -0
- package/src/retailCatalog/dtos/requests/ReserveStockRequest.ts +7 -1
- package/src/retailCatalog/dtos/requests/SuggestPiecesQuery.ts +7 -1
- package/src/retailCatalog/dtos/responses/GetInventorySkuResponse.ts +3 -0
- package/src/retailCatalog/dtos/responses/HoldStockResponse.ts +9 -0
- package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +6 -1
- package/src/retailCatalog/enums/InventoryInboundMessageTypeEnum.ts +5 -0
- package/src/retailCatalog/enums/InventoryItemStatusEnum.ts +3 -1
- package/src/retailCatalog/enums/ReservePurposeEnum.ts +4 -0
- package/src/retailCatalog/events/InventoryInboundMessage.ts +5 -0
- package/src/retailCatalog/events/InventoryReturnMessage.ts +26 -0
- package/src/retailCatalog/events/InventorySaleAppliedMessage.ts +26 -0
- package/src/retailCatalog/index.ts +9 -0
- package/src/retailPromotions/constants/bonusPreMoney.ts +19 -0
- package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +21 -0
- package/src/retailPromotions/constants/salePromotionTransitions.ts +11 -0
- package/src/retailPromotions/dtos/DiscountCode.ts +36 -0
- package/src/retailPromotions/dtos/DiscountValue.ts +8 -0
- package/src/retailPromotions/dtos/LinePromotionDiscount.ts +10 -0
- package/src/retailPromotions/dtos/SalePromotion.ts +36 -0
- package/src/retailPromotions/dtos/SalePromotionLevers.ts +67 -0
- package/src/retailPromotions/dtos/SalePromotionLogEntry.ts +19 -0
- package/src/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.ts +15 -0
- package/src/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.ts +15 -0
- package/src/retailPromotions/dtos/requests/CreateDiscountCodeRequest.ts +71 -0
- package/src/retailPromotions/dtos/requests/CreateSalePromotionRequest.ts +73 -0
- package/src/retailPromotions/dtos/requests/DiscountValueInput.ts +21 -0
- package/src/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.ts +16 -0
- package/src/retailPromotions/dtos/requests/HoldSalePromotionRequest.ts +32 -0
- package/src/retailPromotions/dtos/requests/ListDiscountCodesQuery.ts +33 -0
- package/src/retailPromotions/dtos/requests/ListSalePromotionLogQuery.ts +29 -0
- package/src/retailPromotions/dtos/requests/ListSalePromotionsQuery.ts +24 -0
- package/src/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.ts +10 -0
- package/src/retailPromotions/dtos/requests/SalePromotionLeversInput.ts +136 -0
- package/src/retailPromotions/dtos/requests/SalePromotionScopeInput.ts +45 -0
- package/src/retailPromotions/dtos/requests/UpdateSalePromotionRequest.ts +74 -0
- package/src/retailPromotions/dtos/responses/DiscountCodeResponses.ts +9 -0
- package/src/retailPromotions/dtos/responses/SalePromotionCrudResponses.ts +35 -0
- package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +115 -0
- package/src/retailPromotions/enums/CouponScopeEnum.ts +11 -0
- package/src/retailPromotions/enums/CouponStatusEnum.ts +11 -0
- package/src/retailPromotions/enums/DiscountCodeOriginEnum.ts +8 -0
- package/src/retailPromotions/enums/DiscountCodeStatusEnum.ts +11 -0
- package/src/retailPromotions/enums/DiscountCodeTransitionEnum.ts +7 -0
- package/src/retailPromotions/enums/DiscountTypeEnum.ts +8 -0
- package/src/retailPromotions/enums/EntitlementKindEnum.ts +9 -0
- package/src/retailPromotions/enums/EntitlementStateEnum.ts +13 -0
- package/src/retailPromotions/enums/GiftModeEnum.ts +8 -0
- package/src/retailPromotions/enums/PromotionAppliesToEnum.ts +9 -0
- package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +23 -0
- package/src/retailPromotions/enums/SaleCouponAvailabilityEnum.ts +10 -0
- package/src/retailPromotions/enums/SalePromotionLeverEnum.ts +13 -0
- package/src/retailPromotions/enums/SalePromotionLogEventEnum.ts +14 -0
- package/src/retailPromotions/enums/SalePromotionLogFormatEnum.ts +5 -0
- package/src/retailPromotions/enums/SalePromotionPhaseEnum.ts +11 -0
- package/src/retailPromotions/enums/SalePromotionStatusEnum.ts +12 -0
- package/src/retailPromotions/enums/SalePromotionTransitionEnum.ts +13 -0
- package/src/retailPromotions/helpers/computeBudgetUsedBps.ts +15 -0
- package/src/retailPromotions/helpers/resolveSalePromotionTransition.ts +12 -0
- package/src/retailPromotions/index.ts +55 -0
- package/src/retailWizard/dtos/Sale.ts +8 -8
- package/src/retailWizard/dtos/SaleLine.ts +4 -1
- package/src/retailWizard/dtos/WizardFinancingPreview.ts +12 -0
- package/src/retailWizard/dtos/WizardGiftLine.ts +9 -0
- package/src/retailWizard/dtos/WizardLinePromotionFields.ts +16 -0
- package/src/retailWizard/dtos/WizardReservedLine.ts +4 -1
- package/src/retailWizard/dtos/WizardSession.ts +10 -0
- package/src/retailWizard/dtos/requests/AddProductRequest.ts +8 -1
- package/src/retailWizard/dtos/requests/ApplyLinePromotionRequest.ts +45 -0
- package/src/retailWizard/dtos/requests/ApplySalePromotionRequest.ts +24 -0
- package/src/retailWizard/dtos/requests/PinSessionPiecesRequest.ts +40 -0
- package/src/retailWizard/dtos/requests/QuoteRequest.ts +1 -1
- package/src/retailWizard/dtos/requests/SetAnchorGiftsRequest.ts +40 -0
- package/src/retailWizard/dtos/responses/PrivateWizardSessionResponse.ts +30 -0
- package/src/retailWizard/dtos/responses/SetAnchorGiftsResponse.ts +6 -0
- package/src/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.ts +5 -0
- package/src/retailWizard/enums/WizardLineRoleEnum.ts +4 -0
- package/src/retailWizard/events/RetailCommissionInboundMessage.ts +54 -0
- package/src/retailWizard/events/RetailPromotionInboundMessage.ts +138 -0
- package/src/retailWizard/events/SaleCompletedV1.ts +2 -3
- package/src/retailWizard/index.ts +15 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsInt, IsNotEmpty, IsOptional, IsString, Min, ValidateIf } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
const hasPromotion = (o: ApplyLinePromotionRequest): boolean =>
|
|
5
|
+
o.promotionId !== undefined || o.promotionVersion !== undefined;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* PUT /private/wizard/sessions/{id}/lines/{lineId}/promotion (privateApplyLinePromotion, M2M de Promociones).
|
|
9
|
+
* Reemplaza la promo de la línea por valor: un campo ausente queda borrado. `tenantId` va en el query.
|
|
10
|
+
* Nunca toca role ni linkedLineId: los GIFT los gestiona el PUT …/gifts. Responde 204 sin body.
|
|
11
|
+
*/
|
|
12
|
+
export class ApplyLinePromotionRequest {
|
|
13
|
+
@Expose()
|
|
14
|
+
@ValidateIf(hasPromotion)
|
|
15
|
+
@IsString()
|
|
16
|
+
@IsNotEmpty()
|
|
17
|
+
promotionId?: string;
|
|
18
|
+
|
|
19
|
+
/** Va junto con promotionId; las versiones de Promociones empiezan en 1. */
|
|
20
|
+
@Expose()
|
|
21
|
+
@ValidateIf(hasPromotion)
|
|
22
|
+
@IsInt()
|
|
23
|
+
@Min(1)
|
|
24
|
+
promotionVersion?: number;
|
|
25
|
+
|
|
26
|
+
/** Solo en la línea ancla. */
|
|
27
|
+
@Expose()
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsString()
|
|
30
|
+
@IsNotEmpty()
|
|
31
|
+
discountCode?: string;
|
|
32
|
+
|
|
33
|
+
/** Descuento total de la línea; 0 mientras el código espera revalidarse. */
|
|
34
|
+
@Expose()
|
|
35
|
+
@IsOptional()
|
|
36
|
+
@IsInt()
|
|
37
|
+
@Min(0)
|
|
38
|
+
discountCents?: number;
|
|
39
|
+
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@IsInt()
|
|
43
|
+
@Min(0)
|
|
44
|
+
originalPriceCents?: number;
|
|
45
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsInt, IsNotEmpty, IsString, Min, ValidateIf } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* PUT /private/wizard/sessions/{id}/sale-promotion (privateApplySalePromotion, M2M de Promociones).
|
|
6
|
+
* Ambos en `null` = «Ninguna»; la versión va solo con la promo. `tenantId` va en el query.
|
|
7
|
+
* Responde 204 sin body.
|
|
8
|
+
*/
|
|
9
|
+
export class ApplySalePromotionRequest {
|
|
10
|
+
@Expose()
|
|
11
|
+
@ValidateIf(
|
|
12
|
+
(o: ApplySalePromotionRequest) =>
|
|
13
|
+
o.salePromotionId !== null || (o.salePromotionVersion !== null && o.salePromotionVersion !== undefined),
|
|
14
|
+
)
|
|
15
|
+
@IsString()
|
|
16
|
+
@IsNotEmpty()
|
|
17
|
+
salePromotionId!: string | null;
|
|
18
|
+
|
|
19
|
+
@Expose()
|
|
20
|
+
@ValidateIf((o: ApplySalePromotionRequest) => o.salePromotionId !== null && o.salePromotionId !== undefined)
|
|
21
|
+
@IsInt()
|
|
22
|
+
@Min(1)
|
|
23
|
+
salePromotionVersion!: number | null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsNotEmpty, IsString, ValidateNested } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Componente de la línea con los identificadores de sus piezas. */
|
|
5
|
+
export class PinSessionPiecesComponent {
|
|
6
|
+
@Expose()
|
|
7
|
+
@IsString()
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
sku!: string;
|
|
10
|
+
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsArray()
|
|
13
|
+
@IsString({ each: true })
|
|
14
|
+
identifiers!: string[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Línea de la sesión cuyas piezas se fijan. */
|
|
18
|
+
export class PinSessionPiecesLine {
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
lineId!: string;
|
|
23
|
+
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsArray()
|
|
26
|
+
@ArrayMinSize(1)
|
|
27
|
+
@ValidateNested({ each: true })
|
|
28
|
+
@Type(() => PinSessionPiecesComponent)
|
|
29
|
+
components!: PinSessionPiecesComponent[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** POST /wizard/sessions/:id/pieces (publicPinSessionPieces) — deja HELD las piezas de las líneas. */
|
|
33
|
+
export class PinSessionPiecesRequest {
|
|
34
|
+
@Expose()
|
|
35
|
+
@IsArray()
|
|
36
|
+
@ArrayMinSize(1)
|
|
37
|
+
@ValidateNested({ each: true })
|
|
38
|
+
@Type(() => PinSessionPiecesLine)
|
|
39
|
+
lines!: PinSessionPiecesLine[];
|
|
40
|
+
}
|
|
@@ -19,7 +19,7 @@ export class QuoteRequest {
|
|
|
19
19
|
@Min(1)
|
|
20
20
|
termWeeks!: number;
|
|
21
21
|
|
|
22
|
-
/**
|
|
22
|
+
/** Se ignora: el servidor financia la ancla. Se acepta un release más por el front viejo. */
|
|
23
23
|
@Expose()
|
|
24
24
|
@IsOptional()
|
|
25
25
|
@IsString()
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsInt, IsNotEmpty, IsString, Min, ValidateIf, ValidateNested } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Un regalo del conjunto que queda ligado al ancla. */
|
|
5
|
+
export class AnchorGiftItem {
|
|
6
|
+
@Expose()
|
|
7
|
+
@IsString()
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
sku!: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Hay que validar el campo si hay regalos o si vino con valor. */
|
|
13
|
+
function mustValidate(o: SetAnchorGiftsRequest, value: unknown): boolean {
|
|
14
|
+
return (Array.isArray(o.items) && o.items.length > 0) || (value !== null && value !== undefined);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* PUT /private/wizard/sessions/{id}/lines/{anchorLineId}/gifts (M2M de Promociones).
|
|
19
|
+
* Deja exactamente esos GIFT en el ancla; `items: []` suelta todos. `tenantId` va en el query.
|
|
20
|
+
*/
|
|
21
|
+
export class SetAnchorGiftsRequest {
|
|
22
|
+
/** Obligatorio si hay regalos; puede ir `null` con `items: []`. */
|
|
23
|
+
@Expose()
|
|
24
|
+
@ValidateIf((o: SetAnchorGiftsRequest) => mustValidate(o, o.promotionId))
|
|
25
|
+
@IsString()
|
|
26
|
+
@IsNotEmpty()
|
|
27
|
+
promotionId!: string | null;
|
|
28
|
+
|
|
29
|
+
@Expose()
|
|
30
|
+
@ValidateIf((o: SetAnchorGiftsRequest) => mustValidate(o, o.promotionVersion))
|
|
31
|
+
@IsInt()
|
|
32
|
+
@Min(1)
|
|
33
|
+
promotionVersion!: number | null;
|
|
34
|
+
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsArray()
|
|
37
|
+
@ValidateNested({ each: true })
|
|
38
|
+
@Type(() => AnchorGiftItem)
|
|
39
|
+
items!: AnchorGiftItem[];
|
|
40
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PaymentMethodEnum } from '../../enums/PaymentMethodEnum';
|
|
2
|
+
import type { WizardStateEnum } from '../../enums/WizardStateEnum';
|
|
3
|
+
import type { WizardStepEnum } from '../../enums/WizardStepEnum';
|
|
4
|
+
import type { WizardPayment } from '../WizardPayment';
|
|
5
|
+
import type { WizardReservedLine } from '../WizardReservedLine';
|
|
6
|
+
|
|
7
|
+
/** GET /private/wizard/sessions/{id} (privateGetWizardSession): lo que Promociones lee de la sesión. */
|
|
8
|
+
export interface PrivateWizardSessionResponse {
|
|
9
|
+
sessionId: string;
|
|
10
|
+
retailerId: string;
|
|
11
|
+
storeId: string;
|
|
12
|
+
/** `null` mientras el KYC no dé de alta al cliente. */
|
|
13
|
+
retailCustomerId: string | null;
|
|
14
|
+
state: WizardStateEnum;
|
|
15
|
+
currentStep: WizardStepEnum;
|
|
16
|
+
/** `loan.creditId`; `null` en contado o antes de originar. */
|
|
17
|
+
creditId: string | null;
|
|
18
|
+
/** Línea ancla (teléfono o kit) que deriva el servidor; `null` si aún no hay. */
|
|
19
|
+
anchorLineId: string | null;
|
|
20
|
+
salePromotionId: string | null;
|
|
21
|
+
salePromotionVersion: number | null;
|
|
22
|
+
/** Líneas vivas con los campos de Promociones y financedCents. */
|
|
23
|
+
lines: WizardReservedLine[];
|
|
24
|
+
fiadoDirectoryId?: string | null;
|
|
25
|
+
folio?: string | null;
|
|
26
|
+
/** Forma de pago que eligió el vendedor; existe antes que `creditId`. */
|
|
27
|
+
paymentMethod?: PaymentMethodEnum | null;
|
|
28
|
+
/** Cobro de contado; `null` mientras no se cobra. */
|
|
29
|
+
payment?: WizardPayment | null;
|
|
30
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayMinSize, IsArray, IsEnum, IsISO8601, IsInt, IsNotEmpty, IsString, Min, ValidateNested } from 'class-validator';
|
|
3
|
+
import { ItemTypeEnum } from '../../retailCatalog/enums/ItemTypeEnum';
|
|
4
|
+
|
|
5
|
+
/** Línea vendida en el mensaje de comisiones. */
|
|
6
|
+
export class RetailCommissionInboundLine {
|
|
7
|
+
@IsString()
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
sku!: string;
|
|
10
|
+
|
|
11
|
+
@IsInt()
|
|
12
|
+
@Min(1)
|
|
13
|
+
qty!: number;
|
|
14
|
+
|
|
15
|
+
/** Precio neto de la línea (precio − descuento). */
|
|
16
|
+
@IsInt()
|
|
17
|
+
@Min(0)
|
|
18
|
+
netCents!: number;
|
|
19
|
+
|
|
20
|
+
@IsEnum(ItemTypeEnum)
|
|
21
|
+
itemType!: ItemTypeEnum;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Venta de la saga que el wizard publica en la cola de comisiones, con sus líneas. */
|
|
25
|
+
export class RetailCommissionInboundMessage {
|
|
26
|
+
@IsString()
|
|
27
|
+
@IsNotEmpty()
|
|
28
|
+
tenantId!: string;
|
|
29
|
+
|
|
30
|
+
@IsString()
|
|
31
|
+
@IsNotEmpty()
|
|
32
|
+
retailerId!: string;
|
|
33
|
+
|
|
34
|
+
@IsString()
|
|
35
|
+
@IsNotEmpty()
|
|
36
|
+
storeId!: string;
|
|
37
|
+
|
|
38
|
+
@IsString()
|
|
39
|
+
@IsNotEmpty()
|
|
40
|
+
saleId!: string;
|
|
41
|
+
|
|
42
|
+
@IsString()
|
|
43
|
+
@IsNotEmpty()
|
|
44
|
+
sessionId!: string;
|
|
45
|
+
|
|
46
|
+
@IsISO8601()
|
|
47
|
+
soldAt!: string;
|
|
48
|
+
|
|
49
|
+
@IsArray()
|
|
50
|
+
@ArrayMinSize(1)
|
|
51
|
+
@ValidateNested({ each: true })
|
|
52
|
+
@Type(() => RetailCommissionInboundLine)
|
|
53
|
+
lines!: RetailCommissionInboundLine[];
|
|
54
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
ArrayMinSize,
|
|
4
|
+
IsArray,
|
|
5
|
+
IsBoolean,
|
|
6
|
+
IsEnum,
|
|
7
|
+
IsISO8601,
|
|
8
|
+
IsInt,
|
|
9
|
+
IsNotEmpty,
|
|
10
|
+
IsOptional,
|
|
11
|
+
IsString,
|
|
12
|
+
Min,
|
|
13
|
+
ValidateNested,
|
|
14
|
+
} from 'class-validator';
|
|
15
|
+
import { RetailPromotionInboundMessageTypeEnum } from '../enums/RetailPromotionInboundMessageTypeEnum';
|
|
16
|
+
import { WizardLineRoleEnum } from '../enums/WizardLineRoleEnum';
|
|
17
|
+
|
|
18
|
+
/** Línea de la venta en el mensaje de Promociones. */
|
|
19
|
+
export class RetailPromotionInboundLine {
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
lineId!: string;
|
|
23
|
+
|
|
24
|
+
@IsString()
|
|
25
|
+
@IsNotEmpty()
|
|
26
|
+
sku!: string;
|
|
27
|
+
|
|
28
|
+
@IsInt()
|
|
29
|
+
@Min(1)
|
|
30
|
+
qty!: number;
|
|
31
|
+
|
|
32
|
+
@IsOptional()
|
|
33
|
+
@IsEnum(WizardLineRoleEnum)
|
|
34
|
+
role?: WizardLineRoleEnum;
|
|
35
|
+
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsString()
|
|
38
|
+
@IsNotEmpty()
|
|
39
|
+
linkedLineId?: string;
|
|
40
|
+
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@IsString()
|
|
43
|
+
@IsNotEmpty()
|
|
44
|
+
promotionId?: string;
|
|
45
|
+
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@IsInt()
|
|
48
|
+
@Min(1)
|
|
49
|
+
promotionVersion?: number;
|
|
50
|
+
|
|
51
|
+
/** Solo en la línea ancla. */
|
|
52
|
+
@IsOptional()
|
|
53
|
+
@IsString()
|
|
54
|
+
@IsNotEmpty()
|
|
55
|
+
discountCode?: string;
|
|
56
|
+
|
|
57
|
+
@IsOptional()
|
|
58
|
+
@IsInt()
|
|
59
|
+
@Min(0)
|
|
60
|
+
discountCents?: number;
|
|
61
|
+
|
|
62
|
+
/** Si la línea no lo trae, basePriceCents × qty. */
|
|
63
|
+
@IsInt()
|
|
64
|
+
@Min(0)
|
|
65
|
+
originalPriceCents!: number;
|
|
66
|
+
|
|
67
|
+
/** Identificadores de todos los componentes de la línea, aplanados. */
|
|
68
|
+
@IsArray()
|
|
69
|
+
@IsString({ each: true })
|
|
70
|
+
identifiers!: string[];
|
|
71
|
+
|
|
72
|
+
/** Solo en SALE_CANCELLED: la pieza regresó al inventario. */
|
|
73
|
+
@IsOptional()
|
|
74
|
+
@IsBoolean()
|
|
75
|
+
returned?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Venta confirmada o cancelada que el wizard publica en RetailPromotionInboundQueue; crédito = trae creditId. */
|
|
79
|
+
export class RetailPromotionInboundMessage {
|
|
80
|
+
@IsEnum(RetailPromotionInboundMessageTypeEnum)
|
|
81
|
+
type!: RetailPromotionInboundMessageTypeEnum;
|
|
82
|
+
|
|
83
|
+
@IsString()
|
|
84
|
+
@IsNotEmpty()
|
|
85
|
+
tenantId!: string;
|
|
86
|
+
|
|
87
|
+
@IsString()
|
|
88
|
+
@IsNotEmpty()
|
|
89
|
+
retailerId!: string;
|
|
90
|
+
|
|
91
|
+
@IsString()
|
|
92
|
+
@IsNotEmpty()
|
|
93
|
+
storeId!: string;
|
|
94
|
+
|
|
95
|
+
@IsString()
|
|
96
|
+
@IsNotEmpty()
|
|
97
|
+
saleId!: string;
|
|
98
|
+
|
|
99
|
+
@IsString()
|
|
100
|
+
@IsNotEmpty()
|
|
101
|
+
sessionId!: string;
|
|
102
|
+
|
|
103
|
+
/** El retailCustomerId de la venta. */
|
|
104
|
+
@IsString()
|
|
105
|
+
@IsNotEmpty()
|
|
106
|
+
customerId!: string;
|
|
107
|
+
|
|
108
|
+
@IsISO8601()
|
|
109
|
+
soldAt!: string;
|
|
110
|
+
|
|
111
|
+
/** soldAt en la confirmación; cancelledAt en la cancelación. */
|
|
112
|
+
@IsISO8601()
|
|
113
|
+
occurredAt!: string;
|
|
114
|
+
|
|
115
|
+
@IsOptional()
|
|
116
|
+
@IsString()
|
|
117
|
+
creditId?: string;
|
|
118
|
+
|
|
119
|
+
@IsOptional()
|
|
120
|
+
@IsString()
|
|
121
|
+
fiadoDirectoryId?: string;
|
|
122
|
+
|
|
123
|
+
@IsOptional()
|
|
124
|
+
@IsString()
|
|
125
|
+
@IsNotEmpty()
|
|
126
|
+
salePromotionId?: string;
|
|
127
|
+
|
|
128
|
+
@IsOptional()
|
|
129
|
+
@IsInt()
|
|
130
|
+
@Min(1)
|
|
131
|
+
salePromotionVersion?: number;
|
|
132
|
+
|
|
133
|
+
@IsArray()
|
|
134
|
+
@ArrayMinSize(1)
|
|
135
|
+
@ValidateNested({ each: true })
|
|
136
|
+
@Type(() => RetailPromotionInboundLine)
|
|
137
|
+
lines!: RetailPromotionInboundLine[];
|
|
138
|
+
}
|
|
@@ -14,9 +14,8 @@ export interface SaleCompletedV1 {
|
|
|
14
14
|
sku: string;
|
|
15
15
|
imei: string | null;
|
|
16
16
|
/**
|
|
17
|
-
* Lo
|
|
18
|
-
*
|
|
19
|
-
* `equipmentPriceCents`, NUNCA redefinir este campo.
|
|
17
|
+
* Lo cobrado en caja al cerrar: enganche + lo no financiado (en contado, el total).
|
|
18
|
+
* Desambiguar con `type` + `equipmentPriceCents`.
|
|
20
19
|
*/
|
|
21
20
|
amountCents: number;
|
|
22
21
|
/**
|
|
@@ -26,6 +26,7 @@ export * from './enums/BlockedReasonEnum';
|
|
|
26
26
|
export * from './enums/BlockedCategoryEnum';
|
|
27
27
|
export * from './enums/WizardLineStatusEnum';
|
|
28
28
|
export * from './enums/LinePaymentTypeEnum';
|
|
29
|
+
export * from './enums/WizardLineRoleEnum';
|
|
29
30
|
|
|
30
31
|
// DTOs anidados
|
|
31
32
|
export * from './dtos/WizardConsents';
|
|
@@ -43,7 +44,10 @@ export * from './dtos/WizardResumeTarget';
|
|
|
43
44
|
export * from './dtos/WizardBlocked';
|
|
44
45
|
export * from './dtos/WizardLineProduct';
|
|
45
46
|
export * from './dtos/WizardLineIdentifiers';
|
|
47
|
+
export * from './dtos/WizardLinePromotionFields';
|
|
48
|
+
export * from './dtos/WizardFinancingPreview';
|
|
46
49
|
export * from './dtos/WizardReservedLine';
|
|
50
|
+
export * from './dtos/WizardGiftLine';
|
|
47
51
|
export * from './dtos/SaleLine';
|
|
48
52
|
|
|
49
53
|
// Entidades principales (shapes de estado/persistencia — planas)
|
|
@@ -68,6 +72,10 @@ export * from './dtos/requests/KycManualRequest';
|
|
|
68
72
|
export * from './dtos/requests/ProofOfAddressPrepareRequest';
|
|
69
73
|
export * from './dtos/requests/OccupationRequest';
|
|
70
74
|
export * from './dtos/requests/AddProductRequest';
|
|
75
|
+
export * from './dtos/requests/PinSessionPiecesRequest';
|
|
76
|
+
export * from './dtos/requests/ApplyLinePromotionRequest';
|
|
77
|
+
export * from './dtos/requests/SetAnchorGiftsRequest';
|
|
78
|
+
export * from './dtos/requests/ApplySalePromotionRequest';
|
|
71
79
|
export * from './dtos/requests/DeleteProductRequest';
|
|
72
80
|
export * from './dtos/requests/SetPaymentMethodRequest';
|
|
73
81
|
export * from './dtos/requests/ExternalReferralRequest';
|
|
@@ -156,8 +164,15 @@ export * from './events/SaleCancelledV1';
|
|
|
156
164
|
export * from './events/SaleCompletedV2';
|
|
157
165
|
export * from './events/SaleCancelledV2';
|
|
158
166
|
export * from './events/SessionExpiredV1';
|
|
167
|
+
export * from './enums/RetailPromotionInboundMessageTypeEnum';
|
|
168
|
+
export * from './events/RetailPromotionInboundMessage';
|
|
169
|
+
export * from './events/RetailCommissionInboundMessage';
|
|
159
170
|
|
|
160
171
|
// Lookup privado por lote (GET /private/wizard-sessions/batch)
|
|
161
172
|
export * from './enums/WizardSessionLookupStatusEnum';
|
|
162
173
|
export * from './dtos/WizardSessionLookupEntry';
|
|
163
174
|
export * from './dtos/responses/WizardSessionLookupResponse';
|
|
175
|
+
|
|
176
|
+
// M2M de Promociones (lectura privada de la sesión y regalo)
|
|
177
|
+
export * from './dtos/responses/PrivateWizardSessionResponse';
|
|
178
|
+
export * from './dtos/responses/SetAnchorGiftsResponse';
|