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 String
protected static final String
Fields 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 void
calculateOffer
(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku, PromotionOffer offer, double offeredQty, double totalPricePerBatch, Map<String, Object> totalPricePerBatchForPriceFacets) protected void
calculateOffer
(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku, PromotionOffer offer, double totalPricePerBatch, Map<String, Object> totalPricePerBatchForPriceFacets) void
findBundleBestProductPriceOffer
(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundleSku) This method provides functionality to perform best offer dealsprotected static String
getExpensiveType
(Map<String, Object> actionParams) Functionalities to get Expensive typeprotected void
getOffer
(PromotionOfferDO promotionOfferDO, PromotionDO promotion, PromotionBundle bundle) This method provides functionality to get offer detailsprotected abstract double
Functionalities to calculate total unitPrice/ShippingCost for current batchprotected abstract void
getTotalPriceForCurrentBatch
(Map<String, Object> priceFacets) Functionalities to calculate total unitPrice/ShippingCost for current batchprotected abstract double
getTotalPricePerBatch
(List<PromotionBundle> bundleSkus) Functionalities to calculate total unitPrice/ShippingCost per batchprotected abstract void
getTotalPricePerBatch
(List<PromotionBundle> skus, Map<String, Object> priceFacets) Functionality to get the totalPriceFacet values of X and Y skus in current batch.boolean
prepareApplyAction
(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, 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
-
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 ofPromotionOfferDO
promotion
- An instance ofPromotionDO
bundle
- 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 ofPromotionOfferDO
promotion
- An instance ofPromotionDO
bundleSku
- An instance ofPromotionBundle
offer
- An instance ofPromotionOffer
totalPricePerBatch
- 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 ofPromotionBundle
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 ofPromotionOfferDO
promotion
- An instance ofPromotionDO
bundleSku
- An instance ofPromotionBundle
offer
- An instance ofPromotionOffer
offeredQty
- .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 ofPromotionDO
bundleSku
- An instance ofPromotionBundle
promotionOfferDO
- 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: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
-