Class DefaultFulfillmentOptionService

java.lang.Object
com.broadleafcommerce.fulfillment.service.DefaultFulfillmentOptionService
All Implemented Interfaces:
FulfillmentOptionService

public class DefaultFulfillmentOptionService extends Object implements FulfillmentOptionService
Component to call each FulfillmentCalculator and aggregate and de-duplicate results.
  • 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: FulfillmentOptionService
      Given the FulfillmentOptionRequest, this method provides a map of Priced Fulfillment Options for the request. The map will be per item or per group depending on the client's FulfillmentPricingConfig.getFulfillmentPricingStrategy().
      Specified by:
      findFulfillmentOptions in interface FulfillmentOptionService
      Parameters:
      request - which represents a lightweight Cart for the purpose of determining shipping
      contextInfo - 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

      protected boolean shouldIncludeOption(GroupServiceLevelPriceResult result)
    • 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

      protected FulfillmentCalculatorService getCalculatorService()
    • setShouldIncludeIncompleteGroups

      public void setShouldIncludeIncompleteGroups(boolean shouldIncludeIncompleteGroups)