public interface InventoryLocationResolver
This is generally for determining where inventory is being fulfilled from. Please do not confuse this with
FulfillmentLocationResolver which is used for determining
an address for pricing purposes. They may have similar logic or depend on one another, but they are not the
same.
This is used within the
AdvancedInventoryServiceExtensionHandler#retrieveQuantitiesAvailable(java.util.Collection, java.util.Map, org.broadleafcommerce.common.extension.ExtensionResultHolder)},
AdvancedInventoryServiceExtensionHandler#decrementInventory(java.util.Map, java.util.Map)}| Modifier and Type | Method and Description |
|---|---|
FulfillmentLocation |
resolveInventoryLocationForDecrement(org.broadleafcommerce.core.catalog.domain.Sku sku,
Integer quantity,
org.broadleafcommerce.core.order.domain.Order order)
Resolves an inventory location when none has been determined from other means.
|
FulfillmentLocation |
resolveInventoryLocationForIncrement(org.broadleafcommerce.core.catalog.domain.Sku sku,
Integer quantity,
org.broadleafcommerce.core.order.domain.Order order)
This attempts to resolve an inventory location for incrementing inventory when a location is not known.
|
List<FulfillmentLocation> |
resolveInventoryLocationsForAvailability(org.broadleafcommerce.core.catalog.domain.Sku sku,
org.broadleafcommerce.core.order.domain.Order order)
Resolves a list of locations to check for whether or not the given sku is available.
|
List<FulfillmentLocation> resolveInventoryLocationsForAvailability(org.broadleafcommerce.core.catalog.domain.Sku sku, @Nullable org.broadleafcommerce.core.order.domain.Order order)
Resolves a list of locations to check for whether or not the given sku is available. This can be used in the context of adding to cart or updating cart quantity OR in something from the frontend that is attempting to display the availability for the given sku
sku - the Sku to check for availabilityorder - an optional current order to use for determining which FulfillmentLocations to returnFulfillmentLocations that will be used to show the sku as available or not. This should
return an empty list of no locations are availableAdvancedInventoryServiceExtensionHandler#retrieveQuantitiesAvailable(java.util.Collection, java.util.Map, org.broadleafcommerce.common.extension.ExtensionResultHolder)}FulfillmentLocation resolveInventoryLocationForIncrement(org.broadleafcommerce.core.catalog.domain.Sku sku, Integer quantity, @Nullable org.broadleafcommerce.core.order.domain.Order order)
This attempts to resolve an inventory location for incrementing inventory when a location is not known. This is
used within AdvancedInventoryServiceExtensionHandler.incrementInventory(java.util.Map, java.util.Map) when
previous location information is not known
sku - the Sku whose inventory will be incrementedquantity - the quantity that is going to be incrementedorder - a contextual Order, may be nullFulfillmentLocation suitable to increment inventory for the given sku or null if a
location could not be foundFulfillmentLocation resolveInventoryLocationForDecrement(org.broadleafcommerce.core.catalog.domain.Sku sku, Integer quantity, @Nullable org.broadleafcommerce.core.order.domain.Order order)
InventoryService.decrementInventory(Sku, int) from the framework inventory service outside of the context
of the blCheckoutWorkflow. If this is within the context of a blCheckoutWorkflow the
InventoryReservationStrategy is used instead to determine which inventory reservations should be created.sku - the Sku that inventory will be decremented fromquantity - the quantitity that is going to be decrementedorder - the current Order, usually given via the ContextualInventoryService via the
ContextualInventoryService.ORDER_KEY. May be nullFulfillmentLocation suitable to increment inventory for the given sku or null if a
location could not be foundCopyright © 2020. All rights reserved.