FINERACT-2520: Add disbursement charges to total repayment expected in progressive loan schedule#5592
FINERACT-2520: Add disbursement charges to total repayment expected in progressive loan schedule#5592Wiki05 wants to merge 1 commit intoapache:developfrom
Conversation
|
@Wiki05 hii, somthing went wrong while the push, 3000+ file changes (+5 ,-1,135,822), please check, also make sure to sign your commits. |
a342c5a to
091cc1c
Compare
Hi @airajena , thank you for pointing that out! I've reset my branch and force-pushed a clean version. It now shows only 1 file changed and includes the commit sign-off as requested. Please let me know if it looks good now! |
| scheduleParams.incrementPeriodNumber(); | ||
| } | ||
|
|
||
| // Fix for FINERACT-2520: Ensure disbursement charges are added to total expected repayment |
There was a problem hiding this comment.
Please do not add such comments in the code unless required, this helps to keep code readable. These fixes comments/explaination of changes belong to PR description.
There was a problem hiding this comment.
Understood @airajena , I've removed the comment from the code now.
091cc1c to
7ef3b98
Compare
|
|
||
| if (chargesDueAtTimeOfDisbursement.compareTo(BigDecimal.ZERO) > 0) { | ||
| scheduleParams.addTotalRepaymentExpected(Money.of(currency, chargesDueAtTimeOfDisbursement, mc)); | ||
| } |
There was a problem hiding this comment.
Hi Can you add a unit test covering this case for coverage?
There was a problem hiding this comment.
Hi @Aman-Mittal , I've added a new unit test to LoanScheduleGeneratorTest.java that verifies the inclusion of disbursement charges in the total repayment. Please let me know if it looks good now!
7ef3b98 to
f0eff02
Compare
|
please run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest as pre commit checks so ci checks don't fail |
f0eff02 to
9621f01
Compare
I have successfully run spotlessJavaApply locally using Java 21. I've amended the commit and force-pushed the formatted code. |
9621f01 to
a77bb35
Compare
|
Hi @Aman-Mittal , @airajena, I see that test-core-4 failed in the PostgreSQL/MySQL CI runs. I'm analyzing the logs to see if it's a decimal precision issue in the new unit test. I'll push a fix as soon as I identify the exact mismatch. |
please refer: Error: 1 unsigned commit(s). See CONTRIBUTING.md#signing-your-commits |
dabd9b1 to
3639349
Compare
Thank you for catching that! I've amended the commit with the -s flag to ensure it is properly signed. I've also included the decimal precision fix (stripTrailingZeros()) in this same commit to address the test-core-4 failure |
8556d23 to
1a70750
Compare
Signed-off-by: Wiki05 <vigneshdev1022@gmail.com> Signed-off-by: Vignesh <vigneshdev1022@gmail.com>
1a70750 to
2cefb6a
Compare
|
Hi @airajena , @Aman-Mittal . I have updated my GitHub primary email to match my local Git config and re-signed the commit using the -s flag. I have also implemented the stripTrailingZeros() precision fix in the unit test, which should resolve the previous test-core-4 failures. The PR is now ready for the automated checks to run. |
Description
This PR fixes FINERACT-2520 where disbursement charges were missing from the total repayment expected in the progressive loan schedule.
Changes
Updated ProgressiveLoanScheduleGenerator.java to explicitly add chargesDueAtTimeOfDisbursement to the scheduleParams.totalRepaymentExpected after the main repayment loop.
Impact
Ensures the final schedule model correctly reflects all initial charges, matching the logic used in cumulative loan models.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.