Class DefaultFulfillmentOptionService
java.lang.Object
com.broadleafcommerce.fulfillment.service.DefaultFulfillmentOptionService
- All Implemented Interfaces:
FulfillmentOptionService
Component to call each
FulfillmentCalculator and aggregate and de-duplicate results.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFulfillmentOptionService(FulfillmentPricingConfigAccessor<? extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig> fulfillmentPricingConfigService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, FulfillmentCalculatorService calculatorService) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.order.common.domain.PricedFulfillmentOptionbuildGroupOptionForResponse(EnhancedFulfillmentPricingGroup pricingGroup, String serviceLevel, GroupServiceLevelPriceResult result) protected com.broadleafcommerce.order.common.domain.PricedFulfillmentOptionbuildItemOptionForResponse(EnhancedFulfillmentPricingItem item, String serviceLevel, FulfillmentItemPriceResult result) protected com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponsebuildOptions(FulfillmentPricingContext fpContext, List<FulfillmentCalculator> calculators) Given a list of fulfillment calculators sorted in the order they should be run, build a FulfillmentResponse.protected StringdetermineFulfillmentType(EnhancedFulfillmentPricingGroup pricingGroup, FulfillmentCalculator calculator) protected StringdetermineFulfillmentType(EnhancedFulfillmentPricingGroup pricingGroup, GroupServiceLevelPriceResult result) protected Stringcom.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponsefindFulfillmentOptions(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Given theFulfillmentOptionRequest, this method provides a map ofPriced Fulfillment Optionsfor the request.protected FulfillmentCalculatorServiceprotected FulfillmentPricingConfigAccessor<? extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig>protected com.broadleafcommerce.common.extension.TypeFactoryprotected FulfillmentPricingContextinitializeFulfillmentPricingContext(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidpopulateGroupResponses(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse response, FulfillmentPricingContext context) protected voidpopulateItemResponses(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse response, FulfillmentPricingContext context) protected List<com.broadleafcommerce.order.common.domain.PricedFulfillmentOption>populateOptionsForGroup(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse response, EnhancedFulfillmentPricingGroup group) protected List<com.broadleafcommerce.order.common.domain.PricedFulfillmentOption>populateOptionsForItem(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse response, EnhancedFulfillmentPricingItem item) voidsetShouldIncludeIncompleteGroups(boolean shouldIncludeIncompleteGroups) protected boolean
-
Constructor Details
-
DefaultFulfillmentOptionService
public DefaultFulfillmentOptionService(@NonNull FulfillmentPricingConfigAccessor<? extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig> fulfillmentPricingConfigService, @NonNull com.broadleafcommerce.common.extension.TypeFactory typeFactory, @NonNull FulfillmentCalculatorService calculatorService)
-
-
Method Details
-
findFulfillmentOptions
public com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse findFulfillmentOptions(@NonNull com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentOptionServiceGiven theFulfillmentOptionRequest, this method provides a map ofPriced Fulfillment Optionsfor the request. The map will be per item or per group depending on the client'sFulfillmentPricingConfig.getFulfillmentPricingStrategy().- Specified by:
findFulfillmentOptionsin interfaceFulfillmentOptionService- Parameters:
request- which represents a lightweight Cart for the purpose of determining shippingcontextInfo- the context info providing tenancy and application data among other things- Returns:
- FulfillmentOptionResponse containing a map of PricedFulfillmentOptions
-
buildOptions
protected com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse buildOptions(FulfillmentPricingContext fpContext, List<FulfillmentCalculator> calculators) Given a list of fulfillment calculators sorted in the order they should be run, build a FulfillmentResponse.- Parameters:
context-calculators-- Returns:
-
initializeFulfillmentPricingContext
protected FulfillmentPricingContext initializeFulfillmentPricingContext(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
populateGroupResponses
protected void populateGroupResponses(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse response, FulfillmentPricingContext context) -
populateItemResponses
protected void populateItemResponses(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse response, FulfillmentPricingContext context) -
populateOptionsForGroup
protected List<com.broadleafcommerce.order.common.domain.PricedFulfillmentOption> populateOptionsForGroup(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse response, EnhancedFulfillmentPricingGroup group) -
shouldIncludeOption
-
populateOptionsForItem
protected List<com.broadleafcommerce.order.common.domain.PricedFulfillmentOption> populateOptionsForItem(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse response, EnhancedFulfillmentPricingItem item) -
buildGroupOptionForResponse
protected com.broadleafcommerce.order.common.domain.PricedFulfillmentOption buildGroupOptionForResponse(EnhancedFulfillmentPricingGroup pricingGroup, String serviceLevel, GroupServiceLevelPriceResult result) -
buildItemOptionForResponse
protected com.broadleafcommerce.order.common.domain.PricedFulfillmentOption buildItemOptionForResponse(EnhancedFulfillmentPricingItem item, String serviceLevel, FulfillmentItemPriceResult result) -
determineFulfillmentType
protected String determineFulfillmentType(EnhancedFulfillmentPricingItem item, FulfillmentItemPriceResult result) -
determineFulfillmentType
protected String determineFulfillmentType(EnhancedFulfillmentPricingGroup pricingGroup, GroupServiceLevelPriceResult result) -
determineFulfillmentType
protected String determineFulfillmentType(EnhancedFulfillmentPricingGroup pricingGroup, FulfillmentCalculator calculator) -
getFulfillmentPricingConfigService
protected FulfillmentPricingConfigAccessor<? extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig> getFulfillmentPricingConfigService() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCalculatorService
-
setShouldIncludeIncompleteGroups
public void setShouldIncludeIncompleteGroups(boolean shouldIncludeIncompleteGroups)
-