public class PromotableFulfillmentGroupImpl extends Object implements PromotableFulfillmentGroup
| Modifier and Type | Field and Description |
|---|---|
protected Money |
adjustedPrice |
List<PromotableFulfillmentGroupAdjustment> |
candidateFulfillmentGroupAdjustments |
protected List<PromotableOrderItem> |
discountableOrderItems |
protected FulfillmentGroup |
fulfillmentGroup |
protected PromotableItemFactory |
itemFactory |
protected PromotableOrder |
promotableOrder |
protected boolean |
useSaleAdjustments |
| Constructor and Description |
|---|
PromotableFulfillmentGroupImpl(FulfillmentGroup fulfillmentGroup,
PromotableOrder promotableOrder,
PromotableItemFactory itemFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCandidateFulfillmentGroupAdjustment(PromotableFulfillmentGroupAdjustment adjustment)
Adds a fulfillmentGroupAdjustment
|
Money |
calculatePriceWithAdjustments(boolean useSalePrice)
Calculates the price with adjustments.
|
Money |
calculatePriceWithoutAdjustments()
Returns the price of this fulfillment group if no adjustments were applied.
|
protected Money |
calculateRetailAdjustmentPrice() |
protected Money |
calculateSaleAdjustmentPrice() |
boolean |
canApplyOffer(PromotableCandidateFulfillmentGroupOffer fulfillmentGroupOffer)
Checks to see if the offer can be added to this fulfillmentGroup based on whether or not
it is combinable or if this fulfillmentGroup already has a non-combinable offer applied.
|
void |
chooseSaleOrRetailAdjustments()
This method will check to see if the salePriceAdjustments or retailPriceAdjustments are better
and remove those that should not apply.
|
protected void |
finalizeAdjustments(boolean useSaleAdjustments) |
List<PromotableFulfillmentGroupAdjustment> |
getCandidateFulfillmentGroupAdjustments()
Adds a fulfillmentGroupAdjustment
|
List<PromotableOrderItem> |
getDiscountableOrderItems()
Return list of discountable discrete order items contained in this fulfillmentGroup.
|
Money |
getFinalizedPriceWithAdjustments()
Calculates the price with all adjustments.
|
FulfillmentGroup |
getFulfillmentGroup()
Returns the decorated FulfillmentGroup
|
protected Money |
getSalePriceBeforeAdjustments() |
boolean |
isTotalitarianOfferApplied()
Returns true if totalitarian offer was applied to this promotable fulfillment group.
|
void |
removeAllCandidateAdjustments()
Removes all candidate adjustments
|
protected void |
removeRetailOnlyAdjustments()
Removes retail only adjustments.
|
protected void |
removeZeroDollarAdjustments(boolean useSalePrice)
If removeUnusedAdjustments is s
|
void |
updateRuleVariables(Map<String,Object> ruleVars)
Adds the underlying fulfillmentGroup to the rule variable map.
|
protected FulfillmentGroup fulfillmentGroup
protected PromotableOrder promotableOrder
protected PromotableItemFactory itemFactory
protected List<PromotableOrderItem> discountableOrderItems
protected boolean useSaleAdjustments
protected Money adjustedPrice
public List<PromotableFulfillmentGroupAdjustment> candidateFulfillmentGroupAdjustments
public PromotableFulfillmentGroupImpl(FulfillmentGroup fulfillmentGroup, PromotableOrder promotableOrder, PromotableItemFactory itemFactory)
public FulfillmentGroup getFulfillmentGroup()
PromotableFulfillmentGroupgetFulfillmentGroup in interface PromotableFulfillmentGrouppublic void updateRuleVariables(Map<String,Object> ruleVars)
PromotableFulfillmentGroupupdateRuleVariables in interface PromotableFulfillmentGrouppublic List<PromotableOrderItem> getDiscountableOrderItems()
PromotableFulfillmentGroupgetDiscountableOrderItems in interface PromotableFulfillmentGroupprotected Money getSalePriceBeforeAdjustments()
protected Money calculateSaleAdjustmentPrice()
protected Money calculateRetailAdjustmentPrice()
public void chooseSaleOrRetailAdjustments()
chooseSaleOrRetailAdjustments in interface PromotableFulfillmentGroupprotected void finalizeAdjustments(boolean useSaleAdjustments)
protected void removeRetailOnlyAdjustments()
protected void removeZeroDollarAdjustments(boolean useSalePrice)
useSaleAdjustments - public Money getFinalizedPriceWithAdjustments()
PromotableFulfillmentGroupgetFinalizedPriceWithAdjustments in interface PromotableFulfillmentGrouppublic Money calculatePriceWithoutAdjustments()
PromotableFulfillmentGroupcalculatePriceWithoutAdjustments in interface PromotableFulfillmentGrouppublic void addCandidateFulfillmentGroupAdjustment(PromotableFulfillmentGroupAdjustment adjustment)
PromotableFulfillmentGroupaddCandidateFulfillmentGroupAdjustment in interface PromotableFulfillmentGrouppublic List<PromotableFulfillmentGroupAdjustment> getCandidateFulfillmentGroupAdjustments()
PromotableFulfillmentGroupgetCandidateFulfillmentGroupAdjustments in interface PromotableFulfillmentGrouppublic boolean canApplyOffer(PromotableCandidateFulfillmentGroupOffer fulfillmentGroupOffer)
PromotableFulfillmentGroupcanApplyOffer in interface PromotableFulfillmentGrouppublic Money calculatePriceWithAdjustments(boolean useSalePrice)
PromotableFulfillmentGroupcalculatePriceWithAdjustments in interface PromotableFulfillmentGrouppublic boolean isTotalitarianOfferApplied()
PromotableFulfillmentGroupisTotalitarianOfferApplied in interface PromotableFulfillmentGrouppublic void removeAllCandidateAdjustments()
PromotableFulfillmentGroupremoveAllCandidateAdjustments in interface PromotableFulfillmentGroupCopyright © 2014. All Rights Reserved.