Skip to content

FINERACT-1152: Loan Rescheduling End Date Validation Fix#5619

Open
DeathGun44 wants to merge 1 commit intoapache:developfrom
DeathGun44:FINERACT-1152/fix-loan-reschedule-end-date-validation
Open

FINERACT-1152: Loan Rescheduling End Date Validation Fix#5619
DeathGun44 wants to merge 1 commit intoapache:developfrom
DeathGun44:FINERACT-1152/fix-loan-reschedule-end-date-validation

Conversation

@DeathGun44
Copy link
Contributor

Description

Resolves FINERACT-1152.

The core issue here was that you couldn't extend a loan's tenure (extraTerms) and change its EMI at the same time because the validation threw an error if the new endDate didn't already exist in the schedule.

What I changed:

  1. Relaxed End Date Validation: Tweaked LoanRescheduleRequestDataValidatorImpl so that if extraTerms > 0, we allow the endDate to fall on a future, projected installment date.
  2. Blanket EMI Variations: The old logic tried to map new EMIs to specific existing installments using a loop. I rewrote LoanRescheduleRequestWritePlatformServiceImpl to use a blanket term variation instead (isSpecificToInstallment=false). Now, the schedule generator will naturally apply the new EMI across all future installments, including the newly requested ones.
  3. Fineract-Client & Tests: To properly test this, I realized the Swagger API docs were missing the emi and endDate fields for rescheduling requests. I added them in, regenerated the fineract-client SDK, and then wrote a modern integration test (testCreateLoanRescheduleChangeEMIWithExtraTerms) bypassing the legacy RestAssured models to prove the fix works perfectly!

Checklist

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build
  • Create/update unit or integration tests
  • Follow our coding conventions
  • Add required Swagger annotation and update API documentation
  • This PR must not be a "code dump"

Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
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.

1 participant