Interface SkuInventoryAdjustmentService<I extends SkuInventory>
- All Known Implementing Classes:
- DefaultSkuInventoryAdjustmentService
public interface SkuInventoryAdjustmentService<I extends SkuInventory>
This service handles serializing updates to individual 
SkuInventory records. This handles
 business logic associated with incrementing or decrementing inventory based on the type of
 InventoryTransaction being requested. This component may interact directly with a
 Repository to 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 successful InventoryTransaction results to apply a compensating transaction
 if necessary. The batchId can assist with this.- Author:
- Kelly Tisdell (ktisdell)
- 
Method SummaryModifier and TypeMethodDescriptioncancelInventory(Map<I, List<SkuInventoryAdjustmentRequestItem>> skuInventoryAdjustmentRequestItems, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Perform the cancel of inventory to remove reserved quantity.createHardReservations(Map<I, List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hard reservations that represent final inventory reservations.createSoftReservations(Map<I, List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, String batchId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Soft reservations that represent temporary inventory reservations.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.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.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 Details- 
createSoftReservationsList<InventoryTransaction> createSoftReservations(@NonNull Map<I, List<SkuInventoryAdjustmentRequestItem>> skuInventoryReservationRequestItems, @NonNull String batchId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InventoryUnavailableExceptionSoft 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, throws InventoryUnavailableExceptionList<InventoryTransaction>> existingSoftReservationsByReference, @NonNull String batchId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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 InventoryUnavailableExceptionHard 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, InventoryNotReservedExceptionPerform 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, InventoryNotReservedExceptionPerform 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
 
 
-