Class EcommPromotionUtil

java.lang.Object
com.skava.promotion.ecomm.EcommPromotionUtil

public final class EcommPromotionUtil extends Object
This class provides functionalities that are used to render offer in the response
Since:
8.0
Version:
8.0
Author:
Infosys Equinox
  • Method Details

    • setOverAllDiscountForCart

      public static void setOverAllDiscountForCart(PromotionOfferDO promotionOfferDO, List<Object> offerObjects)
      Functionality to calculate PromotionCart overall discount
      Parameters:
      promotionOfferDO - An instance of PromotionOfferDO
      offerObjects - An instance of List <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 object
      overallPriceFacetsDiscount - holds calculated overallPriceFacetsDiscount
      roundOffType - holds roundOffType value
    • setOverAllDiscountForSku

      public static void setOverAllDiscountForSku(PromotionOfferDO promotionOfferDO, List<Object> offerObjects)
      Functionality to set the PromotionSkus overall discount
      Parameters:
      promotionOfferDO - An instance of PromotionOfferDO
      offerObjects - An instance of List <Object>
    • setOverAllDiscountForBundles

      public static void setOverAllDiscountForBundles(PromotionOfferDO promotionOfferDO, List<Object> offerObjects)
      Functionality to set the PromotionBundles overall discount
      Parameters:
      promotionOfferDO - An instance of PromotionOfferDO
      offerObjects - An instance of List <Object>
    • getTotalPriceFacets

      public static Map<String,Object> getTotalPriceFacets(Map<String,Object> overAllPriceFacets, Map<String,Object> currentPriceFacets, PromotionRoundOffTypes roundOffType)
    • 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

      public static double getRoundOffDiscountValue(PromotionRoundOffTypes roundOffType, double discount)
      Functionality to roundoff the discount value
      Parameters:
      roundOffType - Holds the PromotionRoundOffTypes values
      discount - Holds the calculated discount value
      Returns:
      The rounded off discount value