public class DefaultPromotionResultService extends AbstractPromotionsService implements PromotionResultService
AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultPromotionResultService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(PromotionResultModel promotionResult)
Apply all of the actions that this promotion generated to the order.
|
long |
getConsumedCount(PromotionResultModel promotionResult,
boolean includeCouldFirePromotions)
Get the total number of items consumed by this promotion.
|
boolean |
getCouldFire(PromotionResultModel promotionResult)
Is this a potential result.
|
java.util.Optional<java.util.Set<java.lang.String>> |
getCouponCodesFromPromotion(PromotionResultModel promotionResult)
Return give way coupon code for promotion.
|
java.lang.String |
getDescription(PromotionResultModel promotionResult)
Get the description of this promotion result.
|
java.lang.String |
getDescription(PromotionResultModel promotionResult,
java.util.Locale locale)
Get the description of this promotion result.
|
boolean |
getFired(PromotionResultModel promotionResult)
Returns true if the promotion fired and has produced a result.
|
java.util.List<PromotionResultModel> |
getFiredOrderPromotions(PromotionOrderResults promoResult,
AbstractPromotionModel promotion)
Return a list of results for promotions that fired and did not consume products.
|
java.util.List<PromotionResultModel> |
getFiredProductPromotions(PromotionOrderResults promoResult,
AbstractPromotionModel promotion)
Return a list of results for promotions that fired and consumed products.
|
java.util.List<PromotionResultModel> |
getPotentialOrderPromotions(PromotionOrderResults promoResult,
AbstractPromotionModel promotion)
Return a list of results for potential promotions that fired and did not consume products and have been applied.
|
java.util.List<PromotionResultModel> |
getPotentialProductPromotions(PromotionOrderResults promoResult,
AbstractPromotionModel promotion)
Return a list of results for potential promotions that fired and consumed products and have been applied.
|
double |
getTotalDiscount(PromotionResultModel promotionResult)
Get the total value of all discounts in this result.
|
boolean |
isApplied(PromotionResultModel promotionResult)
Returns true if the promotion fired and all of its actions have been applied to the order.
|
boolean |
isAppliedToOrder(PromotionResultModel promotionResult)
Returns true if the promotion fired and all of its actions have been applied to the order.
|
boolean |
undo(PromotionResultModel promotionResult)
Undo all of the changes that this promotion made to the order.
|
getCart, getOrder, getOrder, getProduct, getPromotion, getPromotion, getPromotion, getPromotionGroup, getResult, getSessionContext, refreshModifiedModelsAftergetModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplacepublic boolean apply(PromotionResultModel promotionResult)
PromotionResultServiceapply in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelpublic long getConsumedCount(PromotionResultModel promotionResult, boolean includeCouldFirePromotions)
PromotionResultServicegetConsumedCount in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelincludeCouldFirePromotions - include could fire promotionspublic boolean getCouldFire(PromotionResultModel promotionResult)
PromotionResultServicegetCouldFire in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelpublic java.lang.String getDescription(PromotionResultModel promotionResult)
PromotionResultServicegetDescription in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelPromotionResultService.getDescription(PromotionResultModel, java.util.Locale)public java.lang.String getDescription(PromotionResultModel promotionResult, java.util.Locale locale)
PromotionResultServiceLocale specified is used to format any numbers, dates or currencies for display to the user. It is
important that this locale best represents the formatting options appropriate for display to the user. The default
currency for the locale is ignored. The currency is always explicitly taken from the
GeneratedAbstractOrder.getCurrency(). The currency is then formatted appropriately in
the locale specified. For example, this does mean that values in the EURO currency will be formatted differently
depending on the locale specified as each locale can specify currency specific formatting.
The currency formatting is part of the Java VM configuration to support multiple locales. If the formatting is
incorrect check your VM configuration for the locale and currency combination.getDescription in interface PromotionResultServicepromotionResult - - instance of PromotionResultModellocale - The locale to use to format the messages. This locale must support currency formatting, i.e. this should
be a region specific local. e.g de_DE, en_US, en_GBpublic boolean getFired(PromotionResultModel promotionResult)
PromotionResultServicegetFired in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelpublic double getTotalDiscount(PromotionResultModel promotionResult)
PromotionResultServicegetTotalDiscount in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelpublic boolean isApplied(PromotionResultModel promotionResult)
PromotionResultServiceisApplied in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelpublic boolean isAppliedToOrder(PromotionResultModel promotionResult)
PromotionResultServiceisAppliedToOrder in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelpublic boolean undo(PromotionResultModel promotionResult)
PromotionResultServiceundo in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelpublic java.util.List<PromotionResultModel> getPotentialProductPromotions(PromotionOrderResults promoResult, AbstractPromotionModel promotion)
PromotionResultServicegetPotentialProductPromotions in interface PromotionResultServicepromoResult - - instance of PromotionOrderResultspromotion - - instance of AbstractPromotionModelpublic java.util.List<PromotionResultModel> getPotentialOrderPromotions(PromotionOrderResults promoResult, AbstractPromotionModel promotion)
PromotionResultServicegetPotentialOrderPromotions in interface PromotionResultServicepromoResult - - instance of PromotionOrderResultspromotion - - instance of AbstractPromotionModelpublic java.util.List<PromotionResultModel> getFiredProductPromotions(PromotionOrderResults promoResult, AbstractPromotionModel promotion)
PromotionResultServicegetFiredProductPromotions in interface PromotionResultServicepromoResult - - instance of PromotionOrderResultspromotion - - instance of AbstractPromotionModelpublic java.util.List<PromotionResultModel> getFiredOrderPromotions(PromotionOrderResults promoResult, AbstractPromotionModel promotion)
PromotionResultServicegetFiredOrderPromotions in interface PromotionResultServicepromoResult - - instance of PromotionOrderResultspromotion - - instance of AbstractPromotionModelpublic java.util.Optional<java.util.Set<java.lang.String>> getCouponCodesFromPromotion(PromotionResultModel promotionResult)
PromotionResultServicegetCouponCodesFromPromotion in interface PromotionResultServicepromotionResult - - instance of PromotionResultModelCopyright © 2018 SAP SE. All Rights Reserved.