Class DefaultFulfillmentCalculationService
java.lang.Object
com.broadleafcommerce.fulfillment.service.DefaultFulfillmentCalculationService
- All Implemented Interfaces:
FulfillmentCalculationService
public class DefaultFulfillmentCalculationService
extends Object
implements FulfillmentCalculationService
Utility service to perform calculation operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FulfillmentItemPriceResultbuildFulfillmentItemPriceResult(FulfillmentPriceResultHolder resultHolder, EnhancedFulfillmentPricingItem item, javax.money.MonetaryAmount unitFlatRate) javax.money.MonetaryAmountcalcItemTotals(@NonNull List<EnhancedFulfillmentPricingItem> items, @NonNull javax.money.CurrencyUnit currencyUnit) protected com.broadleafcommerce.fulfillment.common.domain.Weightprotected voidcalculateFlatRateFulfillmentPricesFromAttributes(FulfillmentPriceResultHolder resultHolder, FulfillmentCalculator calculator) protected voidcalculateFulfillmentPrice(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig) protected voidcalculateFulfillmentPriceByItem(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig) protected javax.money.MonetaryAmountcalculatePriceFromTier(FulfillmentPriceTier tier, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculatorConfig) voidcalculatePrices(FulfillmentPriceResultHolder priceResultHolder) protected javax.money.MonetaryAmountcalculatePriceUsingPrice(FulfillmentPriceResultHolder holder, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculator) protected javax.money.MonetaryAmountcalculatePriceUsingWeight(com.broadleafcommerce.fulfillment.common.domain.Weight weight, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculator) protected com.broadleafcommerce.fulfillment.common.domain.WeightcalcWeightForItems(List<EnhancedFulfillmentPricingItem> items, String weightUnit) protected com.broadleafcommerce.fulfillment.common.domain.WeightcalcWeightForPricingGroup(EnhancedFulfillmentPricingGroup group, String weightUnit) protected javax.money.MonetaryAmountgetPriceToUseForCalculations(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig config) protected List<FulfillmentPriceTier>protected com.broadleafcommerce.common.extension.TypeFactoryprotected WeightCalculationHelperprotected com.broadleafcommerce.fulfillment.common.domain.WeightgetWeightToUse(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig, CalculationMethod method) protected booleanprotected voidpriceOtherCalculatorTypes(FulfillmentPriceResultHolder resultHolder, FulfillmentCalculator flatRateCalculator) voidsetTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Constructor Details
-
DefaultFulfillmentCalculationService
-
-
Method Details
-
calculatePrices
- Specified by:
calculatePricesin interfaceFulfillmentCalculationService
-
calcItemTotals
public javax.money.MonetaryAmount calcItemTotals(@NonNull @NonNull List<EnhancedFulfillmentPricingItem> items, @NonNull @NonNull javax.money.CurrencyUnit currencyUnit) - Specified by:
calcItemTotalsin interfaceFulfillmentCalculationService
-
calculateFlatRateFulfillmentPricesFromAttributes
protected void calculateFlatRateFulfillmentPricesFromAttributes(FulfillmentPriceResultHolder resultHolder, FulfillmentCalculator calculator) -
buildFulfillmentItemPriceResult
protected FulfillmentItemPriceResult buildFulfillmentItemPriceResult(FulfillmentPriceResultHolder resultHolder, EnhancedFulfillmentPricingItem item, javax.money.MonetaryAmount unitFlatRate) -
priceOtherCalculatorTypes
protected void priceOtherCalculatorTypes(FulfillmentPriceResultHolder resultHolder, FulfillmentCalculator flatRateCalculator) -
calculateFulfillmentPrice
protected void calculateFulfillmentPrice(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig) -
getWeightToUse
protected com.broadleafcommerce.fulfillment.common.domain.Weight getWeightToUse(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig, CalculationMethod method) -
getPriceToUseForCalculations
protected javax.money.MonetaryAmount getPriceToUseForCalculations(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig config) -
calculatePriceUsingPrice
protected javax.money.MonetaryAmount calculatePriceUsingPrice(FulfillmentPriceResultHolder holder, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculator) -
calculatePriceUsingWeight
protected javax.money.MonetaryAmount calculatePriceUsingWeight(com.broadleafcommerce.fulfillment.common.domain.Weight weight, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculator) -
getSortedTiers
-
calculatePriceFromTier
protected javax.money.MonetaryAmount calculatePriceFromTier(FulfillmentPriceTier tier, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculatorConfig) -
isCalculatorValueRate
protected boolean isCalculatorValueRate(FulfillmentPriceTier tier, FulfillmentCalculatorConfig config) -
calculateFulfillmentPriceByItem
protected void calculateFulfillmentPriceByItem(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig) -
calcWeightForPricingGroup
protected com.broadleafcommerce.fulfillment.common.domain.Weight calcWeightForPricingGroup(EnhancedFulfillmentPricingGroup group, String weightUnit) -
calcWeightForItems
protected com.broadleafcommerce.fulfillment.common.domain.Weight calcWeightForItems(List<EnhancedFulfillmentPricingItem> items, String weightUnit) -
calcTotalWeightForItem
protected com.broadleafcommerce.fulfillment.common.domain.Weight calcTotalWeightForItem(EnhancedFulfillmentPricingItem eItem) -
getWeightCalculationHelper
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-