FINERACT-16-Cannot close Savings Account when linked to a loan even when loan status is closed

This commit is contained in:
Nazeer Hussain Shaik
2017-01-18 14:15:41 +05:30
parent 80fada22aa
commit 633cfc7c24
@@ -1030,6 +1030,12 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
final List<Note> relatedNotes = this.noteRepository.findByLoanId(loan.getId());
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);
return new CommandProcessingResultBuilder() //