FINERACT-2009: Upgrade latest framework libs
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
1f3bb34e13
commit
e4944c44d6
+3
-13
@@ -22,7 +22,6 @@ import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.accounting.journalentry.domain.JournalEntry;
|
||||
import org.apache.fineract.infrastructure.event.business.BusinessEventListener;
|
||||
import org.apache.fineract.infrastructure.event.business.domain.journalentry.LoanJournalEntryCreatedBusinessEvent;
|
||||
import org.apache.fineract.infrastructure.event.business.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.investor.config.InvestorModuleIsEnabledCondition;
|
||||
@@ -46,26 +45,17 @@ public class ExternalAssetOwnerJournalEntryServiceImpl implements ExternalAssetO
|
||||
|
||||
@PostConstruct
|
||||
public void addListeners() {
|
||||
businessEventNotifierService.addPostBusinessEventListener(LoanJournalEntryCreatedBusinessEvent.class,
|
||||
new HandleLoanJournalEntryCreatedBusinessEvent());
|
||||
}
|
||||
|
||||
private final class HandleLoanJournalEntryCreatedBusinessEvent implements BusinessEventListener<LoanJournalEntryCreatedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanJournalEntryCreatedBusinessEvent event) {
|
||||
businessEventNotifierService.addPostBusinessEventListener(LoanJournalEntryCreatedBusinessEvent.class, event -> {
|
||||
JournalEntry journalEntry = event.get();
|
||||
createMapping(journalEntry);
|
||||
}
|
||||
|
||||
private void createMapping(JournalEntry journalEntry) {
|
||||
Long loanId = loanTransactionRepository.findLoanIdById(journalEntry.getLoanTransactionId()).orElseThrow();
|
||||
|
||||
externalAssetOwnerTransferLoanMappingRepository.findByLoanId(loanId).ifPresent(transferLoanMapping -> {
|
||||
ExternalAssetOwnerJournalEntryMapping mapping = new ExternalAssetOwnerJournalEntryMapping();
|
||||
mapping.setJournalEntry(journalEntry);
|
||||
mapping.setOwner(transferLoanMapping.getOwnerTransfer().getOwner());
|
||||
externalAssetOwnerJournalEntryMappingRepository.saveAndFlush(mapping);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+2
-10
@@ -21,7 +21,6 @@ package org.apache.fineract.investor.service;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.infrastructure.configuration.service.ConfigurationReadPlatformService;
|
||||
import org.apache.fineract.infrastructure.event.business.BusinessEventListener;
|
||||
import org.apache.fineract.infrastructure.event.business.domain.loan.LoanStatusChangedBusinessEvent;
|
||||
import org.apache.fineract.infrastructure.event.business.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
@@ -39,19 +38,12 @@ public class ExternalAssetOwnerLoanStatusChangePlatformServiceImpl implements Ex
|
||||
|
||||
@PostConstruct
|
||||
public void addListeners() {
|
||||
businessEventNotifierService.addPostBusinessEventListener(LoanStatusChangedBusinessEvent.class,
|
||||
new ExternalAssetOwnerLoanStatusChangedListener());
|
||||
}
|
||||
|
||||
private final class ExternalAssetOwnerLoanStatusChangedListener implements BusinessEventListener<LoanStatusChangedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanStatusChangedBusinessEvent event) {
|
||||
businessEventNotifierService.addPostBusinessEventListener(LoanStatusChangedBusinessEvent.class, event -> {
|
||||
final Loan loan = event.get();
|
||||
if (configurationReadPlatformService.retrieveGlobalConfiguration(ASSET_EXTERNALIZATION_OF_NON_ACTIVE_LOANS).isEnabled()
|
||||
&& (loan.isClosed() || loan.getStatus().isOverpaid())) {
|
||||
loanAccountOwnerTransferService.handleLoanClosedOrOverpaid(loan);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user