Class DefaultCandidateOfferUtility
java.lang.Object
com.broadleafcommerce.promotion.offer.service.engine.candidate.DefaultCandidateOfferUtility
- All Implemented Interfaces:
CandidateOfferUtility
- Author:
- Chad Harchar (charchar)
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.broadleafcommerce.common.extension.TypeFactory
-
Constructor Summary
ConstructorDescriptionDefaultCandidateOfferUtility
(com.broadleafcommerce.common.extension.TypeFactory offerFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateCandidateFulfillmentGroupOffer
(EnhancedOrder order, Offer offer) Creates aCandidateFulfillmentGroupOffer
for the given order and offer.createCandidateFulfillmentItemOffer
(EnhancedOrder order, Offer offer) Creates aCandidateItemOffer
for the given order and offer.createCandidateOrderItemOffer
(EnhancedOrder order, Offer offer) Creates aCandidateItemOffer
for the given order and offer.createCandidateOrderOffer
(EnhancedOrder order, Offer offer) Creates aCandidateOrderOffer
for the given order and offer.protected OfferServiceProperties
protected void
populateCandidateOfferCurrency
(@NonNull BaseCandidateOffer candidateOffer, @NonNull EnhancedOrder order, @NonNull Offer offer) protected void
populateOfferRoundingProperties
(BaseCandidateOffer candidateOffer) Populates offer rounding properties for order and item typed offers.void
setOfferServiceProperties
(OfferServiceProperties offerServiceProperties)
-
Field Details
-
offerFactory
protected final com.broadleafcommerce.common.extension.TypeFactory offerFactory
-
-
Constructor Details
-
DefaultCandidateOfferUtility
public DefaultCandidateOfferUtility(com.broadleafcommerce.common.extension.TypeFactory offerFactory)
-
-
Method Details
-
createCandidateOrderOffer
Description copied from interface:CandidateOfferUtility
Creates aCandidateOrderOffer
for the given order and offer.- Specified by:
createCandidateOrderOffer
in interfaceCandidateOfferUtility
- Parameters:
order
- the order to be used when building theCandidateOrderOffer
offer
- the offer to be used when building theCandidateOrderOffer
- Returns:
- the created
CandidateOrderOffer
based on the provided order and offer
-
createCandidateOrderItemOffer
Description copied from interface:CandidateOfferUtility
Creates aCandidateItemOffer
for the given order and offer.- Specified by:
createCandidateOrderItemOffer
in interfaceCandidateOfferUtility
- Parameters:
order
- the order to be used when building theCandidateItemOffer
offer
- the offer to be used when building theCandidateItemOffer
- Returns:
- the created
CandidateItemOffer
based on the provided order and offer
-
createCandidateFulfillmentGroupOffer
public CandidateFulfillmentGroupOffer createCandidateFulfillmentGroupOffer(EnhancedOrder order, Offer offer) Description copied from interface:CandidateOfferUtility
Creates aCandidateFulfillmentGroupOffer
for the given order and offer.- Specified by:
createCandidateFulfillmentGroupOffer
in interfaceCandidateOfferUtility
- Parameters:
order
- the order to be used when building theCandidateFulfillmentGroupOffer
offer
- the offer to be used when building theCandidateFulfillmentGroupOffer
- Returns:
- the created
CandidateFulfillmentGroupOffer
based on the provided order and offer
-
createCandidateFulfillmentItemOffer
Description copied from interface:CandidateOfferUtility
Creates aCandidateItemOffer
for the given order and offer.- Specified by:
createCandidateFulfillmentItemOffer
in interfaceCandidateOfferUtility
- Parameters:
order
- the order to be used when building theCandidateItemOffer
offer
- the offer to be used when building theCandidateItemOffer
- Returns:
- the created
CandidateItemOffer
based on the provided order and offer
-
populateCandidateOfferCurrency
protected void populateCandidateOfferCurrency(@NonNull @NonNull BaseCandidateOffer candidateOffer, @NonNull @NonNull EnhancedOrder order, @NonNull @NonNull Offer offer) Populates theBaseCandidateOffer.getCurrency()
based on the givenEnhancedOrder
andOffer
.If
Offer.getCurrency()
is specified, then that currency is used. OtherwiseEnhancedOrder.getCurrency()
is used, as the offer should be a candidate regardless of currency.- Parameters:
candidateOffer
- theBaseCandidateOffer
to populate the currency fororder
- theEnhancedOrder
that has a currencyoffer
- theOffer
that may have a currency specification- See Also:
-
populateOfferRoundingProperties
Populates offer rounding properties for order and item typed offers.- Parameters:
candidateOffer
- theBaseCandidateOffer
to populate the offer rounding properties for
-
getOfferServiceProperties
-
setOfferServiceProperties
-