Package com.skava.promotion.ecomm.action
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
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 Summary
FieldsModifier and TypeFieldDescriptionprotected List<PromotionBundle>protected static final Stringprotected static final StringFields 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 voidcalculateOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku, PromotionOffer offer, double offeredQty, double totalPricePerBatch, Map<String, Object> totalPricePerBatchForPriceFacets) protected voidcalculateOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku, PromotionOffer offer, double totalPricePerBatch, Map<String, Object> totalPricePerBatchForPriceFacets) voidfindBundleBestProductPriceOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku) This method provides functionality to perform best offer dealsprotected static StringgetExpensiveType(Map<String, Object> actionParams) Functionalities to get Expensive typeprotected voidgetOffer(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundle) This method provides functionality to get offer detailsprotected abstract doubleFunctionalities to calculate total unitPrice/ShippingCost for current batchprotected abstract voidgetTotalPriceForCurrentBatch(Map<String, Object> priceFacets) Functionalities to calculate total unitPrice/ShippingCost for current batchprotected abstract doublegetTotalPricePerBatch(List<PromotionBundle> bundleSkus) Functionalities to calculate total unitPrice/ShippingCost per batchprotected abstract voidgetTotalPricePerBatch(List<PromotionBundle> skus, Map<String, Object> priceFacets) Functionality to get the totalPriceFacet values of X and Y skus in current batch.booleanprepareApplyAction(PromotionOfferDO promotionOfferDO) protected List<PromotionBundle>removefilteredObjects(List<PromotionBundle> filteredObjects, double purchaseQty, String offerType) Functionality to remove the filteredObject which is less than purchaseQtyMethods 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
-
OFFER_SKU_KEY
- See Also:
-
OFFER_BUNDLE_KEY
- See Also:
-
-
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
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 ofPromotionOfferDOpromotion- An instance ofPromotionDObundle- An instance ofPromotionBundle
-
getExpensiveType
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 ofPromotionOfferDOpromotion- An instance ofPromotionDObundleSku- An instance ofPromotionBundleoffer- An instance ofPromotionOffertotalPricePerBatch- in doubletotalPricePerBatchForPriceFacets- holds totalPricePerBatchForPriceFacets
-
getTotalPricePerBatch
Functionalities to calculate total unitPrice/ShippingCost per batch- Parameters:
bundleSkus- An instance ofList<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 ofPromotionBundlepriceFacets- 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 ofPromotionOfferDOpromotion- An instance ofPromotionDObundleSku- An instance ofPromotionBundleoffer- An instance ofPromotionOfferofferedQty- .totalPricePerBatch- in doubletotalPricePerBatchForPriceFacets- 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 ofPromotionDObundleSku- An instance ofPromotionBundlepromotionOfferDO- An instance ofPromotionOfferDO
-
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 bundlespurchaseQty- Holds the current promotion quantityofferType-- Returns:
- returns the filteredBundles
-
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
-