Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ public void apply(
if (transaction.isAll()) {
amount = stored.getAmount();
}


if (amount.getValue().equals(0)) {
throw new IllegalArgumentException("Amount to checkout must be greater than zero.");
}

ItemCheckout.ItemCheckoutBuilder<?, ?, ?> checkoutBuilder = ItemAmountCheckout.builder()
.checkedOutByEntity(interactingEntity.getId())
.item(inventoryItem.getId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ public void apply(
if(toSubtract == null){
throw new IllegalStateException("Cannot subtract an amount from a null value. Should not get here.");
}


if (toSubtract.getValue().equals(0)) {
throw new IllegalArgumentException("Amount to subtract must be greater than zero.");
}

stored.subtract(toSubtract);

affectedStored.add(stored);
Expand Down
Loading