Interface FulfillmentCalculator

All Known Implementing Classes:
DBFulfillmentCalculator, ItemAttributeFlatRateFulfillmentCalculator

public interface FulfillmentCalculator
  • Field Details

  • Method Details

    • getId

      String getId()
      Returns the id of this calculator
      Returns:
      The id for this calculator which must be unique.
    • getName

      String getName()
      Returns the name of this calculator
      Returns:
      The name of the calculator which is useful for debugging.
    • getServiceLevel

      String getServiceLevel()
      Returns the service level that this calculator is able to operate on.
      Returns:
      The service level
    • isEnabled

      boolean isEnabled(Instant now)
      Indicates whether this calculator should be used. Database driven calculators will rely on active dates. Configured calculators can be disabled by setting this property.
      Returns:
      true if this calculator is enabled
    • hasCalculatorConfig

      default boolean hasCalculatorConfig()
    • getCalculatorTypePriority

      default int getCalculatorTypePriority()
      By default, DB configured calculators run between the code level calculators. Implementations can control ordering by configuring calculators to run at the same "type" priority and then use only the "priority" field for default sorting.
      Returns:
      The priority of this fulfillment calculator type.
    • setCalculatorTypePriority

      default void setCalculatorTypePriority(int calculatorTypePriority)
    • getPriority

      default Integer getPriority()
    • matchesCurrency

      boolean matchesCurrency(javax.money.CurrencyUnit currency)
    • matchesAddress

      default boolean matchesAddress(com.broadleafcommerce.fulfillment.common.domain.Address address)
      Returns true if this calculator can compute prices for the passed in Address
      Parameters:
      address -
      Returns:
      See Also:
    • canHandle

      boolean canHandle(EnhancedFulfillmentPricingItem item)
    • getFulfillmentCalculatorConfig

      default FulfillmentCalculatorConfig getFulfillmentCalculatorConfig()
    • getType

      default String getType()
    • matchesAnyOriginInfo

      default boolean matchesAnyOriginInfo(Collection<com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo> originInfos)
      Loops through Fulfillment Origin Infos and calls matchesOriginInfo(FulfillmentOriginInfo) returning true if any matches.
      Parameters:
      addressList -
      Returns:
      true if any of the passed in origin structures can be handled by this calculator
      See Also:
    • matchesAnyFulfillmentTypes

      default boolean matchesAnyFulfillmentTypes(Collection<String> fulfillmentTypes)
      Loops through fulfillment types and calls matchesFulfillmentType(String) returning true if any matches.
      Parameters:
      fulfillmentTypes - The list of fulfillment types
      Returns:
      true if any of the passed in fulfillment types can be handled by this calculator
      See Also:
    • matchesAnyInventoryTypes

      default boolean matchesAnyInventoryTypes(Collection<String> inventoryTypes)
      Loops through fulfillment types and calls matchesInventoryType(String) returning true if any matches.
      Parameters:
      inventoryTypes - The list of inventory types
      Returns:
      true if any of the passed in inventory types can be handled by this calculator
      See Also:
    • matchesOriginInfo

      default boolean matchesOriginInfo(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo originInfo)
      Returns true if the FulfillmentOriginInfo can be handled by this calculator. The origin info is typically a container of inventory location references but can be implementation dependent.
      Parameters:
      originInfo -
      Returns:
    • matchesFulfillmentType

      default boolean matchesFulfillmentType(String type)
      Returns true if the calculator can handle the passed in fulfillment type.
      Parameters:
      type - The type to check
      Returns:
    • matchesInventoryType

      default boolean matchesInventoryType(String type)
      Returns true if the calculator can handle the passed in inventory type.
      Parameters:
      type - The type to check
      Returns:
    • getEstimatedMinDaysToFulfill

      Integer getEstimatedMinDaysToFulfill()
    • getEstimatedMaxDaysToFulfill

      Integer getEstimatedMaxDaysToFulfill()