@@ -18,42 +18,14 @@
|
18 | 18 | return interestAmount; |
19 | 19 | } |
20 | 20 | |
21 | | -if (loanAmount.equalsTo(Money('$5001.00'))) { |
| 21 | +if (loanAmount.greaterThan(Money('$5000.00'))) { |
22 | 22 | let interestAmount = Money('$0.00'); |
23 | 23 | |
24 | 24 | const dollarsAboveThresholdForSecondRange = loanAmount.minus(END_OF_FIRST_RANGE); |
25 | 25 | const interestAmountForSecondRange = CENTS_FOR_SECOND_RANGE.multipliedBy(dollarsAboveThresholdForSecondRange); |
26 | 26 | interestAmount = interestAmount.plus(interestAmountForSecondRange); |
27 | 27 | |
28 | | -const dollarsAboveThresholdForThirdRange = Money('$5001.00').minus(Money('$5000.00')); |
29 | | -const interestAmountForThirdRange = Money('$0.14').minus(Money('$0.09')).multipliedBy(dollarsAboveThresholdForThirdRange); |
30 | | -interestAmount = interestAmount.plus(interestAmountForThirdRange); |
31 | | - |
32 | | -return interestAmount; |
33 | | -} |
34 | | - |
35 | | -if (loanAmount.equalsTo(Money('$5002.00'))) { |
36 | | -let interestAmount = Money('$0.00'); |
37 | | - |
38 | | -const dollarsAboveThresholdForSecondRange = loanAmount.minus(END_OF_FIRST_RANGE); |
39 | | -const interestAmountForSecondRange = CENTS_FOR_SECOND_RANGE.multipliedBy(dollarsAboveThresholdForSecondRange); |
40 | | -interestAmount = interestAmount.plus(interestAmountForSecondRange); |
41 | | - |
42 | | -const dollarsAboveThresholdForThirdRange = Money('$5002.00').minus(Money('$5000.00')); |
43 | | -const interestAmountForThirdRange = Money('$0.14').minus(Money('$0.09')).multipliedBy(dollarsAboveThresholdForThirdRange); |
44 | | -interestAmount = interestAmount.plus(interestAmountForThirdRange); |
45 | | - |
46 | | -return interestAmount; |
47 | | -} |
48 | | - |
49 | | -if (loanAmount.equalsTo(Money('$5003.00'))) { |
50 | | -let interestAmount = Money('$0.00'); |
51 | | - |
52 | | -const dollarsAboveThresholdForSecondRange = loanAmount.minus(END_OF_FIRST_RANGE); |
53 | | -const interestAmountForSecondRange = CENTS_FOR_SECOND_RANGE.multipliedBy(dollarsAboveThresholdForSecondRange); |
54 | | -interestAmount = interestAmount.plus(interestAmountForSecondRange); |
55 | | - |
56 | | -const dollarsAboveThresholdForThirdRange = Money('$5003.00').minus(Money('$5000.00')); |
| 28 | +const dollarsAboveThresholdForThirdRange = loanAmount.minus(Money('$5000.00')); |
57 | 29 | const interestAmountForThirdRange = Money('$0.14').minus(Money('$0.09')).multipliedBy(dollarsAboveThresholdForThirdRange); |
58 | 30 | interestAmount = interestAmount.plus(interestAmountForThirdRange); |
59 | 31 | |
|