Class InventoryOrderEventListener
java.lang.Object
org.salespointframework.inventory.InventoryOrderEventListener
@Component @ConditionalOnProperty(name="salespoint.inventory.disable-updates", havingValue="false", matchIfMissing=true) public class InventoryOrderEventListener extends Object
ApplicationListener
for Order.OrderCompleted
events to verify that sufficient amounts of the
Product
the OrderLine
s contained in the Order
point to are available in the
UniqueInventory
.- Since:
- 6.3
- Author:
- Oliver Gierke
-
Constructor Summary
Constructors Constructor Description InventoryOrderEventListener(@NonNull List<LineItemFilter> filters, @NonNull MultiInventory<MultiInventoryItem> inventory, @NonNull UniqueInventory<UniqueInventoryItem> uniqueInventory)
-
Method Summary
Modifier and Type Method Description void
on(Order.OrderCanceled event)
Rolls back the stock decreases handled forOrder.OrderCompleted
events.void
on(Order.OrderCompleted event)
InvokesUniqueInventory
checks for allOrderLine
of theOrder
in the givenOrder.OrderCompleted
event.
-
Constructor Details
-
InventoryOrderEventListener
public InventoryOrderEventListener(@NonNull @NonNull List<LineItemFilter> filters, @NonNull @NonNull MultiInventory<MultiInventoryItem> inventory, @NonNull @NonNull UniqueInventory<UniqueInventoryItem> uniqueInventory)
-
-
Method Details
-
on
InvokesUniqueInventory
checks for allOrderLine
of theOrder
in the givenOrder.OrderCompleted
event.- Parameters:
event
- must not be null.- Throws:
OrderCompletionFailure
- in case any of theOrderLine
items contained in the order and supported by the configuredLineItemFilter
is not available in sufficient quantity.
-
on
Rolls back the stock decreases handled forOrder.OrderCompleted
events.- Parameters:
event
- must not be null.
-