Class CandidateFulfillmentGroupOffer
java.lang.Object
com.broadleafcommerce.promotion.offer.service.dto.BaseCandidateOffer
com.broadleafcommerce.promotion.offer.service.dto.CandidateFulfillmentGroupOffer
- All Implemented Interfaces:
Serializable
DTO containing information necessary for determining if an
Offer
that can apply to one or
more EnhancedFulfillmentGroup
s is part of the best permutation of all offers applicable
to that group.- Author:
- Nathan Moore (nathanmoore).
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected javax.money.MonetaryAmount
computeDiscountedAmount
(CandidateFulfillmentGroup candidateFulfillmentGroup) Computes the potential savings that can be applied for aCandidateFulfillmentGroup
.boolean
protected javax.money.MonetaryAmount
getBaseTotal
(CandidateFulfillmentGroup candidateFulfillmentGroup) Get the total cost of the provided fulfillment group before any adjustments are made.TheCandidateFulfillmentGroups
that can be targeted byBaseCandidateOffer.offer
, each one representing a decoratedEnhancedFulfillmentGroup
with savings information.protected javax.money.MonetaryAmount
getDiscountedAmount
(CandidateFulfillmentGroup candidateFulfillmentGroup) The priority of theBaseCandidateOffer.offer
.javax.money.MonetaryAmount
Total savings across allcandidateFulfillmentGroups
for theBaseCandidateOffer.offer
.int
hashCode()
void
incrementTotalSavings
(javax.money.MonetaryAmount incrementAmount) void
Price each of theCandidateFulfillmentGroups
according to theBaseCandidateOffer.offer
.void
setCandidateFulfillmentGroups
(List<CandidateFulfillmentGroup> candidateFulfillmentGroups) TheCandidateFulfillmentGroups
that can be targeted byBaseCandidateOffer.offer
, each one representing a decoratedEnhancedFulfillmentGroup
with savings information.void
setTotalSavings
(javax.money.MonetaryAmount totalSavings) Total savings across allcandidateFulfillmentGroups
for theBaseCandidateOffer.offer
.void
Sort theCandidateFulfillmentGroups
according to best discount.toString()
Methods inherited from class com.broadleafcommerce.promotion.offer.service.dto.BaseCandidateOffer
calculateOverrideSegment, excludeDiscountedItemsFromTotal, getAllValidSegments, getCombinableOverrides, getCurrency, getDiscountAmount, getDiscountMethodType, getDiscountTargetType, getExcludedItemIds, getNonCombinableOverrides, getOffer, getOfferCodesMap, getOfferCombinabilityCriteriaKey, getOfferDtosMap, getOfferId, getOverrideOfferId, getPotentialSavings, getRoundingMode, getSegment, getStackableOverrides, initializeExcludedCartItemIds, isApplicableToDependentItems, isNotExcludedFromOffer, isRoundOfferValues, normalizeSegment, populateCombinabilityStructures, populateCombinabilityStructuresUsedBySameTargetType, populatePropertiesFromCodeData, segmentIsValid, setCombinableOverrides, setCurrency, setExcludedItemIds, setNonCombinableOverrides, setOffer, setOfferCodesMap, setOfferCombinabilityCriteriaKey, setOfferDtosMap, setOverrideOfferId, setPotentialSavings, setRoundingMode, setRoundOfferValues, setSegment, setStackableOverrides, updateAmountCurrency, updateMonetaryAmountCurrencyIfNeeded, updateOfferCombinabilityCriteria, validateCodesMatchOfferSegments
-
Field Details
-
ONE_HUNDRED
-
-
Constructor Details
-
CandidateFulfillmentGroupOffer
public CandidateFulfillmentGroupOffer()
-
-
Method Details
-
incrementTotalSavings
public void incrementTotalSavings(javax.money.MonetaryAmount incrementAmount) -
getPriority
The priority of theBaseCandidateOffer.offer
.- Returns:
- The priority of the
BaseCandidateOffer.offer
.
-
priceGroups
public void priceGroups()Price each of theCandidateFulfillmentGroups
according to theBaseCandidateOffer.offer
. -
sortGroups
public void sortGroups()Sort theCandidateFulfillmentGroups
according to best discount. -
getBaseTotal
protected javax.money.MonetaryAmount getBaseTotal(CandidateFulfillmentGroup candidateFulfillmentGroup) Get the total cost of the provided fulfillment group before any adjustments are made.- Parameters:
candidateFulfillmentGroup
- the fulfillment group to find the total cost for- Returns:
- the total cost of the fulfillment before adjustments
-
getDiscountedAmount
protected javax.money.MonetaryAmount getDiscountedAmount(CandidateFulfillmentGroup candidateFulfillmentGroup) -
computeDiscountedAmount
protected javax.money.MonetaryAmount computeDiscountedAmount(CandidateFulfillmentGroup candidateFulfillmentGroup) Computes the potential savings that can be applied for aCandidateFulfillmentGroup
. The calculated amount is not finalized discount value, this only tells the group how much it can be discounted. SeeCandidateFulfillmentGroup.discountedAmount
- Parameters:
candidateFulfillmentGroup
- the fulfillment group to calculate potential discounts for- Returns:
- The monetary value of the total potential discounts
-
getCandidateFulfillmentGroups
TheCandidateFulfillmentGroups
that can be targeted byBaseCandidateOffer.offer
, each one representing a decoratedEnhancedFulfillmentGroup
with savings information.- Returns:
- The
EnhancedFulfillmentGroup
(s) that can be targeted byBaseCandidateOffer.offer
.
-
getTotalSavings
public javax.money.MonetaryAmount getTotalSavings()Total savings across allcandidateFulfillmentGroups
for theBaseCandidateOffer.offer
.- Returns:
- Total savings across all
candidateFulfillmentGroups
for theBaseCandidateOffer.offer
.
-
setCandidateFulfillmentGroups
public void setCandidateFulfillmentGroups(List<CandidateFulfillmentGroup> candidateFulfillmentGroups) TheCandidateFulfillmentGroups
that can be targeted byBaseCandidateOffer.offer
, each one representing a decoratedEnhancedFulfillmentGroup
with savings information.- Parameters:
candidateFulfillmentGroups
- TheEnhancedFulfillmentGroup
(s) that can be targeted byBaseCandidateOffer.offer
.
-
setTotalSavings
public void setTotalSavings(javax.money.MonetaryAmount totalSavings) Total savings across allcandidateFulfillmentGroups
for theBaseCandidateOffer.offer
.- Parameters:
totalSavings
- Total savings across allcandidateFulfillmentGroups
for theBaseCandidateOffer.offer
.
-
equals
- Overrides:
equals
in classBaseCandidateOffer
-
canEqual
- Overrides:
canEqual
in classBaseCandidateOffer
-
hashCode
public int hashCode()- Overrides:
hashCode
in classBaseCandidateOffer
-
toString
- Overrides:
toString
in classBaseCandidateOffer
-