Skip to content

FINERACT-2476: Enable Group Savings Accounts as Guarantors with Guara…#5500

Closed
Abdelrahman-358 wants to merge 1 commit intoapache:developfrom
Abdelrahman-358:FINERACT-2476-enable-group-savings-as-guarantors
Closed

FINERACT-2476: Enable Group Savings Accounts as Guarantors with Guara…#5500
Abdelrahman-358 wants to merge 1 commit intoapache:developfrom
Abdelrahman-358:FINERACT-2476-enable-group-savings-as-guarantors

Conversation

@Abdelrahman-358
Copy link
Copy Markdown
Contributor

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

Your assigned reviewer(s) will follow our guidelines for code reviews.

@Abdelrahman-358
Copy link
Copy Markdown
Contributor Author

Hi @rhopman, I opened a draft PR with the proposed fix for FINERACT-2476. Could you please confirm whether this matches the intended behavior or clarify any missing requirements?

@Abdelrahman-358 Abdelrahman-358 force-pushed the FINERACT-2476-enable-group-savings-as-guarantors branch from 7d4df3d to 6612784 Compare February 15, 2026 10:40
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static Integer openGroupSavingsAccount(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please dont introduce new functionalities which are not using the fineract-client framework!

@adamsaghy
Copy link
Copy Markdown
Contributor

@rhopman @bharathc27 Can you please review the PR from business point of view?

@adamsaghy
Copy link
Copy Markdown
Contributor

@rhopman @bharathc27 Can you please review the PR from business point of view?

@rhopman
Copy link
Copy Markdown
Contributor

rhopman commented Mar 5, 2026

Hi @Abdelrahman-358! Thanks for tackling this issue. I think the approach is on the right track, but there are a few critical issues that concern me:

Validation Bypass

The hasGroupSavingsAccountGuarantor flag currently disables the self-guarantee validation entirely. This means a client could get a loan approved with:

  • Group savings guarantee: 2,500 (25% external)
  • Own funds: 0

Even if the product requires minimum own-funds. I would say the group savings should count as external guarantee, but other validation requirements should still apply.

Fix: Remove the flag and the conditional check on line 146. All validations should run normally - we're just classifying guarantees differently.

Missing Group Loan Support

I would say a group loan that has a group savings account from the same group as guarantor should count as self-guarantee. Currently, all group savings accounts are treated as external guarantee. We need to check:

if (loan.getGroupId() != null && loan.getGroupId().equals(savingsAccount.getGroupId())) {
    // Count as self-guarantee
} else {
    // Count as external guarantee
}

Business Logic

The complete logic should be:

  • Group loan with same group's savings → self-guarantee
  • Client loan with any group savings → external guarantee (you have this)
  • Group loan with different group's savings → external guarantee

Suggested Changes

  1. Remove lines 119 and 146 (the hasGroupSavingsAccountGuarantor flag and its usage)
  2. Update the classification logic (lines 128-136) to handle group loans properly
  3. Add a test for group loan + same group savings scenario
  4. (Optional) Migrate the test helper to use fineract-client instead of the deprecated approach

Let me know if you need help or clarification!

@adamsaghy
Copy link
Copy Markdown
Contributor

@Abdelrahman-358 Gentle reminder.

@Abdelrahman-358
Copy link
Copy Markdown
Contributor Author

@Abdelrahman-358 Gentle reminder.

Hi @adamsaghy , thanks for the reminder. I missed Ralph Hopman's response earlier. Sorry about that. I’ll start working on the requested updates, but I have midterm exams this week. I’ll be back with changes as soon as I’m done.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

This pull request seems to be stale. Are you still planning to work on it? We will automatically close it in 30 days.

@github-actions github-actions Bot added the stale label May 5, 2026
@rhopman
Copy link
Copy Markdown
Contributor

rhopman commented May 6, 2026

Since this PR appears to be abandoned, I've created a new one: #5827.

@github-actions github-actions Bot removed the stale label May 7, 2026
@adamsaghy adamsaghy closed this May 7, 2026
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