Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

FINERACT-3395: Reuse the standing instruction when disbursing a later tranche - #7193

Open
jayyyyqwq wants to merge 1 commit into
apache:developfrom
jayyyyqwq:fix/FINERACT-3395-standing-instruction-second-tranche
Open

jayyyyqwq wants to merge 1 commit into
apache:developfrom
jayyyyqwq:fix/FINERACT-3395-standing-instruction-second-tranche

Conversation

@jayyyyqwq

@jayyyyqwq jayyyyqwq commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

FINERACT-3395

A loan with createStandingInstructionAtDisbursement and a linked savings account could only be disbursed once. The second disbursement was rejected with error.msg.loan.disbursement.unknown.data.integrity.issue.

createStandingInstruction in LoanDisbursementWritePlatformServiceImpl runs after every disbursement and creates an instruction named "To loan ... from savings ...". The second one gets the same name, and m_account_transfer_standing_instructions.name is unique.

It now returns without creating anything when an instruction with that name already exists. That instruction pays the loan dues, so it covers the later tranche too. A disabled instruction stays disabled. A deleted one is renamed on delete, so the next disbursement creates a new one as before.

Tests in StandingInstructionLoanAccountTest: after a second tranche one active instruction remains and the standing instruction job repays both tranches; a disabled instruction stays disabled; after deleting the instruction the second tranche creates a new one. On develop 23c0f7f the first two fail on the unique constraint and the third passes. With the change all six tests in the class pass locally on PostgreSQL, as do LoanAccountDisbursementToSavingsWithAutoDownPaymentTest, the three savings.StandingInstruction* classes and LoanDisbursementWritePlatformServiceImplTest (13 tests). I did not run the full build or the full integration suite.

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.

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

Copilot AI balanced review requested due to automatic review settings December 5, 2026 17:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

2 participants