diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/BulkBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/BulkBusinessEvent.java index 690a08a8c..91e5839ea 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/BulkBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/BulkBusinessEvent.java @@ -22,12 +22,20 @@ import java.util.List; public class BulkBusinessEvent extends AbstractBusinessEvent>> { + private static final String CATEGORY = "Bulk"; + private static final String TYPE = "BulkBusinessEvent"; + public BulkBusinessEvent(List> value) { super(value); } @Override public String getType() { - return "BulkBusinessEvent"; + return TYPE; + } + + @Override + public String getCategory() { + return CATEGORY; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/BusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/BusinessEvent.java index 53720b926..c2876066b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/BusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/BusinessEvent.java @@ -23,4 +23,6 @@ public interface BusinessEvent { T get(); String getType(); + + String getCategory(); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientActivateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientActivateBusinessEvent.java index 031c51099..1f288d33c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientActivateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientActivateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.client.domain.Client; public class ClientActivateBusinessEvent extends ClientBusinessEvent { + private static final String TYPE = "ClientActivateBusinessEvent"; + public ClientActivateBusinessEvent(Client value) { super(value); } @Override public String getType() { - return "ClientActivateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientBusinessEvent.java index 7ddd40083..78acd5432 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.client.domain.Client; public abstract class ClientBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Client"; + public ClientBusinessEvent(Client value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientCreateBusinessEvent.java index d2389de8e..db69f02cc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientCreateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.client.domain.Client; public class ClientCreateBusinessEvent extends ClientBusinessEvent { + private static final String TYPE = "ClientCreateBusinessEvent"; + public ClientCreateBusinessEvent(Client value) { super(value); } @Override public String getType() { - return "ClientCreateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientRejectBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientRejectBusinessEvent.java index 763fcabd7..463cc0747 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientRejectBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/client/ClientRejectBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.client.domain.Client; public class ClientRejectBusinessEvent extends ClientBusinessEvent { + private static final String TYPE = "ClientRejectBusinessEvent"; + public ClientRejectBusinessEvent(Client value) { super(value); } @Override public String getType() { - return "ClientRejectBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/FixedDepositAccountBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/FixedDepositAccountBusinessEvent.java index 1a4e3566f..ae38e0ccc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/FixedDepositAccountBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/FixedDepositAccountBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.savings.domain.FixedDepositAccount; public abstract class FixedDepositAccountBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Deposit"; + public FixedDepositAccountBusinessEvent(FixedDepositAccount value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/FixedDepositAccountCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/FixedDepositAccountCreateBusinessEvent.java index fca0f8b7f..b99ee35e9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/FixedDepositAccountCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/FixedDepositAccountCreateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.FixedDepositAccount; public class FixedDepositAccountCreateBusinessEvent extends FixedDepositAccountBusinessEvent { + private static final String TYPE = "FixedDepositAccountCreateBusinessEvent"; + public FixedDepositAccountCreateBusinessEvent(FixedDepositAccount value) { super(value); } @Override public String getType() { - return "FixedDepositAccountCreateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/RecurringDepositAccountBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/RecurringDepositAccountBusinessEvent.java index 4e1d8241f..1c2b60b53 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/RecurringDepositAccountBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/RecurringDepositAccountBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.savings.domain.RecurringDepositAccount; public abstract class RecurringDepositAccountBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Deposit"; + public RecurringDepositAccountBusinessEvent(RecurringDepositAccount value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/RecurringDepositAccountCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/RecurringDepositAccountCreateBusinessEvent.java index f3a1a9a12..251e89733 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/RecurringDepositAccountCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/deposit/RecurringDepositAccountCreateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.RecurringDepositAccount; public class RecurringDepositAccountCreateBusinessEvent extends RecurringDepositAccountBusinessEvent { + private static final String TYPE = "RecurringDepositAccountCreateBusinessEvent"; + public RecurringDepositAccountCreateBusinessEvent(RecurringDepositAccount value) { super(value); } @Override public String getType() { - return "RecurringDepositAccountCreateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/CentersCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/CentersCreateBusinessEvent.java index 4e3bd7c18..032949469 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/CentersCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/CentersCreateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; public class CentersCreateBusinessEvent extends GroupsBusinessEvent { + private static final String TYPE = "CentersCreateBusinessEvent"; + public CentersCreateBusinessEvent(CommandProcessingResult value) { super(value); } @Override public String getType() { - return "CentersCreateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/GroupsBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/GroupsBusinessEvent.java index 88f71e229..1c0f0030d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/GroupsBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/GroupsBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.infrastructure.event.business.domain.AbstractBusiness public abstract class GroupsBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Group"; + public GroupsBusinessEvent(CommandProcessingResult value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/GroupsCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/GroupsCreateBusinessEvent.java index 06b7ea5a5..d81a35203 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/GroupsCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/group/GroupsCreateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; public class GroupsCreateBusinessEvent extends GroupsBusinessEvent { + private static final String TYPE = "GroupsCreateBusinessEvent"; + public GroupsCreateBusinessEvent(CommandProcessingResult value) { super(value); } @Override public String getType() { - return "GroupsCreateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanAcceptTransferBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanAcceptTransferBusinessEvent.java index 047cd2a00..986e26a59 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanAcceptTransferBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanAcceptTransferBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanAcceptTransferBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanAcceptTransferBusinessEvent"; + public LoanAcceptTransferBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanAcceptTransferBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanAdjustTransactionBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanAdjustTransactionBusinessEvent.java index e33638f76..dc4b98907 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanAdjustTransactionBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanAdjustTransactionBusinessEvent.java @@ -26,13 +26,21 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanAdjustTransactionBusinessEvent extends AbstractBusinessEvent { + private static final String TYPE = "LoanAdjustTransactionBusinessEvent"; + private static final String CATEGORY = "Loan"; + public LoanAdjustTransactionBusinessEvent(Data value) { super(value); } @Override public String getType() { - return "LoanAdjustTransactionBusinessEvent"; + return TYPE; + } + + @Override + public String getCategory() { + return CATEGORY; } @RequiredArgsConstructor diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanApplyOverdueChargeBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanApplyOverdueChargeBusinessEvent.java index 535dc3fdd..af11e9e2a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanApplyOverdueChargeBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanApplyOverdueChargeBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanApplyOverdueChargeBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanApplyOverdueChargeBusinessEvent"; + public LoanApplyOverdueChargeBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanApplyOverdueChargeBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanApprovedBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanApprovedBusinessEvent.java index 506e23841..3ef58213b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanApprovedBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanApprovedBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanApprovedBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanApprovedBusinessEvent"; + public LoanApprovedBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanApprovedBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanBalanceChangedBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanBalanceChangedBusinessEvent.java index 430219a43..e40b301a6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanBalanceChangedBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanBalanceChangedBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanBalanceChangedBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanBalanceChangedBusinessEvent"; + public LoanBalanceChangedBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanBalanceChangedBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanBusinessEvent.java index dec794bca..1ff3eafd5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public abstract class LoanBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Loan"; + public LoanBusinessEvent(Loan value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCloseAsRescheduleBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCloseAsRescheduleBusinessEvent.java index 3168a55c5..be3845936 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCloseAsRescheduleBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCloseAsRescheduleBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanCloseAsRescheduleBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanCloseAsRescheduleBusinessEvent"; + public LoanCloseAsRescheduleBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanCloseAsRescheduleBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCloseBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCloseBusinessEvent.java index b4ce3def0..58cf81f3f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCloseBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCloseBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanCloseBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanCloseBusinessEvent"; + public LoanCloseBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanCloseBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCreatedBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCreatedBusinessEvent.java index 109c77172..1256fdce0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCreatedBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanCreatedBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanCreatedBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanCreatedBusinessEvent"; + public LoanCreatedBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanCreatedBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanDisbursalBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanDisbursalBusinessEvent.java index 7bed832b8..3219f7b6d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanDisbursalBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanDisbursalBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanDisbursalBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanDisbursalBusinessEvent"; + public LoanDisbursalBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanDisbursalBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanInitiateTransferBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanInitiateTransferBusinessEvent.java index d77e233ba..4e3be6d06 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanInitiateTransferBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanInitiateTransferBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanInitiateTransferBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanInitiateTransferBusinessEvent"; + public LoanInitiateTransferBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanInitiateTransferBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanInterestRecalculationBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanInterestRecalculationBusinessEvent.java index 86df37390..3e256ab4b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanInterestRecalculationBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanInterestRecalculationBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanInterestRecalculationBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanInterestRecalculationBusinessEvent"; + public LoanInterestRecalculationBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanInterestRecalculationBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanReassignOfficerBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanReassignOfficerBusinessEvent.java index 84778dae8..b0db66d3b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanReassignOfficerBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanReassignOfficerBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanReassignOfficerBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanReassignOfficerBusinessEvent"; + public LoanReassignOfficerBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanReassignOfficerBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRejectTransferBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRejectTransferBusinessEvent.java index c2f86e793..3425ff843 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRejectTransferBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRejectTransferBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanRejectTransferBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanRejectTransferBusinessEvent"; + public LoanRejectTransferBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanRejectTransferBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRejectedBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRejectedBusinessEvent.java index a24188c96..9daa34944 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRejectedBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRejectedBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanRejectedBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanRejectedBusinessEvent"; + public LoanRejectedBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanRejectedBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRemoveOfficerBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRemoveOfficerBusinessEvent.java index 8ce952f93..dc0bbb9db 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRemoveOfficerBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRemoveOfficerBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanRemoveOfficerBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanRemoveOfficerBusinessEvent"; + public LoanRemoveOfficerBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanRemoveOfficerBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRescheduledDueCalendarChangeBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRescheduledDueCalendarChangeBusinessEvent.java index bdf9db68d..16f1d57b7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRescheduledDueCalendarChangeBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRescheduledDueCalendarChangeBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanRescheduledDueCalendarChangeBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanRescheduledDueCalendarChangeBusinessEvent"; + public LoanRescheduledDueCalendarChangeBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanRescheduledDueCalendarChangeBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRescheduledDueHolidayBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRescheduledDueHolidayBusinessEvent.java index c2a327f4e..07ab6b5b1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRescheduledDueHolidayBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanRescheduledDueHolidayBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanRescheduledDueHolidayBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanRescheduledDueHolidayBusinessEvent"; + public LoanRescheduledDueHolidayBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanRescheduledDueHolidayBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanScheduleVariationsAddedBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanScheduleVariationsAddedBusinessEvent.java index cf68c7156..a6827de66 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanScheduleVariationsAddedBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanScheduleVariationsAddedBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanScheduleVariationsAddedBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanScheduleVariationsAddedBusinessEvent"; + public LoanScheduleVariationsAddedBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanScheduleVariationsAddedBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanScheduleVariationsDeletedBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanScheduleVariationsDeletedBusinessEvent.java index 6c7a9bb84..1920268fa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanScheduleVariationsDeletedBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanScheduleVariationsDeletedBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanScheduleVariationsDeletedBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanScheduleVariationsDeletedBusinessEvent"; + public LoanScheduleVariationsDeletedBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanScheduleVariationsDeletedBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanStatusChangedBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanStatusChangedBusinessEvent.java index 0ca6cf7df..0dc2718c2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanStatusChangedBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanStatusChangedBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanStatusChangedBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanStatusChangedBusinessEvent"; + public LoanStatusChangedBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanStatusChangedBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoApprovalBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoApprovalBusinessEvent.java index 6d43f842b..e24afe2fa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoApprovalBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoApprovalBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanUndoApprovalBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanUndoApprovalBusinessEvent"; + public LoanUndoApprovalBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanUndoApprovalBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoDisbursalBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoDisbursalBusinessEvent.java index 797ab50a4..90d94aa67 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoDisbursalBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoDisbursalBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanUndoDisbursalBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanUndoDisbursalBusinessEvent"; + public LoanUndoDisbursalBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanUndoDisbursalBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoLastDisbursalBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoLastDisbursalBusinessEvent.java index 706ad3b4f..e8a2b5d67 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoLastDisbursalBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUndoLastDisbursalBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanUndoLastDisbursalBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanUndoLastDisbursalBusinessEvent"; + public LoanUndoLastDisbursalBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanUndoLastDisbursalBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUpdateDisbursementDataBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUpdateDisbursementDataBusinessEvent.java index 6a9c4e09d..f3a646a99 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUpdateDisbursementDataBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanUpdateDisbursementDataBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanUpdateDisbursementDataBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanUpdateDisbursementDataBusinessEvent"; + public LoanUpdateDisbursementDataBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanUpdateDisbursementDataBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanWithdrawTransferBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanWithdrawTransferBusinessEvent.java index 431d6afef..ce648fc7e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanWithdrawTransferBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/LoanWithdrawTransferBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanWithdrawTransferBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanWithdrawTransferBusinessEvent"; + public LoanWithdrawTransferBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanWithdrawTransferBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanAddChargeBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanAddChargeBusinessEvent.java index c7be716ff..408664523 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanAddChargeBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanAddChargeBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge; public class LoanAddChargeBusinessEvent extends LoanChargeBusinessEvent { + private static final String TYPE = "LoanAddChargeBusinessEvent"; + public LoanAddChargeBusinessEvent(LoanCharge value) { super(value); } @Override public String getType() { - return "LoanAddChargeBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanChargeBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanChargeBusinessEvent.java index eaf8331d0..71381e6a6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanChargeBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanChargeBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge; public abstract class LoanChargeBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Loan"; + public LoanChargeBusinessEvent(LoanCharge value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanDeleteChargeBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanDeleteChargeBusinessEvent.java index ea2441c8d..9916ad7ad 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanDeleteChargeBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanDeleteChargeBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge; public class LoanDeleteChargeBusinessEvent extends LoanChargeBusinessEvent { + private static final String TYPE = "LoanDeleteChargeBusinessEvent"; + public LoanDeleteChargeBusinessEvent(LoanCharge value) { super(value); } @Override public String getType() { - return "LoanDeleteChargeBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanUpdateChargeBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanUpdateChargeBusinessEvent.java index 4284398dc..91a04e59e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanUpdateChargeBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanUpdateChargeBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge; public class LoanUpdateChargeBusinessEvent extends LoanChargeBusinessEvent { + private static final String TYPE = "LoanUpdateChargeBusinessEvent"; + public LoanUpdateChargeBusinessEvent(LoanCharge value) { super(value); } @Override public String getType() { - return "LoanUpdateChargeBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanWaiveChargeBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanWaiveChargeBusinessEvent.java index 9c383a959..498436257 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanWaiveChargeBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanWaiveChargeBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge; public class LoanWaiveChargeBusinessEvent extends LoanChargeBusinessEvent { + private static final String TYPE = "LoanWaiveChargeBusinessEvent"; + public LoanWaiveChargeBusinessEvent(LoanCharge value) { super(value); } @Override public String getType() { - return "LoanWaiveChargeBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanWaiveChargeUndoBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanWaiveChargeUndoBusinessEvent.java index d5f18d3a8..07b7185c9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanWaiveChargeUndoBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/charge/LoanWaiveChargeUndoBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge; public class LoanWaiveChargeUndoBusinessEvent extends LoanChargeBusinessEvent { + private static final String TYPE = "LoanWaiveChargeUndoBusinessEvent"; + public LoanWaiveChargeUndoBusinessEvent(LoanCharge value) { super(value); } @Override public String getType() { - return "LoanWaiveChargeUndoBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/product/LoanProductBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/product/LoanProductBusinessEvent.java index 53324f059..352315b26 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/product/LoanProductBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/product/LoanProductBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct; public abstract class LoanProductBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Loan"; + public LoanProductBusinessEvent(LoanProduct value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/product/LoanProductCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/product/LoanProductCreateBusinessEvent.java index 6546f8dd2..3c4e24db7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/product/LoanProductCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/product/LoanProductCreateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct; public class LoanProductCreateBusinessEvent extends LoanProductBusinessEvent { + private static final String TYPE = "LoanProductCreateBusinessEvent"; + public LoanProductCreateBusinessEvent(LoanProduct value) { super(value); } @Override public String getType() { - return "LoanProductCreateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargePaymentPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargePaymentPostBusinessEvent.java index 0ae55cc2f..4534222b9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargePaymentPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargePaymentPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanChargePaymentPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanChargePaymentPostBusinessEvent"; + public LoanChargePaymentPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanChargePaymentPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargePaymentPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargePaymentPreBusinessEvent.java index f84a336cc..74d3173df 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargePaymentPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargePaymentPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanChargePaymentPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanChargePaymentPreBusinessEvent"; + public LoanChargePaymentPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanChargePaymentPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargeRefundBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargeRefundBusinessEvent.java index 8d5cd3f24..5f9cacec3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargeRefundBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanChargeRefundBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanChargeRefundBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanChargeRefundBusinessEvent"; + public LoanChargeRefundBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanChargeRefundBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanCreditBalanceRefundPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanCreditBalanceRefundPostBusinessEvent.java index 592b8d1f2..bdb45a5ee 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanCreditBalanceRefundPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanCreditBalanceRefundPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanCreditBalanceRefundPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanCreditBalanceRefundPostBusinessEvent"; + public LoanCreditBalanceRefundPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanCreditBalanceRefundPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanCreditBalanceRefundPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanCreditBalanceRefundPreBusinessEvent.java index da2edd3b6..93871a413 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanCreditBalanceRefundPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanCreditBalanceRefundPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanCreditBalanceRefundPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanCreditBalanceRefundPreBusinessEvent"; + public LoanCreditBalanceRefundPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanCreditBalanceRefundPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanDisbursalTransactionBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanDisbursalTransactionBusinessEvent.java index 9d5814b74..efdf3ac9b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanDisbursalTransactionBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanDisbursalTransactionBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanDisbursalTransactionBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanDisbursalTransactionBusinessEvent"; + public LoanDisbursalTransactionBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanDisbursalTransactionBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanForeClosurePostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanForeClosurePostBusinessEvent.java index 02d2a2b4e..d43b76926 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanForeClosurePostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanForeClosurePostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanForeClosurePostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanForeClosurePostBusinessEvent"; + public LoanForeClosurePostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanForeClosurePostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanForeClosurePreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanForeClosurePreBusinessEvent.java index 85278d211..71a0974b8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanForeClosurePreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanForeClosurePreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanForeClosurePreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanForeClosurePreBusinessEvent"; + public LoanForeClosurePreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanForeClosurePreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanRefundPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanRefundPostBusinessEvent.java index 6b3d06d55..c0c28e915 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanRefundPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanRefundPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanRefundPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanRefundPostBusinessEvent"; + public LoanRefundPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanRefundPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanRefundPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanRefundPreBusinessEvent.java index b6280968b..be64fcd35 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanRefundPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanRefundPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanRefundPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanRefundPreBusinessEvent"; + public LoanRefundPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanRefundPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionBusinessEvent.java index cb7929735..541f302c4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public abstract class LoanTransactionBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Loan"; + public LoanTransactionBusinessEvent(LoanTransaction value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionGoodwillCreditPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionGoodwillCreditPostBusinessEvent.java index f3797c2f9..2cc0f814b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionGoodwillCreditPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionGoodwillCreditPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanTransactionGoodwillCreditPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanTransactionGoodwillCreditPostBusinessEvent"; + public LoanTransactionGoodwillCreditPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanTransactionGoodwillCreditPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionGoodwillCreditPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionGoodwillCreditPreBusinessEvent.java index 238f90cd2..0744eeab2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionGoodwillCreditPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionGoodwillCreditPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanTransactionGoodwillCreditPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanTransactionGoodwillCreditPreBusinessEvent"; + public LoanTransactionGoodwillCreditPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanTransactionGoodwillCreditPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMakeRepaymentPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMakeRepaymentPostBusinessEvent.java index 688859c5c..32f2175ee 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMakeRepaymentPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMakeRepaymentPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanTransactionMakeRepaymentPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanTransactionMakeRepaymentPostBusinessEvent"; + public LoanTransactionMakeRepaymentPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanTransactionMakeRepaymentPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMakeRepaymentPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMakeRepaymentPreBusinessEvent.java index cd96632a5..e7a7798b5 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMakeRepaymentPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMakeRepaymentPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanTransactionMakeRepaymentPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanTransactionMakeRepaymentPreBusinessEvent"; + public LoanTransactionMakeRepaymentPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanTransactionMakeRepaymentPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPostBusinessEvent.java index eca008a70..424a40881 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanTransactionMerchantIssuedRefundPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanTransactionMerchantIssuedRefundPostBusinessEvent"; + public LoanTransactionMerchantIssuedRefundPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanTransactionMerchantIssuedRefundPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPreBusinessEvent.java index 7135e3035..3d8606019 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionMerchantIssuedRefundPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanTransactionMerchantIssuedRefundPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanTransactionMerchantIssuedRefundPreBusinessEvent"; + public LoanTransactionMerchantIssuedRefundPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanTransactionMerchantIssuedRefundPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionPayoutRefundPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionPayoutRefundPostBusinessEvent.java index 69733198e..a0dcd0203 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionPayoutRefundPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionPayoutRefundPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanTransactionPayoutRefundPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanTransactionPayoutRefundPostBusinessEvent"; + public LoanTransactionPayoutRefundPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanTransactionPayoutRefundPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionPayoutRefundPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionPayoutRefundPreBusinessEvent.java index e6791e364..93b834f44 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionPayoutRefundPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionPayoutRefundPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanTransactionPayoutRefundPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanTransactionPayoutRefundPreBusinessEvent"; + public LoanTransactionPayoutRefundPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanTransactionPayoutRefundPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionRecoveryPaymentPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionRecoveryPaymentPostBusinessEvent.java index 89e97aca6..0a668bfe0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionRecoveryPaymentPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionRecoveryPaymentPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanTransactionRecoveryPaymentPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanTransactionRecoveryPaymentPostBusinessEvent"; + public LoanTransactionRecoveryPaymentPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanTransactionRecoveryPaymentPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionRecoveryPaymentPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionRecoveryPaymentPreBusinessEvent.java index 9fa8424ae..e6509749b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionRecoveryPaymentPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanTransactionRecoveryPaymentPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanTransactionRecoveryPaymentPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanTransactionRecoveryPaymentPreBusinessEvent"; + public LoanTransactionRecoveryPaymentPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanTransactionRecoveryPaymentPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanUndoWrittenOffBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanUndoWrittenOffBusinessEvent.java index 7dfbba5be..5863f2ccc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanUndoWrittenOffBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanUndoWrittenOffBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanUndoWrittenOffBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanUndoWrittenOffBusinessEvent"; + public LoanUndoWrittenOffBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanUndoWrittenOffBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWaiveInterestBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWaiveInterestBusinessEvent.java index 4d5e1c3c8..cfc405738 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWaiveInterestBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWaiveInterestBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanWaiveInterestBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanWaiveInterestBusinessEvent"; + public LoanWaiveInterestBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanWaiveInterestBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWrittenOffPostBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWrittenOffPostBusinessEvent.java index ffa9468ec..83a77bb88 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWrittenOffPostBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWrittenOffPostBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction; public class LoanWrittenOffPostBusinessEvent extends LoanTransactionBusinessEvent { + private static final String TYPE = "LoanWrittenOffPostBusinessEvent"; + public LoanWrittenOffPostBusinessEvent(LoanTransaction value) { super(value); } @Override public String getType() { - return "LoanWrittenOffPostBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWrittenOffPreBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWrittenOffPreBusinessEvent.java index 2a7b2ded6..44ec3e43f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWrittenOffPreBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/loan/transaction/LoanWrittenOffPreBusinessEvent.java @@ -23,12 +23,14 @@ import org.apache.fineract.portfolio.loanaccount.domain.Loan; public class LoanWrittenOffPreBusinessEvent extends LoanBusinessEvent { + private static final String TYPE = "LoanWrittenOffPreBusinessEvent"; + public LoanWrittenOffPreBusinessEvent(Loan value) { super(value); } @Override public String getType() { - return "LoanWrittenOffPreBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsAccountBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsAccountBusinessEvent.java index dd3dc1691..e09b45c98 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsAccountBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsAccountBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; public abstract class SavingsAccountBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Savings"; + public SavingsAccountBusinessEvent(SavingsAccount value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsActivateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsActivateBusinessEvent.java index 9e0f37c31..96db65151 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsActivateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsActivateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; public class SavingsActivateBusinessEvent extends SavingsAccountBusinessEvent { + private static final String TYPE = "SavingsActivateBusinessEvent"; + public SavingsActivateBusinessEvent(SavingsAccount value) { super(value); } @Override public String getType() { - return "SavingsActivateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsApproveBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsApproveBusinessEvent.java index a1c09c5ef..0745a3076 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsApproveBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsApproveBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; public class SavingsApproveBusinessEvent extends SavingsAccountBusinessEvent { + private static final String TYPE = "SavingsApproveBusinessEvent"; + public SavingsApproveBusinessEvent(SavingsAccount value) { super(value); } @Override public String getType() { - return "SavingsApproveBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsCloseBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsCloseBusinessEvent.java index d9c550375..9cbc2391d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsCloseBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsCloseBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; public class SavingsCloseBusinessEvent extends SavingsAccountBusinessEvent { + private static final String TYPE = "SavingsCloseBusinessEvent"; + public SavingsCloseBusinessEvent(SavingsAccount value) { super(value); } @Override public String getType() { - return "SavingsCloseBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsCreateBusinessEvent.java index 53f261b1c..dfa0c6cb9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsCreateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; public class SavingsCreateBusinessEvent extends SavingsAccountBusinessEvent { + private static final String TYPE = "SavingsCreateBusinessEvent"; + public SavingsCreateBusinessEvent(SavingsAccount value) { super(value); } @Override public String getType() { - return "SavingsCreateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsPostInterestBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsPostInterestBusinessEvent.java index 24d3cc08a..a952421ac 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsPostInterestBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsPostInterestBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; public class SavingsPostInterestBusinessEvent extends SavingsAccountBusinessEvent { + private static final String TYPE = "SavingsPostInterestBusinessEvent"; + public SavingsPostInterestBusinessEvent(SavingsAccount value) { super(value); } @Override public String getType() { - return "SavingsPostInterestBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsRejectBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsRejectBusinessEvent.java index 9756fedf0..e20fce4c2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsRejectBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/SavingsRejectBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccount; public class SavingsRejectBusinessEvent extends SavingsAccountBusinessEvent { + private static final String TYPE = "SavingsRejectBusinessEvent"; + public SavingsRejectBusinessEvent(SavingsAccount value) { super(value); } @Override public String getType() { - return "SavingsRejectBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsAccountTransactionBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsAccountTransactionBusinessEvent.java index d2a4e2cba..fe56ce09f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsAccountTransactionBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsAccountTransactionBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction; public abstract class SavingsAccountTransactionBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Savings"; + public SavingsAccountTransactionBusinessEvent(SavingsAccountTransaction value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsDepositBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsDepositBusinessEvent.java index cdd73913e..627540e56 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsDepositBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsDepositBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction; public class SavingsDepositBusinessEvent extends SavingsAccountTransactionBusinessEvent { + private static final String TYPE = "SavingsDepositBusinessEvent"; + public SavingsDepositBusinessEvent(SavingsAccountTransaction value) { super(value); } @Override public String getType() { - return "SavingsDepositBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsWithdrawalBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsWithdrawalBusinessEvent.java index 860cd9b01..1f904852e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsWithdrawalBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/savings/transaction/SavingsWithdrawalBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction; public class SavingsWithdrawalBusinessEvent extends SavingsAccountTransactionBusinessEvent { + private static final String TYPE = "SavingsWithdrawalBusinessEvent"; + public SavingsWithdrawalBusinessEvent(SavingsAccountTransaction value) { super(value); } @Override public String getType() { - return "SavingsWithdrawalBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountApproveBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountApproveBusinessEvent.java index 517afce2f..8ffa072fa 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountApproveBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountApproveBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccount; public class ShareAccountApproveBusinessEvent extends ShareAccountBusinessEvent { + private static final String TYPE = "ShareAccountApproveBusinessEvent"; + public ShareAccountApproveBusinessEvent(ShareAccount value) { super(value); } @Override public String getType() { - return "ShareAccountApproveBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountBusinessEvent.java index 3204df993..b4f90febf 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountBusinessEvent.java @@ -23,7 +23,14 @@ import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccount; public abstract class ShareAccountBusinessEvent extends AbstractBusinessEvent { + private static final String CATEGORY = "Share"; + public ShareAccountBusinessEvent(ShareAccount value) { super(value); } + + @Override + public String getCategory() { + return CATEGORY; + } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountCreateBusinessEvent.java index ea8b596a4..e10c96053 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareAccountCreateBusinessEvent.java @@ -22,12 +22,14 @@ import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccount; public class ShareAccountCreateBusinessEvent extends ShareAccountBusinessEvent { + private static final String TYPE = "ShareAccountCreateBusinessEvent"; + public ShareAccountCreateBusinessEvent(ShareAccount value) { super(value); } @Override public String getType() { - return "ShareAccountCreateBusinessEvent"; + return TYPE; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareProductDividentsCreateBusinessEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareProductDividentsCreateBusinessEvent.java index f363dda40..0e25d7ece 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareProductDividentsCreateBusinessEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/business/domain/share/ShareProductDividentsCreateBusinessEvent.java @@ -22,12 +22,20 @@ import org.apache.fineract.infrastructure.event.business.domain.AbstractBusiness public class ShareProductDividentsCreateBusinessEvent extends AbstractBusinessEvent { + private static final String TYPE = "ShareProductDividentsCreateBusinessEvent"; + private static final String CATEGORY = "Share"; + public ShareProductDividentsCreateBusinessEvent(Long value) { super(value); } @Override public String getType() { - return "ShareProductDividentsCreateBusinessEvent"; + return TYPE; + } + + @Override + public String getCategory() { + return CATEGORY; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/repository/domain/ExternalEvent.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/repository/domain/ExternalEvent.java index 16f98f283..e237a38e7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/repository/domain/ExternalEvent.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/repository/domain/ExternalEvent.java @@ -42,6 +42,9 @@ public class ExternalEvent extends AbstractPersistableCustom { @Column(name = "type", nullable = false) private String type; + @Column(name = "category", nullable = false) + private String category; + @Column(name = "schema", nullable = false) private String schema; @@ -67,8 +70,9 @@ public class ExternalEvent extends AbstractPersistableCustom { @Column(name = "business_date", nullable = false) private LocalDate businessDate; - public ExternalEvent(String type, String schema, byte[] data, String idempotencyKey) { + public ExternalEvent(String type, String category, String schema, byte[] data, String idempotencyKey) { this.type = type; + this.category = category; this.schema = schema; this.data = data; this.idempotencyKey = idempotencyKey; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventService.java index cede39a7a..b158eee6b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventService.java @@ -84,17 +84,19 @@ public class ExternalEventService { BulkMessagePayloadV1 avroDto = new BulkMessagePayloadV1(messages); byte[] data = byteBufferConverter.convert(avroDto.toByteBuffer()); - return new ExternalEvent(bulkBusinessEvent.getType(), BulkMessagePayloadV1.class.getName(), data, idempotencyKey); + return new ExternalEvent(bulkBusinessEvent.getType(), bulkBusinessEvent.getCategory(), BulkMessagePayloadV1.class.getName(), data, + idempotencyKey); } private ExternalEvent handleRegularBusinessEvent(BusinessEvent event) throws IOException { String eventType = event.getType(); + String eventCategory = event.getCategory(); String idempotencyKey = idempotencyKeyGenerator.generate(event); BusinessEventSerializer serializer = serializerFactory.create(event); String schema = serializer.getSupportedSchema().getName(); byte[] data = serializer.serialize(event); - return new ExternalEvent(eventType, schema, data, idempotencyKey); + return new ExternalEvent(eventType, eventCategory, schema, data, idempotencyKey); } private void flushChangesBeforeSerialization() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/message/MessageFactory.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/message/MessageFactory.java index 8e727515d..2691d54fb 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/message/MessageFactory.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/message/MessageFactory.java @@ -80,8 +80,7 @@ public class MessageFactory implements InitializingBean { MessageId id = new MessageId(event.getId().intValue()); MessageSource source = new MessageSource(SOURCE_UUID); MessageType type = new MessageType(event.getType()); - String messageCategory = "nocategory"; - MessageCategory category = new MessageCategory(messageCategory); + MessageCategory category = new MessageCategory(event.getCategory()); MessageIdempotencyKey idempotencyKey = new MessageIdempotencyKey(event.getIdempotencyKey()); MessageDataSchema dataSchema = new MessageDataSchema(event.getSchema()); MessageData data = new MessageData(byteBufferConverter.convert(event.getData())); diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml index 6d8ff7c18..6ec9cf739 100644 --- a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml +++ b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml @@ -70,4 +70,5 @@ + diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0051_external_event_table_category_info.xml b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0051_external_event_table_category_info.xml new file mode 100644 index 000000000..80b839f80 --- /dev/null +++ b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0051_external_event_table_category_info.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/business/service/BusinessEventNotifierServiceImplTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/business/service/BusinessEventNotifierServiceImplTest.java index e1a0ad814..3dcd7798d 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/business/service/BusinessEventNotifierServiceImplTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/business/service/BusinessEventNotifierServiceImplTest.java @@ -156,6 +156,11 @@ class BusinessEventNotifierServiceImplTest { public String getType() { return null; } + + @Override + public String getCategory() { + return null; + } } } diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/jobs/SendAsynchronousEventsTaskletTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/jobs/SendAsynchronousEventsTaskletTest.java index fe7c89778..7f15b9c2d 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/jobs/SendAsynchronousEventsTaskletTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/jobs/SendAsynchronousEventsTaskletTest.java @@ -99,8 +99,8 @@ class SendAsynchronousEventsTaskletTest { @Test public void givenBatchSize2WhenTaskExecutionThenSend2Events() throws Exception { // given - List events = Arrays.asList(new ExternalEvent("aType", "aSchema", new byte[0], "aIdemtpotencyKey"), - new ExternalEvent("aType", "aSchema", new byte[0], "aIdemtpotencyKey")); + List events = Arrays.asList(new ExternalEvent("aType", "aCategory", "aSchema", new byte[0], "aIdemtpotencyKey"), + new ExternalEvent("aType", "aCategory", "aSchema", new byte[0], "aIdemtpotencyKey")); // Dummy Message MessageV1 dummyMessage = new MessageV1(1, "aSource", "aType", "nocategory", "aCreateDate", "aTennantId", "anidempotencyKey", "aSchema", Mockito.mock(ByteBuffer.class)); @@ -120,8 +120,8 @@ class SendAsynchronousEventsTaskletTest { @Test public void givenBatchSize2WhenEventSendFailsThenExecutionStops() throws Exception { // given - List events = Arrays.asList(new ExternalEvent("aType", "aSchema", new byte[0], "aIdemtpotencyKey"), - new ExternalEvent("aType", "aSchema", new byte[0], "aIdemtpotencyKey")); + List events = Arrays.asList(new ExternalEvent("aType", "aCategory", "aSchema", new byte[0], "aIdemtpotencyKey"), + new ExternalEvent("aType", "aCategory", "aSchema", new byte[0], "aIdemtpotencyKey")); MessageV1 dummyMessage = new MessageV1(1, "aSource", "aType", "nocategory", "aCreateDate", "aTennantId", "anidempotencyKey", "aSchema", Mockito.mock(ByteBuffer.class)); when(repository.findByStatusOrderById(Mockito.any(), Mockito.any())).thenReturn(events); @@ -140,7 +140,7 @@ class SendAsynchronousEventsTaskletTest { public void givenOneEventWhenEventSentThenEventStatusUpdates() throws Exception { // given ArgumentCaptor externalEventArgumentCaptor = ArgumentCaptor.forClass(ExternalEvent.class); - List events = Arrays.asList(new ExternalEvent("aType", "aSchema", new byte[0], "aIdemtpotencyKey")); + List events = Arrays.asList(new ExternalEvent("aType", "aCategory", "aSchema", new byte[0], "aIdemtpotencyKey")); MessageV1 dummyMessage = new MessageV1(1, "aSource", "aType", "nocategory", "aCreateDate", "aTennantId", "anidempotencyKey", "aSchema", Mockito.mock(ByteBuffer.class)); when(repository.findByStatusOrderById(Mockito.any(), Mockito.any())).thenReturn(events); diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventServiceTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventServiceTest.java index 37d919484..7b0101fce 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventServiceTest.java +++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventServiceTest.java @@ -159,4 +159,31 @@ class ExternalEventServiceTest { assertThat(externalEvent.getType()).isEqualTo(eventType); assertThat(externalEvent.getSchema()).isEqualTo(schema); } + + @Test + public void testPostEventShouldSaveEventCategory() throws IOException { + // given + ArgumentCaptor externalEventArgumentCaptor = ArgumentCaptor.forClass(ExternalEvent.class); + String eventSchema = "org.apache.fineract.avro.loan.v1.LoanAccountDataV1"; + String eventType = "TestType"; + String eventCategory = "TestCategory"; + String idempotencyKey = "key"; + BusinessEvent event = mock(BusinessEvent.class); + BusinessEventSerializer eventSerializer = mock(BusinessEventSerializer.class); + byte[] data = new byte[0]; + + given(event.getType()).willReturn(eventType); + given(event.getCategory()).willReturn(eventCategory); + given(idempotencyKeyGenerator.generate(event)).willReturn(idempotencyKey); + given(serializerFactory.create(event)).willReturn(eventSerializer); + given(eventSerializer.getSupportedSchema()).will(invocation -> LoanAccountDataV1.class); + given(eventSerializer.serialize(event)).willReturn(data); + // when + underTest.postEvent(event); + // then + verify(repository).save(externalEventArgumentCaptor.capture()); + ExternalEvent externalEvent = externalEventArgumentCaptor.getValue(); + assertThat(externalEvent.getCategory()).isEqualTo(eventCategory); + + } }