Class OfferProcesingUtility
java.lang.Object
com.broadleafcommerce.promotion.offer.service.engine.OfferProcesingUtility
Utility methods used by the offer processing engine extracted for ease of testing.
prepareOfferProcessingContext - creates the OfferProcessingContext and builds all permutations of
the offers to process.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddNodes(CompatiblePermutationNode parentNode, OfferProcessingContext context, List<Set<OfferCombinabilityCriteria>> offerTypeCriteria, LinkedHashSet<CompatiblePermutationNode> allNodesSet) protected voidbuildCombinedOfferTypePermutations(EnhancedOrder order, OfferProcessingContext context) Each offer type (e.g.protected com.broadleafcommerce.common.extension.TypeFactoryprotected OrderTotalsprepareOfferProcessingContext(EnhancedOrder order, CandidateOffers candidateOffers) voidsetTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Constructor Details
-
OfferProcesingUtility
public OfferProcesingUtility()
-
-
Method Details
-
prepareOfferProcessingContext
public OfferProcessingContext prepareOfferProcessingContext(EnhancedOrder order, CandidateOffers candidateOffers) -
buildCombinedOfferTypePermutations
protected void buildCombinedOfferTypePermutations(EnhancedOrder order, OfferProcessingContext context) Each offer type (e.g. item, order, etc.) has a set of permutations grouped by aOfferCombinabilityCriteriaKeyobject. This method builds a higher level set of permutations where each one represents a valid combination representing all of the offer types. Stated another way, at the end of this methods execution, theOfferProcessingContextwill have a collection ofCombinedTypesOfferPermutations, one of which is the best option for the passed in order. This method only builds the compatible combinations, it does not attempt to score or choose the best one.- Parameters:
order-context-
-
initializeOrderTotals
-
addNodes
protected void addNodes(CompatiblePermutationNode parentNode, OfferProcessingContext context, List<Set<OfferCombinabilityCriteria>> offerTypeCriteria, LinkedHashSet<CompatiblePermutationNode> allNodesSet) -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-