Class DefaultFulfillmentGroupService

java.lang.Object
com.broadleafcommerce.cartoperation.service.fulfillment.DefaultFulfillmentGroupService
All Implemented Interfaces:
FulfillmentGroupService

public class DefaultFulfillmentGroupService extends Object implements FulfillmentGroupService
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultFulfillmentGroupService(FulfillmentPricingConfigHelperService configHelper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    buildGroupReferenceNumber(String cartId, String fulfillmentGroupId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Builds a FulfillmentGroup.getReferenceNumber() for the given cart and group ID.
    protected void
    checkItemsInGroup(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig config, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Check the given FulfillmentGroup for any items with a different Fulfillment Type.
    protected void
    clearFulfillmentPricing(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)
     
    com.broadleafcommerce.cart.client.domain.FulfillmentGroup
    createFulfillmentGroup(String fulfillmentType, com.broadleafcommerce.order.common.domain.Address address, List<com.broadleafcommerce.cart.client.domain.FulfillmentItem> fulfillmentItems, String cartId, int groupIndex, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
     
    protected Map<String,com.broadleafcommerce.cart.client.domain.FulfillmentGroup>
    getFulGroupsByFulType(com.broadleafcommerce.cart.client.domain.Cart cart)
     
    protected Map<String,List<com.broadleafcommerce.cart.client.domain.FulfillmentItem>>
    getItemsByFulfillmentTypeMap(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)
    Should have either: empty if pricing by group for group, only changed items if pricing by item for group, mix of methods if pricing by item for item.
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    protected void
    moveItemsToGroup(List<com.broadleafcommerce.cart.client.domain.FulfillmentItem> itemsToMove, com.broadleafcommerce.cart.client.domain.FulfillmentGroup sourceGroup, com.broadleafcommerce.cart.client.domain.FulfillmentGroup destinationGroup, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, boolean priceByGroup)
     
    protected void
    removeEmptyGroups(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    protected String
    resolveTaxAddressSource(String fulfillmentType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determines the tax address source that should be used for FulfillmentGroup.getTaxAddressSource() for the given fulfillment type.
    void
    syncItemGrouping(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig config, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Scan the FulfillmentItems to check if any need to move to a different fulfillment group.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultFulfillmentGroupService

      public DefaultFulfillmentGroupService(FulfillmentPricingConfigHelperService configHelper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • createFulfillmentGroup

      public com.broadleafcommerce.cart.client.domain.FulfillmentGroup createFulfillmentGroup(String fulfillmentType, com.broadleafcommerce.order.common.domain.Address address, List<com.broadleafcommerce.cart.client.domain.FulfillmentItem> fulfillmentItems, String cartId, int groupIndex, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      createFulfillmentGroup in interface FulfillmentGroupService
    • syncItemGrouping

      public void syncItemGrouping(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig config, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Scan the FulfillmentItems to check if any need to move to a different fulfillment group. If so, move them to an existing group or create a new group.
      Specified by:
      syncItemGrouping in interface FulfillmentGroupService
      Parameters:
      cart -
    • checkItemsInGroup

      protected void checkItemsInGroup(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig config, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Check the given FulfillmentGroup for any items with a different Fulfillment Type. Move items into new fulfillment groups if necessary
      Parameters:
      fulfillmentGroup -
      cart -
      config -
      contextInfo -
    • removeEmptyGroups

      protected void removeEmptyGroups(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • getFulGroupsByFulType

      protected Map<String,com.broadleafcommerce.cart.client.domain.FulfillmentGroup> getFulGroupsByFulType(com.broadleafcommerce.cart.client.domain.Cart cart)
    • getItemsByFulfillmentTypeMap

      protected Map<String,List<com.broadleafcommerce.cart.client.domain.FulfillmentItem>> getItemsByFulfillmentTypeMap(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)
      Should have either: empty if pricing by group for group, only changed items if pricing by item for group, mix of methods if pricing by item for item.
      Parameters:
      fulfillmentGroup -
      Returns:
    • moveItemsToGroup

      protected void moveItemsToGroup(List<com.broadleafcommerce.cart.client.domain.FulfillmentItem> itemsToMove, com.broadleafcommerce.cart.client.domain.FulfillmentGroup sourceGroup, com.broadleafcommerce.cart.client.domain.FulfillmentGroup destinationGroup, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, boolean priceByGroup)
    • buildGroupReferenceNumber

      protected String buildGroupReferenceNumber(String cartId, String fulfillmentGroupId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Builds a FulfillmentGroup.getReferenceNumber() for the given cart and group ID.
      Parameters:
      cartId -
      fulfillmentGroupId - ID of the fulfillment group for which to build a reference number. Usually defaults to the index of the group in Cart.getFulfillmentGroups().
      Returns:
      The new reference number
    • resolveTaxAddressSource

      protected String resolveTaxAddressSource(String fulfillmentType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determines the tax address source that should be used for FulfillmentGroup.getTaxAddressSource() for the given fulfillment type.
      Parameters:
      fulfillmentType - the fulfillment type from which to determine the tax address source
      Returns:
      the tax address source that should be used
    • clearFulfillmentPricing

      protected void clearFulfillmentPricing(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)
    • getConfigHelper

      protected FulfillmentPricingConfigHelperService getConfigHelper()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()