Class DefaultTmaAbstractOrderEntryPriceBuilder
java.lang.Object
de.hybris.platform.b2ctelcoservices.pricing.strategy.builder.orderentry.DefaultTmaAbstractOrderEntryPriceBuilder
- All Implemented Interfaces:
TmaAbstractOrderEntryPriceBuilder
- Direct Known Subclasses:
TmaAbstractOrderOneTimeChargePriceBuilder,TmaAbstractOrderPriceValueBuilder,TmaAbstractOrderProductOfferingPriceBuilder,TmaAbstractOrderRecurringChargePriceBuilder,TmaAbstractOrderUsageChargePriceBuilder,TmaAbstractOrderUsageChargesPriceBuilder
public abstract class DefaultTmaAbstractOrderEntryPriceBuilder
extends Object
implements TmaAbstractOrderEntryPriceBuilder
Abstract builder for defining a template used to create a list
of
TmaAbstractOrderPriceModel to be set on the order entry- Since:
- 1907
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildPrices(PriceRowModel price, AbstractOrderEntryModel entry, List<de.hybris.platform.util.TaxValue> taxes) Builds a list ofTmaAbstractOrderPriceModelfor the given param.protected abstract List<TmaAbstractOrderPriceModel>createPrices(PriceRowModel price, AbstractOrderEntryModel entry, List<de.hybris.platform.util.TaxValue> taxes) Creates a list ofTmaAbstractOrderPriceModelbased on the param.protected de.hybris.platform.servicelayer.keygenerator.KeyGeneratorprotected de.hybris.platform.servicelayer.model.ModelServiceprotected TmaSubscriptionTermServiceprotected TmaRetrieveTaxRateStrategyprotected voidpopulateBillingTime(ChargeEntryModel chargeEntry, TmaAbstractOrderChargePriceModel priceCharge) Populates theTmaAbstractOrderChargePriceModelwith the billing time information.protected voidpopulatePriceValues(Double price, AbstractOrderEntryModel entry, List<de.hybris.platform.util.TaxValue> taxes, TmaAbstractOrderChargePriceModel priceCharge) Populates the price values for the order entry price charge.protected BillingTimeModelRetrieves theBillingTimeModelof the default configured subscription term.voidsetKeyGenerator(de.hybris.platform.servicelayer.keygenerator.KeyGenerator keyGenerator) voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) voidsetSubscriptionTermService(TmaSubscriptionTermService subscriptionTermService) voidsetTmaRetrieveTaxRateStrategy(TmaRetrieveTaxRateStrategy tmaRetrieveTaxRateStrategy) protected abstract booleanshouldCreatePrices(PriceRowModel price) Verify is the list of prices for order entry should be created
-
Constructor Details
-
DefaultTmaAbstractOrderEntryPriceBuilder
public DefaultTmaAbstractOrderEntryPriceBuilder()
-
-
Method Details
-
buildPrices
public List<TmaAbstractOrderPriceModel> buildPrices(PriceRowModel price, AbstractOrderEntryModel entry, List<de.hybris.platform.util.TaxValue> taxes) Description copied from interface:TmaAbstractOrderEntryPriceBuilderBuilds a list ofTmaAbstractOrderPriceModelfor the given param.- Specified by:
buildPricesin interfaceTmaAbstractOrderEntryPriceBuilder- Parameters:
price- the price used to create and populate the order entry prices listentry- the order entry for which the price is createdtaxes- the taxes to be applied on the order price- Returns:
- the list of order entry prices
-
shouldCreatePrices
Verify is the list of prices for order entry should be created- Parameters:
price- the priceCharge based on which the order entry priceCharge should be created- Returns:
- Returns true if the condition that verifies if prices should be created is fulfilled, otherwise false
-
createPrices
protected abstract List<TmaAbstractOrderPriceModel> createPrices(PriceRowModel price, AbstractOrderEntryModel entry, List<de.hybris.platform.util.TaxValue> taxes) Creates a list ofTmaAbstractOrderPriceModelbased on the param.- Parameters:
price- the priceCharge used to create and populate the prices listentry- the entry for which the priceCharge is computedtaxes- the taxes that should be applied on the order entry priceCharge- Returns:
- the created and populated priceCharge list
-
populatePriceValues
protected void populatePriceValues(Double price, AbstractOrderEntryModel entry, List<de.hybris.platform.util.TaxValue> taxes, TmaAbstractOrderChargePriceModel priceCharge) Populates the price values for the order entry price charge. If the price is net then the taxes are added to the duty free amount value, otherwise the taxes are subtracted from the duty free amount value- Parameters:
price- the price value to be set on the chargeentry- the entry for which the price charge is populatedtaxes- the taxes to be appliedpriceCharge- the charge for which the price is populated
-
populateBillingTime
protected void populateBillingTime(ChargeEntryModel chargeEntry, TmaAbstractOrderChargePriceModel priceCharge) Populates theTmaAbstractOrderChargePriceModelwith the billing time information.- Parameters:
chargeEntry- theChargeEntryModelfrom which the billing time is retrieved in case it existspriceCharge- the charge price for which the billing time will be populated
-
retrieveDefaultBillingTime
Retrieves theBillingTimeModelof the default configured subscription term.- Returns:
- the
BillingTimeModelof the default term if any configured.
-
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService() -
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) -
getKeyGenerator
protected de.hybris.platform.servicelayer.keygenerator.KeyGenerator getKeyGenerator() -
setKeyGenerator
public void setKeyGenerator(de.hybris.platform.servicelayer.keygenerator.KeyGenerator keyGenerator) -
getTmaRetrieveTaxRateStrategy
-
setTmaRetrieveTaxRateStrategy
-
getSubscriptionTermService
-
setSubscriptionTermService
-