You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ar...@apache.org on 2022/06/23 16:00:02 UTC
[fineract] branch develop updated: Putting back support for pre business events
This is an automated email from the ASF dual-hosted git repository.
arnold pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new f98681ffd Putting back support for pre business events
f98681ffd is described below
commit f98681ffdd0b43296b2dadb4618cf9e246850dcf
Author: Arnold Galovics <ga...@gmail.com>
AuthorDate: Thu Jun 23 17:00:40 2022 +0200
Putting back support for pre business events
---
.../service/EmailCampaignDomainServiceImpl.java | 13 ++--
.../sms/service/SmsCampaignDomainServiceImpl.java | 26 +++----
.../service/NotificationDomainServiceImpl.java | 47 ++++++------
...ava => LoanChargePaymentPostBusinessEvent.java} | 4 +-
...java => LoanChargePaymentPreBusinessEvent.java} | 7 +-
... LoanCreditBalanceRefundPostBusinessEvent.java} | 4 +-
...> LoanCreditBalanceRefundPreBusinessEvent.java} | 7 +-
....java => LoanForeClosurePostBusinessEvent.java} | 4 +-
...t.java => LoanForeClosurePreBusinessEvent.java} | 7 +-
.../LoanMerchantIssuedRefundBusinessEvent.java | 28 --------
.../transaction/LoanPayoutRefundBusinessEvent.java | 28 --------
.../loan/transaction/LoanRefundBusinessEvent.java | 28 --------
...Event.java => LoanRefundPostBusinessEvent.java} | 4 +-
...sEvent.java => LoanRefundPreBusinessEvent.java} | 7 +-
...ransactionGoodwillCreditPostBusinessEvent.java} | 4 +-
...TransactionGoodwillCreditPreBusinessEvent.java} | 7 +-
...TransactionMakeRepaymentPostBusinessEvent.java} | 4 +-
...nTransactionMakeRepaymentPreBusinessEvent.java} | 7 +-
...tionMerchantIssuedRefundPostBusinessEvent.java} | 4 +-
...ctionMerchantIssuedRefundPreBusinessEvent.java} | 7 +-
...nTransactionPayoutRefundPostBusinessEvent.java} | 4 +-
...anTransactionPayoutRefundPreBusinessEvent.java} | 7 +-
...ansactionRecoveryPaymentPostBusinessEvent.java} | 4 +-
...ransactionRecoveryPaymentPreBusinessEvent.java} | 7 +-
...t.java => LoanWrittenOffPostBusinessEvent.java} | 4 +-
...nt.java => LoanWrittenOffPreBusinessEvent.java} | 7 +-
.../service/BusinessEventNotifierService.java | 14 +++-
.../service/BusinessEventNotifierServiceImpl.java | 47 ++++++------
...lientWritePlatformServiceJpaRepositoryImpl.java | 8 +--
...TypesWritePlatformServiceJpaRepositoryImpl.java | 4 +-
.../domain/LoanAccountDomainServiceJpa.java | 83 ++++++++++++++++------
.../service/GuarantorDomainServiceImpl.java | 31 ++++----
...ationWritePlatformServiceJpaRepositoryImpl.java | 8 +--
.../service/LoanArrearsAgingServiceImpl.java | 49 +++++++------
.../LoanWritePlatformServiceJpaRepositoryImpl.java | 81 ++++++++++++++-------
...oductWritePlatformServiceJpaRepositoryImpl.java | 2 +-
.../domain/SavingsAccountDomainServiceJpa.java | 4 +-
...ocessWritePlatformServiceJpaRepositoryImpl.java | 4 +-
...countWritePlatformServiceJpaRepositoryImpl.java | 6 +-
...ocessWritePlatformServiceJpaRepositoryImpl.java | 6 +-
...countWritePlatformServiceJpaRepositoryImpl.java | 4 +-
...oductWritePlatformServiceJpaRepositoryImpl.java | 2 +-
42 files changed, 328 insertions(+), 305 deletions(-)
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignDomainServiceImpl.java
index a3b5fa0ad..c7c5c8c37 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignDomainServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignDomainServiceImpl.java
@@ -32,7 +32,7 @@ import org.apache.fineract.infrastructure.campaigns.sms.constants.SmsCampaignTri
import org.apache.fineract.portfolio.businessevent.BusinessEventListener;
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApprovedBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanRejectedBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMakeRepaymentPostBusinessEvent;
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
@@ -49,15 +49,16 @@ public class EmailCampaignDomainServiceImpl implements EmailCampaignDomainServic
@PostConstruct
public void addListeners() {
- businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new SendEmailOnLoanApproved());
- businessEventNotifierService.addBusinessEventListener(LoanRejectedBusinessEvent.class, new SendEmailOnLoanRejected());
- businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new SendEmailOnLoanRepayment());
+ businessEventNotifierService.addPostBusinessEventListener(LoanApprovedBusinessEvent.class, new SendEmailOnLoanApproved());
+ businessEventNotifierService.addPostBusinessEventListener(LoanRejectedBusinessEvent.class, new SendEmailOnLoanRejected());
+ businessEventNotifierService.addPostBusinessEventListener(LoanTransactionMakeRepaymentPostBusinessEvent.class,
+ new SendEmailOnLoanRepayment());
}
- private class SendEmailOnLoanRepayment implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
+ private class SendEmailOnLoanRepayment implements BusinessEventListener<LoanTransactionMakeRepaymentPostBusinessEvent> {
@Override
- public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
+ public void onBusinessEvent(LoanTransactionMakeRepaymentPostBusinessEvent event) {
LoanTransaction loanTransaction = event.get();
try {
notifyLoanOwner(loanTransaction, "Loan Repayment");
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java
index 3dff93c1b..a7b2aae0d 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java
@@ -49,7 +49,7 @@ import org.apache.fineract.portfolio.businessevent.domain.client.ClientActivateB
import org.apache.fineract.portfolio.businessevent.domain.client.ClientRejectBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApprovedBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanRejectedBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMakeRepaymentPostBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsActivateBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsRejectBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.savings.transaction.SavingsDepositBusinessEvent;
@@ -82,16 +82,18 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
@PostConstruct
public void addListeners() {
- businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new SendSmsOnLoanApproved());
- businessEventNotifierService.addBusinessEventListener(LoanRejectedBusinessEvent.class, new SendSmsOnLoanRejected());
- businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new SendSmsOnLoanRepayment());
- businessEventNotifierService.addBusinessEventListener(ClientActivateBusinessEvent.class, new ClientActivatedListener());
- businessEventNotifierService.addBusinessEventListener(ClientRejectBusinessEvent.class, new ClientRejectedListener());
- businessEventNotifierService.addBusinessEventListener(SavingsActivateBusinessEvent.class, new SavingsAccountActivatedListener());
- businessEventNotifierService.addBusinessEventListener(SavingsRejectBusinessEvent.class, new SavingsAccountRejectedListener());
- businessEventNotifierService.addBusinessEventListener(SavingsDepositBusinessEvent.class,
+ businessEventNotifierService.addPostBusinessEventListener(LoanApprovedBusinessEvent.class, new SendSmsOnLoanApproved());
+ businessEventNotifierService.addPostBusinessEventListener(LoanRejectedBusinessEvent.class, new SendSmsOnLoanRejected());
+ businessEventNotifierService.addPostBusinessEventListener(LoanTransactionMakeRepaymentPostBusinessEvent.class,
+ new SendSmsOnLoanRepayment());
+ businessEventNotifierService.addPostBusinessEventListener(ClientActivateBusinessEvent.class, new ClientActivatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(ClientRejectBusinessEvent.class, new ClientRejectedListener());
+ businessEventNotifierService.addPostBusinessEventListener(SavingsActivateBusinessEvent.class,
+ new SavingsAccountActivatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(SavingsRejectBusinessEvent.class, new SavingsAccountRejectedListener());
+ businessEventNotifierService.addPostBusinessEventListener(SavingsDepositBusinessEvent.class,
new DepositSavingsAccountTransactionListener());
- businessEventNotifierService.addBusinessEventListener(SavingsWithdrawalBusinessEvent.class,
+ businessEventNotifierService.addPostBusinessEventListener(SavingsWithdrawalBusinessEvent.class,
new NonDepositSavingsAccountTransactionListener());
}
@@ -388,10 +390,10 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
}
}
- private class SendSmsOnLoanRepayment implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
+ private class SendSmsOnLoanRepayment implements BusinessEventListener<LoanTransactionMakeRepaymentPostBusinessEvent> {
@Override
- public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
+ public void onBusinessEvent(LoanTransactionMakeRepaymentPostBusinessEvent event) {
sendSmsForLoanRepayment(event.get());
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
index d5b66c108..94ee2ac2f 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
@@ -41,7 +41,7 @@ import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCloseAsResche
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCloseBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCreatedBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.product.LoanProductCreateBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMakeRepaymentPostBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsApproveBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsCloseBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsCreateBusinessEvent;
@@ -76,29 +76,32 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
@PostConstruct
public void addListeners() {
- businessEventNotifierService.addBusinessEventListener(ClientCreateBusinessEvent.class, new ClientCreatedListener());
- businessEventNotifierService.addBusinessEventListener(SavingsApproveBusinessEvent.class, new SavingsAccountApprovedListener());
- businessEventNotifierService.addBusinessEventListener(CentersCreateBusinessEvent.class, new CenterCreatedListener());
- businessEventNotifierService.addBusinessEventListener(GroupsCreateBusinessEvent.class, new GroupCreatedListener());
- businessEventNotifierService.addBusinessEventListener(SavingsDepositBusinessEvent.class, new SavingsAccountDepositListener());
- businessEventNotifierService.addBusinessEventListener(ShareProductDividentsCreateBusinessEvent.class,
+ businessEventNotifierService.addPostBusinessEventListener(ClientCreateBusinessEvent.class, new ClientCreatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(SavingsApproveBusinessEvent.class, new SavingsAccountApprovedListener());
+ businessEventNotifierService.addPostBusinessEventListener(CentersCreateBusinessEvent.class, new CenterCreatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(GroupsCreateBusinessEvent.class, new GroupCreatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(SavingsDepositBusinessEvent.class, new SavingsAccountDepositListener());
+ businessEventNotifierService.addPostBusinessEventListener(ShareProductDividentsCreateBusinessEvent.class,
new ShareProductDividendCreatedListener());
- businessEventNotifierService.addBusinessEventListener(FixedDepositAccountCreateBusinessEvent.class,
+ businessEventNotifierService.addPostBusinessEventListener(FixedDepositAccountCreateBusinessEvent.class,
new FixedDepositAccountCreatedListener());
- businessEventNotifierService.addBusinessEventListener(RecurringDepositAccountCreateBusinessEvent.class,
+ businessEventNotifierService.addPostBusinessEventListener(RecurringDepositAccountCreateBusinessEvent.class,
new RecurringDepositAccountCreatedListener());
- businessEventNotifierService.addBusinessEventListener(SavingsPostInterestBusinessEvent.class, new SavingsPostInterestListener());
- businessEventNotifierService.addBusinessEventListener(LoanCreatedBusinessEvent.class, new LoanCreatedListener());
- businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new LoanApprovedListener());
- businessEventNotifierService.addBusinessEventListener(LoanCloseBusinessEvent.class, new LoanClosedListener());
- businessEventNotifierService.addBusinessEventListener(LoanCloseAsRescheduleBusinessEvent.class,
+ businessEventNotifierService.addPostBusinessEventListener(SavingsPostInterestBusinessEvent.class,
+ new SavingsPostInterestListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanCreatedBusinessEvent.class, new LoanCreatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanApprovedBusinessEvent.class, new LoanApprovedListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanCloseBusinessEvent.class, new LoanClosedListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanCloseAsRescheduleBusinessEvent.class,
new LoanCloseAsRescheduledListener());
- businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new LoanMakeRepaymentListener());
- businessEventNotifierService.addBusinessEventListener(LoanProductCreateBusinessEvent.class, new LoanProductCreatedListener());
- businessEventNotifierService.addBusinessEventListener(SavingsCreateBusinessEvent.class, new SavingsAccountCreatedListener());
- businessEventNotifierService.addBusinessEventListener(SavingsCloseBusinessEvent.class, new SavingsAccountClosedListener());
- businessEventNotifierService.addBusinessEventListener(ShareAccountCreateBusinessEvent.class, new ShareAccountCreatedListener());
- businessEventNotifierService.addBusinessEventListener(ShareAccountApproveBusinessEvent.class, new ShareAccountApprovedListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanTransactionMakeRepaymentPostBusinessEvent.class,
+ new LoanMakeRepaymentListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanProductCreateBusinessEvent.class, new LoanProductCreatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(SavingsCreateBusinessEvent.class, new SavingsAccountCreatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(SavingsCloseBusinessEvent.class, new SavingsAccountClosedListener());
+ businessEventNotifierService.addPostBusinessEventListener(ShareAccountCreateBusinessEvent.class, new ShareAccountCreatedListener());
+ businessEventNotifierService.addPostBusinessEventListener(ShareAccountApproveBusinessEvent.class,
+ new ShareAccountApprovedListener());
}
private class ClientCreatedListener implements BusinessEventListener<ClientCreateBusinessEvent> {
@@ -244,10 +247,10 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
}
}
- private class LoanMakeRepaymentListener implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
+ private class LoanMakeRepaymentListener implements BusinessEventListener<LoanTransactionMakeRepaymentPostBusinessEvent> {
@Override
- public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
+ public void onBusinessEvent(LoanTransactionMakeRepaymentPostBusinessEvent event) {
Loan loan = event.get().getLoan();
buildNotification("READ_LOAN", "loan", loan.getId(), "Repayment made", "repaymentMade", context.authenticatedUser().getId(),
loan.getOfficeId());
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanMakeRepaymentBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentPostBusinessEvent.java
similarity index 86%
rename from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanMakeRepaymentBusinessEvent.java
rename to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentPostBusinessEvent.java
index cbe4d9835..b0194a2f1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanMakeRepaymentBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanMakeRepaymentBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanChargePaymentPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanMakeRepaymentBusinessEvent(LoanTransaction value) {
+ public LoanChargePaymentPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentPreBusinessEvent.java
similarity index 76%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentPreBusinessEvent.java
index b2438a880..fe287cc98 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanChargePaymentPreBusinessEvent extends LoanBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanChargePaymentPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundPostBusinessEvent.java
similarity index 85%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundPostBusinessEvent.java
index b2438a880..1ac43e06b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanCreditBalanceRefundPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanCreditBalanceRefundPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosureBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundPreBusinessEvent.java
similarity index 77%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosureBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundPreBusinessEvent.java
index fa277a80f..97a1263b5 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosureBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanForeClosureBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanCreditBalanceRefundPreBusinessEvent extends LoanBusinessEvent {
- public LoanForeClosureBusinessEvent(LoanTransaction value) {
+ public LoanCreditBalanceRefundPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRecoveryPaymentBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosurePostBusinessEvent.java
similarity index 88%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRecoveryPaymentBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosurePostBusinessEvent.java
index 6445f18ce..7ec43045a 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRecoveryPaymentBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosurePostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanRecoveryPaymentBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanForeClosurePostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanRecoveryPaymentBusinessEvent(LoanTransaction value) {
+ public LoanForeClosurePostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosurePreBusinessEvent.java
similarity index 76%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosurePreBusinessEvent.java
index b2438a880..0f6279d49 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosurePreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanForeClosurePreBusinessEvent extends LoanBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanForeClosurePreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanMerchantIssuedRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanMerchantIssuedRefundBusinessEvent.java
deleted file mode 100644
index aa8c853f3..000000000
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanMerchantIssuedRefundBusinessEvent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-
-public class LoanMerchantIssuedRefundBusinessEvent extends LoanTransactionBusinessEvent {
-
- public LoanMerchantIssuedRefundBusinessEvent(LoanTransaction value) {
- super(value);
- }
-}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanPayoutRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanPayoutRefundBusinessEvent.java
deleted file mode 100644
index 00a294f6f..000000000
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanPayoutRefundBusinessEvent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-
-public class LoanPayoutRefundBusinessEvent extends LoanTransactionBusinessEvent {
-
- public LoanPayoutRefundBusinessEvent(LoanTransaction value) {
- super(value);
- }
-}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundBusinessEvent.java
deleted file mode 100644
index f50de7a00..000000000
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundBusinessEvent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-
-public class LoanRefundBusinessEvent extends LoanTransactionBusinessEvent {
-
- public LoanRefundBusinessEvent(LoanTransaction value) {
- super(value);
- }
-}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundPostBusinessEvent.java
similarity index 88%
rename from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffBusinessEvent.java
rename to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundPostBusinessEvent.java
index 8e49123c1..d71cee248 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanWrittenOffBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanRefundPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanWrittenOffBusinessEvent(LoanTransaction value) {
+ public LoanRefundPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundPreBusinessEvent.java
similarity index 77%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundPreBusinessEvent.java
index b2438a880..20c81c5b8 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRefundPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanRefundPreBusinessEvent extends LoanBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanRefundPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionGoodwillCreditPostBusinessEvent.java
similarity index 84%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionGoodwillCreditPostBusinessEvent.java
index b2438a880..c9bb1a0f2 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionGoodwillCreditPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionGoodwillCreditPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanTransactionGoodwillCreditPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionGoodwillCreditPreBusinessEvent.java
similarity index 75%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionGoodwillCreditPreBusinessEvent.java
index b2438a880..fa93ef28e 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionGoodwillCreditPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionGoodwillCreditPreBusinessEvent extends LoanBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanTransactionGoodwillCreditPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMakeRepaymentPostBusinessEvent.java
similarity index 84%
rename from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentBusinessEvent.java
rename to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMakeRepaymentPostBusinessEvent.java
index 666feb8d2..7f1439f9a 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanChargePaymentBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMakeRepaymentPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanChargePaymentBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionMakeRepaymentPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanChargePaymentBusinessEvent(LoanTransaction value) {
+ public LoanTransactionMakeRepaymentPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMakeRepaymentPreBusinessEvent.java
similarity index 75%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMakeRepaymentPreBusinessEvent.java
index b2438a880..64f837e56 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMakeRepaymentPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionMakeRepaymentPreBusinessEvent extends LoanBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanTransactionMakeRepaymentPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPostBusinessEvent.java
similarity index 83%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPostBusinessEvent.java
index b2438a880..8f7415104 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionMerchantIssuedRefundPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanTransactionMerchantIssuedRefundPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPreBusinessEvent.java
similarity index 74%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPreBusinessEvent.java
index b2438a880..3ee3faa04 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionMerchantIssuedRefundPreBusinessEvent extends LoanBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanTransactionMerchantIssuedRefundPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosureBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionPayoutRefundPostBusinessEvent.java
similarity index 84%
rename from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosureBusinessEvent.java
rename to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionPayoutRefundPostBusinessEvent.java
index fa277a80f..0b777a5df 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanForeClosureBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionPayoutRefundPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanForeClosureBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionPayoutRefundPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanForeClosureBusinessEvent(LoanTransaction value) {
+ public LoanTransactionPayoutRefundPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRecoveryPaymentBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionPayoutRefundPreBusinessEvent.java
similarity index 75%
rename from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRecoveryPaymentBusinessEvent.java
rename to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionPayoutRefundPreBusinessEvent.java
index 6445f18ce..dbc51cfda 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanRecoveryPaymentBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionPayoutRefundPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanRecoveryPaymentBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionPayoutRefundPreBusinessEvent extends LoanBusinessEvent {
- public LoanRecoveryPaymentBusinessEvent(LoanTransaction value) {
+ public LoanTransactionPayoutRefundPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionRecoveryPaymentPostBusinessEvent.java
similarity index 84%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionRecoveryPaymentPostBusinessEvent.java
index b2438a880..44cccfb27 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionRecoveryPaymentPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionRecoveryPaymentPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanTransactionRecoveryPaymentPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionRecoveryPaymentPreBusinessEvent.java
similarity index 75%
copy from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
copy to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionRecoveryPaymentPreBusinessEvent.java
index b2438a880..657e327d4 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanTransactionRecoveryPaymentPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanTransactionRecoveryPaymentPreBusinessEvent extends LoanBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanTransactionRecoveryPaymentPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanGoodwillCreditBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffPostBusinessEvent.java
similarity index 88%
rename from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanGoodwillCreditBusinessEvent.java
rename to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffPostBusinessEvent.java
index 9ff4b81d2..5637f9696 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanGoodwillCreditBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffPostBusinessEvent.java
@@ -20,9 +20,9 @@ package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
-public class LoanGoodwillCreditBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanWrittenOffPostBusinessEvent extends LoanTransactionBusinessEvent {
- public LoanGoodwillCreditBusinessEvent(LoanTransaction value) {
+ public LoanWrittenOffPostBusinessEvent(LoanTransaction value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffPreBusinessEvent.java
similarity index 77%
rename from fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
rename to fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffPreBusinessEvent.java
index b2438a880..9e51d1f4d 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanCreditBalanceRefundBusinessEvent.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/domain/loan/transaction/LoanWrittenOffPreBusinessEvent.java
@@ -18,11 +18,12 @@
*/
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
-import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.loanaccount.domain.Loan;
-public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
+public class LoanWrittenOffPreBusinessEvent extends LoanBusinessEvent {
- public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
+ public LoanWrittenOffPreBusinessEvent(Loan value) {
super(value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/service/BusinessEventNotifierService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/service/BusinessEventNotifierService.java
index dffe2acdc..f4b00f1c1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/service/BusinessEventNotifierService.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/service/BusinessEventNotifierService.java
@@ -27,14 +27,24 @@ import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
*/
public interface BusinessEventNotifierService {
+ /**
+ * Method should be called to notify listeners after Business event execution for any pre-processing of event
+ */
+ void notifyPreBusinessEvent(BusinessEvent<?> businessEvent);
+
/**
* Method should be called to notify listeners after Business event execution for any post-processing of event
*/
- void notifyBusinessEvent(BusinessEvent<?> businessEvent);
+ void notifyPostBusinessEvent(BusinessEvent<?> businessEvent);
+
+ /**
+ * Method is to register a class as listener for pre-processing of any Business event
+ */
+ <T extends BusinessEvent<?>> void addPreBusinessEventListener(Class<T> eventType, BusinessEventListener<T> listener);
/**
* Method is to register a class as listener for post-processing of any Business event
*/
- <T extends BusinessEvent<?>> void addBusinessEventListener(Class<T> eventType, BusinessEventListener<T> listener);
+ <T extends BusinessEvent<?>> void addPostBusinessEventListener(Class<T> eventType, BusinessEventListener<T> listener);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/service/BusinessEventNotifierServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/service/BusinessEventNotifierServiceImpl.java
index e95a236e8..dcc4af8d1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/service/BusinessEventNotifierServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/businessevent/service/BusinessEventNotifierServiceImpl.java
@@ -30,18 +30,12 @@ import org.springframework.stereotype.Service;
@SuppressWarnings({ "unchecked", "rawtypes" })
public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierService {
- private final Map<Class, List<BusinessEventListener>> listeners = new HashMap<>();
+ private final Map<Class, List<BusinessEventListener>> preListeners = new HashMap<>();
+ private final Map<Class, List<BusinessEventListener>> postListeners = new HashMap<>();
- /*
- * (non-Javadoc)
- *
- * @see org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService
- * #notifyBusinessEventWasExecuted (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants
- * .BusinessEvents, org.springframework.data.jpa.domain.AbstractPersistable)
- */
@Override
- public void notifyBusinessEvent(BusinessEvent<?> businessEvent) {
- List<BusinessEventListener> businessEventListeners = listeners.get(businessEvent.getClass());
+ public void notifyPreBusinessEvent(BusinessEvent<?> businessEvent) {
+ List<BusinessEventListener> businessEventListeners = preListeners.get(businessEvent.getClass());
if (businessEventListeners != null) {
for (BusinessEventListener eventListener : businessEventListeners) {
eventListener.onBusinessEvent(businessEvent);
@@ -49,19 +43,32 @@ public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierSe
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService
- * #addBusinessEventPostListeners (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants
- * .BusinessEvents, org.apache.fineract.portfolio.businessevent.BusinessEventListener)
- */
@Override
- public <T extends BusinessEvent<?>> void addBusinessEventListener(Class<T> eventType, BusinessEventListener<T> listener) {
- List<BusinessEventListener> businessEventListeners = listeners.get(eventType);
+ public <T extends BusinessEvent<?>> void addPreBusinessEventListener(Class<T> eventType, BusinessEventListener<T> listener) {
+ List<BusinessEventListener> businessEventListeners = preListeners.get(eventType);
if (businessEventListeners == null) {
businessEventListeners = new ArrayList<>();
- listeners.put(eventType, businessEventListeners);
+ preListeners.put(eventType, businessEventListeners);
+ }
+ businessEventListeners.add(listener);
+ }
+
+ @Override
+ public void notifyPostBusinessEvent(BusinessEvent<?> businessEvent) {
+ List<BusinessEventListener> businessEventListeners = postListeners.get(businessEvent.getClass());
+ if (businessEventListeners != null) {
+ for (BusinessEventListener eventListener : businessEventListeners) {
+ eventListener.onBusinessEvent(businessEvent);
+ }
+ }
+ }
+
+ @Override
+ public <T extends BusinessEvent<?>> void addPostBusinessEventListener(Class<T> eventType, BusinessEventListener<T> listener) {
+ List<BusinessEventListener> businessEventListeners = postListeners.get(eventType);
+ if (businessEventListeners == null) {
+ businessEventListeners = new ArrayList<>();
+ postListeners.put(eventType, businessEventListeners);
}
businessEventListeners.add(listener);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java
index 270084f14..978943f89 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java
@@ -303,7 +303,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
this.clientRepository.saveAndFlush(newClient);
if (newClient.isActive()) {
- businessEventNotifierService.notifyBusinessEvent(new ClientActivateBusinessEvent(newClient));
+ businessEventNotifierService.notifyPostBusinessEvent(new ClientActivateBusinessEvent(newClient));
}
if (newClient.isAccountNumberRequiresAutoGeneration()) {
AccountNumberFormat accountNumberFormat = this.accountNumberFormatRepository.findByAccountType(EntityAccountType.CLIENT);
@@ -337,7 +337,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
command.arrayOfParameterNamed(ClientApiConstants.datatables));
}
- businessEventNotifierService.notifyBusinessEvent(new ClientCreateBusinessEvent(newClient));
+ businessEventNotifierService.notifyPostBusinessEvent(new ClientCreateBusinessEvent(newClient));
entityDatatableChecksWritePlatformService.runTheCheck(newClient.getId(), EntityTables.CLIENT.getName(),
StatusEnum.CREATE.getCode().longValue(), EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable());
@@ -591,7 +591,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
client.activate(currentUser, fmt, activationDate);
CommandProcessingResult result = openSavingsAccount(client, fmt);
clientRepository.saveAndFlush(client);
- businessEventNotifierService.notifyBusinessEvent(new ClientActivateBusinessEvent(client));
+ businessEventNotifierService.notifyPostBusinessEvent(new ClientActivateBusinessEvent(client));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withOfficeId(client.officeId()) //
@@ -845,7 +845,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
}
client.reject(currentUser, rejectionReason, Date.from(rejectionDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
clientRepository.saveAndFlush(client);
- businessEventNotifierService.notifyBusinessEvent(new ClientRejectBusinessEvent(client));
+ businessEventNotifierService.notifyPostBusinessEvent(new ClientRejectBusinessEvent(client));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withClientId(entityId) //
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java
index 1d3fe226d..46cd443ee 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java
@@ -257,7 +257,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
CommandProcessingResult commandProcessingResult = createGroupingType(command, GroupTypes.CENTER, centerId);
- businessEventNotifierService.notifyBusinessEvent(new CentersCreateBusinessEvent(commandProcessingResult));
+ businessEventNotifierService.notifyPostBusinessEvent(new CentersCreateBusinessEvent(commandProcessingResult));
return commandProcessingResult;
}
@@ -274,7 +274,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
CommandProcessingResult commandProcessingResult = createGroupingType(command, GroupTypes.GROUP, centerId);
- businessEventNotifierService.notifyBusinessEvent(new GroupsCreateBusinessEvent(commandProcessingResult));
+ businessEventNotifierService.notifyPostBusinessEvent(new GroupsCreateBusinessEvent(commandProcessingResult));
return commandProcessingResult;
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java
index 3b2370011..41b2f1236 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAccountDomainServiceJpa.java
@@ -58,16 +58,26 @@ import org.apache.fineract.portfolio.account.domain.AccountTransferTransaction;
import org.apache.fineract.portfolio.account.domain.StandingInstructionRepository;
import org.apache.fineract.portfolio.account.domain.StandingInstructionStatus;
import org.apache.fineract.portfolio.accountdetails.domain.AccountType;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanChargePaymentBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanCreditBalanceRefundBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanForeClosureBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanGoodwillCreditBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMerchantIssuedRefundBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanPayoutRefundBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRecoveryPaymentBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRefundBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanChargePaymentPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanChargePaymentPreBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanCreditBalanceRefundPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanCreditBalanceRefundPreBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanForeClosurePostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanForeClosurePreBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRefundPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRefundPreBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionGoodwillCreditPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionGoodwillCreditPreBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMakeRepaymentPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMakeRepaymentPreBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMerchantIssuedRefundPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMerchantIssuedRefundPreBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionPayoutRefundPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionPayoutRefundPreBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionRecoveryPaymentPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionRecoveryPaymentPreBusinessEvent;
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
import org.apache.fineract.portfolio.client.domain.Client;
import org.apache.fineract.portfolio.client.exception.ClientNotActiveException;
@@ -151,6 +161,9 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
AppUser currentUser = getAppUserIfPresent();
checkClientOrGroupActive(loan);
+ LoanBusinessEvent repaymentEvent = getLoanRepaymentTypeBusinessEvent(repaymentTransactionType, isRecoveryRepayment, loan);
+ businessEventNotifierService.notifyPreBusinessEvent(repaymentEvent);
+
// TODO: Is it required to validate transaction date with meeting dates
// if repayments is synced with meeting?
/*
@@ -213,9 +226,9 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
recalculateAccruals(loan);
- LoanTransactionBusinessEvent repaymentEvent = getRepaymentTypeBusinessEvent(repaymentTransactionType, isRecoveryRepayment,
- newRepaymentTransaction);
- businessEventNotifierService.notifyBusinessEvent(repaymentEvent);
+ LoanTransactionBusinessEvent transactionRepaymentEvent = getTransactionRepaymentTypeBusinessEvent(repaymentTransactionType,
+ isRecoveryRepayment, newRepaymentTransaction);
+ businessEventNotifierService.notifyPostBusinessEvent(transactionRepaymentEvent);
// disable all active standing orders linked to this loan if status
// changes to closed
@@ -256,19 +269,36 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
return newRepaymentTransaction;
}
- private LoanTransactionBusinessEvent getRepaymentTypeBusinessEvent(LoanTransactionType repaymentTransactionType,
+ private LoanBusinessEvent getLoanRepaymentTypeBusinessEvent(LoanTransactionType repaymentTransactionType, boolean isRecoveryRepayment,
+ Loan loan) {
+ LoanBusinessEvent repaymentEvent = null;
+ if (repaymentTransactionType.isRepayment()) {
+ repaymentEvent = new LoanTransactionMakeRepaymentPreBusinessEvent(loan);
+ } else if (repaymentTransactionType.isMerchantIssuedRefund()) {
+ repaymentEvent = new LoanTransactionMerchantIssuedRefundPreBusinessEvent(loan);
+ } else if (repaymentTransactionType.isPayoutRefund()) {
+ repaymentEvent = new LoanTransactionPayoutRefundPreBusinessEvent(loan);
+ } else if (repaymentTransactionType.isGoodwillCredit()) {
+ repaymentEvent = new LoanTransactionGoodwillCreditPreBusinessEvent(loan);
+ } else if (isRecoveryRepayment) {
+ repaymentEvent = new LoanTransactionRecoveryPaymentPreBusinessEvent(loan);
+ }
+ return repaymentEvent;
+ }
+
+ private LoanTransactionBusinessEvent getTransactionRepaymentTypeBusinessEvent(LoanTransactionType repaymentTransactionType,
boolean isRecoveryRepayment, LoanTransaction transaction) {
LoanTransactionBusinessEvent repaymentEvent = null;
if (repaymentTransactionType.isRepayment()) {
- repaymentEvent = new LoanMakeRepaymentBusinessEvent(transaction);
+ repaymentEvent = new LoanTransactionMakeRepaymentPostBusinessEvent(transaction);
} else if (repaymentTransactionType.isMerchantIssuedRefund()) {
- repaymentEvent = new LoanMerchantIssuedRefundBusinessEvent(transaction);
+ repaymentEvent = new LoanTransactionMerchantIssuedRefundPostBusinessEvent(transaction);
} else if (repaymentTransactionType.isPayoutRefund()) {
- repaymentEvent = new LoanPayoutRefundBusinessEvent(transaction);
+ repaymentEvent = new LoanTransactionPayoutRefundPostBusinessEvent(transaction);
} else if (repaymentTransactionType.isGoodwillCredit()) {
- repaymentEvent = new LoanGoodwillCreditBusinessEvent(transaction);
+ repaymentEvent = new LoanTransactionGoodwillCreditPostBusinessEvent(transaction);
} else if (isRecoveryRepayment) {
- repaymentEvent = new LoanRecoveryPaymentBusinessEvent(transaction);
+ repaymentEvent = new LoanTransactionRecoveryPaymentPostBusinessEvent(transaction);
}
return repaymentEvent;
}
@@ -334,6 +364,8 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
AppUser currentUser = getAppUserIfPresent();
boolean isAccountTransfer = true;
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanChargePaymentPreBusinessEvent(loan));
+
final List<Long> existingTransactionIds = new ArrayList<>();
final List<Long> existingReversedTransactionIds = new ArrayList<>();
@@ -368,7 +400,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, isAccountTransfer);
recalculateAccruals(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanChargePaymentBusinessEvent(newPaymentTransaction));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanChargePaymentPostBusinessEvent(newPaymentTransaction));
return newPaymentTransaction;
}
@@ -417,6 +449,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
boolean isAccountTransfer = true;
final Loan loan = this.loanAccountAssembler.assembleFrom(accountId);
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanRefundPreBusinessEvent(loan));
final List<Long> existingTransactionIds = new ArrayList<>();
final List<Long> existingReversedTransactionIds = new ArrayList<>();
@@ -441,7 +474,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
}
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, isAccountTransfer);
- businessEventNotifierService.notifyBusinessEvent(new LoanRefundBusinessEvent(newRefundTransaction));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanRefundPostBusinessEvent(newRefundTransaction));
builderResult.withEntityId(newRefundTransaction.getId()).withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId())
.withGroupId(loan.getGroupId());
@@ -610,6 +643,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
public CommandProcessingResultBuilder creditBalanceRefund(Long loanId, LocalDate transactionDate, BigDecimal transactionAmount,
String noteText, String externalId) {
final Loan loan = this.loanAccountAssembler.assembleFrom(loanId);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanCreditBalanceRefundPreBusinessEvent(loan));
final List<Long> existingTransactionIds = new ArrayList<>();
final List<Long> existingReversedTransactionIds = new ArrayList<>();
AppUser currentUser = getAppUserIfPresent();
@@ -630,7 +664,8 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, false);
recalculateAccruals(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanCreditBalanceRefundBusinessEvent(newCreditBalanceRefundTransaction));
+ businessEventNotifierService
+ .notifyPostBusinessEvent(new LoanCreditBalanceRefundPostBusinessEvent(newCreditBalanceRefundTransaction));
return new CommandProcessingResultBuilder().withEntityId(newCreditBalanceRefundTransaction.getId()) //
.withOfficeId(loan.getOfficeId()) //
@@ -643,6 +678,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
BigDecimal transactionAmount, PaymentDetail paymentDetail, String noteText, String txnExternalId) {
final Loan loan = this.loanAccountAssembler.assembleFrom(accountId);
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanRefundPreBusinessEvent(loan));
final List<Long> existingTransactionIds = new ArrayList<>();
final List<Long> existingReversedTransactionIds = new ArrayList<>();
AppUser currentUser = getAppUserIfPresent();
@@ -668,7 +704,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, false);
recalculateAccruals(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanRefundBusinessEvent(newRefundTransaction));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanRefundPostBusinessEvent(newRefundTransaction));
builderResult.withEntityId(newRefundTransaction.getId()).withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId())
.withGroupId(loan.getGroupId());
@@ -678,6 +714,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
@Override
public Map<String, Object> foreCloseLoan(final Loan loan, final LocalDate foreClosureDate, final String noteText) {
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanForeClosurePreBusinessEvent(loan));
MonetaryCurrency currency = loan.getCurrency();
LocalDateTime createdDate = DateUtils.getLocalDateTimeOfTenant();
final Map<String, Object> changes = new LinkedHashMap<>();
@@ -776,7 +813,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
}
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, false);
- businessEventNotifierService.notifyBusinessEvent(new LoanForeClosureBusinessEvent(payment));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanForeClosurePostBusinessEvent(payment));
return changes;
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java
index 51a69ded5..442c95d4b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/guarantor/service/GuarantorDomainServiceImpl.java
@@ -44,9 +44,9 @@ import org.apache.fineract.portfolio.businessevent.domain.loan.LoanAdjustTransac
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApprovedBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanUndoApprovalBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanUndoDisbursalBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMakeRepaymentPostBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanUndoWrittenOffBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWrittenOffBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWrittenOffPostBusinessEvent;
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
@@ -83,14 +83,17 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService {
@PostConstruct
public void addListeners() {
- businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new ValidateOnBusinessEvent());
- businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new HoldFundsOnBusinessEvent());
- businessEventNotifierService.addBusinessEventListener(LoanUndoApprovalBusinessEvent.class, new UndoAllFundTransactions());
- businessEventNotifierService.addBusinessEventListener(LoanUndoDisbursalBusinessEvent.class, new ReverseAllFundsOnBusinessEvent());
- businessEventNotifierService.addBusinessEventListener(LoanAdjustTransactionBusinessEvent.class, new AdjustFundsOnBusinessEvent());
- businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new ReleaseFundsOnBusinessEvent());
- businessEventNotifierService.addBusinessEventListener(LoanWrittenOffBusinessEvent.class, new ReleaseAllFunds());
- businessEventNotifierService.addBusinessEventListener(LoanUndoWrittenOffBusinessEvent.class, new ReverseFundsOnBusinessEvent());
+ businessEventNotifierService.addPostBusinessEventListener(LoanApprovedBusinessEvent.class, new ValidateOnBusinessEvent());
+ businessEventNotifierService.addPostBusinessEventListener(LoanApprovedBusinessEvent.class, new HoldFundsOnBusinessEvent());
+ businessEventNotifierService.addPostBusinessEventListener(LoanUndoApprovalBusinessEvent.class, new UndoAllFundTransactions());
+ businessEventNotifierService.addPostBusinessEventListener(LoanUndoDisbursalBusinessEvent.class,
+ new ReverseAllFundsOnBusinessEvent());
+ businessEventNotifierService.addPostBusinessEventListener(LoanAdjustTransactionBusinessEvent.class,
+ new AdjustFundsOnBusinessEvent());
+ businessEventNotifierService.addPostBusinessEventListener(LoanTransactionMakeRepaymentPostBusinessEvent.class,
+ new ReleaseFundsOnBusinessEvent());
+ businessEventNotifierService.addPostBusinessEventListener(LoanWrittenOffPostBusinessEvent.class, new ReleaseAllFunds());
+ businessEventNotifierService.addPostBusinessEventListener(LoanUndoWrittenOffBusinessEvent.class, new ReverseFundsOnBusinessEvent());
}
@Override
@@ -528,10 +531,10 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService {
}
}
- private class ReleaseFundsOnBusinessEvent implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
+ private class ReleaseFundsOnBusinessEvent implements BusinessEventListener<LoanTransactionMakeRepaymentPostBusinessEvent> {
@Override
- public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
+ public void onBusinessEvent(LoanTransactionMakeRepaymentPostBusinessEvent event) {
LoanTransaction loanTransaction = event.get();
if (releaseLoanIds.containsKey(loanTransaction.getLoan().getId())) {
completeGuarantorFund(loanTransaction);
@@ -589,10 +592,10 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService {
}
}
- private class ReleaseAllFunds implements BusinessEventListener<LoanWrittenOffBusinessEvent> {
+ private class ReleaseAllFunds implements BusinessEventListener<LoanWrittenOffPostBusinessEvent> {
@Override
- public void onBusinessEvent(LoanWrittenOffBusinessEvent event) {
+ public void onBusinessEvent(LoanWrittenOffPostBusinessEvent event) {
LoanTransaction loanTransaction = event.get();
releaseAllGuarantors(loanTransaction);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java
index f4281ca03..368e45bcb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanApplicationWritePlatformServiceJpaRepositoryImpl.java
@@ -590,7 +590,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
StatusEnum.CREATE.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(),
newLoanApplication.productId());
- businessEventNotifierService.notifyBusinessEvent(new LoanCreatedBusinessEvent(newLoanApplication));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanCreatedBusinessEvent(newLoanApplication));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
@@ -1477,7 +1477,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
this.noteRepository.save(note);
}
- businessEventNotifierService.notifyBusinessEvent(new LoanApprovedBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanApprovedBusinessEvent(loan));
}
return new CommandProcessingResultBuilder() //
@@ -1555,7 +1555,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
final Note note = Note.loanNote(loan, noteText);
this.noteRepository.save(note);
}
- businessEventNotifierService.notifyBusinessEvent(new LoanUndoApprovalBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanUndoApprovalBusinessEvent(loan));
}
return new CommandProcessingResultBuilder() //
@@ -1625,7 +1625,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
this.noteRepository.save(note);
}
}
- businessEventNotifierService.notifyBusinessEvent(new LoanRejectedBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanRejectedBusinessEvent(loan));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withEntityId(loan.getId()) //
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java
index ac3076c08..bedca8d9e 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java
@@ -42,10 +42,10 @@ import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApplyOverdueC
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanDisbursalBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanAddChargeBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanWaiveChargeBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanChargePaymentBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanForeClosureBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRefundBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanChargePaymentPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanForeClosurePostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRefundPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionMakeRepaymentPostBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanUndoWrittenOffBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWaiveInterestBusinessEvent;
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
@@ -74,19 +74,22 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService {
@PostConstruct
public void registerForNotification() {
- businessEventNotifierService.addBusinessEventListener(LoanRefundBusinessEvent.class, new RefundEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanAdjustTransactionBusinessEvent.class,
+ businessEventNotifierService.addPostBusinessEventListener(LoanRefundPostBusinessEvent.class, new RefundEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanAdjustTransactionBusinessEvent.class,
new AdjustTransactionBusinessEventEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new MakeRepaymentEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanUndoWrittenOffBusinessEvent.class, new UndoWrittenOffEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanWaiveInterestBusinessEvent.class, new WaiveInterestEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanAddChargeBusinessEvent.class, new AddChargeEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanWaiveChargeBusinessEvent.class, new WaiveChargeEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanChargePaymentBusinessEvent.class, new LoanChargePaymentEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanApplyOverdueChargeBusinessEvent.class,
+ businessEventNotifierService.addPostBusinessEventListener(LoanTransactionMakeRepaymentPostBusinessEvent.class,
+ new MakeRepaymentEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanUndoWrittenOffBusinessEvent.class, new UndoWrittenOffEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanWaiveInterestBusinessEvent.class, new WaiveInterestEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanAddChargeBusinessEvent.class, new AddChargeEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanWaiveChargeBusinessEvent.class, new WaiveChargeEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanChargePaymentPostBusinessEvent.class,
+ new LoanChargePaymentEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanApplyOverdueChargeBusinessEvent.class,
new ApplyOverdueChargeEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanDisbursalBusinessEvent.class, new DisbursementEventListener());
- businessEventNotifierService.addBusinessEventListener(LoanForeClosureBusinessEvent.class, new LoanForeClosureEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanDisbursalBusinessEvent.class, new DisbursementEventListener());
+ businessEventNotifierService.addPostBusinessEventListener(LoanForeClosurePostBusinessEvent.class,
+ new LoanForeClosureEventListener());
}
@Transactional
@@ -487,11 +490,11 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService {
}
}
- private class RefundEventListener implements BusinessEventListener<LoanRefundBusinessEvent> {
+ private class RefundEventListener implements BusinessEventListener<LoanRefundPostBusinessEvent> {
@SuppressWarnings("unused")
@Override
- public void onBusinessEvent(LoanRefundBusinessEvent event) {
+ public void onBusinessEvent(LoanRefundPostBusinessEvent event) {
LoanTransaction loanTransaction = event.get();
Loan loan = loanTransaction.getLoan();
handleArrearsForLoan(loan);
@@ -511,10 +514,10 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService {
}
}
- private class MakeRepaymentEventListener implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
+ private class MakeRepaymentEventListener implements BusinessEventListener<LoanTransactionMakeRepaymentPostBusinessEvent> {
@Override
- public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
+ public void onBusinessEvent(LoanTransactionMakeRepaymentPostBusinessEvent event) {
LoanTransaction loanTransaction = event.get();
Loan loan = loanTransaction.getLoan();
handleArrearsForLoan(loan);
@@ -541,20 +544,20 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService {
}
}
- private class LoanForeClosureEventListener implements BusinessEventListener<LoanForeClosureBusinessEvent> {
+ private class LoanForeClosureEventListener implements BusinessEventListener<LoanForeClosurePostBusinessEvent> {
@Override
- public void onBusinessEvent(LoanForeClosureBusinessEvent event) {
+ public void onBusinessEvent(LoanForeClosurePostBusinessEvent event) {
LoanTransaction loanTransaction = event.get();
Loan loan = loanTransaction.getLoan();
handleArrearsForLoan(loan);
}
}
- private class LoanChargePaymentEventListener implements BusinessEventListener<LoanChargePaymentBusinessEvent> {
+ private class LoanChargePaymentEventListener implements BusinessEventListener<LoanChargePaymentPostBusinessEvent> {
@Override
- public void onBusinessEvent(LoanChargePaymentBusinessEvent event) {
+ public void onBusinessEvent(LoanChargePaymentPostBusinessEvent event) {
LoanTransaction loanTransaction = event.get();
Loan loan = loanTransaction.getLoan();
handleArrearsForLoan(loan);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
index a1bc6a52d..aeeb40fbb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
@@ -113,7 +113,8 @@ import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanWaiveC
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanWaiveChargeUndoBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanUndoWrittenOffBusinessEvent;
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWaiveInterestBusinessEvent;
-import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWrittenOffBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWrittenOffPostBusinessEvent;
+import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWrittenOffPreBusinessEvent;
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
import org.apache.fineract.portfolio.calendar.domain.Calendar;
import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType;
@@ -377,6 +378,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
scheduleGeneratorDTO.isSkipRepaymentOnFirstDayofMonth(), scheduleGeneratorDTO.getNumberOfdays());
}
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanDisbursalBusinessEvent(loan));
+
final List<Long> existingTransactionIds = new ArrayList<>();
final List<Long> existingReversedTransactionIds = new ArrayList<>();
@@ -525,7 +528,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
updatePostDatedChecks(postDatedChecks);
}
- businessEventNotifierService.notifyBusinessEvent(new LoanDisbursalBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanDisbursalBusinessEvent(loan));
Long entityId = loan.getId();
@@ -679,6 +682,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
syncExpectedDateWithActualDisbursementDate(loan, actualDisbursementDate);
}
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanDisbursalBusinessEvent(loan));
final List<Long> existingTransactionIds = new ArrayList<>();
final List<Long> existingReversedTransactionIds = new ArrayList<>();
@@ -769,7 +773,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
}
updateRecurringCalendarDatesForInterestRecalculation(loan);
loanAccountDomainService.recalculateAccruals(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanDisbursalBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanDisbursalBusinessEvent(loan));
}
return changes;
@@ -807,6 +811,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final AppUser currentUser = getAppUserIfPresent();
final Loan loan = this.loanAssembler.assembleFrom(loanId);
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanUndoDisbursalBusinessEvent(loan));
removeLoanCycle(loan);
final List<Long> existingTransactionIds = new ArrayList<>();
final List<Long> existingReversedTransactionIds = new ArrayList<>();
@@ -848,7 +853,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Map<String, Object> accountingBridgeData = loan.deriveAccountingBridgeData(applicationCurrency.toData(),
existingTransactionIds, existingReversedTransactionIds, isAccountTransfer);
journalEntryWritePlatformService.createJournalEntriesForLoan(accountingBridgeData);
- businessEventNotifierService.notifyBusinessEvent(new LoanUndoDisbursalBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanUndoDisbursalBusinessEvent(loan));
}
return new CommandProcessingResultBuilder() //
@@ -1017,6 +1022,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
checkClientOrGroupActive(loan);
final LoanTransaction transactionToAdjust = this.loanTransactionRepository.findById(transactionId)
.orElseThrow(() -> new LoanTransactionNotFoundException(transactionId));
+ businessEventNotifierService.notifyPreBusinessEvent(
+ new LoanAdjustTransactionBusinessEvent(new LoanAdjustTransactionBusinessEvent.Data(transactionToAdjust)));
if (this.accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.LOAN)) {
throw new PlatformServiceUnavailableException("error.msg.loan.transfer.transaction.update.not.allowed",
"Loan transaction:" + transactionId + " update not allowed as it involves in account transfer", transactionId);
@@ -1129,7 +1136,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
if (newTransactionDetail.isRepaymentType() && newTransactionDetail.isGreaterThanZero(loan.getPrincpal().getCurrency())) {
eventData.setNewTransactionDetail(newTransactionDetail);
}
- businessEventNotifierService.notifyBusinessEvent(new LoanAdjustTransactionBusinessEvent(eventData));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanAdjustTransactionBusinessEvent(eventData));
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(transactionId)
.withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId()).withGroupId(loan.getGroupId()).withLoanId(loanId)
@@ -1170,6 +1177,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
}
final LoanTransaction waiveInterestTransaction = LoanTransaction.waiver(loan.getOffice(), loan, transactionAmountAsMoney,
transactionDate, interestComponent, unrecognizedIncome, DateUtils.getLocalDateTimeOfTenant(), currentUser);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanWaiveInterestBusinessEvent(waiveInterestTransaction));
LocalDate recalculateFrom = null;
if (loan.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
recalculateFrom = transactionDate;
@@ -1206,7 +1214,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
loanAccountDomainService.recalculateAccruals(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanWaiveInterestBusinessEvent(waiveInterestTransaction));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanWaiveInterestBusinessEvent(waiveInterestTransaction));
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(waiveInterestTransaction.getId())
.withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId()).withGroupId(loan.getGroupId()).withLoanId(loanId)
.with(changes).build();
@@ -1233,6 +1241,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
}
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanWrittenOffPreBusinessEvent(loan));
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
StatusEnum.WRITE_OFF.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
@@ -1268,7 +1277,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
loanAccountDomainService.recalculateAccruals(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanWrittenOffBusinessEvent(writeOff));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanWrittenOffPostBusinessEvent(writeOff));
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(writeOff.getId())
.withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId()).withGroupId(loan.getGroupId()).withLoanId(loanId)
.with(changes).build();
@@ -1284,6 +1293,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Loan loan = this.loanAssembler.assembleFrom(loanId);
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanCloseBusinessEvent(loan));
final Map<String, Object> changes = new LinkedHashMap<>();
changes.put("transactionDate", command.stringValueOfParameterNamed("transactionDate"));
@@ -1325,7 +1335,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
}
loanAccountDomainService.recalculateAccruals(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanCloseBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanCloseBusinessEvent(loan));
// Update loan transaction on repayment.
if (AccountType.fromInt(loan.getLoanType()).isIndividualAccount()) {
@@ -1370,6 +1380,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Loan loan = this.loanAssembler.assembleFrom(loanId);
checkClientOrGroupActive(loan);
removeLoanCycle(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanCloseAsRescheduleBusinessEvent(loan));
final Map<String, Object> changes = new LinkedHashMap<>();
changes.put("transactionDate", command.stringValueOfParameterNamed("transactionDate"));
@@ -1386,7 +1397,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Note note = Note.loanNote(loan, noteText);
this.noteRepository.save(note);
}
- businessEventNotifierService.notifyBusinessEvent(new LoanCloseAsRescheduleBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanCloseAsRescheduleBusinessEvent(loan));
// disable all active standing instructions linked to the loan
this.loanAccountDomainService.disableStandingInstructionsLinkedToClosedLoan(loan);
@@ -1464,6 +1475,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
disbursementDetail.expectedDisbursementDateAsLocalDate(), null, null);
loanTrancheDisbursementCharge = new LoanTrancheDisbursementCharge(loanCharge, disbursementDetail);
loanCharge.updateLoanTrancheDisbursementCharge(loanTrancheDisbursementCharge);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanAddChargeBusinessEvent(loanCharge));
validateAddLoanCharge(loan, chargeDefinition, loanCharge);
addCharge(loan, chargeDefinition, loanCharge);
isAppliedOnBackDate = true;
@@ -1475,6 +1487,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
loan.addTrancheLoanCharge(chargeDefinition);
} else {
loanCharge = LoanCharge.createNewFromJson(loan, chargeDefinition, command);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanAddChargeBusinessEvent(loanCharge));
validateAddLoanCharge(loan, chargeDefinition, loanCharge);
isAppliedOnBackDate = addCharge(loan, chargeDefinition, loanCharge);
@@ -1513,7 +1526,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
&& loan.isFeeCompoundingEnabledForInterestRecalculation()) {
this.loanAccountDomainService.recalculateAccruals(loan);
}
- businessEventNotifierService.notifyBusinessEvent(new LoanAddChargeBusinessEvent(loanCharge));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanAddChargeBusinessEvent(loanCharge));
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(loanCharge.getId())
.withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId()).withGroupId(loan.getGroupId()).withLoanId(loanId)
.build();
@@ -1628,11 +1641,12 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
throw new LoanChargeCannotBeUpdatedException(LoanChargeCannotBeUpdatedReason.LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE,
loanCharge.getId());
}
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanUpdateChargeBusinessEvent(loanCharge));
final Map<String, Object> changes = loan.updateLoanCharge(loanCharge, command);
saveLoanWithDataIntegrityViolationChecks(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanUpdateChargeBusinessEvent(loanCharge));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanUpdateChargeBusinessEvent(loanCharge));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withEntityId(loanChargeId) //
@@ -1684,6 +1698,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Map<String, Object> changes = new LinkedHashMap<>(3);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanWaiveChargeUndoBusinessEvent(loanCharge));
+
if (loanCharge.isInstalmentFee()) {
LoanInstallmentCharge chargePerInstallment = null;
@@ -1770,7 +1786,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
saveLoanWithDataIntegrityViolationChecks(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanWaiveChargeUndoBusinessEvent(loanCharge));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanWaiveChargeUndoBusinessEvent(loanCharge));
LoanTransaction loanTransactionData = this.loanTransactionRepository.getById(command.entityId());
changes.put("principalPortion", loanTransactionData.getPrincipalPortion());
@@ -1811,6 +1827,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
} else if (loanCharge.isPaid()) {
throw new LoanChargeCannotBeWaivedException(LoanChargeCannotBeWaivedReason.ALREADY_PAID, loanCharge.getId());
}
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanWaiveChargeBusinessEvent(loanCharge));
Integer loanInstallmentNumber = null;
if (loanCharge.isInstalmentFee()) {
LoanInstallmentCharge chargePerInstallment = null;
@@ -1859,7 +1876,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
- businessEventNotifierService.notifyBusinessEvent(new LoanWaiveChargeBusinessEvent(loanCharge));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanWaiveChargeBusinessEvent(loanCharge));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
@@ -1886,10 +1903,11 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
throw new LoanChargeCannotBeDeletedException(LoanChargeCannotBeDeletedReason.LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE,
loanCharge.getId());
}
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanDeleteChargeBusinessEvent(loanCharge));
loan.removeLoanCharge(loanCharge);
saveLoanWithDataIntegrityViolationChecks(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanDeleteChargeBusinessEvent(loanCharge));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanDeleteChargeBusinessEvent(loanCharge));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withEntityId(loanChargeId) //
@@ -2101,6 +2119,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
checkClientOrGroupActive(loan);
validateTransactionsForTransfer(loan, transferDate);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanInitiateTransferBusinessEvent(loan));
+
final List<Long> existingTransactionIds = new ArrayList<>(loan.findExistingTransactionIds());
final List<Long> existingReversedTransactionIds = new ArrayList<>(loan.findExistingReversedTransactionIds());
@@ -2113,7 +2133,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
saveLoanWithDataIntegrityViolationChecks(loan);
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
- businessEventNotifierService.notifyBusinessEvent(new LoanInitiateTransferBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanInitiateTransferBusinessEvent(loan));
return newTransferTransaction;
}
@@ -2123,6 +2143,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Staff loanOfficer) {
AppUser currentUser = getAppUserIfPresent();
this.loanAssembler.setHelpers(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanAcceptTransferBusinessEvent(loan));
final List<Long> existingTransactionIds = new ArrayList<>(loan.findExistingTransactionIds());
final List<Long> existingReversedTransactionIds = new ArrayList<>(loan.findExistingReversedTransactionIds());
@@ -2142,7 +2163,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
saveLoanWithDataIntegrityViolationChecks(loan);
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
- businessEventNotifierService.notifyBusinessEvent(new LoanAcceptTransferBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanAcceptTransferBusinessEvent(loan));
return newTransferAcceptanceTransaction;
}
@@ -2152,6 +2173,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
public LoanTransaction withdrawLoanTransfer(final Loan loan, final LocalDate transferDate) {
AppUser currentUser = getAppUserIfPresent();
this.loanAssembler.setHelpers(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanWithdrawTransferBusinessEvent(loan));
final List<Long> existingTransactionIds = new ArrayList<>(loan.findExistingTransactionIds());
final List<Long> existingReversedTransactionIds = new ArrayList<>(loan.findExistingReversedTransactionIds());
@@ -2165,7 +2187,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
saveLoanWithDataIntegrityViolationChecks(loan);
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
- businessEventNotifierService.notifyBusinessEvent(new LoanWithdrawTransferBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanWithdrawTransferBusinessEvent(loan));
return newTransferAcceptanceTransaction;
}
@@ -2174,9 +2196,10 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
@Override
public void rejectLoanTransfer(final Loan loan) {
this.loanAssembler.setHelpers(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanRejectTransferBusinessEvent(loan));
loan.setLoanStatus(LoanStatus.TRANSFER_ON_HOLD.getValue());
saveLoanWithDataIntegrityViolationChecks(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanRejectTransferBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanRejectTransferBusinessEvent(loan));
}
@Transactional
@@ -2194,6 +2217,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Loan loan = this.loanAssembler.assembleFrom(loanId);
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanReassignOfficerBusinessEvent(loan));
if (!loan.hasLoanOfficer(fromLoanOfficer)) {
throw new LoanOfficerAssignmentException(loanId, fromLoanOfficerId);
}
@@ -2201,7 +2225,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
loan.reassignLoanOfficer(toLoanOfficer, dateOfLoanOfficerAssignment);
saveLoanWithDataIntegrityViolationChecks(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanReassignOfficerBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanReassignOfficerBusinessEvent(loan));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
@@ -2231,6 +2255,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
for (final String loanIdString : loanIds) {
final Long loanId = Long.valueOf(loanIdString);
final Loan loan = this.loanAssembler.assembleFrom(loanId);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanReassignOfficerBusinessEvent(loan));
checkClientOrGroupActive(loan);
if (!loan.hasLoanOfficer(fromLoanOfficer)) {
@@ -2239,7 +2264,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
loan.reassignLoanOfficer(toLoanOfficer, dateOfLoanOfficerAssignment);
saveLoanWithDataIntegrityViolationChecks(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanReassignOfficerBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanReassignOfficerBusinessEvent(loan));
}
this.loanRepositoryWrapper.flush();
@@ -2264,10 +2289,12 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
if (loan.getLoanOfficer() == null) {
throw new LoanOfficerUnassignmentException(loanId);
}
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanRemoveOfficerBusinessEvent(loan));
+
loan.removeLoanOfficer(dateOfLoanOfficerunAssigned);
saveLoanWithDataIntegrityViolationChecks(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanRemoveOfficerBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanRemoveOfficerBusinessEvent(loan));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
@@ -2635,7 +2662,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
&& loan.isFeeCompoundingEnabledForInterestRecalculation()) {
this.loanAccountDomainService.recalculateAccruals(loan);
}
- businessEventNotifierService.notifyBusinessEvent(new LoanApplyOverdueChargeBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanApplyOverdueChargeBusinessEvent(loan));
}
}
@@ -2715,6 +2742,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
LocalDate recalculateFrom = DateUtils.getLocalDateOfTenant();
if (loan != null) {
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanApplyOverdueChargeBusinessEvent(loan));
for (Map.Entry<Integer, LocalDate> entry : scheduleDates.entrySet()) {
final LoanCharge loanCharge = LoanCharge.createNewFromJson(loan, chargeDefinition, command, entry.getValue());
@@ -2754,6 +2782,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
}
LocalDate recalculateFrom = null;
LoanTransaction writeOffTransaction = loan.findWriteOffTransaction();
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanUndoWrittenOffBusinessEvent(writeOffTransaction));
ScheduleGeneratorDTO scheduleGeneratorDTO = this.loanUtilService.buildScheduleGeneratorDTO(loan, recalculateFrom);
@@ -2770,7 +2799,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
this.loanAccountDomainService.recalculateAccruals(loan);
if (writeOffTransaction != null) {
- businessEventNotifierService.notifyBusinessEvent(new LoanUndoWrittenOffBusinessEvent(writeOffTransaction));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanUndoWrittenOffBusinessEvent(writeOffTransaction));
}
return new CommandProcessingResultBuilder() //
.withOfficeId(loan.getOfficeId()) //
@@ -3022,6 +3051,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
Loan loan = this.loanAssembler.assembleFrom(loanId);
LocalDate recalculateFrom = loan.fetchInterestRecalculateFromDate();
AppUser currentUser = getAppUserIfPresent();
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanInterestRecalculationBusinessEvent(loan));
final List<Long> existingTransactionIds = new ArrayList<>();
final List<Long> existingReversedTransactionIds = new ArrayList<>();
@@ -3043,7 +3073,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
}
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
loanAccountDomainService.recalculateAccruals(loan);
- businessEventNotifierService.notifyBusinessEvent(new LoanInterestRecalculationBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanInterestRecalculationBusinessEvent(loan));
}
@Override
@@ -3190,6 +3220,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final LocalDate recalculateFromDate = loan.getLastRepaymentDate();
validateIsMultiDisbursalLoanAndDisbursedMoreThanOneTranche(loan);
checkClientOrGroupActive(loan);
+ businessEventNotifierService.notifyPreBusinessEvent(new LoanUndoLastDisbursalBusinessEvent(loan));
final MonetaryCurrency currency = loan.getCurrency();
final ApplicationCurrency applicationCurrency = this.applicationCurrencyRepository.findOneWithNotFoundDetection(currency);
@@ -3214,7 +3245,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final Map<String, Object> accountingBridgeData = loan.deriveAccountingBridgeData(applicationCurrency.toData(),
existingTransactionIds, existingReversedTransactionIds, isAccountTransfer);
journalEntryWritePlatformService.createJournalEntriesForLoan(accountingBridgeData);
- businessEventNotifierService.notifyBusinessEvent(new LoanUndoLastDisbursalBusinessEvent(loan));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanUndoLastDisbursalBusinessEvent(loan));
}
return new CommandProcessingResultBuilder() //
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java
index 1b31bcaeb..8b6cff4cc 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/service/LoanProductWritePlatformServiceJpaRepositoryImpl.java
@@ -148,7 +148,7 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro
fineractEntityAccessUtil.checkConfigurationAndAddProductResrictionsForUserOffice(
FineractEntityAccessType.OFFICE_ACCESS_TO_LOAN_PRODUCTS, loanProduct.getId());
- businessEventNotifierService.notifyBusinessEvent(new LoanProductCreateBusinessEvent(loanProduct));
+ businessEventNotifierService.notifyPostBusinessEvent(new LoanProductCreateBusinessEvent(loanProduct));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountDomainServiceJpa.java
index d25b94566..92456da73 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountDomainServiceJpa.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountDomainServiceJpa.java
@@ -138,7 +138,7 @@ public class SavingsAccountDomainServiceJpa implements SavingsAccountDomainServi
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds, transactionBooleanValues.isAccountTransfer(),
backdatedTxnsAllowedTill);
- businessEventNotifierService.notifyBusinessEvent(new SavingsWithdrawalBusinessEvent(withdrawal));
+ businessEventNotifierService.notifyPostBusinessEvent(new SavingsWithdrawalBusinessEvent(withdrawal));
return withdrawal;
}
@@ -213,7 +213,7 @@ public class SavingsAccountDomainServiceJpa implements SavingsAccountDomainServi
this.savingsAccountRepository.saveAndFlush(account);
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds, isAccountTransfer, backdatedTxnsAllowedTill);
- businessEventNotifierService.notifyBusinessEvent(new SavingsDepositBusinessEvent(deposit));
+ businessEventNotifierService.notifyPostBusinessEvent(new SavingsDepositBusinessEvent(deposit));
return deposit;
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java
index 2cf66788d..9bc289577 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.java
@@ -230,7 +230,7 @@ public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
}
final Long savingsId = account.getId();
- businessEventNotifierService.notifyBusinessEvent(new FixedDepositAccountCreateBusinessEvent(account));
+ businessEventNotifierService.notifyPostBusinessEvent(new FixedDepositAccountCreateBusinessEvent(account));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
@@ -289,7 +289,7 @@ public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
financialYearBeginningMonth);
account.validateApplicableInterestRate();
savingAccountRepository.save(account);
- businessEventNotifierService.notifyBusinessEvent(new RecurringDepositAccountCreateBusinessEvent(account));
+ businessEventNotifierService.notifyPostBusinessEvent(new RecurringDepositAccountCreateBusinessEvent(account));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java
index 1bd5291e4..2e12c0b48 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java
@@ -273,7 +273,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
}
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds, false);
- businessEventNotifierService.notifyBusinessEvent(new SavingsActivateBusinessEvent(account));
+ businessEventNotifierService.notifyPostBusinessEvent(new SavingsActivateBusinessEvent(account));
return new CommandProcessingResultBuilder() //
.withEntityId(savingsId) //
@@ -577,7 +577,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
}
postInterest(account, postInterestAs, transactionDate, backdatedTxnsAllowedTill);
- businessEventNotifierService.notifyBusinessEvent(new SavingsPostInterestBusinessEvent(account));
+ businessEventNotifierService.notifyPostBusinessEvent(new SavingsPostInterestBusinessEvent(account));
return new CommandProcessingResultBuilder() //
.withEntityId(savingsId) //
.withOfficeId(account.officeId()) //
@@ -1031,7 +1031,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
}
- businessEventNotifierService.notifyBusinessEvent(new SavingsCloseBusinessEvent(account));
+ businessEventNotifierService.notifyPostBusinessEvent(new SavingsCloseBusinessEvent(account));
// disable all standing orders linked to the savings account
disableStandingInstructionsLinkedToClosedSavings(account);
return new CommandProcessingResultBuilder() //
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java
index 78ba63d97..9e9a00f17 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java
@@ -265,7 +265,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
this.entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVING.getName(),
StatusEnum.CREATE.getCode().longValue(), EntityTables.SAVING.getForeignKeyColumnNameOnDatatable(), account.productId());
- businessEventNotifierService.notifyBusinessEvent(new SavingsCreateBusinessEvent(account));
+ businessEventNotifierService.notifyPostBusinessEvent(new SavingsCreateBusinessEvent(account));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
@@ -493,7 +493,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
}
}
- businessEventNotifierService.notifyBusinessEvent(new SavingsApproveBusinessEvent(savingsAccount));
+ businessEventNotifierService.notifyPostBusinessEvent(new SavingsApproveBusinessEvent(savingsAccount));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
@@ -615,7 +615,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
this.noteRepository.save(note);
}
}
- businessEventNotifierService.notifyBusinessEvent(new SavingsRejectBusinessEvent(savingsAccount));
+ businessEventNotifierService.notifyPostBusinessEvent(new SavingsRejectBusinessEvent(savingsAccount));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withEntityId(savingsId) //
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/ShareAccountWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/ShareAccountWritePlatformServiceJpaRepositoryImpl.java
index 622abd6c4..7c5a1010d 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/ShareAccountWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/service/ShareAccountWritePlatformServiceJpaRepositoryImpl.java
@@ -105,7 +105,7 @@ public class ShareAccountWritePlatformServiceJpaRepositoryImpl implements ShareA
journalEntryWritePlatformService.createJournalEntriesForShares(
populateJournalEntries(account, account.getPendingForApprovalSharePurchaseTransactions()));
- businessEventNotifierService.notifyBusinessEvent(new ShareAccountCreateBusinessEvent(account));
+ businessEventNotifierService.notifyPostBusinessEvent(new ShareAccountCreateBusinessEvent(account));
return new CommandProcessingResultBuilder() //
.withCommandId(jsonCommand.commandId()) //
@@ -281,7 +281,7 @@ public class ShareAccountWritePlatformServiceJpaRepositoryImpl implements ShareA
this.journalEntryWritePlatformService.createJournalEntriesForShares(populateJournalEntries(account, journalTransactions));
- businessEventNotifierService.notifyBusinessEvent(new ShareAccountApproveBusinessEvent(account));
+ businessEventNotifierService.notifyPostBusinessEvent(new ShareAccountApproveBusinessEvent(account));
return new CommandProcessingResultBuilder() //
.withCommandId(jsonCommand.commandId()) //
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductWritePlatformServiceJpaRepositoryImpl.java
index 1edd2cf3f..e8f7fc345 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/service/ShareProductWritePlatformServiceJpaRepositoryImpl.java
@@ -131,7 +131,7 @@ public class ShareProductWritePlatformServiceJpaRepositoryImpl implements ShareP
}
this.shareProductDividentPayOutDetailsRepository.save(dividendPayOutDetails);
- businessEventNotifierService.notifyBusinessEvent(new ShareProductDividentsCreateBusinessEvent(productId));
+ businessEventNotifierService.notifyPostBusinessEvent(new ShareProductDividentsCreateBusinessEvent(productId));
return new CommandProcessingResultBuilder() //
.withCommandId(jsonCommand.commandId()) //