Interface FulfillmentOptionPricingProvider

All Superinterfaces:
org.springframework.core.Ordered
All Known Implementing Classes:
NoInventoryFulfillmentPricingProvider

public interface FulfillmentOptionPricingProvider extends org.springframework.core.Ordered
Interface to define an integration with a specific fulfillment pricing provider. Consider that these providers are often 3rd party systems (e.g. USPS, UPS, FedEx, ShipEngine, etc.) The can also be integrated with DB or JSON data (e.g. a banded fulfillment pricing provider).
Author:
Kelly Tisdell (ktisdell)
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse
    findFulfillmentOptions(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionRequest request, com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig config, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Given the FulfillmentOptionRequest, this method attempts to provide a list of appropriate Priced Fulfillment Options.
    default int
    Provides order - or priority - to a collection of Fulfillment Option Pricing Providers.
    This is an arbitrary, but unique, descriptive ID (e.g.
    default boolean
    Indicates if calls to this provider require a network call, especially to a 1st or 3rd party system.
  • Method Details

    • getProviderId

      String getProviderId()
      This is an arbitrary, but unique, descriptive ID (e.g. 'BLC_BANDED_PRICING_PROVIDER'). This could be a class name too, but often something with a prefix and a descriptive name is enough. All providers offered by Broadleaf will have a name starting with "BLC_". Client and 3rd party providers should not use "BLC_" as a prefix.
      Returns:
    • findFulfillmentOptions

      @Nullable com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse findFulfillmentOptions(@NonNull com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionRequest request, @NonNull com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig config, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Given the FulfillmentOptionRequest, this method attempts to provide a list of appropriate Priced Fulfillment Options. If this provider can't handle the request, it should return null or a FulfillmentOptionResponse with an empty list of Priced Fulfillment Options. The items in the FulfillmentPricingGroups are assumed to have the same FulfillmentPricingGroup.getFulfillmentType(). The results of this method may contain PricedFulfillmentOptions that may not have been requested. Those may affect the way that Fulfillment Groups are re-grouped or re-organized (e.g. based on inventory, or store availability, for example).
      Parameters:
      request - which represents a lightweight Cart for the purpose of determining shipping
      config - the FulfillmentPricingConfig associated with the given contextInfo
      contextInfo - the context info providing tenancy and application data among other things
      Returns:
      FulfillmentOptionResponse containing a list of PricedFulfillmentOptions
    • getOrder

      default int getOrder()
      Provides order - or priority - to a collection of Fulfillment Option Pricing Providers. The default value is zero (0). Implementors that wish a higher priority should ensure that this method returns a value less than 0 (lower value == higher priority). Note that, by default, this property does not affect logic because all providers will get executed. However, this is here in case there is a creative need for ordering Fulfillment Option Pricing Providers.
      Specified by:
      getOrder in interface org.springframework.core.Ordered
      Returns:
      See Also:
      • Ordered
    • isRemoteProvider

      default boolean isRemoteProvider()
      Indicates if calls to this provider require a network call, especially to a 1st or 3rd party system. If the provider talks directly to a database or to a file system resource, then that is generally considered to not be remote. This affects whether a CircuitBreaker may be used, if available.
      Returns: