Skip to content

Commit 9844be3

Browse files
committed
use encapsulated quantityDiscount getter at Order.price
1 parent 725105d commit 9844be3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

order.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ class Order {
2121

2222
get price() {
2323
return (
24-
this.basePrice -
25-
Math.max(0, this.quantity - 500) * this.itemPrice * 0.05 +
26-
Math.min(this.quantity * this.itemPrice * 0.1, 100)
24+
this.basePrice - this.quantityDiscount + Math.min(this.quantity * this.itemPrice * 0.1, 100)
2725
);
2826
}
2927
}

0 commit comments

Comments
 (0)