Class DefaultFulfillmentGroupOfferProcessor
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.service.engine.application.processor.DefaultFulfillmentGroupOfferProcessor
-
- All Implemented Interfaces:
FulfillmentGroupOfferProcessor
public class DefaultFulfillmentGroupOfferProcessor extends Object implements FulfillmentGroupOfferProcessor
- Author:
- Chad Harchar (charchar), Brian Polster (bpolster)
-
-
Field Summary
Fields Modifier and Type Field Description protected OrderAndItemOfferHelperhelperprotected com.broadleafcommerce.common.extension.TypeFactoryofferFactoryprotected static intONE_HUNDREDprotected com.broadleafcommerce.rulesengine.expression.service.RuleEvaluationServiceruleEvaluationService
-
Constructor Summary
Constructors Constructor Description DefaultFulfillmentGroupOfferProcessor(com.broadleafcommerce.common.extension.TypeFactory offerFactory, com.broadleafcommerce.rulesengine.expression.service.RuleEvaluationService ruleEvaluationService, OrderAndItemOfferHelper helper)
-
Method Summary
-
-
-
Field Detail
-
ONE_HUNDRED
protected static final int ONE_HUNDRED
- See Also:
- Constant Field Values
-
offerFactory
protected final com.broadleafcommerce.common.extension.TypeFactory offerFactory
-
ruleEvaluationService
protected final com.broadleafcommerce.rulesengine.expression.service.RuleEvaluationService ruleEvaluationService
-
helper
protected final OrderAndItemOfferHelper helper
-
-
Constructor Detail
-
DefaultFulfillmentGroupOfferProcessor
public DefaultFulfillmentGroupOfferProcessor(com.broadleafcommerce.common.extension.TypeFactory offerFactory, com.broadleafcommerce.rulesengine.expression.service.RuleEvaluationService ruleEvaluationService, OrderAndItemOfferHelper helper)
-
-
Method Detail
-
findBestFulfillmentGroupOffersForPermutation
public void findBestFulfillmentGroupOffersForPermutation(OfferProcessingContext context, CombinedTypesOfferPermutation ctop)
- Specified by:
findBestFulfillmentGroupOffersForPermutationin interfaceFulfillmentGroupOfferProcessor
-
applyFulfillmentGroupAdjustments
public void applyFulfillmentGroupAdjustments(OfferProcessingContext context, Map<String,List<FulfillmentGroupAdjustment>> adjustmentsMap)
- Specified by:
applyFulfillmentGroupAdjustmentsin interfaceFulfillmentGroupOfferProcessor
-
computeOfferPermutationValue
protected FulfillmentGroupOfferPermutationResult computeOfferPermutationValue(OfferProcessingContext context, OffersPermutation<CandidateFulfillmentGroupOffer> offersPermutation, OrderTotals orderTotals)
-
couldOfferApplyToGroup
protected boolean couldOfferApplyToGroup(EnhancedFulfillmentGroup group, CandidateFulfillmentGroupOffer groupOffer)
-
addAdjustmentToFulfillmentGroup
protected void addAdjustmentToFulfillmentGroup(CandidateFulfillmentGroup fg, FulfillmentGroupAdjustment adjustment)
-
createFulfillmentGroupAdjustment
protected FulfillmentGroupAdjustment createFulfillmentGroupAdjustment(OfferProcessingContext context, CandidateFulfillmentGroupOffer fulfillmentGroupOffer, CandidateFulfillmentGroup fulfillmentGroup, javax.money.MonetaryAmount amount)
-
computeAdjustmentValue
protected Optional<javax.money.MonetaryAmount> computeAdjustmentValue(CandidateFulfillmentGroupOffer fgOffer, CandidateFulfillmentGroup currentGroup, OfferProcessingContext context)
Calculates the value of the adjustment .If this adjustment value is greater than the fulfillmentGroup total (e.g. would make the order go negative then the adjustment value is set to the value of the group).
-
clearStateBetweenPermutations
protected void clearStateBetweenPermutations(EnhancedOrder order, List<CandidateFulfillmentGroupOffer> candidateOffers)
-
calculatePotentialSavings
public void calculatePotentialSavings(@NonNull EnhancedOrder order, @NonNull List<CandidateFulfillmentGroupOffer> candidateOffers)
-
truncateCandidateGroups
protected void truncateCandidateGroups(CandidateFulfillmentGroupOffer offer)
-
incrementTotalSavingsPerCandidate
protected void incrementTotalSavingsPerCandidate(EnhancedOrder order, CandidateFulfillmentGroupOffer offer, List<CandidateFulfillmentGroup> groups)
-
updateFulfillmentGroupTotal
public void updateFulfillmentGroupTotal(EnhancedOrder order)
- Specified by:
updateFulfillmentGroupTotalin interfaceFulfillmentGroupOfferProcessor
-
sortAndFilter
public List<CandidateFulfillmentGroupOffer> sortAndFilter(List<CandidateFulfillmentGroupOffer> candidateFulfillmentGroupOffers)
-
getGetTotalSavings
@NotNull protected @NotNull Function<CandidateFulfillmentGroupOffer,javax.money.MonetaryAmount> getGetTotalSavings()
-
getOfferPriority
@NotNull protected @NotNull Function<CandidateFulfillmentGroupOffer,Long> getOfferPriority()
-
-