-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts #4384
base: develop
Are you sure you want to change the base?
Conversation
1402fb3
to
f93f6c0
Compare
…large charge amounts
f93f6c0
to
f5c069f
Compare
@@ -2007,10 +2007,11 @@ private List<List<String>> getActualValuesList(List<GetLoansLoanIdLoanChargeData | |||
actualValues.add(t.getChargeTimeType().getValue() == null ? null : t.getChargeTimeType().getValue()); | |||
actualValues.add(t.getDueDate() == null ? null : FORMATTER.format(t.getDueDate())); | |||
actualValues.add(t.getChargeCalculationType().getValue() == null ? null : t.getChargeCalculationType().getValue()); | |||
actualValues.add(t.getAmount() == null ? null : String.valueOf(t.getAmount())); | |||
actualValues.add(t.getAmount() == null ? null : String.valueOf(new Utils.DoubleFormatter(t.getAmount()).format())); |
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.
We can remove the additional invocation of String.valueOf(), as DoubleFormatter.format already returns a string.
actualValues.add(t.getAmountPaid() == null ? null : String.valueOf(t.getAmountPaid())); | ||
actualValues.add(t.getAmountWaived() == null ? null : String.valueOf(t.getAmountWaived())); | ||
actualValues.add(t.getAmountOutstanding() == null ? null : String.valueOf(t.getAmountOutstanding())); | ||
actualValues.add( | ||
t.getAmountOutstanding() == null ? null : String.valueOf(new Utils.DoubleFormatter(t.getAmountOutstanding()).format())); |
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.
The same here, we can remove the additional invocation of String.valueOf(), as DoubleFormatter.format already returns a string.
case "Due" -> actualValues.add( | ||
repaymentPeriod.getTotalDueForPeriod() == null ? null : String.valueOf(repaymentPeriod.getTotalDueForPeriod())); | ||
case "Fees" -> actualValues.add(repaymentPeriod.getFeeChargesDue() == null ? null | ||
: String.valueOf(new Utils.DoubleFormatter(repaymentPeriod.getFeeChargesDue()).format())); |
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.
Unnecessary String.valueOf() call
case "Fees" -> actualValues.add(repaymentPeriod.getFeeChargesDue() == null ? null | ||
: String.valueOf(new Utils.DoubleFormatter(repaymentPeriod.getFeeChargesDue()).format())); | ||
case "Penalties" -> actualValues.add(repaymentPeriod.getPenaltyChargesDue() == null ? null | ||
: String.valueOf(new Utils.DoubleFormatter(repaymentPeriod.getPenaltyChargesDue()).format())); |
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.
Unnecessary String.valueOf() call
case "Penalties" -> actualValues.add(repaymentPeriod.getPenaltyChargesDue() == null ? null | ||
: String.valueOf(new Utils.DoubleFormatter(repaymentPeriod.getPenaltyChargesDue()).format())); | ||
case "Due" -> actualValues.add(repaymentPeriod.getTotalDueForPeriod() == null ? null | ||
: String.valueOf(new Utils.DoubleFormatter(repaymentPeriod.getTotalDueForPeriod()).format())); |
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.
Unnecessary String.valueOf() call
@@ -3218,7 +3220,7 @@ private List<String> fetchValuesOfRepaymentSchedule(List<String> header, GetLoan | |||
case "Waived" -> actualValues.add(repaymentPeriod.getTotalWaivedForPeriod() == null ? null | |||
: String.valueOf(repaymentPeriod.getTotalWaivedForPeriod())); | |||
case "Outstanding" -> actualValues.add(repaymentPeriod.getTotalOutstandingForPeriod() == null ? null | |||
: String.valueOf(repaymentPeriod.getTotalOutstandingForPeriod())); | |||
: String.valueOf(new Utils.DoubleFormatter(repaymentPeriod.getTotalOutstandingForPeriod()).format())); |
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.
Unnecessary String.valueOf() call
@@ -2007,10 +2007,11 @@ private List<List<String>> getActualValuesList(List<GetLoansLoanIdLoanChargeData | |||
actualValues.add(t.getChargeTimeType().getValue() == null ? null : t.getChargeTimeType().getValue()); | |||
actualValues.add(t.getDueDate() == null ? null : FORMATTER.format(t.getDueDate())); | |||
actualValues.add(t.getChargeCalculationType().getValue() == null ? null : t.getChargeCalculationType().getValue()); | |||
actualValues.add(t.getAmount() == null ? null : String.valueOf(t.getAmount())); | |||
actualValues.add(t.getAmount() == null ? null : String.valueOf(new Utils.DoubleFormatter(t.getAmount()).format())); | |||
actualValues.add(t.getAmountPaid() == null ? null : String.valueOf(t.getAmountPaid())); | |||
actualValues.add(t.getAmountWaived() == null ? null : String.valueOf(t.getAmountWaived())); |
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.
I am not sure, just asking - maybe we need to use a new double formatter for the amountPaid
and amountWaived
fields?
Description
Added e2e tests for repayment schedules with large charge amounts changes made as part of #4314
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Write the commit message as per https://github.com/apache/fineract/#pull-requests
Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
[-] Create/update unit or integration tests for verifying the changes made.
Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
[-] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.