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, offerAbleSku
Fields 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 TypeMethodDescriptionvoid
applyAction
(PromotionOfferDO promotionOfferDO, PromotionDO promotion) Provides functionality to perform discount calculation based on the configuration.protected abstract void
applyOffer
(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) Functionality to calculate offerprotected void
getOffer
(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) This method provides functionality to get offerprotected static double
getUpdatedShippingCost
(double shippingCost, int ruleType, List<PromotionCartOffer> offers) This method returns the updated shipping costprotected static double
getUpdatedTotalPrice
(double price, int ruleType, List<PromotionCartOffer> offers, String enableForEligibleProducts, double ratio) Loads the updated total price of the cartprotected 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 cartprotected static double
getUpdatedTradeInValue
(double tradeInValue, int ruleType, List<PromotionCartOffer> offers) Loads the updated trade-in value of the cartboolean
prepareApplyAction
(PromotionOfferDO promotionOfferDO) protected PromotionCartOffer
setOffer
(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) Functionality to set the offer detailsprotected void
updateProximityMessage
(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, updateUnitQuantiyBasedDiscount
Methods 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 ofPromotionOfferDO
promotion
- An instance ofPromotionDO
cart
- 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 ofPromotionOfferDO
promotion
- An instance ofPromotionDO
cart
- An instance ofPromotionCart
-
applyOffer
protected abstract void applyOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionCart cart) Functionality to calculate offer- Parameters:
promotionOfferDO
- An instance ofPromotionOfferDO
promotion
- An instance ofPromotionDO
cart
- An instance ofPromotionCart
-
applyAction
Description copied from interface:PromotionAction
Provides functionality to perform discount calculation based on the configuration.- Specified by:
applyAction
in interfacePromotionAction
- Overrides:
applyAction
in classBasePromotionAction
- Parameters:
promotionOfferDO
- An instance ofPromotionOfferDO
.promotion
- An instance ofPromotionDO
.
-
prepareApplyAction
- Specified by:
prepareApplyAction
in interfacePromotionAction
- Overrides:
prepareApplyAction
in classBasePromotionAction
-
updateProximityMessage
This method is used to proximity message- Parameters:
offer
- offer
-