Skip to content

Commit

Permalink
use the encapsulated basePrice getter at Order.price
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiosilveira committed Aug 20, 2022
1 parent b01ce19 commit 50242dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion order.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Order {

get price() {
return (
this.quantity * this.itemPrice -
this.basePrice -
Math.max(0, this.quantity - 500) * this.itemPrice * 0.05 +
Math.min(this.quantity * this.itemPrice * 0.1, 100)
);
Expand Down

0 comments on commit 50242dc

Please sign in to comment.