@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,67 @@
|
|
|
1
|
+
import { ProductCategoryEnum } from '../../retailCatalog/enums/ProductCategoryEnum';
|
|
2
|
+
import { ProductTierEnum } from '../../retailCatalog/enums/ProductTierEnum';
|
|
3
|
+
import { CouponScopeEnum } from '../enums/CouponScopeEnum';
|
|
4
|
+
import { GiftModeEnum } from '../enums/GiftModeEnum';
|
|
5
|
+
import { DiscountValue } from './DiscountValue';
|
|
6
|
+
|
|
7
|
+
/** Descuento en accesorios: % sobre los accesorios de la venta, con tope opcional en centavos. */
|
|
8
|
+
export interface AccessoryDiscountLever {
|
|
9
|
+
percentBps: number;
|
|
10
|
+
maxAmountCents: number | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Regalo por lista (`skus`) o por gama (`category` + `maxPriceCents`); el cliente elige `chooseCount`. */
|
|
14
|
+
export interface GiftLever {
|
|
15
|
+
mode: GiftModeEnum;
|
|
16
|
+
skus: string[] | null;
|
|
17
|
+
category: string | null;
|
|
18
|
+
maxPriceCents: number | null;
|
|
19
|
+
chooseCount: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Cupón que emite la venta: su descuento, días de vida y dónde vale. */
|
|
23
|
+
export interface CouponLever extends DiscountValue {
|
|
24
|
+
validityDays: number;
|
|
25
|
+
scope: CouponScopeEnum;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Tiempo aire: `rechargeCount` recargas de `rechargeAmountCents`. */
|
|
29
|
+
export interface AirtimeLever {
|
|
30
|
+
rechargeCount: number;
|
|
31
|
+
rechargeAmountCents: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Garantía extendida: meses extra sobre la de fábrica y su costo para el presupuesto. */
|
|
35
|
+
export interface ExtendedWarrantyLever {
|
|
36
|
+
extraMonths: number;
|
|
37
|
+
costCents: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface WalletBonusLever {
|
|
41
|
+
amountCents: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Las 7 palancas; una palanca ausente o `null` no se usa. */
|
|
45
|
+
export interface SalePromotionLevers {
|
|
46
|
+
deviceDiscount: DiscountValue | null;
|
|
47
|
+
accessoryDiscount: AccessoryDiscountLever | null;
|
|
48
|
+
gift: GiftLever | null;
|
|
49
|
+
coupon: CouponLever | null;
|
|
50
|
+
airtime: AirtimeLever | null;
|
|
51
|
+
extendedWarranty: ExtendedWarrantyLever | null;
|
|
52
|
+
walletBonus: WalletBonusLever | null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Qué compra dispara la promo; cada lista `null` = sin restricción en esa dimensión. */
|
|
56
|
+
export interface SalePromotionScope {
|
|
57
|
+
productCategories: ProductCategoryEnum[] | null;
|
|
58
|
+
tiers: ProductTierEnum[] | null;
|
|
59
|
+
skus: string[] | null;
|
|
60
|
+
storeIds: string[] | null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** A quién va la promo: segmentos de loan-offerings y, aparte, si exige crédito SK activo. */
|
|
64
|
+
export interface SalePromotionSegmentation {
|
|
65
|
+
segmentIds: string[] | null;
|
|
66
|
+
requiresActiveSurekeepCredit: boolean;
|
|
67
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SalePromotionLogEventEnum } from '../enums/SalePromotionLogEventEnum';
|
|
2
|
+
import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
|
|
3
|
+
|
|
4
|
+
/** Evento del historial de una promo. */
|
|
5
|
+
export interface SalePromotionLogEntry {
|
|
6
|
+
logId: string;
|
|
7
|
+
promotionId: string;
|
|
8
|
+
promotionName: string;
|
|
9
|
+
version: number;
|
|
10
|
+
event: SalePromotionLogEventEnum;
|
|
11
|
+
fromStatus: SalePromotionStatusEnum | null;
|
|
12
|
+
toStatus: SalePromotionStatusEnum | null;
|
|
13
|
+
/** `null` = evento automático del sistema. */
|
|
14
|
+
performedByUserId: string | null;
|
|
15
|
+
/** Nombre visible del actor; «Sistema» en los automáticos. */
|
|
16
|
+
performedByName: string;
|
|
17
|
+
occurredAt: string;
|
|
18
|
+
reason: string | null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { DiscountCodeTransitionEnum } from '../../enums/DiscountCodeTransitionEnum';
|
|
4
|
+
|
|
5
|
+
/** Body de publicChangeDiscountCodeStatus (anular un código o cupón). */
|
|
6
|
+
export class ChangeDiscountCodeStatusRequest {
|
|
7
|
+
@Expose()
|
|
8
|
+
@IsEnum(DiscountCodeTransitionEnum)
|
|
9
|
+
transition!: DiscountCodeTransitionEnum;
|
|
10
|
+
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsString()
|
|
14
|
+
reason?: string | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { SalePromotionTransitionEnum } from '../../enums/SalePromotionTransitionEnum';
|
|
4
|
+
|
|
5
|
+
/** Body de publicChangeSalePromotionStatus; `reason` queda en el historial. */
|
|
6
|
+
export class ChangeSalePromotionStatusRequest {
|
|
7
|
+
@Expose()
|
|
8
|
+
@IsEnum(SalePromotionTransitionEnum)
|
|
9
|
+
transition!: SalePromotionTransitionEnum;
|
|
10
|
+
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsString()
|
|
14
|
+
reason?: string | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
IsArray,
|
|
4
|
+
IsBoolean,
|
|
5
|
+
IsDefined,
|
|
6
|
+
IsEnum,
|
|
7
|
+
IsInt,
|
|
8
|
+
IsISO8601,
|
|
9
|
+
IsNotEmpty,
|
|
10
|
+
IsOptional,
|
|
11
|
+
IsString,
|
|
12
|
+
MaxLength,
|
|
13
|
+
ValidateNested,
|
|
14
|
+
} from 'class-validator';
|
|
15
|
+
import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
|
|
16
|
+
import { DiscountValueInput } from './DiscountValueInput';
|
|
17
|
+
|
|
18
|
+
/** Body de publicCreateDiscountCode. Que el texto sea único entre los vigentes es `CODE_TEXT_TAKEN`. */
|
|
19
|
+
export class CreateDiscountCodeRequest {
|
|
20
|
+
@Expose()
|
|
21
|
+
@IsString()
|
|
22
|
+
@IsNotEmpty()
|
|
23
|
+
@MaxLength(32)
|
|
24
|
+
codeText!: string;
|
|
25
|
+
|
|
26
|
+
@Expose()
|
|
27
|
+
@IsDefined()
|
|
28
|
+
@ValidateNested()
|
|
29
|
+
@Type(() => DiscountValueInput)
|
|
30
|
+
discount!: DiscountValueInput;
|
|
31
|
+
|
|
32
|
+
@Expose()
|
|
33
|
+
@IsOptional()
|
|
34
|
+
@IsISO8601()
|
|
35
|
+
validFrom?: string | null;
|
|
36
|
+
|
|
37
|
+
@Expose()
|
|
38
|
+
@IsOptional()
|
|
39
|
+
@IsISO8601()
|
|
40
|
+
validUntil?: string | null;
|
|
41
|
+
|
|
42
|
+
/** `null` = sin tope de usos. */
|
|
43
|
+
@Expose()
|
|
44
|
+
@IsOptional()
|
|
45
|
+
@IsInt()
|
|
46
|
+
maxUses?: number | null;
|
|
47
|
+
|
|
48
|
+
/** Equipos donde vale; `null` = todos. */
|
|
49
|
+
@Expose()
|
|
50
|
+
@IsOptional()
|
|
51
|
+
@IsArray()
|
|
52
|
+
@IsString({ each: true })
|
|
53
|
+
skus?: string[] | null;
|
|
54
|
+
|
|
55
|
+
@Expose()
|
|
56
|
+
@IsOptional()
|
|
57
|
+
@IsArray()
|
|
58
|
+
@IsString({ each: true })
|
|
59
|
+
storeIds?: string[] | null;
|
|
60
|
+
|
|
61
|
+
@Expose()
|
|
62
|
+
@IsOptional()
|
|
63
|
+
@IsBoolean()
|
|
64
|
+
announceInStore?: boolean;
|
|
65
|
+
|
|
66
|
+
/** Ausente = `SUREKEEP_ONLY`. */
|
|
67
|
+
@Expose()
|
|
68
|
+
@IsOptional()
|
|
69
|
+
@IsEnum(PromotionAppliesToEnum)
|
|
70
|
+
appliesTo?: PromotionAppliesToEnum;
|
|
71
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
IsBoolean,
|
|
4
|
+
IsDefined,
|
|
5
|
+
IsEnum,
|
|
6
|
+
IsInt,
|
|
7
|
+
IsISO8601,
|
|
8
|
+
IsNotEmpty,
|
|
9
|
+
IsOptional,
|
|
10
|
+
IsString,
|
|
11
|
+
ValidateNested,
|
|
12
|
+
} from 'class-validator';
|
|
13
|
+
import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
|
|
14
|
+
import { SalePromotionLeversInput } from './SalePromotionLeversInput';
|
|
15
|
+
import { SalePromotionScopeInput, SalePromotionSegmentationInput } from './SalePromotionScopeInput';
|
|
16
|
+
|
|
17
|
+
/** Body de publicCreateSalePromotion. Nace en `DRAFT`; el retailer sale del token. */
|
|
18
|
+
export class CreateSalePromotionRequest {
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
name!: string;
|
|
23
|
+
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsString()
|
|
26
|
+
customerText!: string;
|
|
27
|
+
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsDefined()
|
|
30
|
+
@ValidateNested()
|
|
31
|
+
@Type(() => SalePromotionLeversInput)
|
|
32
|
+
levers!: SalePromotionLeversInput;
|
|
33
|
+
|
|
34
|
+
@Expose()
|
|
35
|
+
@IsOptional()
|
|
36
|
+
@ValidateNested()
|
|
37
|
+
@Type(() => SalePromotionScopeInput)
|
|
38
|
+
scope?: SalePromotionScopeInput | null;
|
|
39
|
+
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@ValidateNested()
|
|
43
|
+
@Type(() => SalePromotionSegmentationInput)
|
|
44
|
+
segmentation?: SalePromotionSegmentationInput | null;
|
|
45
|
+
|
|
46
|
+
/** Ausente = `SUREKEEP_ONLY`. */
|
|
47
|
+
@Expose()
|
|
48
|
+
@IsOptional()
|
|
49
|
+
@IsEnum(PromotionAppliesToEnum)
|
|
50
|
+
appliesTo?: PromotionAppliesToEnum;
|
|
51
|
+
|
|
52
|
+
/** `null` = sin tope. */
|
|
53
|
+
@Expose()
|
|
54
|
+
@IsOptional()
|
|
55
|
+
@IsInt()
|
|
56
|
+
budgetMaxCents?: number | null;
|
|
57
|
+
|
|
58
|
+
@Expose()
|
|
59
|
+
@IsOptional()
|
|
60
|
+
@IsISO8601()
|
|
61
|
+
validFrom?: string | null;
|
|
62
|
+
|
|
63
|
+
/** `null` = permanente. */
|
|
64
|
+
@Expose()
|
|
65
|
+
@IsOptional()
|
|
66
|
+
@IsISO8601()
|
|
67
|
+
validUntil?: string | null;
|
|
68
|
+
|
|
69
|
+
@Expose()
|
|
70
|
+
@IsOptional()
|
|
71
|
+
@IsBoolean()
|
|
72
|
+
oncePerCustomer?: boolean;
|
|
73
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsInt, ValidateIf } from 'class-validator';
|
|
3
|
+
import { DiscountTypeEnum } from '../../enums/DiscountTypeEnum';
|
|
4
|
+
|
|
5
|
+
/** Descuento en el body: exige el campo que corresponde al tipo. Rangos y signo los valida el lambda (422). */
|
|
6
|
+
export class DiscountValueInput {
|
|
7
|
+
@Expose()
|
|
8
|
+
@IsEnum(DiscountTypeEnum)
|
|
9
|
+
type!: DiscountTypeEnum;
|
|
10
|
+
|
|
11
|
+
@Expose()
|
|
12
|
+
@ValidateIf((o: DiscountValueInput) => o.type === DiscountTypeEnum.AMOUNT)
|
|
13
|
+
@IsInt()
|
|
14
|
+
amountCents?: number | null;
|
|
15
|
+
|
|
16
|
+
/** Puntos base: 1000 = 10%. */
|
|
17
|
+
@Expose()
|
|
18
|
+
@ValidateIf((o: DiscountValueInput) => o.type === DiscountTypeEnum.PERCENTAGE)
|
|
19
|
+
@IsInt()
|
|
20
|
+
percentBps?: number | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Body de publicEvaluateSalePromotions; precios, líneas y cliente salen de la sesión. */
|
|
5
|
+
export class EvaluateSalePromotionsRequest {
|
|
6
|
+
@Expose()
|
|
7
|
+
@IsString()
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
sessionId!: string;
|
|
10
|
+
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsString()
|
|
14
|
+
@IsNotEmpty()
|
|
15
|
+
discountCode?: string | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsInt, IsNotEmpty, IsOptional, IsString, ValidateIf } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de publicHoldSalePromotion (PUT, `sessionId` en el path). `promotionId: null` = «Ninguna»;
|
|
6
|
+
* un PUT distinto reemplaza el apartado anterior.
|
|
7
|
+
*/
|
|
8
|
+
export class HoldSalePromotionRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsOptional()
|
|
11
|
+
@IsString()
|
|
12
|
+
@IsNotEmpty()
|
|
13
|
+
promotionId?: string | null;
|
|
14
|
+
|
|
15
|
+
@Expose()
|
|
16
|
+
@ValidateIf((o: HoldSalePromotionRequest) => o.promotionId !== undefined && o.promotionId !== null)
|
|
17
|
+
@IsInt()
|
|
18
|
+
promotionVersion?: number | null;
|
|
19
|
+
|
|
20
|
+
/** Regalos elegidos por el cliente, si la promo trae regalo. */
|
|
21
|
+
@Expose()
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@IsArray()
|
|
24
|
+
@IsString({ each: true })
|
|
25
|
+
giftSkus?: string[] | null;
|
|
26
|
+
|
|
27
|
+
@Expose()
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsString()
|
|
30
|
+
@IsNotEmpty()
|
|
31
|
+
discountCode?: string | null;
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsIn, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
3
|
+
import { CouponStatusEnum } from '../../enums/CouponStatusEnum';
|
|
4
|
+
import { DiscountCodeOriginEnum } from '../../enums/DiscountCodeOriginEnum';
|
|
5
|
+
import { DiscountCodeStatusEnum } from '../../enums/DiscountCodeStatusEnum';
|
|
6
|
+
|
|
7
|
+
const LISTABLE_STATUSES = [...new Set<string>([...Object.values(DiscountCodeStatusEnum), ...Object.values(CouponStatusEnum)])];
|
|
8
|
+
|
|
9
|
+
/** Query de publicListDiscountCodes: códigos y cupones, filtrables por origen y estado. */
|
|
10
|
+
export class ListDiscountCodesQuery {
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsEnum(DiscountCodeOriginEnum)
|
|
14
|
+
origin?: DiscountCodeOriginEnum;
|
|
15
|
+
|
|
16
|
+
@Expose()
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsIn(LISTABLE_STATUSES)
|
|
19
|
+
status?: DiscountCodeStatusEnum | CouponStatusEnum;
|
|
20
|
+
|
|
21
|
+
@Expose()
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@Type(() => Number)
|
|
24
|
+
@IsInt()
|
|
25
|
+
@Min(1)
|
|
26
|
+
@Max(100)
|
|
27
|
+
limit?: number;
|
|
28
|
+
|
|
29
|
+
@Expose()
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@IsString()
|
|
32
|
+
nextToken?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
3
|
+
import { SalePromotionLogFormatEnum } from '../../enums/SalePromotionLogFormatEnum';
|
|
4
|
+
|
|
5
|
+
/** Query de publicListSalePromotionLog: global o de una promo; `CSV` exporta en vez de paginar. */
|
|
6
|
+
export class ListSalePromotionLogQuery {
|
|
7
|
+
@Expose()
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsString()
|
|
10
|
+
promotionId?: string;
|
|
11
|
+
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsOptional()
|
|
14
|
+
@IsEnum(SalePromotionLogFormatEnum)
|
|
15
|
+
format?: SalePromotionLogFormatEnum;
|
|
16
|
+
|
|
17
|
+
@Expose()
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@Type(() => Number)
|
|
20
|
+
@IsInt()
|
|
21
|
+
@Min(1)
|
|
22
|
+
@Max(100)
|
|
23
|
+
limit?: number;
|
|
24
|
+
|
|
25
|
+
@Expose()
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsString()
|
|
28
|
+
nextToken?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
3
|
+
import { SalePromotionStatusEnum } from '../../enums/SalePromotionStatusEnum';
|
|
4
|
+
|
|
5
|
+
/** Query de publicListSalePromotions; sin `status` excluye las archivadas. */
|
|
6
|
+
export class ListSalePromotionsQuery {
|
|
7
|
+
@Expose()
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsEnum(SalePromotionStatusEnum)
|
|
10
|
+
status?: SalePromotionStatusEnum;
|
|
11
|
+
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsOptional()
|
|
14
|
+
@Type(() => Number)
|
|
15
|
+
@IsInt()
|
|
16
|
+
@Min(1)
|
|
17
|
+
@Max(100)
|
|
18
|
+
limit?: number;
|
|
19
|
+
|
|
20
|
+
@Expose()
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsString()
|
|
23
|
+
nextToken?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Query de publicListStoreSalePromotions; la tienda sale de la sesión, no del request. */
|
|
5
|
+
export class ListStoreSalePromotionsQuery {
|
|
6
|
+
@Expose()
|
|
7
|
+
@IsString()
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
sessionId!: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
ArrayNotEmpty,
|
|
4
|
+
IsArray,
|
|
5
|
+
IsEnum,
|
|
6
|
+
IsInt,
|
|
7
|
+
IsNotEmpty,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
ValidateIf,
|
|
11
|
+
ValidateNested,
|
|
12
|
+
} from 'class-validator';
|
|
13
|
+
import { CouponScopeEnum } from '../../enums/CouponScopeEnum';
|
|
14
|
+
import { GiftModeEnum } from '../../enums/GiftModeEnum';
|
|
15
|
+
import { DiscountValueInput } from './DiscountValueInput';
|
|
16
|
+
|
|
17
|
+
export class AccessoryDiscountLeverInput {
|
|
18
|
+
@Expose()
|
|
19
|
+
@IsInt()
|
|
20
|
+
percentBps!: number;
|
|
21
|
+
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
@IsInt()
|
|
25
|
+
maxAmountCents?: number | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Regalo por lista exige `skus`; por gama exige `category` y `maxPriceCents`. */
|
|
29
|
+
export class GiftLeverInput {
|
|
30
|
+
@Expose()
|
|
31
|
+
@IsEnum(GiftModeEnum)
|
|
32
|
+
mode!: GiftModeEnum;
|
|
33
|
+
|
|
34
|
+
@Expose()
|
|
35
|
+
@ValidateIf((o: GiftLeverInput) => o.mode === GiftModeEnum.LIST)
|
|
36
|
+
@IsArray()
|
|
37
|
+
@ArrayNotEmpty()
|
|
38
|
+
@IsString({ each: true })
|
|
39
|
+
skus?: string[] | null;
|
|
40
|
+
|
|
41
|
+
@Expose()
|
|
42
|
+
@ValidateIf((o: GiftLeverInput) => o.mode === GiftModeEnum.RANGE)
|
|
43
|
+
@IsString()
|
|
44
|
+
@IsNotEmpty()
|
|
45
|
+
category?: string | null;
|
|
46
|
+
|
|
47
|
+
@Expose()
|
|
48
|
+
@ValidateIf((o: GiftLeverInput) => o.mode === GiftModeEnum.RANGE)
|
|
49
|
+
@IsInt()
|
|
50
|
+
maxPriceCents?: number | null;
|
|
51
|
+
|
|
52
|
+
@Expose()
|
|
53
|
+
@IsInt()
|
|
54
|
+
chooseCount!: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export class CouponLeverInput extends DiscountValueInput {
|
|
58
|
+
@Expose()
|
|
59
|
+
@IsInt()
|
|
60
|
+
validityDays!: number;
|
|
61
|
+
|
|
62
|
+
@Expose()
|
|
63
|
+
@IsEnum(CouponScopeEnum)
|
|
64
|
+
scope!: CouponScopeEnum;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export class AirtimeLeverInput {
|
|
68
|
+
@Expose()
|
|
69
|
+
@IsInt()
|
|
70
|
+
rechargeCount!: number;
|
|
71
|
+
|
|
72
|
+
@Expose()
|
|
73
|
+
@IsInt()
|
|
74
|
+
rechargeAmountCents!: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export class ExtendedWarrantyLeverInput {
|
|
78
|
+
@Expose()
|
|
79
|
+
@IsInt()
|
|
80
|
+
extraMonths!: number;
|
|
81
|
+
|
|
82
|
+
@Expose()
|
|
83
|
+
@IsInt()
|
|
84
|
+
costCents!: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export class WalletBonusLeverInput {
|
|
88
|
+
@Expose()
|
|
89
|
+
@IsInt()
|
|
90
|
+
amountCents!: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Las 7 palancas en el body; que venga al menos una lo valida el lambda (422). */
|
|
94
|
+
export class SalePromotionLeversInput {
|
|
95
|
+
@Expose()
|
|
96
|
+
@IsOptional()
|
|
97
|
+
@ValidateNested()
|
|
98
|
+
@Type(() => DiscountValueInput)
|
|
99
|
+
deviceDiscount?: DiscountValueInput | null;
|
|
100
|
+
|
|
101
|
+
@Expose()
|
|
102
|
+
@IsOptional()
|
|
103
|
+
@ValidateNested()
|
|
104
|
+
@Type(() => AccessoryDiscountLeverInput)
|
|
105
|
+
accessoryDiscount?: AccessoryDiscountLeverInput | null;
|
|
106
|
+
|
|
107
|
+
@Expose()
|
|
108
|
+
@IsOptional()
|
|
109
|
+
@ValidateNested()
|
|
110
|
+
@Type(() => GiftLeverInput)
|
|
111
|
+
gift?: GiftLeverInput | null;
|
|
112
|
+
|
|
113
|
+
@Expose()
|
|
114
|
+
@IsOptional()
|
|
115
|
+
@ValidateNested()
|
|
116
|
+
@Type(() => CouponLeverInput)
|
|
117
|
+
coupon?: CouponLeverInput | null;
|
|
118
|
+
|
|
119
|
+
@Expose()
|
|
120
|
+
@IsOptional()
|
|
121
|
+
@ValidateNested()
|
|
122
|
+
@Type(() => AirtimeLeverInput)
|
|
123
|
+
airtime?: AirtimeLeverInput | null;
|
|
124
|
+
|
|
125
|
+
@Expose()
|
|
126
|
+
@IsOptional()
|
|
127
|
+
@ValidateNested()
|
|
128
|
+
@Type(() => ExtendedWarrantyLeverInput)
|
|
129
|
+
extendedWarranty?: ExtendedWarrantyLeverInput | null;
|
|
130
|
+
|
|
131
|
+
@Expose()
|
|
132
|
+
@IsOptional()
|
|
133
|
+
@ValidateNested()
|
|
134
|
+
@Type(() => WalletBonusLeverInput)
|
|
135
|
+
walletBonus?: WalletBonusLeverInput | null;
|
|
136
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsArray, IsBoolean, IsEnum, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { ProductCategoryEnum } from '../../../retailCatalog/enums/ProductCategoryEnum';
|
|
4
|
+
import { ProductTierEnum } from '../../../retailCatalog/enums/ProductTierEnum';
|
|
5
|
+
|
|
6
|
+
/** Alcance en el body; cada lista ausente o `null` = sin restricción. */
|
|
7
|
+
export class SalePromotionScopeInput {
|
|
8
|
+
@Expose()
|
|
9
|
+
@IsOptional()
|
|
10
|
+
@IsArray()
|
|
11
|
+
@IsEnum(ProductCategoryEnum, { each: true })
|
|
12
|
+
productCategories?: ProductCategoryEnum[] | null;
|
|
13
|
+
|
|
14
|
+
@Expose()
|
|
15
|
+
@IsOptional()
|
|
16
|
+
@IsArray()
|
|
17
|
+
@IsEnum(ProductTierEnum, { each: true })
|
|
18
|
+
tiers?: ProductTierEnum[] | null;
|
|
19
|
+
|
|
20
|
+
@Expose()
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsArray()
|
|
23
|
+
@IsString({ each: true })
|
|
24
|
+
skus?: string[] | null;
|
|
25
|
+
|
|
26
|
+
@Expose()
|
|
27
|
+
@IsOptional()
|
|
28
|
+
@IsArray()
|
|
29
|
+
@IsString({ each: true })
|
|
30
|
+
storeIds?: string[] | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Segmentación en el body: segmentos de loan-offerings y si exige crédito SK activo. */
|
|
34
|
+
export class SalePromotionSegmentationInput {
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsArray()
|
|
38
|
+
@IsString({ each: true })
|
|
39
|
+
segmentIds?: string[] | null;
|
|
40
|
+
|
|
41
|
+
@Expose()
|
|
42
|
+
@IsOptional()
|
|
43
|
+
@IsBoolean()
|
|
44
|
+
requiresActiveSurekeepCredit?: boolean;
|
|
45
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
IsBoolean,
|
|
4
|
+
IsEnum,
|
|
5
|
+
IsInt,
|
|
6
|
+
IsISO8601,
|
|
7
|
+
IsNotEmpty,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
ValidateNested,
|
|
11
|
+
} from 'class-validator';
|
|
12
|
+
import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
|
|
13
|
+
import { SalePromotionLeversInput } from './SalePromotionLeversInput';
|
|
14
|
+
import { SalePromotionScopeInput, SalePromotionSegmentationInput } from './SalePromotionScopeInput';
|
|
15
|
+
|
|
16
|
+
/** Body de publicUpdateSalePromotion: parche; el lambda crea una versión nueva para ventas futuras. */
|
|
17
|
+
export class UpdateSalePromotionRequest {
|
|
18
|
+
@Expose()
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
name?: string;
|
|
23
|
+
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@IsString()
|
|
27
|
+
customerText?: string;
|
|
28
|
+
|
|
29
|
+
@Expose()
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@ValidateNested()
|
|
32
|
+
@Type(() => SalePromotionLeversInput)
|
|
33
|
+
levers?: SalePromotionLeversInput;
|
|
34
|
+
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@ValidateNested()
|
|
38
|
+
@Type(() => SalePromotionScopeInput)
|
|
39
|
+
scope?: SalePromotionScopeInput | null;
|
|
40
|
+
|
|
41
|
+
@Expose()
|
|
42
|
+
@IsOptional()
|
|
43
|
+
@ValidateNested()
|
|
44
|
+
@Type(() => SalePromotionSegmentationInput)
|
|
45
|
+
segmentation?: SalePromotionSegmentationInput | null;
|
|
46
|
+
|
|
47
|
+
/** Ausente = conserva el valor actual. */
|
|
48
|
+
@Expose()
|
|
49
|
+
@IsOptional()
|
|
50
|
+
@IsEnum(PromotionAppliesToEnum)
|
|
51
|
+
appliesTo?: PromotionAppliesToEnum;
|
|
52
|
+
|
|
53
|
+
/** `null` = sin tope. */
|
|
54
|
+
@Expose()
|
|
55
|
+
@IsOptional()
|
|
56
|
+
@IsInt()
|
|
57
|
+
budgetMaxCents?: number | null;
|
|
58
|
+
|
|
59
|
+
@Expose()
|
|
60
|
+
@IsOptional()
|
|
61
|
+
@IsISO8601()
|
|
62
|
+
validFrom?: string | null;
|
|
63
|
+
|
|
64
|
+
/** `null` = permanente. */
|
|
65
|
+
@Expose()
|
|
66
|
+
@IsOptional()
|
|
67
|
+
@IsISO8601()
|
|
68
|
+
validUntil?: string | null;
|
|
69
|
+
|
|
70
|
+
@Expose()
|
|
71
|
+
@IsOptional()
|
|
72
|
+
@IsBoolean()
|
|
73
|
+
oncePerCustomer?: boolean;
|
|
74
|
+
}
|