[FINERACT-1724] trigger arrears aging on LoanBalanceChangedBusinessEvent

This commit is contained in:
taskain7
2023-06-02 08:30:32 +02:00
committed by Arnold Gálovics
parent 60cb0cbe11
commit 9fe7927d7e
@@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecific
import org.apache.fineract.infrastructure.event.business.BusinessEventListener;
import org.apache.fineract.infrastructure.event.business.domain.loan.LoanAdjustTransactionBusinessEvent;
import org.apache.fineract.infrastructure.event.business.domain.loan.LoanApplyOverdueChargeBusinessEvent;
import org.apache.fineract.infrastructure.event.business.domain.loan.LoanBalanceChangedBusinessEvent;
import org.apache.fineract.infrastructure.event.business.domain.loan.LoanDisbursalBusinessEvent;
import org.apache.fineract.infrastructure.event.business.domain.loan.charge.LoanAddChargeBusinessEvent;
import org.apache.fineract.infrastructure.event.business.domain.loan.charge.LoanWaiveChargeBusinessEvent;
@@ -92,6 +93,8 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService {
businessEventNotifierService.addPostBusinessEventListener(LoanDisbursalBusinessEvent.class, new DisbursementEventListener());
businessEventNotifierService.addPostBusinessEventListener(LoanForeClosurePostBusinessEvent.class,
new LoanForeClosureEventListener());
businessEventNotifierService.addPostBusinessEventListener(LoanBalanceChangedBusinessEvent.class,
new LoanBalanceChangedEventListener());
}
@Override
@@ -523,4 +526,13 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService {
handleArrearsForLoan(loan);
}
}
private class LoanBalanceChangedEventListener implements BusinessEventListener<LoanBalanceChangedBusinessEvent> {
@Override
public void onBusinessEvent(LoanBalanceChangedBusinessEvent event) {
Loan loan = event.get();
handleArrearsForLoan(loan);
}
}
}