You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "ruzeynalov (via GitHub)" <gi...@apache.org> on 2025/02/26 15:11:49 UTC
[PR] Feature/fineract 1971 repayment schedule incorrect values after charge [fineract]
ruzeynalov opened a new pull request, #4384:
URL: https://github.com/apache/fineract/pull/4384
## Description
Added e2e tests for repayment schedules with large charge amounts changes made as part of https://github.com/apache/fineract/pull/4314
## Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
- [x ] Write the commit message as per https://github.com/apache/fineract/#pull-requests
- [x ] 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.
- [x ] 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
- [ x] 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "ruzeynalov (via GitHub)" <gi...@apache.org>.
ruzeynalov commented on code in PR #4384:
URL: https://github.com/apache/fineract/pull/4384#discussion_r1973213463
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -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()));
Review Comment:
Correct, fixed as well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "oleksii-novikov-onix (via GitHub)" <gi...@apache.org>.
oleksii-novikov-onix commented on PR #4384:
URL: https://github.com/apache/fineract/pull/4384#issuecomment-2687403331
LGTM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "oleksii-novikov-onix (via GitHub)" <gi...@apache.org>.
oleksii-novikov-onix commented on code in PR #4384:
URL: https://github.com/apache/fineract/pull/4384#discussion_r1972089449
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -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()));
Review Comment:
I am not sure, just asking - maybe we need to use a new double formatter for the `amountPaid` and `amountWaived` fields?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "oleksii-novikov-onix (via GitHub)" <gi...@apache.org>.
oleksii-novikov-onix commented on code in PR #4384:
URL: https://github.com/apache/fineract/pull/4384#discussion_r1972072010
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -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()));
- actualValues.add(t.getAmountOutstanding() == null ? null : String.valueOf(t.getAmountOutstanding()));
+ actualValues.add(
+ t.getAmountOutstanding() == null ? null : String.valueOf(new Utils.DoubleFormatter(t.getAmountOutstanding()).format()));
Review Comment:
The same here, we can remove the additional invocation of String.valueOf(), as DoubleFormatter.format already returns a string.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #4384:
URL: https://github.com/apache/fineract/pull/4384#issuecomment-2687385874
@ruzeynalov Kindly check the failed test cases!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "oleksii-novikov-onix (via GitHub)" <gi...@apache.org>.
oleksii-novikov-onix commented on code in PR #4384:
URL: https://github.com/apache/fineract/pull/4384#discussion_r1972071362
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -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()));
Review Comment:
We can remove the additional invocation of String.valueOf(), as DoubleFormatter.format already returns a string.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "oleksii-novikov-onix (via GitHub)" <gi...@apache.org>.
oleksii-novikov-onix commented on code in PR #4384:
URL: https://github.com/apache/fineract/pull/4384#discussion_r1972074242
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -3203,12 +3205,12 @@ private List<String> fetchValuesOfRepaymentSchedule(List<String> header, GetLoan
actualValues.add(repaymentPeriod.getPrincipalDue() == null ? null : String.valueOf(repaymentPeriod.getPrincipalDue()));
case "Interest" ->
actualValues.add(repaymentPeriod.getInterestDue() == null ? null : String.valueOf(repaymentPeriod.getInterestDue()));
- case "Fees" -> actualValues
- .add(repaymentPeriod.getFeeChargesDue() == null ? null : String.valueOf(repaymentPeriod.getFeeChargesDue()));
- case "Penalties" -> actualValues.add(
- repaymentPeriod.getPenaltyChargesDue() == null ? null : String.valueOf(repaymentPeriod.getPenaltyChargesDue()));
- 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()));
Review Comment:
Unnecessary String.valueOf() call
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "oleksii-novikov-onix (via GitHub)" <gi...@apache.org>.
oleksii-novikov-onix commented on code in PR #4384:
URL: https://github.com/apache/fineract/pull/4384#discussion_r1972074925
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -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()));
Review Comment:
Unnecessary String.valueOf() call
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "oleksii-novikov-onix (via GitHub)" <gi...@apache.org>.
oleksii-novikov-onix commented on code in PR #4384:
URL: https://github.com/apache/fineract/pull/4384#discussion_r1972074619
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -3203,12 +3205,12 @@ private List<String> fetchValuesOfRepaymentSchedule(List<String> header, GetLoan
actualValues.add(repaymentPeriod.getPrincipalDue() == null ? null : String.valueOf(repaymentPeriod.getPrincipalDue()));
case "Interest" ->
actualValues.add(repaymentPeriod.getInterestDue() == null ? null : String.valueOf(repaymentPeriod.getInterestDue()));
- case "Fees" -> actualValues
- .add(repaymentPeriod.getFeeChargesDue() == null ? null : String.valueOf(repaymentPeriod.getFeeChargesDue()));
- case "Penalties" -> actualValues.add(
- repaymentPeriod.getPenaltyChargesDue() == null ? null : String.valueOf(repaymentPeriod.getPenaltyChargesDue()));
- 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()));
+ case "Penalties" -> actualValues.add(repaymentPeriod.getPenaltyChargesDue() == null ? null
+ : String.valueOf(new Utils.DoubleFormatter(repaymentPeriod.getPenaltyChargesDue()).format()));
Review Comment:
Unnecessary String.valueOf() call
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanStepDef.java:
##########
@@ -3203,12 +3205,12 @@ private List<String> fetchValuesOfRepaymentSchedule(List<String> header, GetLoan
actualValues.add(repaymentPeriod.getPrincipalDue() == null ? null : String.valueOf(repaymentPeriod.getPrincipalDue()));
case "Interest" ->
actualValues.add(repaymentPeriod.getInterestDue() == null ? null : String.valueOf(repaymentPeriod.getInterestDue()));
- case "Fees" -> actualValues
- .add(repaymentPeriod.getFeeChargesDue() == null ? null : String.valueOf(repaymentPeriod.getFeeChargesDue()));
- case "Penalties" -> actualValues.add(
- repaymentPeriod.getPenaltyChargesDue() == null ? null : String.valueOf(repaymentPeriod.getPenaltyChargesDue()));
- 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()));
+ 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()));
Review Comment:
Unnecessary String.valueOf() call
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-1971: added test scenarios to cover repayment schedule with large charge amounts [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #4384:
URL: https://github.com/apache/fineract/pull/4384
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org