st-tu-dresden/salespoint

`InventoryManagement.cancelOrder(…)` only cancels complete orders

Closed this issue · 0 comments

InventoryManagement.cancelOrder(…) skips updating the inventory if the order is anything but completed. However, the method is never actually triggered with an order in that state, as the only code currently invoking it is the event listener reacting to theOrderCanceled event. For that, the order is obviously in canceled state so that the guard drops the order.

The bug is masked by an invalidly set up order in completed state that passes the flag. The order bound to the event is in the wrong state for the event in the first place.