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
forOrder.OrderCompleted
events to verify that sufficient amounts of theProduct
theOrderLine
s contained in theOrder
point to are available in theUniqueInventory
.- 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
on(Order.OrderCancelled 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 Detail
-
InventoryOrderEventListener
public InventoryOrderEventListener(@NonNull @NonNull List<LineItemFilter> filters, @NonNull @NonNull MultiInventory<MultiInventoryItem> inventory, @NonNull @NonNull UniqueInventory<UniqueInventoryItem> uniqueInventory)
-
-
Method Detail
-
on
@EventListener public void on(Order.OrderCompleted event) throws OrderCompletionFailure
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
@EventListener public void on(Order.OrderCancelled event)
Rolls back the stock decreases handled forOrder.OrderCompleted
events.- Parameters:
event
- must not be null.
-
-