Class AbstractBundleOfferActionQuantityFractional

java.lang.Object
com.skava.promotion.action.BasePromotionAction
com.skava.promotion.ecomm.action.EcommBasePromotionAction
com.skava.promotion.ecomm.action.AbstractBundleOfferActionQuantityFractional
All Implemented Interfaces:
PromotionAction
Direct Known Subclasses:
BundleProductPriceOff, BundleProductShippingOff

public abstract class AbstractBundleOfferActionQuantityFractional extends EcommBasePromotionAction
This class provides the functionality that are common to bundle product price offers
Since:
8.0.2
Version:
8.0.2
Author:
Infosys Equinox
  • Field Details

  • Constructor Details

    • AbstractBundleOfferActionQuantityFractional

      public AbstractBundleOfferActionQuantityFractional()
  • Method Details

    • getTotalPriceForCurrentBatch

      protected abstract double getTotalPriceForCurrentBatch()
      Functionalities to calculate total unitPrice/ShippingCost for current batch
      Returns:
      return totalPrice in double
    • getTotalPriceForCurrentBatch

      protected abstract void getTotalPriceForCurrentBatch(Map<String,Object> priceFacets)
      Functionalities to calculate total unitPrice/ShippingCost for current batch
      Parameters:
      priceFacets - contains priceFacets
    • getOffer

      protected void getOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundle)
      This method provides functionality to get offer details
      Parameters:
      promotionOfferDO - An instance of PromotionOfferDO
      promotion - An instance of PromotionDO
      bundle - An instance of PromotionBundle
    • getExpensiveType

      protected static String getExpensiveType(Map<String,Object> actionParams)
      Functionalities to get Expensive type
      Parameters:
      actionParams - Holds the param values
      Returns:
      Returns Expensive type in String format
    • calculateOffer

      protected void calculateOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku, PromotionOffer offer, double totalPricePerBatch, Map<String,Object> totalPricePerBatchForPriceFacets)
      Parameters:
      promotionOfferDO - An instance of PromotionOfferDO
      promotion - An instance of PromotionDO
      bundleSku - An instance of PromotionBundle
      offer - An instance of PromotionOffer
      totalPricePerBatch - in double
      totalPricePerBatchForPriceFacets - holds totalPricePerBatchForPriceFacets
    • getTotalPricePerBatch

      protected abstract double getTotalPricePerBatch(List<PromotionBundle> bundleSkus)
      Functionalities to calculate total unitPrice/ShippingCost per batch
      Parameters:
      bundleSkus - An instance of List<PromotionBundle
      Returns:
      return totalPrice in double
    • getTotalPricePerBatch

      protected abstract void getTotalPricePerBatch(List<PromotionBundle> skus, Map<String,Object> priceFacets)
      Functionality to get the totalPriceFacet values of X and Y skus in current batch.
      Parameters:
      skus - An instance of PromotionBundle
      priceFacets - contain updatedPriceFacets value
    • calculateOffer

      protected void calculateOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku, PromotionOffer offer, double offeredQty, double totalPricePerBatch, Map<String,Object> totalPricePerBatchForPriceFacets)
      Parameters:
      promotionOfferDO - An instance of PromotionOfferDO
      promotion - An instance of PromotionDO
      bundleSku - An instance of PromotionBundle
      offer - An instance of PromotionOffer
      offeredQty - .
      totalPricePerBatch - in double
      totalPricePerBatchForPriceFacets - holds totalPricePerBatchForPriceFacets
    • findBundleBestProductPriceOffer

      public void findBundleBestProductPriceOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku)
      This method provides functionality to perform best offer deals
      Parameters:
      promotion - An instance of PromotionDO
      bundleSku - An instance of PromotionBundle
      promotionOfferDO - An instance of PromotionOfferDO
    • removefilteredObjects

      protected List<PromotionBundle> removefilteredObjects(List<PromotionBundle> filteredObjects, double purchaseQty, String offerType)
      Functionality to remove the filteredObject which is less than purchaseQty
      Parameters:
      filteredObjects - Holds the filtered bundles
      purchaseQty - Holds the current promotion quantity
      offerType -
      Returns:
      returns the filteredBundles
    • applyAction

      public void applyAction(PromotionOfferDO promotionOfferDO, PromotionDO promotion)
      Description copied from interface: PromotionAction
      Provides functionality to perform discount calculation based on the configuration.
      Specified by:
      applyAction in interface PromotionAction
      Overrides:
      applyAction in class BasePromotionAction
      Parameters:
      promotionOfferDO - An instance of PromotionOfferDO.
      promotion - An instance of PromotionDO.
    • prepareApplyAction

      public boolean prepareApplyAction(PromotionOfferDO promotionOfferDO)
      Specified by:
      prepareApplyAction in interface PromotionAction
      Overrides:
      prepareApplyAction in class BasePromotionAction