public class DefaultCsPromotionService extends AbstractBusinessService implements CsPromotionService
CsPromotionService interface. This service is auto-wired with the hybris
PromotionsService if the spring bean is defined. This implementation then uses reflection to expose the
functionality of the promotions service.AbstractService.SerializableDTO| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.Class |
ORDER_PROMOTION_MODEL_CLASS |
protected static java.lang.Class |
PROMOTION_ORDER_ENTRY_CONSUMED_MODEL_CLASS |
protected static java.lang.Class |
PROMOTION_PRODUCT_MODEL_CLASS |
protected static java.lang.Class |
PROMOTION_RESULT_MODEL_CLASS |
modelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCsPromotionService() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.lang.Class |
classForName(java.lang.String className) |
java.util.List<WrappedPromotionResultModel> |
getAppliedPromotionResults(AbstractOrderModel cart,
boolean includeOrderPromotions,
boolean includeProductPromotions)
Get the applied order level promotions for the order.
|
BaseSiteService |
getBaseSiteService() |
protected WrappedPromotionGroupModel |
getDefaultPromotionGroup() |
java.util.List<CartLineItem> |
getOrderCombinedPromotionsAndEntries(AbstractOrderModel cart)
Gets the list of order entries and promotion results for a order.
|
java.util.List<WrappedPromotionResultModel> |
getPotentialOrderPromotionResults(AbstractOrderModel cart)
Get the potential order level promotions for the order.
|
java.util.List<WrappedPromotionModel> |
getProductPromotions(ProductModel product,
boolean evaluateRestrictions,
java.util.Date currentTime)
Get the available product promotions for a specific product
|
protected java.util.List<CartLineItem> |
getPromotionResultConsumedEntries(java.util.List<WrappedPromotionResultModel> promotionResults) |
protected WrappedPromotionsService |
getPromotionsService() |
protected java.util.List<CartLineItem> |
getWrappedOrderEntriesAndPotentialPromotionResults(java.util.List<WrappedWrappedOrderEntry> wrappedOrderEntries) |
boolean |
isPromotionServiceAvailable()
Test if the promotions extension integration is available
|
protected boolean |
listContains(java.util.List<WrappedPromotionModel> list,
WrappedPromotionModel item) |
void |
setBaseSiteService(BaseSiteService baseSiteService) |
void |
setPromotionsService(java.lang.Object promotionsService) |
AbstractItemModelReflectionWrapper |
unwrapPromotionTypedObject(TypedObject item)
Helper method to unwrap a TypedObject that contains a model item that should be reflection wrapped.
|
java.util.List<TypedObject> |
wrapInTypedObjects(java.util.List<? extends AbstractItemModelReflectionWrapper> lines)
Helper method to convert promotion wrappers into TypedObject
|
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplaceprotected static final java.lang.Class PROMOTION_ORDER_ENTRY_CONSUMED_MODEL_CLASS
protected static final java.lang.Class PROMOTION_RESULT_MODEL_CLASS
protected static final java.lang.Class PROMOTION_PRODUCT_MODEL_CLASS
protected static final java.lang.Class ORDER_PROMOTION_MODEL_CLASS
public void setPromotionsService(java.lang.Object promotionsService)
public BaseSiteService getBaseSiteService()
public void setBaseSiteService(BaseSiteService baseSiteService)
protected WrappedPromotionsService getPromotionsService()
protected WrappedPromotionGroupModel getDefaultPromotionGroup()
public boolean isPromotionServiceAvailable()
CsPromotionServiceisPromotionServiceAvailable in interface CsPromotionServicepublic java.util.List<WrappedPromotionModel> getProductPromotions(ProductModel product, boolean evaluateRestrictions, java.util.Date currentTime)
CsPromotionServicegetProductPromotions in interface CsPromotionServiceproduct - The product to checkevaluateRestrictions - Flag to enable checking of promotion restrictions (set to true if you don't know)currentTime - The effective time to evaluate the promotions (can be null for current time)protected boolean listContains(java.util.List<WrappedPromotionModel> list, WrappedPromotionModel item)
public AbstractItemModelReflectionWrapper unwrapPromotionTypedObject(TypedObject item)
CsPromotionServiceunwrapPromotionTypedObject in interface CsPromotionServiceitem - The TypedObject to unwrappublic java.util.List<TypedObject> wrapInTypedObjects(java.util.List<? extends AbstractItemModelReflectionWrapper> lines)
CsPromotionServicewrapInTypedObjects in interface CsPromotionServicelines - The list of wrappers to convertprotected java.util.List<CartLineItem> getPromotionResultConsumedEntries(java.util.List<WrappedPromotionResultModel> promotionResults)
protected java.util.List<CartLineItem> getWrappedOrderEntriesAndPotentialPromotionResults(java.util.List<WrappedWrappedOrderEntry> wrappedOrderEntries)
public java.util.List<CartLineItem> getOrderCombinedPromotionsAndEntries(AbstractOrderModel cart)
CsPromotionServicegetOrderCombinedPromotionsAndEntries in interface CsPromotionServicecart - The orderpublic java.util.List<WrappedPromotionResultModel> getAppliedPromotionResults(AbstractOrderModel cart, boolean includeOrderPromotions, boolean includeProductPromotions)
CsPromotionServicegetAppliedPromotionResults in interface CsPromotionServicecart - The orderincludeOrderPromotions - Set to true to include order promotionsincludeProductPromotions - Set to true to include product promotionspublic java.util.List<WrappedPromotionResultModel> getPotentialOrderPromotionResults(AbstractOrderModel cart)
CsPromotionServicegetPotentialOrderPromotionResults in interface CsPromotionServicecart - The orderprotected static java.lang.Class classForName(java.lang.String className)
Copyright © 2018 SAP SE. All Rights Reserved.