Skip to content

Commit

Permalink
Fix getting price in order validator
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdijk committed Oct 27, 2024
1 parent 56a341e commit d3cdd03
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private void assertDefaultOrderChecks(Order order) throws OrderInvalidException
}

Double administrationCostShouldBe = order.getOrderProducts().stream()
.mapToDouble(orderProduct -> orderProduct.getProduct().getCost() * orderProduct.getAmount())
.mapToDouble(orderProduct -> orderProduct.getPrice() * orderProduct.getAmount())
.anyMatch(c -> c > 0.0) ? administrationCosts : 0.0;

if (!order.getAdministrationCosts().equals(administrationCostShouldBe)) {
Expand Down

0 comments on commit d3cdd03

Please sign in to comment.