Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@oluexpert99
Copy link

…t Due Date for RBF Loans

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!

  • 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.

@oluexpert99 oluexpert99 self-assigned this Dec 29, 2025
Copilot AI review requested due to automatic review settings December 29, 2025 14:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables early repayment/prepayment before the first installment due date for all loan types, not just drawdown loans (RBF loans). The change simplifies the logic by treating all loans uniformly for early repayment scenarios.

Key changes:

  • Modified installment resolution logic to find the first unpaid installment for early repayments
  • Removed the drawdown loan check by setting isDrawdownLoan to always true
  • Added comprehensive test coverage for sequential early repayments and edge cases

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
CredibleXLoanPenaltyCalculator.java Enhanced resolveInstallmentByTransactionDate and getInterestDueForTransaction methods to properly handle early repayments by skipping PAID installments and finding the first unpaid installment
CustomLoanWritePlatformServiceJpaRepositoryImpl.java Simplified logic by hardcoding isDrawdownLoan to true to enable early repayment for all loan types
CredXLoanReadPlatformServiceImpl.java Applied same simplification as CustomLoanWritePlatformServiceJpaRepositoryImpl.java for consistency
CredibleXLoanPenaltyCalculatorTest.java Added three comprehensive test cases covering sequential early repayments, multiple installments, and repayment before first due date

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@hayederr hayederr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@oluexpert99 oluexpert99 merged commit d899f84 into develop Dec 29, 2025
6 checks passed
@oluexpert99 oluexpert99 deleted the feature/CRED-331 branch December 29, 2025 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants