Package com.skava.promotion.ecomm
Class EcommPromotionUtil
java.lang.Object
com.skava.promotion.ecomm.EcommPromotionUtil
This class provides functionalities that are used to render offer in the response
- Since:
- 8.0
- Version:
- 8.0
- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
getRoundOffDiscountValue
(PromotionRoundOffTypes roundOffType, double discount) Functionality to roundoff the discount valuestatic void
getTotalDiscountForPriceFacets
(BaseDiscount priceFacets, Map<String, Object> overallPriceFacetsDiscountObj, PromotionRoundOffTypes roundOffType) getTotalPriceFacets
(Map<String, Object> overAllPriceFacets, Map<String, Object> currentPriceFacets, PromotionRoundOffTypes roundOffType) static void
overallCartPriceFacetsDiscount
(Map<String, Object> priceFacets, Map<String, Object> overallPriceFacetsDiscount, PromotionRoundOffTypes roundOffType) This method is used to calculate overallCartPriceFacets DiscountoverallPriceFacetsDiscount
(List<BaseDiscount> priceFacets, Map<String, Object> overallPriceFacetsDiscount, PromotionRoundOffTypes roundOffType) static void
setOverAllDiscountForBundles
(PromotionOfferDO promotionOfferDO, List<Object> offerObjects) Functionality to set the PromotionBundles overall discountstatic void
setOverAllDiscountForCart
(PromotionOfferDO promotionOfferDO, List<Object> offerObjects) Functionality to calculate PromotionCart overall discountstatic void
setOverAllDiscountForSku
(PromotionOfferDO promotionOfferDO, List<Object> offerObjects) Functionality to set the PromotionSkus overall discount
-
Method Details
-
setOverAllDiscountForCart
public static void setOverAllDiscountForCart(PromotionOfferDO promotionOfferDO, List<Object> offerObjects) Functionality to calculate PromotionCart overall discount- Parameters:
promotionOfferDO
- An instance ofPromotionOfferDO
offerObjects
- An instance ofList
<Object
>
-
overallCartPriceFacetsDiscount
public static void overallCartPriceFacetsDiscount(Map<String, Object> priceFacets, @Nonnull Map<String, Object> overallPriceFacetsDiscount, PromotionRoundOffTypes roundOffType) This method is used to calculate overallCartPriceFacets Discount- Parameters:
priceFacets
- contains priceFacets objectoverallPriceFacetsDiscount
- holds calculated overallPriceFacetsDiscountroundOffType
- holds roundOffType value
-
setOverAllDiscountForSku
public static void setOverAllDiscountForSku(PromotionOfferDO promotionOfferDO, List<Object> offerObjects) Functionality to set the PromotionSkus overall discount- Parameters:
promotionOfferDO
- An instance ofPromotionOfferDO
offerObjects
- An instance ofList
<Object
>
-
setOverAllDiscountForBundles
public static void setOverAllDiscountForBundles(PromotionOfferDO promotionOfferDO, List<Object> offerObjects) Functionality to set the PromotionBundles overall discount- Parameters:
promotionOfferDO
- An instance ofPromotionOfferDO
offerObjects
- An instance ofList
<Object
>
-
getTotalPriceFacets
-
overallPriceFacetsDiscount
public static Map<String,Object> overallPriceFacetsDiscount(List<BaseDiscount> priceFacets, @Nonnull Map<String, Object> overallPriceFacetsDiscount, PromotionRoundOffTypes roundOffType) -
getTotalDiscountForPriceFacets
public static void getTotalDiscountForPriceFacets(BaseDiscount priceFacets, Map<String, Object> overallPriceFacetsDiscountObj, PromotionRoundOffTypes roundOffType) -
getRoundOffDiscountValue
Functionality to roundoff the discount value- Parameters:
roundOffType
- Holds thePromotionRoundOffTypes
valuesdiscount
- Holds the calculated discount value- Returns:
- The rounded off discount value
-