Interface SkuInventoryAdjustmentService<I extends SkuInventory>
- 
- All Known Implementing Classes:
- DefaultSkuInventoryAdjustmentService
 
 public interface SkuInventoryAdjustmentService<I extends SkuInventory>This service handles serializing updates to individualSkuInventoryrecords. This handles business logic associated with incrementing or decrementing inventory based on the type ofInventoryTransactionbeing requested. This component may interact directly with aRepositoryto ensure that records are locked for update. As a result, this component is typically transactional, and may create a new transaction on every request. Callers are urged to keep track of successfulInventoryTransactionresults to apply a compensating transaction if necessary. The batchId can assist with this.- Author:
- Kelly Tisdell (ktisdell)
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description List<InventoryTransaction>cancelInventory(Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryAdjustmentRequestItems, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Perform the cancel of inventory to remove reserved quantity.List<InventoryTransaction>createHardReservations(Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hard reservations that represent final inventory reservations.List<InventoryTransaction>createSoftReservations(Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Soft reservations that represent temporary inventory reservations.List<InventoryTransaction>createSoftReservations(Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, Map<String,List<InventoryTransaction>> existingSoftReservationsByReference, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Soft reservations that represent temporary inventory reservations.voidfreeSoftReservations(List<InventoryTransaction> softReservations, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Release soft reservations and add back to on-hand quantity.List<InventoryTransaction>fulfillInventory(Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryAdjustmentRequestItems, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Perform the fulfillment of inventory to remove reserved quantity and decrement on-hand quantity.List<InventoryTransaction>returnInventory(Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryAdjustmentRequestItems, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Perform the return of inventory to add back on-hand quantity.
 
- 
- 
- 
Method Detail- 
createSoftReservationsList<InventoryTransaction> createSoftReservations(@NonNull Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, @NonNull String batchId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InventoryUnavailableException Soft reservations that represent temporary inventory reservations.- Parameters:
- skuInventoryReservationRequestItems- - the key to the map is the- SkuInventorythat needs to be updated (pre-determined outside of this method).
- batchId- identifier for the current batch of items updating inventory
- contextInfo- the context around sandboxing and multitenant state
- Returns:
- the created inventory transactions
- Throws:
- InventoryUnavailableException- if there was insufficient inventory to be reserved
 
 - 
createSoftReservationsList<InventoryTransaction> createSoftReservations(@NonNull Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, Map<String,List<InventoryTransaction>> existingSoftReservationsByReference, @NonNull String batchId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InventoryUnavailableException Soft reservations that represent temporary inventory reservations.- Parameters:
- skuInventoryReservationRequestItems- - the key to the map is the- SkuInventorythat needs to be updated (pre-determined outside of this method).
- existingSoftReservationsByReference- the existing soft reservations grouped by reference number
- batchId- identifier for the current batch of items updating inventory
- contextInfo- the context around sandboxing and multitenant state
- Returns:
- the created inventory transactions
- Throws:
- InventoryUnavailableException- if there was insufficient inventory to be reserved
 
 - 
createHardReservationsList<InventoryTransaction> createHardReservations(@NonNull Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, @NonNull String batchId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InventoryUnavailableException Hard reservations that represent final inventory reservations.- Parameters:
- skuInventoryReservationRequestItems- - the key to the map is the- SkuInventorythat needs to be updated (pre-determined outside of this method).
- batchId- identifier for the current batch of items updating inventory
- contextInfo- the context around sandboxing and multitenant state
- Returns:
- the created inventory transactions
- Throws:
- InventoryUnavailableException- if there was insufficient inventory to be reserved
 
 - 
fulfillInventoryList<InventoryTransaction> fulfillInventory(@NonNull Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryAdjustmentRequestItems, @NonNull String batchId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InventoryUnavailableException, InventoryNotReservedException Perform the fulfillment of inventory to remove reserved quantity and decrement on-hand quantity.- Parameters:
- skuInventoryAdjustmentRequestItems- - the key to the map is the- SkuInventorythat needs to be updated (pre-determined outside of this method).
- batchId- identifier for the current batch of items updating inventory
- contextInfo- the context around sandboxing and multitenant state
- Returns:
- the created inventory transactions
- Throws:
- InventoryUnavailableException- if there was insufficient inventory reserved or on hand
- InventoryNotReservedException- if there were not already hard reservations for these inventory items
 
 - 
cancelInventoryList<InventoryTransaction> cancelInventory(@NonNull Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryAdjustmentRequestItems, @NonNull String batchId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InventoryUnavailableException, InventoryNotReservedException Perform the cancel of inventory to remove reserved quantity.- Parameters:
- skuInventoryAdjustmentRequestItems- - the key to the map is the- SkuInventorythat needs to be updated (pre-determined outside of this method).
- batchId- identifier for the current batch of items updating inventory
- contextInfo- the context around sandboxing and multitenant state
- Returns:
- the created inventory transactions
- Throws:
- InventoryUnavailableException- if there was insufficient inventory reserved
- InventoryNotReservedException- if there were not already hard reservations for these inventory items
 
 - 
returnInventoryList<InventoryTransaction> returnInventory(@NonNull Map<I,List<SkuInventoryAdjustmentRequestItem>> skuInventoryAdjustmentRequestItems, @NonNull String batchId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Perform the return of inventory to add back on-hand quantity.- Parameters:
- skuInventoryAdjustmentRequestItems- - the key to the map is the- SkuInventorythat needs to be updated (pre-determined outside of this method).
- batchId- identifier for the current batch of items updating inventory
- contextInfo- the context around sandboxing and multitenant state
- Returns:
- the created inventory transactions
 
 - 
freeSoftReservationsvoid freeSoftReservations(@NonNull List<InventoryTransaction> softReservations, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Release soft reservations and add back to on-hand quantity. Note that this archives the soft reservation in-place, no new inventory transactions are created.- Parameters:
- softReservations- the soft reservations to free
- contextInfo- the context around sandboxing and multitenant state
 
 
- 
 
-