Package com.skava.promotion.ecomm.action
Class AbstractCartOfferAction
java.lang.Object
com.skava.promotion.action.BasePromotionAction
com.skava.promotion.ecomm.action.EcommBasePromotionAction
com.skava.promotion.ecomm.action.AbstractCartOfferAction
- All Implemented Interfaces:
PromotionAction
- Direct Known Subclasses:
CartGiftWithPurchase,CartPriceOff,CartShippingOff,TradeInOffer
This class provides the functionality that are common to cart based offers
- Since:
- 8.0
- Version:
- 8.0
- Author:
- Infosys Equinox
-
Field Summary
FieldsFields inherited from class com.skava.promotion.ecomm.action.EcommBasePromotionAction
DEAL_ITEM_CONSUMABLE, DISCOUNT_TYPE_EACH, DISCOUNT_TYPE_FLAT, DISCOUNT_TYPE_PARAM, DISCOUNT_TYPE_VALUE, OFFER_EXPENSIVE_TYPE_LEAST, OFFER_EXPENSIVE_TYPE_MOST, offerAbleBundle, offerAbleSkuFields inherited from class com.skava.promotion.action.BasePromotionAction
ADDITIONAL_OFFER_INFO, ALLOW_NEGATIVE_VALUE, CURRENCY_OFFER, FIXED_OFFER, FORMULA, MAX_DISCOUNT_AMOUNT, MIN_DISCOUNT_AMOUNT, OFFER_VALUE, PERCENTAGE_OFFER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyAction(PromotionOfferDO promotionOfferDO, PromotionDO promotion) Provides functionality to perform discount calculation based on the configuration.protected abstract voidapplyOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) Functionality to calculate offerprotected voidgetOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) This method provides functionality to get offerprotected static doublegetUpdatedShippingCost(double shippingCost, int ruleType, List<PromotionCartOffer> offers) This method returns the updated shipping costprotected static doublegetUpdatedTotalPrice(double price, int ruleType, List<PromotionCartOffer> offers, String enableForEligibleProducts, double ratio) Loads the updated total price of the cartprotected static doublegetUpdatedTotalPriceForPriceFacets(double price, int ruleType, List<PromotionCartOffer> offers, String keyDiscount, double ratio, String enableForEligibleProducts) Loads the updated total price facet value of the cartprotected static doublegetUpdatedTradeInValue(double tradeInValue, int ruleType, List<PromotionCartOffer> offers) Loads the updated trade-in value of the cartbooleanprepareApplyAction(PromotionOfferDO promotionOfferDO) protected PromotionCartOffersetOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) Functionality to set the offer detailsprotected voidupdateProximityMessage(PromotionCartOffer offer, PromotionOfferDO promotionOfferDO) This method is used to proximity messageMethods inherited from class com.skava.promotion.ecomm.action.EcommBasePromotionAction
bundleClone, bundleProductClone, calculatAndGetUpdatedPriceFacetsValue, calculatAndGetUpdatedPriceFacetsValue, calculatAndGetUpdatedPriceFacetsValue, calculatAndGetUpdatedPriceFacetsValue, calculatAndGetUpdatedPriceFacetValue, calculateBundleOffer, calculateBundleOffer, calculateDiscount, calculateOffer, calculateOffer, calculatePriceFacetsOffer, calculatePriceFacetsOfferForBundleProduct, calculateTotalBundlePriceFacets, calculateTotalBundlePriceFacetsQtyFractional, calculateTotalPrice, calculateTotalPriceBundle, calculateTotalPriceBundleQtyFractional, calculateTotalPriceFacets, calculateTotalPriceFacetsQtyFractional, calculateTotalPriceQtyFractional, calibrateDiscount, calibrateDiscount2, checkForBestOffer, clone, findBestBundlePriceOffer, findBestProductPriceOffer, getBaseOffers, getBundleTotalQuantity, getBundleTotalQuantityFractional, getDiscountType, getEachDiscountQtyVal, getEcommOffer, getFlatDiscount, getTotalQuantity, getTotalQuantity, getTotalQuantityFractional, getTotalQuantityFractional, getUpdatedPrice, getUpdatedPriceFacetsValue, getUpdatedShippingCost, promotionSkuClone, removeCompletedBatchBundles, removeCompletedBatchBundles, removeCompletedBatchBundles, removeCompletedBatchBundles, removeCompletedBatchSkus, removeCompletedBatchSkus, setGiftQuantity, setGiftQuantity, setMatchedSkuId, setOffer, setOfferAbleBundles, setOfferAbleSkus, setOfferAbleSkus, sort, sortBundle, updateQuantiyBasedDiscount, updateUnitQuantiyBasedDiscountMethods inherited from class com.skava.promotion.action.BasePromotionAction
createOffer, getAdditionalOfferInfo, getAllowedDiscount, getDiscount, getDiscountForPercentOffer, getDouble, getFormulaDiscount, getFormulaResult, getMaximumDiscount, getMinimumDiscount, getMinValue, getOfferId, getOfferValue, getPercentageDiscount, getPriceFacetDiscount, hasValueForProperty, isOfferExist, onFinish, prepareApplyAction
-
Field Details
-
filteredObjects
-
-
Constructor Details
-
AbstractCartOfferAction
public AbstractCartOfferAction()
-
-
Method Details
-
getUpdatedTotalPrice
protected static double getUpdatedTotalPrice(double price, int ruleType, List<PromotionCartOffer> offers, String enableForEligibleProducts, double ratio) Loads the updated total price of the cart- Parameters:
price- Total price of the cartruleType- Rule typeoffers- An instance ofList<PromotionCartOffer>enableForEligibleProducts- indicates the if the current offer is eligible for all items.ratio- indicates ratio of eligible price to the total price.- Returns:
- The updated total price of the cart
-
getUpdatedTotalPriceForPriceFacets
protected static double getUpdatedTotalPriceForPriceFacets(double price, int ruleType, List<PromotionCartOffer> offers, String keyDiscount, double ratio, String enableForEligibleProducts) Loads the updated total price facet value of the cart- Parameters:
price- Total price facet value of the cartruleType- Rule typeoffers- An instance ofList<PromotionCartOffer>keyDiscount- Holds the price facet keyratio- indicates ratio of eligible price to the total price.enableForEligibleProducts- indicates the if the current offer is eligible for all items.- Returns:
- The updated total price facet value of the cart
-
getUpdatedTradeInValue
protected static double getUpdatedTradeInValue(double tradeInValue, int ruleType, List<PromotionCartOffer> offers) Loads the updated trade-in value of the cart- Parameters:
tradeInValue- Trade-in value of the cartruleType- Rule typeoffers- An instance ofList<PromotionCartOffer>- Returns:
- The updated trade-in value of the cart
-
getUpdatedShippingCost
protected static double getUpdatedShippingCost(double shippingCost, int ruleType, List<PromotionCartOffer> offers) This method returns the updated shipping cost- Parameters:
shippingCost- Holds the shipping cost of the productruleType- Holds the value for the rule typeoffers- An instance ofList<PromotionCartOffer>- Returns:
- The updated shipping cost of the product
-
setOffer
protected PromotionCartOffer setOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) Functionality to set the offer details- Parameters:
promotionOfferDO- An instance ofPromotionOfferDOpromotion- An instance ofPromotionDOcart- An instance ofPromotionCart- Returns:
- The instance of
PromotionDiscount
-
getOffer
protected void getOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) This method provides functionality to get offer- Parameters:
promotionOfferDO- An instance ofPromotionOfferDOpromotion- An instance ofPromotionDOcart- An instance ofPromotionCart
-
applyOffer
protected abstract void applyOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) Functionality to calculate offer- Parameters:
promotionOfferDO- An instance ofPromotionOfferDOpromotion- An instance ofPromotionDOcart- An instance ofPromotionCart
-
applyAction
Description copied from interface:PromotionActionProvides functionality to perform discount calculation based on the configuration.- Specified by:
applyActionin interfacePromotionAction- Overrides:
applyActionin classBasePromotionAction- Parameters:
promotionOfferDO- An instance ofPromotionOfferDO.promotion- An instance ofPromotionDO.
-
prepareApplyAction
- Specified by:
prepareApplyActionin interfacePromotionAction- Overrides:
prepareApplyActionin classBasePromotionAction
-
updateProximityMessage
This method is used to proximity message- Parameters:
offer- offer
-