FINERACT-16-Cannot close Savings Account when linked to a loan even when loan status is closed
This commit is contained in:
+6
@@ -1030,6 +1030,12 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
final List<Note> relatedNotes = this.noteRepository.findByLoanId(loan.getId());
|
final List<Note> relatedNotes = this.noteRepository.findByLoanId(loan.getId());
|
||||||
this.noteRepository.deleteInBatch(relatedNotes);
|
this.noteRepository.deleteInBatch(relatedNotes);
|
||||||
|
|
||||||
|
final AccountAssociations accountAssociations = this.accountAssociationsRepository.findByLoanIdAndType(loanId,
|
||||||
|
AccountAssociationType.LINKED_ACCOUNT_ASSOCIATION.getValue());
|
||||||
|
if (accountAssociations != null) {
|
||||||
|
this.accountAssociationsRepository.delete(accountAssociations);
|
||||||
|
}
|
||||||
|
|
||||||
this.loanRepositoryWrapper.delete(loanId);
|
this.loanRepositoryWrapper.delete(loanId);
|
||||||
|
|
||||||
return new CommandProcessingResultBuilder() //
|
return new CommandProcessingResultBuilder() //
|
||||||
|
|||||||
Reference in New Issue
Block a user