Skip to content

FINERACT-1234: Fix disbursement validation to respect over-applied loan product configuration#5693

Open
P-ragati wants to merge 2 commits intoapache:developfrom
P-ragati:fix/sbom-error
Open

FINERACT-1234: Fix disbursement validation to respect over-applied loan product configuration#5693
P-ragati wants to merge 2 commits intoapache:developfrom
P-ragati:fix/sbom-error

Conversation

@P-ragati
Copy link
Copy Markdown

Description

Fix disbursement validation to correctly respect over-applied loan product configuration.

Previously, validation restricted disbursement strictly to the approved principal,
ignoring over-applied configuration.

This change:

  • Supports both percentage-based and absolute over-applied limits
  • Validates against total disbursed amount including capitalized income
  • Centralizes validation logic to avoid duplication
  • Maintains backward compatibility when configuration is absent

Checklist

  • Code compiles successfully
  • Changes are minimal and focused
  • Logic reused via helper method

Copilot AI review requested due to automatic review settings March 25, 2026 07:41
Copy link
Copy Markdown

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

Updates loan disbursement validation to account for loan product “over-applied” configuration (percentage/absolute) and to validate using total disbursed + capitalized income.

Changes:

  • Reworked compareDisbursedToApprovedOrProposedPrincipal() to compute a “max allowed” disbursement threshold using loan product over-applied settings.
  • Updated validateOverMaximumAmount() to apply the same threshold logic and include capitalized income in comparisons.
  • Adjusted exception messaging/arguments to report total (disbursed + capitalized income) vs the computed maximum.

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

@vidakovic
Copy link
Copy Markdown
Contributor

Please follow the rules for pull request title format: "FINERACT-1234: Your title here"... also: could you please squash the 3 commits into 1... I doubt that you want to keep all three for just a couple of changes in one file. Thanks

@P-ragati P-ragati changed the title Fix disbursement validation to respect over-applied loan product conf… FINERACT-1234: Fix disbursement validation to respect over-applied loan product configuration Mar 26, 2026
…an product configuration

- Centralized max disbursement calculation

- Respected over-applied configuration

- Removed duplicated logic

- Improved null-safety and precision
@adamsaghy
Copy link
Copy Markdown
Contributor

@P-ragati Aleks was just giving you an example, he was not asking you to use FINERACT-1234 :D

Please make sure your changes are paired with a relevant JIRA story in https://issues.apache.org/jira/projects/FINERACT/issues/

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.

4 participants