-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FINERACT-2312: full term calculation #5219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
FINERACT-2312: full term calculation #5219
Conversation
c7d8a3b to
ed3c0ea
Compare
8503394 to
b677187
Compare
|
4327678 to
a05daaa
Compare
a05daaa to
65e7bac
Compare
65e7bac to
5a2503b
Compare
|
5a2503b to
b4ad7ae
Compare
| public BigDecimal getRateFactorPlus1FromDate(LocalDate fromDate) { | ||
| return interestPeriods.stream().filter(ip -> !ip.getFromDate().isBefore(fromDate)).map(InterestPeriod::getRateFactor) | ||
| .reduce(BigDecimal.ONE, BigDecimal::add); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getRateFactorPlus1FromDate
has implementation .reduce(BigDecimal.ONE, BigDecimal::add);
1 + rate1 + rate2 + rate3 ...
But the Javadoc says:
sum of (Rate Factor + 1) from interest periods
similar to.
(rate1 + 1) + (rate2 + 1) + ...
Needs some more clarification in this javadoc, it is ambiguous
| * the date from which to include interest periods | ||
| * @return rate factor plus 1 for filtered interest periods | ||
| */ | ||
| public BigDecimal getRateFactorPlus1FromDate(LocalDate fromDate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that interestPeriods never be null?
Description
Describe the changes made and why they were made.
Ignore if these details are present on the associated Apache Fineract JIRA ticket.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.