public abstract class AbstractInventoryReservationStrategy extends Object implements InventoryReservationStrategy
| Modifier and Type | Field and Description |
|---|---|
protected org.broadleafcommerce.common.persistence.EntityConfiguration |
entityConfig |
protected AdvancedInventoryService |
inventoryService |
| Constructor and Description |
|---|
AbstractInventoryReservationStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected InventoryReservation |
createInventoryReservation(FulfillmentLocation location,
org.broadleafcommerce.core.order.domain.FulfillmentGroupItem item,
Integer quantity) |
boolean |
favorHigherQuantityDecrement() |
boolean |
favorLowerQuantityDecrement() |
org.broadleafcommerce.core.catalog.domain.Sku |
getSkuForItem(org.broadleafcommerce.core.order.domain.FulfillmentGroupItem item)
Convenience method to determine the SKU from the FulfillmentGroupItem
|
List<Inventory> |
prioritizeInventory(List<Inventory> inventory)
Takes the given list of inventory and returns a new sorted list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetReservations, getTypeprotected AdvancedInventoryService inventoryService
protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfig
public AbstractInventoryReservationStrategy()
protected InventoryReservation createInventoryReservation(FulfillmentLocation location, org.broadleafcommerce.core.order.domain.FulfillmentGroupItem item, Integer quantity)
public org.broadleafcommerce.core.catalog.domain.Sku getSkuForItem(org.broadleafcommerce.core.order.domain.FulfillmentGroupItem item)
InventoryReservationStrategygetSkuForItem in interface InventoryReservationStrategypublic List<Inventory> prioritizeInventory(List<Inventory> inventory)
InventoryReservationStrategyTakes the given list of inventory and returns a new sorted list. Example use cases would be to sort this list by maximum inventory at a location or to exclude specific instances of inventory.
No modifications should be performed on the original list of inventory passed in.
The out-of-the-box implementations of InventoryReservationStrategy prioritize inventory according to the
advanced-inventory.prioritize.higher.quantity and advanced-inventory.prioritize.lower.quantity
system properties.
prioritizeInventory in interface InventoryReservationStrategyinventory - the list of Inventory to prioritizeInventory used for reserving inventorypublic boolean favorHigherQuantityDecrement()
public boolean favorLowerQuantityDecrement()
Copyright © 2020. All rights reserved.