Class DefaultTmaCommercePriceService
- java.lang.Object
-
- de.hybris.platform.commerceservices.price.impl.DefaultCommercePriceService
-
- de.hybris.platform.subscriptionservices.price.impl.DefaultSubscriptionCommercePriceService
-
- de.hybris.platform.b2ctelcoservices.pricing.services.impl.DefaultTmaCommercePriceService
-
- All Implemented Interfaces:
TmaCommercePriceService,de.hybris.platform.commerceservices.price.CommercePriceService,de.hybris.platform.subscriptionservices.price.SubscriptionCommercePriceService
public class DefaultTmaCommercePriceService extends de.hybris.platform.subscriptionservices.price.impl.DefaultSubscriptionCommercePriceService implements TmaCommercePriceService
Default implementation of theTmaCommercePriceService.- Since:
- 6.7
-
-
Constructor Summary
Constructors Constructor Description DefaultTmaCommercePriceService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected TmaPriceContextcreatePriceContext(AbstractOrderEntryModel entry)Deprecated.since 2007.java.util.Set<PriceRowModel>filterPricesbyPriceContext(TmaPriceContext priceContext)Retrieves all instances ofPriceRowModels andSubscriptionPricePlanModels for the {@param priceContextData} and {@param productModel} provided.PriceRowModelgetBestApplicablePrice(TmaPriceContext priceContext)Retrieves the bestPriceRowModelapplicable for the given context, be it either the standalone price of the offering or a price override.PriceRowModelgetBestApplicablePrice(AbstractOrderEntryModel orderEntryModel)Retrieves the bestPriceRowModelapplicable for the given {@param orderEntryModel}, considering the context in which the offering has been bought (either standalone or as part of a bundle).PriceRowModelgetMinimumPrice(TmaPriceContext priceContext)Retrieves the minimumPriceRowModelwhich may be applicable for the given context, be it either the standalone price of the offering or a price override.PriceRowModelgetMinimumPrice(AbstractOrderEntryModel orderEntryModel)Retrieves the minimumPriceRowModelwhich may be applicable for the given {@param orderEntryModel}, considering the context in which the offering has been bought (either standalone or as part of a bundle).protected DefaultTmaMinimumPriceSelectorgetMinimumPriceSelector()Deprecated.since 2007java.lang.DoublegetMinimumPriceValue(TmaPriceContext priceContext)Retrieves the value of the minimum price which may be applicable for the given context, be it either the standalone price of the offering or a price override.protected java.util.Set<SubscriptionPricePlanModel>getPriceOverrides(TmaPriceContext priceContext)Retrieves all overrideSubscriptionPricePlanModels for theTmaPriceContextprovided.protected PriceRowModelComparatorgetPriceRowComparator()Deprecated.since 2007protected ProductModelgetProduct(TmaPriceContext priceContext)Returns the product for which to calculate the price.protected java.util.Set<TmaProductOfferingModel>getRequiredProductsFromCart(AbstractOrderEntryModel entry, ProductModel affectedProduct)Deprecated.since 2007.PriceRowModelgetStandAlonePriceForSpo(ProductModel productOfferingModel, TmaPriceContext priceContext)Deprecated, for removal: This API element is subject to removal in a future version.since 1903protected java.util.Set<PriceRowModel>getStandalonePrices(TmaPriceContext priceContext)protected TmaSubscriptionPricePlanDaogetSubscriptionPricePlanDao()SubscriptionPricePlanModelgetSubscriptionPricePlanForProduct(ProductModel subscriptionProduct)Deprecated, for removal: This API element is subject to removal in a future version.since 1903.protected TmaPriceContextServicegetTmaPriceContextService()protected TmaPriceSelectorgetTmaPriceSelector()voidsetMinimumPriceSelector(DefaultTmaMinimumPriceSelector minimumPriceSelector)Deprecated.since 2007voidsetPriceRowComparator(PriceRowModelComparator priceRowComparator)Deprecated.since 2007voidsetSubscriptionPricePlanDao(TmaSubscriptionPricePlanDao subscriptionPricePlanDao)voidsetTmaPriceContextService(TmaPriceContextService tmaPriceContextService)voidsetTmaPriceSelector(TmaPriceSelector tmaPriceSelector)-
Methods inherited from class de.hybris.platform.subscriptionservices.price.impl.DefaultSubscriptionCommercePriceService
getCurrentPriceFactory, getFirstRecurringPriceFromPlan, getLastRecurringPriceFromPlan, getModelService, getOneTimeChargeEntryPlan, getSubscriptionPricePlanForEntry, setModelService
-
Methods inherited from class de.hybris.platform.commerceservices.price.impl.DefaultCommercePriceService
fillAllVariantPrices, getAllVariantPrices, getFromPriceForProduct, getLowestVariantPrice, getPriceService, getWebPriceForProduct, setPriceService
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
getMinimumPrice
public PriceRowModel getMinimumPrice(TmaPriceContext priceContext)
Description copied from interface:TmaCommercePriceServiceRetrieves the minimumPriceRowModelwhich may be applicable for the given context, be it either the standalone price of the offering or a price override.- Specified by:
getMinimumPricein interfaceTmaCommercePriceService- Parameters:
priceContext- priceContext to retrieve the configuration from- Returns:
- minimum
PriceRowModelapplicable for the given context
-
getBestApplicablePrice
public PriceRowModel getBestApplicablePrice(TmaPriceContext priceContext)
Description copied from interface:TmaCommercePriceServiceRetrieves the bestPriceRowModelapplicable for the given context, be it either the standalone price of the offering or a price override.- Specified by:
getBestApplicablePricein interfaceTmaCommercePriceService- Parameters:
priceContext- priceContext to retrieve the configuration from- Returns:
- best
PriceRowModelapplicable for the given context
-
getMinimumPriceValue
public java.lang.Double getMinimumPriceValue(TmaPriceContext priceContext)
Description copied from interface:TmaCommercePriceServiceRetrieves the value of the minimum price which may be applicable for the given context, be it either the standalone price of the offering or a price override. The priorities for retrieving the value are the following:- if the price has recurring charges, return the first recurring charge
- if the price has a value, return the value
- if the price has one time charges, return the first one time charge
- Specified by:
getMinimumPriceValuein interfaceTmaCommercePriceService- Parameters:
priceContext- price context to retrieve the price value from- Returns:
- price value considering the priorities mentioned above
-
getMinimumPrice
public PriceRowModel getMinimumPrice(AbstractOrderEntryModel orderEntryModel)
Description copied from interface:TmaCommercePriceServiceRetrieves the minimumPriceRowModelwhich may be applicable for the given {@param orderEntryModel}, considering the context in which the offering has been bought (either standalone or as part of a bundle).- Specified by:
getMinimumPricein interfaceTmaCommercePriceService- Parameters:
orderEntryModel- the order entry for which the price will be computed- Returns:
- minimum
PriceRowModelapplicable for the given order entry
-
getBestApplicablePrice
public PriceRowModel getBestApplicablePrice(AbstractOrderEntryModel orderEntryModel)
Description copied from interface:TmaCommercePriceServiceRetrieves the bestPriceRowModelapplicable for the given {@param orderEntryModel}, considering the context in which the offering has been bought (either standalone or as part of a bundle).- Specified by:
getBestApplicablePricein interfaceTmaCommercePriceService- Parameters:
orderEntryModel- the order entry for which the price will be computed- Returns:
- best
PriceRowModelapplicable for the given order entry
-
filterPricesbyPriceContext
public java.util.Set<PriceRowModel> filterPricesbyPriceContext(TmaPriceContext priceContext)
Description copied from interface:TmaCommercePriceServiceRetrieves all instances ofPriceRowModels andSubscriptionPricePlanModels for the {@param priceContextData} and {@param productModel} provided.- Specified by:
filterPricesbyPriceContextin interfaceTmaCommercePriceService- Parameters:
priceContext- priceContext to retrieve the configuration from- Returns:
PriceRowModels retrieved from the configuration provided by the {@param priceContextData}
-
createPriceContext
@Deprecated(since="2007") protected TmaPriceContext createPriceContext(AbstractOrderEntryModel entry)
Deprecated.since 2007. Use insteadTmaPriceContextService.createPriceContext(AbstractOrderEntryModel)Creates aTmaPriceContextbased on the attributes values set on the order entry. If a bundle product offering exists on the order entry then a bundle product offering context is created, otherwise a simple price context is created- Parameters:
entry- order entry for which the context is created- Returns:
- newly created
TmaPriceContextwith the configured parameters
-
getRequiredProductsFromCart
@Deprecated(since="2007") protected java.util.Set<TmaProductOfferingModel> getRequiredProductsFromCart(AbstractOrderEntryModel entry, ProductModel affectedProduct)
Deprecated.since 2007.Retrieves all required product offerings found on the current order entry, in order for a price to apply .- Parameters:
entry- order entry to retrieve the product for which the price should be configured, asTmaPriceContext.product.affectedProduct- product for which the price will be modified- Returns:
- required products necessary for the new price to apply to the {@param affectedProduct}
-
getPriceOverrides
protected java.util.Set<SubscriptionPricePlanModel> getPriceOverrides(TmaPriceContext priceContext)
Retrieves all overrideSubscriptionPricePlanModels for theTmaPriceContextprovided.- Parameters:
priceContext- priceContext to retrieve the configuration from- Returns:
- all
SubscriptionPricePlanModels having the configuration as on the {@param priceContext} provided or empty set in case no price overrides are found.
-
getProduct
protected ProductModel getProduct(TmaPriceContext priceContext)
Returns the product for which to calculate the price. If theTmaPriceContext.productis a BPO, the price will be computed for theTmaPriceContext.affectedProduct.- Parameters:
priceContext- price context to retrieve the product from- Returns:
- product for which the price should be computed
-
getStandalonePrices
protected java.util.Set<PriceRowModel> getStandalonePrices(TmaPriceContext priceContext)
-
getStandAlonePriceForSpo
@Deprecated(since="1903", forRemoval=true) public PriceRowModel getStandAlonePriceForSpo(ProductModel productOfferingModel, TmaPriceContext priceContext)Deprecated, for removal: This API element is subject to removal in a future version.since 1903Retrieves the applicable price of a simple {@param productOfferingModel} considering the configuration provided in the {@param priceContext} given or null if no such price is found.- Specified by:
getStandAlonePriceForSpoin interfaceTmaCommercePriceService- Parameters:
productOfferingModel- product offering for which to retrieve the pricepriceContext- price context for which the configuration needs to be valid- Returns:
- price of the provided {@param productOffering} and {@param priceContext}
-
getSubscriptionPricePlanForProduct
@Nullable @Deprecated(since="1903", forRemoval=true) public SubscriptionPricePlanModel getSubscriptionPricePlanForProduct(@Nonnull ProductModel subscriptionProduct)Deprecated, for removal: This API element is subject to removal in a future version.since 1903. Use insteadTmaCommercePriceService.getMinimumPrice(TmaPriceContext)ThrowsUnsupportedOperationExceptiondue to missingTmaPriceContextrequired for filtering prices.- Specified by:
getSubscriptionPricePlanForProductin interfacede.hybris.platform.subscriptionservices.price.SubscriptionCommercePriceService- Overrides:
getSubscriptionPricePlanForProductin classde.hybris.platform.subscriptionservices.price.impl.DefaultSubscriptionCommercePriceService- Parameters:
subscriptionProduct- theSubscriptionProductModel
-
getSubscriptionPricePlanDao
protected TmaSubscriptionPricePlanDao getSubscriptionPricePlanDao()
-
setSubscriptionPricePlanDao
public void setSubscriptionPricePlanDao(TmaSubscriptionPricePlanDao subscriptionPricePlanDao)
-
getPriceRowComparator
@Deprecated(since="2007") protected PriceRowModelComparator getPriceRowComparator()
Deprecated.since 2007
-
setPriceRowComparator
@Deprecated(since="2007") public void setPriceRowComparator(PriceRowModelComparator priceRowComparator)
Deprecated.since 2007
-
getTmaPriceContextService
protected TmaPriceContextService getTmaPriceContextService()
-
setTmaPriceContextService
public void setTmaPriceContextService(TmaPriceContextService tmaPriceContextService)
-
getTmaPriceSelector
protected TmaPriceSelector getTmaPriceSelector()
-
setTmaPriceSelector
public void setTmaPriceSelector(TmaPriceSelector tmaPriceSelector)
-
setMinimumPriceSelector
@Deprecated(since="2007") public void setMinimumPriceSelector(DefaultTmaMinimumPriceSelector minimumPriceSelector)
Deprecated.since 2007
-
getMinimumPriceSelector
@Deprecated(since="2007") protected DefaultTmaMinimumPriceSelector getMinimumPriceSelector()
Deprecated.since 2007
-
-