Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
FINERACT-3395
A loan with
createStandingInstructionAtDisbursementand a linked savings account could only be disbursed once. The second disbursement was rejected witherror.msg.loan.disbursement.unknown.data.integrity.issue.createStandingInstructioninLoanDisbursementWritePlatformServiceImplruns after every disbursement and creates an instruction named "To loan ... from savings ...". The second one gets the same name, andm_account_transfer_standing_instructions.nameis 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 doLoanAccountDisbursementToSavingsWithAutoDownPaymentTest, the threesavings.StandingInstruction*classes andLoanDisbursementWritePlatformServiceImplTest(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!
Your assigned reviewer(s) will follow our guidelines for code reviews.