Skip to content

FINERACT-415: Enforce exact math validation for loan product mandatory guarantee - #6435

Open
Bhavya-Sonigra wants to merge 1 commit into
apache:developfrom
Bhavya-Sonigra:FINERACT-415-guarantee-validation
Open

Bhavya-Sonigra wants to merge 1 commit into
apache:developfrom
Bhavya-Sonigra:FINERACT-415-guarantee-validation

Conversation

@Bhavya-Sonigra

Copy link
Copy Markdown
Contributor

Closes FINERACT-415

Description

Updated validateGuaranteeParams in LoanProductDataValidator.java to enforce strict equality (!= 0) instead of a loose less-than check (< 0).

Previously, the Fineract API allowed loan product creation if the mandatory guarantee was strictly greater than the sum of the own funds and guarantor funds, leaving the remaining balance completely unaccounted for in the database. This patch ensures the API strictly validates that the mandatoryGuarantee is exactly equal to the sum of minimumGuaranteeFromOwnFunds and minimumGuaranteeFromGuarantor (or exactly equals one of them if the other is null/zero) before allowing creation or updates. Payload rejections now return the must.be.equal.to.sum.of.own.and.guarantor.funds error code.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • 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 our 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
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.
  • If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
  • I followed the AI Policy.

@Bhavya-Sonigra
Bhavya-Sonigra force-pushed the FINERACT-415-guarantee-validation branch from 1f8a0b7 to d48dfb3 Compare September 14, 2026 06:27
@Bhavya-Sonigra
Bhavya-Sonigra force-pushed the FINERACT-415-guarantee-validation branch from d48dfb3 to 25bd6ec Compare September 16, 2026 15:48
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