@Component(value="blInventoryLocationResolver") public class DefaultInventoryLocationResolver extends Object implements InventoryLocationResolver
| Modifier and Type | Field and Description |
|---|---|
protected org.broadleafcommerce.common.persistence.EntityConfiguration |
entityConfig |
protected AdvancedInventoryService |
inventoryService |
protected FulfillmentLocationService |
locationService |
| Constructor and Description |
|---|
DefaultInventoryLocationResolver() |
| 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.
|
protected FulfillmentLocationService locationService
protected AdvancedInventoryService inventoryService
protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfig
public List<FulfillmentLocation> resolveInventoryLocationsForAvailability(org.broadleafcommerce.core.catalog.domain.Sku sku, org.broadleafcommerce.core.order.domain.Order order)
InventoryLocationResolverResolves 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
resolveInventoryLocationsForAvailability in interface InventoryLocationResolversku - 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)}public FulfillmentLocation resolveInventoryLocationForIncrement(org.broadleafcommerce.core.catalog.domain.Sku sku, Integer quantity, org.broadleafcommerce.core.order.domain.Order order)
InventoryLocationResolverThis 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
resolveInventoryLocationForIncrement in interface InventoryLocationResolversku - 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 foundpublic FulfillmentLocation resolveInventoryLocationForDecrement(org.broadleafcommerce.core.catalog.domain.Sku sku, Integer quantity, org.broadleafcommerce.core.order.domain.Order order)
InventoryLocationResolverInventoryService.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.resolveInventoryLocationForDecrement in interface InventoryLocationResolversku - 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.