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
-
Method Summary
Modifier and TypeMethodDescriptionprotected FulfillmentItemPriceResult
buildFulfillmentItemPriceResult
(FulfillmentPriceResultHolder resultHolder, EnhancedFulfillmentPricingItem item, javax.money.MonetaryAmount unitFlatRate) javax.money.MonetaryAmount
calcItemTotals
(@NonNull List<EnhancedFulfillmentPricingItem> items, @NonNull javax.money.CurrencyUnit currencyUnit) protected com.broadleafcommerce.fulfillment.common.domain.Weight
protected void
calculateFlatRateFulfillmentPricesFromAttributes
(FulfillmentPriceResultHolder resultHolder, FulfillmentCalculator calculator) protected void
calculateFulfillmentPrice
(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig) protected void
calculateFulfillmentPriceByItem
(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig) protected javax.money.MonetaryAmount
calculatePriceFromTier
(FulfillmentPriceTier tier, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculatorConfig) void
calculatePrices
(FulfillmentPriceResultHolder priceResultHolder) protected javax.money.MonetaryAmount
calculatePriceUsingPrice
(FulfillmentPriceResultHolder holder, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculator) protected javax.money.MonetaryAmount
calculatePriceUsingWeight
(com.broadleafcommerce.fulfillment.common.domain.Weight weight, javax.money.MonetaryAmount price, FulfillmentCalculatorConfig calculator) protected com.broadleafcommerce.fulfillment.common.domain.Weight
calcWeightForItems
(List<EnhancedFulfillmentPricingItem> items, String weightUnit) protected com.broadleafcommerce.fulfillment.common.domain.Weight
calcWeightForPricingGroup
(EnhancedFulfillmentPricingGroup group, String weightUnit) protected javax.money.MonetaryAmount
getPriceToUseForCalculations
(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig config) protected List<FulfillmentPriceTier>
protected com.broadleafcommerce.common.extension.TypeFactory
protected WeightCalculationHelper
protected com.broadleafcommerce.fulfillment.common.domain.Weight
getWeightToUse
(FulfillmentPriceResultHolder holder, FulfillmentCalculatorConfig calculatorConfig, CalculationMethod method) protected boolean
protected void
priceOtherCalculatorTypes
(FulfillmentPriceResultHolder resultHolder, FulfillmentCalculator flatRateCalculator) void
setTypeFactory
(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Constructor Details
-
DefaultFulfillmentCalculationService
-
-
Method Details
-
calculatePrices
- Specified by:
calculatePrices
in interfaceFulfillmentCalculationService
-
calcItemTotals
public javax.money.MonetaryAmount calcItemTotals(@NonNull @NonNull List<EnhancedFulfillmentPricingItem> items, @NonNull @NonNull javax.money.CurrencyUnit currencyUnit) - Specified by:
calcItemTotals
in 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)
-