@Component(value="blMultipleReservationPerItemReservationStrategy") public class MultipleReservationPerItemReservationStrategy extends AbstractInventoryReservationStrategy
Creates multiple reservations for each FulfillmentGroupItem. Quantity for a single FulfillmentGroupItem
can thus be spread across different FulfillmentLocations when checking out.
Inventory is prioritized according to the quantity available at each location. This can be prioritized to use the maximum
quantity or the minimum quantity first, and is customized using the advanced-inventory.prioritize.higher.quantity or
advanced-inventory.prioritize.lower.quantity system properties.
entityConfig, inventoryService| Constructor and Description |
|---|
MultipleReservationPerItemReservationStrategy() |
| Modifier and Type | Method and Description |
|---|---|
List<InventoryReservation> |
getReservations(org.broadleafcommerce.core.order.domain.FulfillmentGroup fg)
This attempts to resolve a fulfillment (inventory) location for a particular fulfillment group for the given Sku
and quantity.
|
InventoryReservationStrategyType |
getType()
The type of this strategy, used for configuring the active strategy for selecting between.
|
createInventoryReservation, favorHigherQuantityDecrement, favorLowerQuantityDecrement, getSkuForItem, prioritizeInventorypublic MultipleReservationPerItemReservationStrategy()
public InventoryReservationStrategyType getType()
InventoryReservationStrategypublic List<InventoryReservation> getReservations(org.broadleafcommerce.core.order.domain.FulfillmentGroup fg)
InventoryReservationStrategy
This attempts to resolve a fulfillment (inventory) location for a particular fulfillment group for the given Sku
and quantity. This is used within the AdvancedInventoryWorkflowExtensionHandler to determine the corresponding
InventoryReservations to create when checking out an Order and decrementing Inventory.
Persisting the list of InventoryReservations that is returned should occur within the same transaction that
actually decrements the quantity available for an Inventory record within a FulfillmentLocation.
fg - the FulfillmentGroup being used to get reservations forInventoryReservations for the given fg. If no suitable reservations could be made,
this should return an empty listAdvancedInventoryServiceExtensionHandler#decrementInventory(java.util.Map, java.util.Map)},
AdvancedInventoryService#decrementInventoryFromLocations(java.util.Map, List)}Copyright © 2020. All rights reserved.