Refactored business events
This commit is contained in:
committed by
Arnold Gálovics
parent
ddc6a76689
commit
cd38262152
+31
-59
@@ -23,92 +23,72 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.infrastructure.campaigns.email.domain.EmailCampaign;
|
||||
import org.apache.fineract.infrastructure.campaigns.email.domain.EmailCampaignRepository;
|
||||
import org.apache.fineract.infrastructure.campaigns.sms.constants.SmsCampaignTriggerType;
|
||||
import org.apache.fineract.portfolio.businessevent.BusinessEventListener;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApprovedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanRejectedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class EmailCampaignDomainServiceImpl implements EmailCampaignDomainService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(EmailCampaignDomainServiceImpl.class);
|
||||
private final BusinessEventNotifierService businessEventNotifierService;
|
||||
private final EmailCampaignWritePlatformService emailCampaignWritePlatformService;
|
||||
private final EmailCampaignRepository emailCampaignRepository;
|
||||
|
||||
@Autowired
|
||||
public EmailCampaignDomainServiceImpl(BusinessEventNotifierService businessEventNotifierService,
|
||||
EmailCampaignWritePlatformService emailCampaignWritePlatformService, EmailCampaignRepository emailCampaignRepository) {
|
||||
this.businessEventNotifierService = businessEventNotifierService;
|
||||
this.emailCampaignWritePlatformService = emailCampaignWritePlatformService;
|
||||
this.emailCampaignRepository = emailCampaignRepository;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void addListeners() {
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_APPROVED,
|
||||
new EmailCampaignDomainServiceImpl.SendEmailOnLoanApproved());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_REJECTED,
|
||||
new EmailCampaignDomainServiceImpl.SendEmailOnLoanRejected());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_MAKE_REPAYMENT,
|
||||
new EmailCampaignDomainServiceImpl.SendEmailOnLoanRepayment());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new SendEmailOnLoanApproved());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanRejectedBusinessEvent.class, new SendEmailOnLoanRejected());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new SendEmailOnLoanRepayment());
|
||||
}
|
||||
|
||||
private class SendEmailOnLoanRepayment extends EmailBusinessEventAdapter {
|
||||
private class SendEmailOnLoanRepayment implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN_TRANSACTION);
|
||||
if (entity instanceof LoanTransaction) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) entity;
|
||||
try {
|
||||
notifyLoanOwner(loanTransaction, "Loan Repayment");
|
||||
} catch (IOException e) {
|
||||
LOG.error("Exception when trying to send triggered email: {}", e.getMessage());
|
||||
}
|
||||
public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
try {
|
||||
notifyLoanOwner(loanTransaction, "Loan Repayment");
|
||||
} catch (IOException e) {
|
||||
log.error("Exception when trying to send triggered email: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class SendEmailOnLoanRejected extends EmailBusinessEventAdapter {
|
||||
private class SendEmailOnLoanRejected implements BusinessEventListener<LoanRejectedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity instanceof Loan) {
|
||||
Loan loan = (Loan) entity;
|
||||
try {
|
||||
notifyLoanOwner(loan, "Loan Rejected");
|
||||
} catch (IOException e) {
|
||||
LOG.error("Exception when trying to send triggered email: {}", e.getMessage());
|
||||
}
|
||||
public void onBusinessEvent(LoanRejectedBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
try {
|
||||
notifyLoanOwner(loan, "Loan Rejected");
|
||||
} catch (IOException e) {
|
||||
log.error("Exception when trying to send triggered email: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class SendEmailOnLoanApproved extends EmailBusinessEventAdapter {
|
||||
private class SendEmailOnLoanApproved implements BusinessEventListener<LoanApprovedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity instanceof Loan) {
|
||||
Loan loan = (Loan) entity;
|
||||
try {
|
||||
notifyLoanOwner(loan, "Loan Approved");
|
||||
} catch (IOException e) {
|
||||
LOG.error("Exception when trying to send triggered email: {}", e.getMessage());
|
||||
}
|
||||
public void onBusinessEvent(LoanApprovedBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
try {
|
||||
notifyLoanOwner(loan, "Loan Approved");
|
||||
} catch (IOException e) {
|
||||
log.error("Exception when trying to send triggered email: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,14 +115,6 @@ public class EmailCampaignDomainServiceImpl implements EmailCampaignDomainServic
|
||||
}
|
||||
}
|
||||
|
||||
private abstract static class EmailBusinessEventAdapter implements BusinessEventListener {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
// Nothing to do
|
||||
}
|
||||
}
|
||||
|
||||
private List<EmailCampaign> retrieveEmailCampaigns(String paramValue) {
|
||||
List<EmailCampaign> emailCampaigns = emailCampaignRepository.findActiveEmailCampaigns("%" + paramValue + "%",
|
||||
SmsCampaignTriggerType.TRIGGERED.getValue());
|
||||
|
||||
+57
-115
@@ -32,6 +32,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.infrastructure.campaigns.sms.constants.SmsCampaignTriggerType;
|
||||
import org.apache.fineract.infrastructure.campaigns.sms.domain.SmsCampaign;
|
||||
import org.apache.fineract.infrastructure.campaigns.sms.domain.SmsCampaignRepository;
|
||||
@@ -43,8 +45,15 @@ import org.apache.fineract.infrastructure.sms.scheduler.SmsMessageScheduledJobSe
|
||||
import org.apache.fineract.organisation.office.domain.Office;
|
||||
import org.apache.fineract.organisation.office.domain.OfficeRepository;
|
||||
import org.apache.fineract.portfolio.businessevent.BusinessEventListener;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.client.ClientActivateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.client.ClientRejectBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApprovedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanRejectedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsActivateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsRejectBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.transaction.SavingsDepositBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.transaction.SavingsWithdrawalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
import org.apache.fineract.portfolio.group.domain.Group;
|
||||
@@ -54,18 +63,13 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
import org.apache.fineract.portfolio.loanaccount.exception.InvalidLoanTypeException;
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SmsCampaignDomainServiceImpl.class);
|
||||
|
||||
// private static final int POOL_SIZE = 5 ;
|
||||
|
||||
private final SmsCampaignRepository smsCampaignRepository;
|
||||
private final SmsMessageRepository smsMessageRepository;
|
||||
private final OfficeRepository officeRepository;
|
||||
@@ -76,35 +80,19 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
||||
private final SmsMessageScheduledJobService smsMessageScheduledJobService;
|
||||
private final SmsCampaignValidator smsCampaignValidator;
|
||||
|
||||
@Autowired
|
||||
public SmsCampaignDomainServiceImpl(final SmsCampaignRepository smsCampaignRepository, final SmsMessageRepository smsMessageRepository,
|
||||
final BusinessEventNotifierService businessEventNotifierService, final OfficeRepository officeRepository,
|
||||
final SmsCampaignWritePlatformService smsCampaignWritePlatformCommandHandler, final GroupRepository groupRepository,
|
||||
final SmsMessageScheduledJobService smsMessageScheduledJobService, final SmsCampaignValidator smsCampaignValidator) {
|
||||
this.smsCampaignRepository = smsCampaignRepository;
|
||||
this.smsMessageRepository = smsMessageRepository;
|
||||
this.businessEventNotifierService = businessEventNotifierService;
|
||||
this.officeRepository = officeRepository;
|
||||
this.smsCampaignWritePlatformCommandHandler = smsCampaignWritePlatformCommandHandler;
|
||||
this.groupRepository = groupRepository;
|
||||
this.smsMessageScheduledJobService = smsMessageScheduledJobService;
|
||||
this.smsCampaignValidator = smsCampaignValidator;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void addListeners() {
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_APPROVED, new SendSmsOnLoanApproved());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_REJECTED, new SendSmsOnLoanRejected());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_MAKE_REPAYMENT, new SendSmsOnLoanRepayment());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.CLIENTS_ACTIVATE, new ClientActivatedListener());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.CLIENTS_REJECT, new ClientRejectedListener());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_ACTIVATE,
|
||||
new SavingsAccountActivatedListener());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_REJECT, new SavingsAccountRejectedListener());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_DEPOSIT,
|
||||
new SavingsAccountTransactionListener(true));
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_WITHDRAWAL,
|
||||
new SavingsAccountTransactionListener(false));
|
||||
businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new SendSmsOnLoanApproved());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanRejectedBusinessEvent.class, new SendSmsOnLoanRejected());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new SendSmsOnLoanRepayment());
|
||||
businessEventNotifierService.addBusinessEventListener(ClientActivateBusinessEvent.class, new ClientActivatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(ClientRejectBusinessEvent.class, new ClientRejectedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsActivateBusinessEvent.class, new SavingsAccountActivatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsRejectBusinessEvent.class, new SavingsAccountRejectedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsDepositBusinessEvent.class,
|
||||
new DepositSavingsAccountTransactionListener());
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsWithdrawalBusinessEvent.class,
|
||||
new NonDepositSavingsAccountTransactionListener());
|
||||
}
|
||||
|
||||
private void notifyRejectedLoanOwner(Loan loan) {
|
||||
@@ -227,9 +215,9 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
LOG.error("smsParams does not contain the key: ", e);
|
||||
log.error("smsParams does not contain the key: ", e);
|
||||
} catch (final RuntimeException e) {
|
||||
LOG.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
||||
log.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,9 +270,9 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
||||
this.smsMessageScheduledJobService.sendTriggeredMessages(smsDataMap);
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
LOG.error("smsParams does not contain the key: ", e);
|
||||
log.error("smsParams does not contain the key: ", e);
|
||||
} catch (final RuntimeException e) {
|
||||
LOG.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
||||
log.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,123 +370,77 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
||||
return smsParams;
|
||||
}
|
||||
|
||||
private abstract static class SmsBusinessEventAdapter implements BusinessEventListener {
|
||||
private class SendSmsOnLoanApproved implements BusinessEventListener<LoanApprovedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
// Nothing to do
|
||||
public void onBusinessEvent(LoanApprovedBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
notifyAcceptedLoanOwner(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class SendSmsOnLoanApproved extends SmsBusinessEventAdapter {
|
||||
private class SendSmsOnLoanRejected implements BusinessEventListener<LoanRejectedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity instanceof Loan) {
|
||||
Loan loan = (Loan) entity;
|
||||
notifyAcceptedLoanOwner(loan);
|
||||
}
|
||||
public void onBusinessEvent(LoanRejectedBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
notifyRejectedLoanOwner(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class SendSmsOnLoanRejected extends SmsBusinessEventAdapter {
|
||||
private class SendSmsOnLoanRepayment implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity instanceof Loan) {
|
||||
Loan loan = (Loan) entity;
|
||||
notifyRejectedLoanOwner(loan);
|
||||
}
|
||||
public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
|
||||
sendSmsForLoanRepayment(event.get());
|
||||
}
|
||||
}
|
||||
|
||||
private class SendSmsOnLoanRepayment extends SmsBusinessEventAdapter {
|
||||
private class ClientActivatedListener implements BusinessEventListener<ClientActivateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN_TRANSACTION);
|
||||
if (entity instanceof LoanTransaction) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) entity;
|
||||
sendSmsForLoanRepayment(loanTransaction);
|
||||
}
|
||||
public void onBusinessEvent(ClientActivateBusinessEvent event) {
|
||||
notifyClientActivated(event.get());
|
||||
}
|
||||
}
|
||||
|
||||
private class ClientActivatedListener extends SmsBusinessEventAdapter {
|
||||
private class ClientRejectedListener implements BusinessEventListener<ClientRejectBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.CLIENT);
|
||||
if (entity instanceof Client) {
|
||||
notifyClientActivated((Client) entity);
|
||||
}
|
||||
public void onBusinessEvent(ClientRejectBusinessEvent event) {
|
||||
notifyClientRejected(event.get());
|
||||
}
|
||||
}
|
||||
|
||||
private class ClientRejectedListener extends SmsBusinessEventAdapter {
|
||||
private class SavingsAccountActivatedListener implements BusinessEventListener<SavingsActivateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.CLIENT);
|
||||
if (entity instanceof Client) {
|
||||
notifyClientRejected((Client) entity);
|
||||
}
|
||||
|
||||
public void onBusinessEvent(SavingsActivateBusinessEvent event) {
|
||||
notifySavingsAccountActivated(event.get());
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountActivatedListener extends SmsBusinessEventAdapter {
|
||||
private class SavingsAccountRejectedListener implements BusinessEventListener<SavingsRejectBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SAVING);
|
||||
if (entity instanceof SavingsAccount) {
|
||||
notifySavingsAccountActivated((SavingsAccount) entity);
|
||||
}
|
||||
|
||||
public void onBusinessEvent(SavingsRejectBusinessEvent event) {
|
||||
notifySavingsAccountRejected(event.get());
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountRejectedListener extends SmsBusinessEventAdapter {
|
||||
private class DepositSavingsAccountTransactionListener implements BusinessEventListener<SavingsDepositBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SAVING);
|
||||
if (entity instanceof SavingsAccount) {
|
||||
notifySavingsAccountRejected((SavingsAccount) entity);
|
||||
}
|
||||
public void onBusinessEvent(SavingsDepositBusinessEvent event) {
|
||||
sendSmsForSavingsTransaction(event.get(), true);
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountTransactionListener extends SmsBusinessEventAdapter {
|
||||
|
||||
final boolean isDeposit;
|
||||
|
||||
SavingsAccountTransactionListener(final boolean isDeposit) {
|
||||
this.isDeposit = isDeposit;
|
||||
}
|
||||
private class NonDepositSavingsAccountTransactionListener implements BusinessEventListener<SavingsWithdrawalBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SAVINGS_TRANSACTION);
|
||||
if (entity instanceof SavingsAccountTransaction) {
|
||||
sendSmsForSavingsTransaction((SavingsAccountTransaction) entity, this.isDeposit);
|
||||
}
|
||||
public void onBusinessEvent(SavingsWithdrawalBusinessEvent event) {
|
||||
sendSmsForSavingsTransaction(event.get(), false);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* private abstract class Task implements Runnable {
|
||||
*
|
||||
* protected final FineractPlatformTenant tenant;
|
||||
*
|
||||
* protected final String reportName ;
|
||||
*
|
||||
* private final Object entity ;
|
||||
*
|
||||
* public Task(final FineractPlatformTenant tenant, final String reportName, final Object entity) { this.tenant =
|
||||
* tenant; this.reportName = reportName ; this.entity = entity ; } }
|
||||
*/
|
||||
}
|
||||
|
||||
+176
-247
@@ -21,7 +21,6 @@ package org.apache.fineract.notification.service;
|
||||
import static java.util.stream.Collectors.toSet;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -32,8 +31,25 @@ import org.apache.fineract.infrastructure.security.service.PlatformSecurityConte
|
||||
import org.apache.fineract.notification.data.NotificationData;
|
||||
import org.apache.fineract.notification.eventandlistener.NotificationEventPublisher;
|
||||
import org.apache.fineract.portfolio.businessevent.BusinessEventListener;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.client.ClientCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.deposit.FixedDepositAccountCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.deposit.RecurringDepositAccountCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.group.CentersCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.group.GroupsCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApprovedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCloseAsRescheduleBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCloseBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCreatedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.product.LoanProductCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsApproveBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsCloseBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsPostInterestBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.transaction.SavingsDepositBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.share.ShareAccountApproveBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.share.ShareAccountCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.share.ShareProductDividentsCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
@@ -60,318 +76,231 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
|
||||
|
||||
@PostConstruct
|
||||
public void addListeners() {
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.CLIENTS_CREATE, new ClientCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_APPROVE, new SavingsAccountApprovedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.CENTERS_CREATE, new CenterCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.GROUPS_CREATE, new GroupCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_DEPOSIT, new SavingsAccountDepositListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SHARE_PRODUCT_DIVIDENDS_CREATE,
|
||||
businessEventNotifierService.addBusinessEventListener(ClientCreateBusinessEvent.class, new ClientCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsApproveBusinessEvent.class, new SavingsAccountApprovedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(CentersCreateBusinessEvent.class, new CenterCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(GroupsCreateBusinessEvent.class, new GroupCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsDepositBusinessEvent.class, new SavingsAccountDepositListener());
|
||||
businessEventNotifierService.addBusinessEventListener(ShareProductDividentsCreateBusinessEvent.class,
|
||||
new ShareProductDividendCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.FIXED_DEPOSIT_ACCOUNT_CREATE,
|
||||
businessEventNotifierService.addBusinessEventListener(FixedDepositAccountCreateBusinessEvent.class,
|
||||
new FixedDepositAccountCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.RECURRING_DEPOSIT_ACCOUNT_CREATE,
|
||||
businessEventNotifierService.addBusinessEventListener(RecurringDepositAccountCreateBusinessEvent.class,
|
||||
new RecurringDepositAccountCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_POST_INTEREST, new SavingsPostInterestListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_CREATE, new LoanCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_APPROVED, new LoanApprovedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_CLOSE, new LoanClosedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_CLOSE_AS_RESCHEDULE,
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsPostInterestBusinessEvent.class, new SavingsPostInterestListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanCreatedBusinessEvent.class, new LoanCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new LoanApprovedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanCloseBusinessEvent.class, new LoanClosedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanCloseAsRescheduleBusinessEvent.class,
|
||||
new LoanCloseAsRescheduledListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_MAKE_REPAYMENT, new LoanMakeRepaymentListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_PRODUCT_CREATE, new LoanProductCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_CREATE, new SavingsAccountCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SAVINGS_CLOSE, new SavingsAccountClosedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SHARE_ACCOUNT_CREATE, new ShareAccountCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.SHARE_ACCOUNT_APPROVE, new ShareAccountApprovedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new LoanMakeRepaymentListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanProductCreateBusinessEvent.class, new LoanProductCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsCreateBusinessEvent.class, new SavingsAccountCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(SavingsCloseBusinessEvent.class, new SavingsAccountClosedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(ShareAccountCreateBusinessEvent.class, new ShareAccountCreatedListener());
|
||||
businessEventNotifierService.addBusinessEventListener(ShareAccountApproveBusinessEvent.class, new ShareAccountApprovedListener());
|
||||
}
|
||||
|
||||
private abstract static class NotificationBusinessEventAdapter implements BusinessEventListener {
|
||||
private class ClientCreatedListener implements BusinessEventListener<ClientCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
public void onBusinessEvent(ClientCreateBusinessEvent event) {
|
||||
Client client = event.get();
|
||||
buildNotification("ACTIVATE_CLIENT", "client", client.getId(), "New client created", "created",
|
||||
context.authenticatedUser().getId(), client.getOffice().getId());
|
||||
}
|
||||
}
|
||||
|
||||
private class ClientCreatedListener extends NotificationBusinessEventAdapter {
|
||||
private class CenterCreatedListener implements BusinessEventListener<CentersCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Client client;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.CLIENT);
|
||||
if (entity != null) {
|
||||
client = (Client) entity;
|
||||
buildNotification("ACTIVATE_CLIENT", "client", client.getId(), "New client created", "created",
|
||||
context.authenticatedUser().getId(), client.getOffice().getId());
|
||||
public void onBusinessEvent(CentersCreateBusinessEvent event) {
|
||||
CommandProcessingResult commandProcessingResult = event.get();
|
||||
buildNotification("ACTIVATE_CENTER", "center", commandProcessingResult.getGroupId(), "New center created", "created",
|
||||
context.authenticatedUser().getId(), commandProcessingResult.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class GroupCreatedListener implements BusinessEventListener<GroupsCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(GroupsCreateBusinessEvent event) {
|
||||
CommandProcessingResult commandProcessingResult = event.get();
|
||||
buildNotification("ACTIVATE_GROUP", "group", commandProcessingResult.getGroupId(), "New group created", "created",
|
||||
context.authenticatedUser().getId(), commandProcessingResult.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountDepositListener implements BusinessEventListener<SavingsDepositBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(SavingsDepositBusinessEvent event) {
|
||||
SavingsAccountTransaction savingsAccountTransaction = event.get();
|
||||
buildNotification("READ_SAVINGSACCOUNT", "savingsAccount", savingsAccountTransaction.getSavingsAccount().getId(),
|
||||
"Deposit made", "depositMade", context.authenticatedUser().getId(),
|
||||
savingsAccountTransaction.getSavingsAccount().officeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class ShareProductDividendCreatedListener implements BusinessEventListener<ShareProductDividentsCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(ShareProductDividentsCreateBusinessEvent event) {
|
||||
Long shareProductId = event.get();
|
||||
buildNotification("READ_DIVIDEND_SHAREPRODUCT", "shareProduct", shareProductId, "Dividend posted to account", "dividendPosted",
|
||||
context.authenticatedUser().getId(), context.authenticatedUser().getOffice().getId());
|
||||
}
|
||||
}
|
||||
|
||||
private class FixedDepositAccountCreatedListener implements BusinessEventListener<FixedDepositAccountCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(FixedDepositAccountCreateBusinessEvent event) {
|
||||
FixedDepositAccount fixedDepositAccount = event.get();
|
||||
buildNotification("APPROVE_FIXEDDEPOSITACCOUNT", "fixedDeposit", fixedDepositAccount.getId(),
|
||||
"New fixed deposit account created", "created", context.authenticatedUser().getId(), fixedDepositAccount.officeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class RecurringDepositAccountCreatedListener implements BusinessEventListener<RecurringDepositAccountCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(RecurringDepositAccountCreateBusinessEvent event) {
|
||||
RecurringDepositAccount recurringDepositAccount = event.get();
|
||||
buildNotification("APPROVE_RECURRINGDEPOSITACCOUNT", "recurringDepositAccount", recurringDepositAccount.getId(),
|
||||
"New recurring deposit account created", "created", context.authenticatedUser().getId(),
|
||||
recurringDepositAccount.officeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountApprovedListener implements BusinessEventListener<SavingsApproveBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(SavingsApproveBusinessEvent event) {
|
||||
SavingsAccount savingsAccount = event.get();
|
||||
if (savingsAccount.depositAccountType().equals(DepositAccountType.FIXED_DEPOSIT)) {
|
||||
|
||||
buildNotification("ACTIVATE_FIXEDDEPOSITACCOUNT", "fixedDeposit", savingsAccount.getId(), "Fixed deposit account approved",
|
||||
"approved", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
} else if (savingsAccount.depositAccountType().equals(DepositAccountType.RECURRING_DEPOSIT)) {
|
||||
|
||||
buildNotification("ACTIVATE_RECURRINGDEPOSITACCOUNT", "recurringDepositAccount", savingsAccount.getId(),
|
||||
"Recurring deposit account approved", "approved", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
} else if (savingsAccount.depositAccountType().equals(DepositAccountType.SAVINGS_DEPOSIT)) {
|
||||
|
||||
buildNotification("ACTIVATE_SAVINGSACCOUNT", "savingsAccount", savingsAccount.getId(), "Savings account approved",
|
||||
"approved", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class CenterCreatedListener extends NotificationBusinessEventAdapter {
|
||||
private class SavingsPostInterestListener implements BusinessEventListener<SavingsPostInterestBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
CommandProcessingResult commandProcessingResult;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.GROUP);
|
||||
if (entity != null) {
|
||||
commandProcessingResult = (CommandProcessingResult) entity;
|
||||
buildNotification("ACTIVATE_CENTER", "center", commandProcessingResult.getGroupId(), "New center created", "created",
|
||||
context.authenticatedUser().getId(), commandProcessingResult.getOfficeId());
|
||||
}
|
||||
public void onBusinessEvent(SavingsPostInterestBusinessEvent event) {
|
||||
SavingsAccount savingsAccount = event.get();
|
||||
buildNotification("READ_SAVINGSACCOUNT", "savingsAccount", savingsAccount.getId(), "Interest posted to account",
|
||||
"interestPosted", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class GroupCreatedListener extends NotificationBusinessEventAdapter {
|
||||
private class LoanCreatedListener implements BusinessEventListener<LoanCreatedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
CommandProcessingResult commandProcessingResult;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.GROUP);
|
||||
if (entity != null) {
|
||||
commandProcessingResult = (CommandProcessingResult) entity;
|
||||
buildNotification("ACTIVATE_GROUP", "group", commandProcessingResult.getGroupId(), "New group created", "created",
|
||||
context.authenticatedUser().getId(), commandProcessingResult.getOfficeId());
|
||||
}
|
||||
public void onBusinessEvent(LoanCreatedBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
buildNotification("APPROVE_LOAN", "loan", loan.getId(), "New loan created", "created", context.authenticatedUser().getId(),
|
||||
loan.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountDepositListener extends NotificationBusinessEventAdapter {
|
||||
private class LoanApprovedListener implements BusinessEventListener<LoanApprovedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
SavingsAccountTransaction savingsAccountTransaction;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SAVINGS_TRANSACTION);
|
||||
if (entity != null) {
|
||||
savingsAccountTransaction = (SavingsAccountTransaction) entity;
|
||||
buildNotification("READ_SAVINGSACCOUNT", "savingsAccount", savingsAccountTransaction.getSavingsAccount().getId(),
|
||||
"Deposit made", "depositMade", context.authenticatedUser().getId(),
|
||||
savingsAccountTransaction.getSavingsAccount().officeId());
|
||||
}
|
||||
public void onBusinessEvent(LoanApprovedBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
buildNotification("DISBURSE_LOAN", "loan", loan.getId(), "New loan approved", "approved", context.authenticatedUser().getId(),
|
||||
loan.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class ShareProductDividendCreatedListener extends NotificationBusinessEventAdapter {
|
||||
private class LoanClosedListener implements BusinessEventListener<LoanCloseBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Long shareProductId;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SHARE_PRODUCT);
|
||||
if (entity != null) {
|
||||
shareProductId = (Long) entity;
|
||||
buildNotification("READ_DIVIDEND_SHAREPRODUCT", "shareProduct", shareProductId, "Dividend posted to account",
|
||||
"dividendPosted", context.authenticatedUser().getId(), context.authenticatedUser().getOffice().getId());
|
||||
}
|
||||
public void onBusinessEvent(LoanCloseBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
buildNotification("READ_LOAN", "loan", loan.getId(), "Loan closed", "loanClosed", context.authenticatedUser().getId(),
|
||||
loan.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class FixedDepositAccountCreatedListener extends NotificationBusinessEventAdapter {
|
||||
private class LoanCloseAsRescheduledListener implements BusinessEventListener<LoanCloseAsRescheduleBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
FixedDepositAccount fixedDepositAccount;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.DEPOSIT_ACCOUNT);
|
||||
if (entity != null) {
|
||||
fixedDepositAccount = (FixedDepositAccount) entity;
|
||||
buildNotification("APPROVE_FIXEDDEPOSITACCOUNT", "fixedDeposit", fixedDepositAccount.getId(),
|
||||
"New fixed deposit account created", "created", context.authenticatedUser().getId(),
|
||||
fixedDepositAccount.officeId());
|
||||
}
|
||||
public void onBusinessEvent(LoanCloseAsRescheduleBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
buildNotification("READ_Rescheduled Loans", "loan", loan.getId(), "Loan has been rescheduled", "loanRescheduled",
|
||||
context.authenticatedUser().getId(), loan.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class RecurringDepositAccountCreatedListener extends NotificationBusinessEventAdapter {
|
||||
private class LoanMakeRepaymentListener implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
RecurringDepositAccount recurringDepositAccount;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.DEPOSIT_ACCOUNT);
|
||||
if (entity != null) {
|
||||
recurringDepositAccount = (RecurringDepositAccount) entity;
|
||||
buildNotification("APPROVE_RECURRINGDEPOSITACCOUNT", "recurringDepositAccount", recurringDepositAccount.getId(),
|
||||
"New recurring deposit account created", "created", context.authenticatedUser().getId(),
|
||||
recurringDepositAccount.officeId());
|
||||
}
|
||||
public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
|
||||
Loan loan = event.get().getLoan();
|
||||
buildNotification("READ_LOAN", "loan", loan.getId(), "Repayment made", "repaymentMade", context.authenticatedUser().getId(),
|
||||
loan.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountApprovedListener extends NotificationBusinessEventAdapter {
|
||||
private class LoanProductCreatedListener implements BusinessEventListener<LoanProductCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
SavingsAccount savingsAccount;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SAVING);
|
||||
if (entity != null) {
|
||||
savingsAccount = (SavingsAccount) entity;
|
||||
if (savingsAccount.depositAccountType().equals(DepositAccountType.FIXED_DEPOSIT)) {
|
||||
|
||||
buildNotification("ACTIVATE_FIXEDDEPOSITACCOUNT", "fixedDeposit", savingsAccount.getId(),
|
||||
"Fixed deposit account approved", "approved", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
} else if (savingsAccount.depositAccountType().equals(DepositAccountType.RECURRING_DEPOSIT)) {
|
||||
|
||||
buildNotification("ACTIVATE_RECURRINGDEPOSITACCOUNT", "recurringDepositAccount", savingsAccount.getId(),
|
||||
"Recurring deposit account approved", "approved", context.authenticatedUser().getId(),
|
||||
savingsAccount.officeId());
|
||||
} else if (savingsAccount.depositAccountType().equals(DepositAccountType.SAVINGS_DEPOSIT)) {
|
||||
|
||||
buildNotification("ACTIVATE_SAVINGSACCOUNT", "savingsAccount", savingsAccount.getId(), "Savings account approved",
|
||||
"approved", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
}
|
||||
}
|
||||
public void onBusinessEvent(LoanProductCreateBusinessEvent event) {
|
||||
LoanProduct loanProduct = event.get();
|
||||
buildNotification("READ_LOANPRODUCT", "loanProduct", loanProduct.getId(), "New loan product created", "created",
|
||||
context.authenticatedUser().getId(), context.authenticatedUser().getOffice().getId());
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsPostInterestListener extends NotificationBusinessEventAdapter {
|
||||
private class SavingsAccountCreatedListener implements BusinessEventListener<SavingsCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
SavingsAccount savingsAccount;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SAVING);
|
||||
if (entity != null) {
|
||||
savingsAccount = (SavingsAccount) entity;
|
||||
buildNotification("READ_SAVINGSACCOUNT", "savingsAccount", savingsAccount.getId(), "Interest posted to account",
|
||||
"interestPosted", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
}
|
||||
public void onBusinessEvent(SavingsCreateBusinessEvent event) {
|
||||
SavingsAccount savingsAccount = event.get();
|
||||
buildNotification("APPROVE_SAVINGSACCOUNT", "savingsAccount", savingsAccount.getId(), "New savings account created", "created",
|
||||
context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class LoanCreatedListener extends NotificationBusinessEventAdapter {
|
||||
private class SavingsAccountClosedListener implements BusinessEventListener<SavingsCloseBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Loan loan;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity != null) {
|
||||
loan = (Loan) entity;
|
||||
buildNotification("APPROVE_LOAN", "loan", loan.getId(), "New loan created", "created", context.authenticatedUser().getId(),
|
||||
loan.getOfficeId());
|
||||
}
|
||||
|
||||
public void onBusinessEvent(SavingsCloseBusinessEvent event) {
|
||||
SavingsAccount savingsAccount = event.get();
|
||||
buildNotification("READ_SAVINGSACCOUNT", "savingsAccount", savingsAccount.getId(), "Savings has gone into dormant", "closed",
|
||||
context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class LoanApprovedListener extends NotificationBusinessEventAdapter {
|
||||
private class ShareAccountCreatedListener implements BusinessEventListener<ShareAccountCreateBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Loan loan;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity != null) {
|
||||
loan = (Loan) entity;
|
||||
buildNotification("DISBURSE_LOAN", "loan", loan.getId(), "New loan approved", "approved",
|
||||
context.authenticatedUser().getId(), loan.getOfficeId());
|
||||
}
|
||||
public void onBusinessEvent(ShareAccountCreateBusinessEvent event) {
|
||||
ShareAccount shareAccount = event.get();
|
||||
buildNotification("APPROVE_SHAREACCOUNT", "shareAccount", shareAccount.getId(), "New share account created", "created",
|
||||
context.authenticatedUser().getId(), shareAccount.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
private class LoanClosedListener extends NotificationBusinessEventAdapter {
|
||||
private class ShareAccountApprovedListener implements BusinessEventListener<ShareAccountApproveBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
|
||||
Loan loan;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity != null) {
|
||||
loan = (Loan) entity;
|
||||
buildNotification("READ_LOAN", "loan", loan.getId(), "Loan closed", "loanClosed", context.authenticatedUser().getId(),
|
||||
loan.getOfficeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class LoanCloseAsRescheduledListener extends NotificationBusinessEventAdapter {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Loan loan;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity != null) {
|
||||
loan = (Loan) entity;
|
||||
buildNotification("READ_Rescheduled Loans", "loan", loan.getId(), "Loan has been rescheduled", "loanRescheduled",
|
||||
context.authenticatedUser().getId(), loan.getOfficeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class LoanMakeRepaymentListener extends NotificationBusinessEventAdapter {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Loan loan;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity != null) {
|
||||
loan = (Loan) entity;
|
||||
buildNotification("READ_LOAN", "loan", loan.getId(), "Repayment made", "repaymentMade", context.authenticatedUser().getId(),
|
||||
loan.getOfficeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class LoanProductCreatedListener extends NotificationBusinessEventAdapter {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
|
||||
LoanProduct loanProduct;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN_PRODUCT);
|
||||
if (entity != null) {
|
||||
loanProduct = (LoanProduct) entity;
|
||||
buildNotification("READ_LOANPRODUCT", "loanProduct", loanProduct.getId(), "New loan product created", "created",
|
||||
context.authenticatedUser().getId(), context.authenticatedUser().getOffice().getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountCreatedListener extends NotificationBusinessEventAdapter {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
SavingsAccount savingsAccount;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SAVING);
|
||||
if (entity != null) {
|
||||
savingsAccount = (SavingsAccount) entity;
|
||||
buildNotification("APPROVE_SAVINGSACCOUNT", "savingsAccount", savingsAccount.getId(), "New savings account created",
|
||||
"created", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class SavingsAccountClosedListener extends NotificationBusinessEventAdapter {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
SavingsAccount savingsAccount;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SAVING);
|
||||
if (entity != null) {
|
||||
savingsAccount = (SavingsAccount) entity;
|
||||
buildNotification("READ_SAVINGSACCOUNT", "savingsAccount", savingsAccount.getId(), "Savings has gone into dormant",
|
||||
"closed", context.authenticatedUser().getId(), savingsAccount.officeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ShareAccountCreatedListener extends NotificationBusinessEventAdapter {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
ShareAccount shareAccount;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SHARE_ACCOUNT);
|
||||
if (entity != null) {
|
||||
shareAccount = (ShareAccount) entity;
|
||||
buildNotification("APPROVE_SHAREACCOUNT", "shareAccount", shareAccount.getId(), "New share account created", "created",
|
||||
context.authenticatedUser().getId(), shareAccount.getOfficeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ShareAccountApprovedListener extends NotificationBusinessEventAdapter {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
ShareAccount shareAccount;
|
||||
Object entity = businessEventEntity.get(BusinessEntity.SHARE_ACCOUNT);
|
||||
if (entity != null) {
|
||||
shareAccount = (ShareAccount) entity;
|
||||
buildNotification("ACTIVATE_SHAREACCOUNT", "shareAccount", shareAccount.getId(), "Share account approved", "approved",
|
||||
context.authenticatedUser().getId(), shareAccount.getOfficeId());
|
||||
}
|
||||
public void onBusinessEvent(ShareAccountApproveBusinessEvent event) {
|
||||
ShareAccount shareAccount = event.get();
|
||||
buildNotification("ACTIVATE_SHAREACCOUNT", "shareAccount", shareAccount.getId(), "Share account approved", "approved",
|
||||
context.authenticatedUser().getId(), shareAccount.getOfficeId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-9
@@ -18,24 +18,18 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent;
|
||||
|
||||
import java.util.Map;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
|
||||
/**
|
||||
* The interface to be implemented by classes that want to be informed when a Business Event executes. example: on
|
||||
* completion of loan approval event need to block guarantor funds
|
||||
*
|
||||
*/
|
||||
public interface BusinessEventListener {
|
||||
|
||||
/**
|
||||
* Implement this method for notifications before executing Business Event
|
||||
*/
|
||||
void businessEventToBeExecuted(Map<BusinessEntity, Object> businessEventEntity);
|
||||
public interface BusinessEventListener<T extends BusinessEvent<?>> {
|
||||
|
||||
/**
|
||||
* Implement this method for notifications after executing Business Event
|
||||
*/
|
||||
void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity);
|
||||
void onBusinessEvent(T event);
|
||||
|
||||
}
|
||||
|
||||
+6
-18
@@ -18,27 +18,15 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain;
|
||||
|
||||
public enum BusinessEntity {
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
LOAN("loan"), //
|
||||
LOAN_TRANSACTION("loan_transaction"), //
|
||||
LOAN_CHARGE("loan_charge"), //
|
||||
LOAN_ADJUSTED_TRANSACTION("loan_adjusted_transaction"), SAVING("saving"), //
|
||||
CLIENT("client"), //
|
||||
SAVINGS_TRANSACTION("Savings Transaction"), //
|
||||
GROUP("group"), //
|
||||
SHARE_ACCOUNT("share_account"), //
|
||||
SHARE_PRODUCT("share_product"), //
|
||||
DEPOSIT_ACCOUNT("deposit_account"), //
|
||||
LOAN_PRODUCT("loan_product");
|
||||
@RequiredArgsConstructor
|
||||
public abstract class AbstractBusinessEvent<T> implements BusinessEvent<T> {
|
||||
|
||||
private final String value;
|
||||
private final T value;
|
||||
|
||||
BusinessEntity(final String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
@Override
|
||||
public T get() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
+2
-81
@@ -18,86 +18,7 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
public interface BusinessEvent<T> {
|
||||
|
||||
public enum BusinessEvent {
|
||||
|
||||
LOAN_APPROVED("loan_approved"), //
|
||||
LOAN_REJECTED("loan_reject"), //
|
||||
LOAN_UNDO_APPROVAL("loan_undo_approval"), //
|
||||
LOAN_UNDO_DISBURSAL("loan_undo_disbursal"), //
|
||||
LOAN_UNDO_LASTDISBURSAL("loan_undo_lastdisbursal"), //
|
||||
LOAN_UNDO_TRANSACTION("loan_undo_transaction"), //
|
||||
LOAN_ADJUST_TRANSACTION("loan_adjust_transaction"), //
|
||||
LOAN_MAKE_REPAYMENT("loan_repayment_transaction"), //
|
||||
LOAN_MERCHANT_ISSUED_REFUND("loan_merchant_issued_refund"), //
|
||||
LOAN_PAYOUT_REFUND("loan_payout_refund"), //
|
||||
LOAN_GOODWILL_CREDIT("loan_goodwill_credit"), //
|
||||
LOAN_RECOVERY_PAYMENT("loan_recovery_payment"), //
|
||||
LOAN_WRITTEN_OFF("loan_writtenoff"), //
|
||||
LOAN_UNDO_WRITTEN_OFF("loan_undo_writtenoff"), //
|
||||
LOAN_DISBURSAL("loan_disbursal"), //
|
||||
LOAN_WAIVE_INTEREST("loan_waive_interest"), //
|
||||
LOAN_CLOSE("loan_close"), //
|
||||
LOAN_CLOSE_AS_RESCHEDULE("loan_close_as_reschedule"), //
|
||||
LOAN_ADD_CHARGE("loan_add_charge"), //
|
||||
LOAN_UPDATE_CHARGE("loan_update_charge"), //
|
||||
LOAN_WAIVE_CHARGE_UNDO("loan_waive_charge_undo"), //
|
||||
LOAN_WAIVE_CHARGE("loan_waive_charge"), //
|
||||
LOAN_DELETE_CHARGE("loan_delete_charge"), //
|
||||
LOAN_CHARGE_PAYMENT("loan_charge_payment"), //
|
||||
LOAN_INITIATE_TRANSFER("loan_initiate_transfer"), //
|
||||
LOAN_ACCEPT_TRANSFER("loan_accept_transfer"), //
|
||||
LOAN_WITHDRAW_TRANSFER("loan_withdraw_transfer"), //
|
||||
LOAN_REJECT_TRANSFER("loan_reject_transfer"), //
|
||||
LOAN_REASSIGN_OFFICER("loan_reassign_officer"), //
|
||||
LOAN_REMOVE_OFFICER("loan_remove_officer"), //
|
||||
LOAN_APPLY_OVERDUE_CHARGE("loan_apply_overdue_charge"), //
|
||||
LOAN_INTEREST_RECALCULATION("loan_interest_recalculation"), //
|
||||
LOAN_REFUND("loan_refund"), //
|
||||
LOAN_FORECLOSURE("loan_foreclosure"), //
|
||||
LOAN_CREDIT_BALANCE_REFUND("loan_credit_balance_refund"), //
|
||||
LOAN_CREATE("loan_create"), //
|
||||
LOAN_PRODUCT_CREATE("loan_product_create"), //
|
||||
SAVINGS_ACTIVATE("savings_activated"), //
|
||||
SAVINGS_REJECT("savings_reject"), //
|
||||
SAVINGS_POST_INTEREST("savings_post_interest"), //
|
||||
SAVINGS_DEPOSIT("savings_deposit"), //
|
||||
SAVINGS_CLOSE("savings_close"), //
|
||||
SAVINGS_WITHDRAWAL("savings_withdrawal"), //
|
||||
SAVINGS_APPROVE("savings_approve"), //
|
||||
SAVINGS_CREATE("savings_create"), //
|
||||
CLIENTS_ACTIVATE("clients_activate"), //
|
||||
SHARE_ACCOUNT_CREATE("share_account_create"), //
|
||||
CLIENTS_REJECT("clients_reject"), //
|
||||
CLIENTS_CREATE("clients_create"), //
|
||||
CENTERS_CREATE("centers_create"), //
|
||||
GROUPS_CREATE("groups_create"), //
|
||||
SHARE_PRODUCT_DIVIDENDS_CREATE("share_product_dividends_create"), //
|
||||
FIXED_DEPOSIT_ACCOUNT_CREATE("fixed_deposit_account_create"), //
|
||||
SHARE_ACCOUNT_APPROVE("share_account_approve"), //
|
||||
RECURRING_DEPOSIT_ACCOUNT_CREATE("recurring_deposit_account_create");
|
||||
|
||||
private static final Set<String> VALUES = new HashSet<>();
|
||||
|
||||
static {
|
||||
for (final BusinessEvent type : BusinessEvent.values()) {
|
||||
VALUES.add(type.value);
|
||||
}
|
||||
}
|
||||
|
||||
private final String value;
|
||||
|
||||
BusinessEvent(final String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Set<String> getAllValues() {
|
||||
return VALUES;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
T get();
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.client;
|
||||
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
|
||||
public class ClientActivateBusinessEvent extends ClientBusinessEvent {
|
||||
|
||||
public ClientActivateBusinessEvent(Client value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.client;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
|
||||
public abstract class ClientBusinessEvent extends AbstractBusinessEvent<Client> {
|
||||
|
||||
public ClientBusinessEvent(Client value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.client;
|
||||
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
|
||||
public class ClientCreateBusinessEvent extends ClientBusinessEvent {
|
||||
|
||||
public ClientCreateBusinessEvent(Client value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.client;
|
||||
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
|
||||
public class ClientRejectBusinessEvent extends ClientBusinessEvent {
|
||||
|
||||
public ClientRejectBusinessEvent(Client value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.deposit;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.savings.domain.FixedDepositAccount;
|
||||
|
||||
public abstract class FixedDepositAccountBusinessEvent extends AbstractBusinessEvent<FixedDepositAccount> {
|
||||
|
||||
public FixedDepositAccountBusinessEvent(FixedDepositAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.deposit;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.FixedDepositAccount;
|
||||
|
||||
public class FixedDepositAccountCreateBusinessEvent extends FixedDepositAccountBusinessEvent {
|
||||
|
||||
public FixedDepositAccountCreateBusinessEvent(FixedDepositAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.deposit;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.savings.domain.RecurringDepositAccount;
|
||||
|
||||
public abstract class RecurringDepositAccountBusinessEvent extends AbstractBusinessEvent<RecurringDepositAccount> {
|
||||
|
||||
public RecurringDepositAccountBusinessEvent(RecurringDepositAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.deposit;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.RecurringDepositAccount;
|
||||
|
||||
public class RecurringDepositAccountCreateBusinessEvent extends RecurringDepositAccountBusinessEvent {
|
||||
|
||||
public RecurringDepositAccountCreateBusinessEvent(RecurringDepositAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.group;
|
||||
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
|
||||
public class CentersCreateBusinessEvent extends GroupsBusinessEvent {
|
||||
|
||||
public CentersCreateBusinessEvent(CommandProcessingResult value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.group;
|
||||
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
|
||||
public abstract class GroupsBusinessEvent extends AbstractBusinessEvent<CommandProcessingResult> {
|
||||
|
||||
public GroupsBusinessEvent(CommandProcessingResult value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.group;
|
||||
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
|
||||
public class GroupsCreateBusinessEvent extends GroupsBusinessEvent {
|
||||
|
||||
public GroupsCreateBusinessEvent(CommandProcessingResult value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanAcceptTransferBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanAcceptTransferBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanAdjustTransactionBusinessEvent extends AbstractBusinessEvent<LoanAdjustTransactionBusinessEvent.Data> {
|
||||
|
||||
public LoanAdjustTransactionBusinessEvent(Data value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public static class Data {
|
||||
|
||||
private final LoanTransaction transactionToAdjust;
|
||||
@Setter
|
||||
private LoanTransaction newTransactionDetail;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanApplyOverdueChargeBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanApplyOverdueChargeBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanApprovedBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanApprovedBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public abstract class LoanBusinessEvent extends AbstractBusinessEvent<Loan> {
|
||||
|
||||
public LoanBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanCloseAsRescheduleBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanCloseAsRescheduleBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanCloseBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanCloseBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanCreatedBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanCreatedBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanDisbursalBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanDisbursalBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanInitiateTransferBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanInitiateTransferBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanInterestRecalculationBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanInterestRecalculationBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanReassignOfficerBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanReassignOfficerBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanRejectTransferBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanRejectTransferBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanRejectedBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanRejectedBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanRemoveOfficerBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanRemoveOfficerBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanUndoApprovalBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanUndoApprovalBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanUndoDisbursalBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanUndoDisbursalBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanUndoLastDisbursalBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanUndoLastDisbursalBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
|
||||
public class LoanWithdrawTransferBusinessEvent extends LoanBusinessEvent {
|
||||
|
||||
public LoanWithdrawTransferBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.charge;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;
|
||||
|
||||
public class LoanAddChargeBusinessEvent extends LoanChargeBusinessEvent {
|
||||
|
||||
public LoanAddChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.charge;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;
|
||||
|
||||
public abstract class LoanChargeBusinessEvent extends AbstractBusinessEvent<LoanCharge> {
|
||||
|
||||
public LoanChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.charge;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;
|
||||
|
||||
public class LoanDeleteChargeBusinessEvent extends LoanChargeBusinessEvent {
|
||||
|
||||
public LoanDeleteChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.charge;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;
|
||||
|
||||
public class LoanUpdateChargeBusinessEvent extends LoanChargeBusinessEvent {
|
||||
|
||||
public LoanUpdateChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.charge;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;
|
||||
|
||||
public class LoanWaiveChargeBusinessEvent extends LoanChargeBusinessEvent {
|
||||
|
||||
public LoanWaiveChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.charge;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;
|
||||
|
||||
public class LoanWaiveChargeUndoBusinessEvent extends LoanChargeBusinessEvent {
|
||||
|
||||
public LoanWaiveChargeUndoBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.product;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
|
||||
|
||||
public abstract class LoanProductBusinessEvent extends AbstractBusinessEvent<LoanProduct> {
|
||||
|
||||
public LoanProductBusinessEvent(LoanProduct value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.product;
|
||||
|
||||
import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
|
||||
|
||||
public class LoanProductCreateBusinessEvent extends LoanProductBusinessEvent {
|
||||
|
||||
public LoanProductCreateBusinessEvent(LoanProduct value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanChargePaymentBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanChargePaymentBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanCreditBalanceRefundBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanCreditBalanceRefundBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanForeClosureBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanForeClosureBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanGoodwillCreditBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanGoodwillCreditBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanMakeRepaymentBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanMakeRepaymentBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanMerchantIssuedRefundBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanMerchantIssuedRefundBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanPayoutRefundBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanPayoutRefundBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanRecoveryPaymentBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanRecoveryPaymentBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanRefundBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanRefundBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public abstract class LoanTransactionBusinessEvent extends AbstractBusinessEvent<LoanTransaction> {
|
||||
|
||||
public LoanTransactionBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanUndoWrittenOffBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanUndoWrittenOffBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanWaiveInterestBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanWaiveInterestBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanWrittenOffBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
public LoanWrittenOffBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
|
||||
public abstract class SavingsAccountBusinessEvent extends AbstractBusinessEvent<SavingsAccount> {
|
||||
|
||||
public SavingsAccountBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
|
||||
public class SavingsActivateBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
|
||||
public SavingsActivateBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
|
||||
public class SavingsApproveBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
|
||||
public SavingsApproveBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
|
||||
public class SavingsCloseBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
|
||||
public SavingsCloseBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
|
||||
public class SavingsCreateBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
|
||||
public SavingsCreateBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
|
||||
public class SavingsPostInterestBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
|
||||
public SavingsPostInterestBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
|
||||
public class SavingsRejectBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
|
||||
public SavingsRejectBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction;
|
||||
|
||||
public abstract class SavingsAccountTransactionBusinessEvent extends AbstractBusinessEvent<SavingsAccountTransaction> {
|
||||
|
||||
public SavingsAccountTransactionBusinessEvent(SavingsAccountTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction;
|
||||
|
||||
public class SavingsDepositBusinessEvent extends SavingsAccountTransactionBusinessEvent {
|
||||
|
||||
public SavingsDepositBusinessEvent(SavingsAccountTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.savings.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccountTransaction;
|
||||
|
||||
public class SavingsWithdrawalBusinessEvent extends SavingsAccountTransactionBusinessEvent {
|
||||
|
||||
public SavingsWithdrawalBusinessEvent(SavingsAccountTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.share;
|
||||
|
||||
import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccount;
|
||||
|
||||
public class ShareAccountApproveBusinessEvent extends ShareAccountBusinessEvent {
|
||||
|
||||
public ShareAccountApproveBusinessEvent(ShareAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.share;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccount;
|
||||
|
||||
public abstract class ShareAccountBusinessEvent extends AbstractBusinessEvent<ShareAccount> {
|
||||
|
||||
public ShareAccountBusinessEvent(ShareAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.share;
|
||||
|
||||
import org.apache.fineract.portfolio.shareaccounts.domain.ShareAccount;
|
||||
|
||||
public class ShareAccountCreateBusinessEvent extends ShareAccountBusinessEvent {
|
||||
|
||||
public ShareAccountCreateBusinessEvent(ShareAccount value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain.share;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.AbstractBusinessEvent;
|
||||
|
||||
public class ShareProductDividentsCreateBusinessEvent extends AbstractBusinessEvent<Long> {
|
||||
|
||||
public ShareProductDividentsCreateBusinessEvent(Long value) {
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
+2
-14
@@ -18,9 +18,7 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.service;
|
||||
|
||||
import java.util.Map;
|
||||
import org.apache.fineract.portfolio.businessevent.BusinessEventListener;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
|
||||
/**
|
||||
@@ -29,24 +27,14 @@ import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
*/
|
||||
public interface BusinessEventNotifierService {
|
||||
|
||||
/**
|
||||
* Method should be called to notify listeners before Business event execution for any pre-processing of event
|
||||
*/
|
||||
void notifyBusinessEventToBeExecuted(BusinessEvent businessEvent, Map<BusinessEntity, Object> businessEventEntity);
|
||||
|
||||
/**
|
||||
* Method should be called to notify listeners after Business event execution for any post-processing of event
|
||||
*/
|
||||
void notifyBusinessEventWasExecuted(BusinessEvent businessEvent, Map<BusinessEntity, Object> businessEventEntity);
|
||||
|
||||
/**
|
||||
* Method is to register a class as listener for pre-processing of any Business event
|
||||
*/
|
||||
void addBusinessEventPreListeners(BusinessEvent businessEvent, BusinessEventListener businessEventListener);
|
||||
void notifyBusinessEvent(BusinessEvent<?> businessEvent);
|
||||
|
||||
/**
|
||||
* Method is to register a class as listener for post-processing of any Business event
|
||||
*/
|
||||
void addBusinessEventPostListeners(BusinessEvent businessEvent, BusinessEventListener businessEventListener);
|
||||
<T extends BusinessEvent<?>> void addBusinessEventListener(Class<T> eventType, BusinessEventListener<T> listener);
|
||||
|
||||
}
|
||||
|
||||
+9
-44
@@ -23,32 +23,14 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.fineract.portfolio.businessevent.BusinessEventListener;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierService {
|
||||
|
||||
private final Map<BusinessEvent, List<BusinessEventListener>> preListeners = new HashMap<>(5);
|
||||
private final Map<BusinessEvent, List<BusinessEventListener>> postListeners = new HashMap<>(5);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService
|
||||
* #notifyBusinessEventToBeExecuted (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants
|
||||
* .BusinessEvents, org.springframework.data.jpa.domain.AbstractPersistable)
|
||||
*/
|
||||
@Override
|
||||
public void notifyBusinessEventToBeExecuted(BusinessEvent businessEvent, Map<BusinessEntity, Object> businessEventEntity) {
|
||||
List<BusinessEventListener> businessEventListeners = this.preListeners.get(businessEvent);
|
||||
if (businessEventListeners != null) {
|
||||
for (BusinessEventListener eventListener : businessEventListeners) {
|
||||
eventListener.businessEventToBeExecuted(businessEventEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
private final Map<Class, List<BusinessEventListener>> listeners = new HashMap<>();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -58,27 +40,15 @@ public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierSe
|
||||
* .BusinessEvents, org.springframework.data.jpa.domain.AbstractPersistable)
|
||||
*/
|
||||
@Override
|
||||
public void notifyBusinessEventWasExecuted(BusinessEvent businessEvent, Map<BusinessEntity, Object> businessEventEntity) {
|
||||
List<BusinessEventListener> businessEventListeners = this.postListeners.get(businessEvent);
|
||||
public void notifyBusinessEvent(BusinessEvent<?> businessEvent) {
|
||||
List<BusinessEventListener> businessEventListeners = listeners.get(businessEvent.getClass());
|
||||
if (businessEventListeners != null) {
|
||||
for (BusinessEventListener eventListener : businessEventListeners) {
|
||||
eventListener.businessEventWasExecuted(businessEventEntity);
|
||||
eventListener.onBusinessEvent(businessEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService
|
||||
* #addBusinessEventPreListeners (org.apache.fineract.portfolio.common.BusinessEventNotificationConstants
|
||||
* .BusinessEvents, org.apache.fineract.portfolio.businessevent.BusinessEventListener)
|
||||
*/
|
||||
@Override
|
||||
public void addBusinessEventPreListeners(BusinessEvent businessEvent, BusinessEventListener businessEventListener) {
|
||||
addBusinessEventListeners(businessEvent, businessEventListener, preListeners);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -87,18 +57,13 @@ public class BusinessEventNotifierServiceImpl implements BusinessEventNotifierSe
|
||||
* .BusinessEvents, org.apache.fineract.portfolio.businessevent.BusinessEventListener)
|
||||
*/
|
||||
@Override
|
||||
public void addBusinessEventPostListeners(BusinessEvent businessEvent, BusinessEventListener businessEventListener) {
|
||||
addBusinessEventListeners(businessEvent, businessEventListener, postListeners);
|
||||
}
|
||||
|
||||
private void addBusinessEventListeners(BusinessEvent businessEvent, BusinessEventListener businessEventListener,
|
||||
final Map<BusinessEvent, List<BusinessEventListener>> businessEventListenerMap) {
|
||||
List<BusinessEventListener> businessEventListeners = businessEventListenerMap.get(businessEvent);
|
||||
public <T extends BusinessEvent<?>> void addBusinessEventListener(Class<T> eventType, BusinessEventListener<T> listener) {
|
||||
List<BusinessEventListener> businessEventListeners = listeners.get(eventType);
|
||||
if (businessEventListeners == null) {
|
||||
businessEventListeners = new ArrayList<>();
|
||||
businessEventListenerMap.put(businessEvent, businessEventListeners);
|
||||
listeners.put(eventType, businessEventListeners);
|
||||
}
|
||||
businessEventListeners.add(businessEventListener);
|
||||
businessEventListeners.add(listener);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+14
-26
@@ -23,12 +23,12 @@ import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import javax.persistence.PersistenceException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.fineract.commands.domain.CommandWrapper;
|
||||
import org.apache.fineract.commands.service.CommandProcessingService;
|
||||
@@ -55,8 +55,9 @@ import org.apache.fineract.organisation.office.domain.OfficeRepositoryWrapper;
|
||||
import org.apache.fineract.organisation.staff.domain.Staff;
|
||||
import org.apache.fineract.organisation.staff.domain.StaffRepositoryWrapper;
|
||||
import org.apache.fineract.portfolio.address.service.AddressWritePlatformService;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.client.ClientActivateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.client.ClientCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.client.ClientRejectBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.client.api.ClientApiConstants;
|
||||
import org.apache.fineract.portfolio.client.data.ClientDataValidator;
|
||||
@@ -87,8 +88,6 @@ import org.apache.fineract.portfolio.savings.domain.SavingsProductRepository;
|
||||
import org.apache.fineract.portfolio.savings.exception.SavingsProductNotFoundException;
|
||||
import org.apache.fineract.portfolio.savings.service.SavingsApplicationProcessWritePlatformService;
|
||||
import org.apache.fineract.useradministration.domain.AppUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
@@ -96,10 +95,9 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWritePlatformService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ClientWritePlatformServiceJpaRepositoryImpl.class);
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final ClientRepositoryWrapper clientRepository;
|
||||
private final ClientNonPersonRepositoryWrapper clientNonPersonRepository;
|
||||
@@ -191,7 +189,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
.build();
|
||||
} catch (final JpaSystemException | DataIntegrityViolationException dve) {
|
||||
Throwable throwable = ExceptionUtils.getRootCause(dve.getCause());
|
||||
LOG.error("Error occured.", throwable);
|
||||
log.error("Error occured.", throwable);
|
||||
throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.", dve);
|
||||
}
|
||||
@@ -305,8 +303,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
|
||||
this.clientRepository.saveAndFlush(newClient);
|
||||
if (newClient.isActive()) {
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.CLIENTS_ACTIVATE,
|
||||
constructEntityMap(BusinessEntity.CLIENT, newClient));
|
||||
businessEventNotifierService.notifyBusinessEvent(new ClientActivateBusinessEvent(newClient));
|
||||
}
|
||||
if (newClient.isAccountNumberRequiresAutoGeneration()) {
|
||||
AccountNumberFormat accountNumberFormat = this.accountNumberFormatRepository.findByAccountType(EntityAccountType.CLIENT);
|
||||
@@ -340,10 +337,9 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
command.arrayOfParameterNamed(ClientApiConstants.datatables));
|
||||
}
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.CLIENTS_CREATE,
|
||||
constructEntityMap(BusinessEntity.CLIENT, newClient));
|
||||
businessEventNotifierService.notifyBusinessEvent(new ClientCreateBusinessEvent(newClient));
|
||||
|
||||
this.entityDatatableChecksWritePlatformService.runTheCheck(newClient.getId(), EntityTables.CLIENT.getName(),
|
||||
entityDatatableChecksWritePlatformService.runTheCheck(newClient.getId(), EntityTables.CLIENT.getName(),
|
||||
StatusEnum.CREATE.getCode().longValue(), EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable());
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -594,9 +590,8 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
final AppUser currentUser = this.context.authenticatedUser();
|
||||
client.activate(currentUser, fmt, activationDate);
|
||||
CommandProcessingResult result = openSavingsAccount(client, fmt);
|
||||
this.clientRepository.saveAndFlush(client);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.CLIENTS_ACTIVATE,
|
||||
constructEntityMap(BusinessEntity.CLIENT, client));
|
||||
clientRepository.saveAndFlush(client);
|
||||
businessEventNotifierService.notifyBusinessEvent(new ClientActivateBusinessEvent(client));
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
.withOfficeId(client.officeId()) //
|
||||
@@ -627,7 +622,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
LOG.error("Error occured.", dve);
|
||||
log.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -849,9 +844,8 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
rejectionDate, client.getSubmittedOnDate());
|
||||
}
|
||||
client.reject(currentUser, rejectionReason, Date.from(rejectionDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
||||
this.clientRepository.saveAndFlush(client);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.CLIENTS_REJECT,
|
||||
constructEntityMap(BusinessEntity.CLIENT, client));
|
||||
clientRepository.saveAndFlush(client);
|
||||
businessEventNotifierService.notifyBusinessEvent(new ClientRejectBusinessEvent(client));
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
.withClientId(entityId) //
|
||||
@@ -966,10 +960,4 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
||||
.withEntityId(entityId) //
|
||||
.build();
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-51
@@ -29,6 +29,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.persistence.PersistenceException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.fineract.commands.domain.CommandWrapper;
|
||||
import org.apache.fineract.commands.service.CommandProcessingService;
|
||||
@@ -54,8 +56,8 @@ import org.apache.fineract.organisation.office.domain.OfficeRepositoryWrapper;
|
||||
import org.apache.fineract.organisation.office.exception.InvalidOfficeException;
|
||||
import org.apache.fineract.organisation.staff.domain.Staff;
|
||||
import org.apache.fineract.organisation.staff.domain.StaffRepositoryWrapper;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.group.CentersCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.group.GroupsCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.calendar.domain.Calendar;
|
||||
import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType;
|
||||
@@ -86,9 +88,6 @@ import org.apache.fineract.portfolio.note.domain.NoteRepository;
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper;
|
||||
import org.apache.fineract.useradministration.domain.AppUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -97,10 +96,10 @@ import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements GroupingTypesWritePlatformService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(GroupingTypesWritePlatformServiceJpaRepositoryImpl.class);
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final GroupRepositoryWrapper groupRepository;
|
||||
private final ClientRepositoryWrapper clientRepositoryWrapper;
|
||||
@@ -120,38 +119,6 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
private final EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService;
|
||||
private final BusinessEventNotifierService businessEventNotifierService;
|
||||
|
||||
@Autowired
|
||||
public GroupingTypesWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context,
|
||||
final GroupRepositoryWrapper groupRepository, final ClientRepositoryWrapper clientRepositoryWrapper,
|
||||
final OfficeRepositoryWrapper officeRepositoryWrapper, final StaffRepositoryWrapper staffRepository,
|
||||
final NoteRepository noteRepository, final GroupLevelRepository groupLevelRepository,
|
||||
final GroupingTypesDataValidator fromApiJsonDeserializer, final SavingsAccountRepositoryWrapper savingsAccountRepositoryWrapper,
|
||||
final CodeValueRepositoryWrapper codeValueRepository, final CommandProcessingService commandProcessingService,
|
||||
final CalendarInstanceRepository calendarInstanceRepository, final ConfigurationDomainService configurationDomainService,
|
||||
final LoanRepositoryWrapper loanRepositoryWrapper, final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository,
|
||||
final AccountNumberGenerator accountNumberGenerator,
|
||||
final EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService,
|
||||
final BusinessEventNotifierService businessEventNotifierService) {
|
||||
this.context = context;
|
||||
this.groupRepository = groupRepository;
|
||||
this.clientRepositoryWrapper = clientRepositoryWrapper;
|
||||
this.officeRepositoryWrapper = officeRepositoryWrapper;
|
||||
this.staffRepository = staffRepository;
|
||||
this.noteRepository = noteRepository;
|
||||
this.groupLevelRepository = groupLevelRepository;
|
||||
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
|
||||
this.savingsAccountRepositoryWrapper = savingsAccountRepositoryWrapper;
|
||||
this.codeValueRepository = codeValueRepository;
|
||||
this.commandProcessingService = commandProcessingService;
|
||||
this.calendarInstanceRepository = calendarInstanceRepository;
|
||||
this.configurationDomainService = configurationDomainService;
|
||||
this.loanRepositoryWrapper = loanRepositoryWrapper;
|
||||
this.accountNumberFormatRepository = accountNumberFormatRepository;
|
||||
this.accountNumberGenerator = accountNumberGenerator;
|
||||
this.entityDatatableChecksWritePlatformService = entityDatatableChecksWritePlatformService;
|
||||
this.businessEventNotifierService = businessEventNotifierService;
|
||||
}
|
||||
|
||||
private CommandProcessingResult createGroupingType(final JsonCommand command, final GroupTypes groupingType, final Long centerId) {
|
||||
try {
|
||||
final String accountNo = command.stringValueOfParameterNamed(GroupingTypesApiConstants.accountNoParamName);
|
||||
@@ -290,8 +257,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
|
||||
CommandProcessingResult commandProcessingResult = createGroupingType(command, GroupTypes.CENTER, centerId);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.CENTERS_CREATE,
|
||||
constructEntityMap(BusinessEntity.GROUP, commandProcessingResult));
|
||||
businessEventNotifierService.notifyBusinessEvent(new CentersCreateBusinessEvent(commandProcessingResult));
|
||||
|
||||
return commandProcessingResult;
|
||||
}
|
||||
@@ -308,8 +274,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
|
||||
CommandProcessingResult commandProcessingResult = createGroupingType(command, GroupTypes.GROUP, centerId);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.GROUPS_CREATE,
|
||||
constructEntityMap(BusinessEntity.GROUP, commandProcessingResult));
|
||||
businessEventNotifierService.notifyBusinessEvent(new GroupsCreateBusinessEvent(commandProcessingResult));
|
||||
|
||||
return commandProcessingResult;
|
||||
}
|
||||
@@ -605,7 +570,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
.build();
|
||||
} catch (final JpaSystemException | DataIntegrityViolationException dve) {
|
||||
Throwable throwable = ExceptionUtils.getRootCause(dve.getCause());
|
||||
LOG.error("Error occured.", throwable);
|
||||
log.error("Error occured.", throwable);
|
||||
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.", dve);
|
||||
}
|
||||
@@ -799,7 +764,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
name);
|
||||
}
|
||||
|
||||
LOG.error("Error occured.", dve);
|
||||
log.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
@@ -997,10 +962,4 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+29
-80
@@ -26,11 +26,11 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.accounting.journalentry.service.JournalEntryWritePlatformService;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||
@@ -58,8 +58,16 @@ import org.apache.fineract.portfolio.account.domain.AccountTransferTransaction;
|
||||
import org.apache.fineract.portfolio.account.domain.StandingInstructionRepository;
|
||||
import org.apache.fineract.portfolio.account.domain.StandingInstructionStatus;
|
||||
import org.apache.fineract.portfolio.accountdetails.domain.AccountType;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanChargePaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanCreditBalanceRefundBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanForeClosureBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanGoodwillCreditBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMerchantIssuedRefundBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanPayoutRefundBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRecoveryPaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRefundBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
import org.apache.fineract.portfolio.client.exception.ClientNotActiveException;
|
||||
@@ -79,13 +87,13 @@ import org.apache.fineract.portfolio.repaymentwithpostdatedchecks.data.PostDated
|
||||
import org.apache.fineract.portfolio.repaymentwithpostdatedchecks.domain.PostDatedChecks;
|
||||
import org.apache.fineract.portfolio.repaymentwithpostdatedchecks.domain.PostDatedChecksRepository;
|
||||
import org.apache.fineract.useradministration.domain.AppUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
|
||||
private final LoanAssembler loanAccountAssembler;
|
||||
@@ -100,7 +108,6 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
private final NoteRepository noteRepository;
|
||||
private final AccountTransferRepository accountTransferRepository;
|
||||
private final ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository;
|
||||
private final LoanRepaymentScheduleInstallmentRepository repaymentScheduleInstallmentRepository;
|
||||
private final LoanAccrualPlatformService loanAccrualPlatformService;
|
||||
private final PlatformSecurityContext context;
|
||||
private final BusinessEventNotifierService businessEventNotifierService;
|
||||
@@ -109,41 +116,6 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
private final PostDatedChecksRepository postDatedChecksRepository;
|
||||
private final LoanCollateralManagementRepository loanCollateralManagementRepository;
|
||||
|
||||
@Autowired
|
||||
public LoanAccountDomainServiceJpa(final LoanAssembler loanAccountAssembler, final LoanRepositoryWrapper loanRepositoryWrapper,
|
||||
final LoanTransactionRepository loanTransactionRepository, final NoteRepository noteRepository,
|
||||
final ConfigurationDomainService configurationDomainService, final HolidayRepository holidayRepository,
|
||||
final WorkingDaysRepositoryWrapper workingDaysRepository,
|
||||
final ApplicationCurrencyRepositoryWrapper applicationCurrencyRepositoryWrapper,
|
||||
final JournalEntryWritePlatformService journalEntryWritePlatformService,
|
||||
final AccountTransferRepository accountTransferRepository,
|
||||
final ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository,
|
||||
final LoanRepaymentScheduleInstallmentRepository repaymentScheduleInstallmentRepository,
|
||||
final LoanAccrualPlatformService loanAccrualPlatformService, final PlatformSecurityContext context,
|
||||
final BusinessEventNotifierService businessEventNotifierService, final LoanUtilService loanUtilService,
|
||||
final StandingInstructionRepository standingInstructionRepository, final PostDatedChecksRepository postDatedChecksRepository,
|
||||
final LoanCollateralManagementRepository loanCollateralManagementRepository) {
|
||||
this.loanAccountAssembler = loanAccountAssembler;
|
||||
this.loanTransactionRepository = loanTransactionRepository;
|
||||
this.noteRepository = noteRepository;
|
||||
this.configurationDomainService = configurationDomainService;
|
||||
this.holidayRepository = holidayRepository;
|
||||
this.workingDaysRepository = workingDaysRepository;
|
||||
this.applicationCurrencyRepositoryWrapper = applicationCurrencyRepositoryWrapper;
|
||||
this.journalEntryWritePlatformService = journalEntryWritePlatformService;
|
||||
this.accountTransferRepository = accountTransferRepository;
|
||||
this.applicationCurrencyRepository = applicationCurrencyRepository;
|
||||
this.repaymentScheduleInstallmentRepository = repaymentScheduleInstallmentRepository;
|
||||
this.loanAccrualPlatformService = loanAccrualPlatformService;
|
||||
this.context = context;
|
||||
this.businessEventNotifierService = businessEventNotifierService;
|
||||
this.loanUtilService = loanUtilService;
|
||||
this.standingInstructionRepository = standingInstructionRepository;
|
||||
this.postDatedChecksRepository = postDatedChecksRepository;
|
||||
this.loanCollateralManagementRepository = loanCollateralManagementRepository;
|
||||
this.loanRepositoryWrapper = loanRepositoryWrapper;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public LoanTransaction makeRepayment(final LoanTransactionType repaymentTransactionType, final Loan loan,
|
||||
@@ -179,10 +151,6 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
AppUser currentUser = getAppUserIfPresent();
|
||||
checkClientOrGroupActive(loan);
|
||||
|
||||
BusinessEvent repaymentTypeEvent = getRepaymentTypeBusinessEvent(repaymentTransactionType, isRecoveryRepayment);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(repaymentTypeEvent,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
// TODO: Is it required to validate transaction date with meeting dates
|
||||
// if repayments is synced with meeting?
|
||||
/*
|
||||
@@ -245,8 +213,9 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
|
||||
recalculateAccruals(loan);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(repaymentTypeEvent,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, newRepaymentTransaction));
|
||||
LoanTransactionBusinessEvent repaymentEvent = getRepaymentTypeBusinessEvent(repaymentTransactionType, isRecoveryRepayment,
|
||||
newRepaymentTransaction);
|
||||
businessEventNotifierService.notifyBusinessEvent(repaymentEvent);
|
||||
|
||||
// disable all active standing orders linked to this loan if status
|
||||
// changes to closed
|
||||
@@ -287,20 +256,21 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
return newRepaymentTransaction;
|
||||
}
|
||||
|
||||
private BusinessEvent getRepaymentTypeBusinessEvent(LoanTransactionType repaymentTransactionType, boolean isRecoveryRepayment) {
|
||||
BusinessEvent repaymentTypeEvent = null;
|
||||
private LoanTransactionBusinessEvent getRepaymentTypeBusinessEvent(LoanTransactionType repaymentTransactionType,
|
||||
boolean isRecoveryRepayment, LoanTransaction transaction) {
|
||||
LoanTransactionBusinessEvent repaymentEvent = null;
|
||||
if (repaymentTransactionType.isRepayment()) {
|
||||
repaymentTypeEvent = BusinessEvent.LOAN_MAKE_REPAYMENT;
|
||||
repaymentEvent = new LoanMakeRepaymentBusinessEvent(transaction);
|
||||
} else if (repaymentTransactionType.isMerchantIssuedRefund()) {
|
||||
repaymentTypeEvent = BusinessEvent.LOAN_MERCHANT_ISSUED_REFUND;
|
||||
repaymentEvent = new LoanMerchantIssuedRefundBusinessEvent(transaction);
|
||||
} else if (repaymentTransactionType.isPayoutRefund()) {
|
||||
repaymentTypeEvent = BusinessEvent.LOAN_PAYOUT_REFUND;
|
||||
repaymentEvent = new LoanPayoutRefundBusinessEvent(transaction);
|
||||
} else if (repaymentTransactionType.isGoodwillCredit()) {
|
||||
repaymentTypeEvent = BusinessEvent.LOAN_GOODWILL_CREDIT;
|
||||
repaymentEvent = new LoanGoodwillCreditBusinessEvent(transaction);
|
||||
} else if (isRecoveryRepayment) {
|
||||
repaymentTypeEvent = BusinessEvent.LOAN_RECOVERY_PAYMENT;
|
||||
repaymentEvent = new LoanRecoveryPaymentBusinessEvent(transaction);
|
||||
}
|
||||
return repaymentTypeEvent;
|
||||
return repaymentEvent;
|
||||
}
|
||||
|
||||
private void saveLoanTransactionWithDataIntegrityViolationChecks(LoanTransaction newRepaymentTransaction) {
|
||||
@@ -364,8 +334,6 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
AppUser currentUser = getAppUserIfPresent();
|
||||
boolean isAccountTransfer = true;
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_CHARGE_PAYMENT,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
final List<Long> existingTransactionIds = new ArrayList<>();
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>();
|
||||
|
||||
@@ -400,8 +368,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, isAccountTransfer);
|
||||
recalculateAccruals(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_CHARGE_PAYMENT,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, newPaymentTransaction));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanChargePaymentBusinessEvent(newPaymentTransaction));
|
||||
return newPaymentTransaction;
|
||||
}
|
||||
|
||||
@@ -450,8 +417,6 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
boolean isAccountTransfer = true;
|
||||
final Loan loan = this.loanAccountAssembler.assembleFrom(accountId);
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_REFUND,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
final List<Long> existingTransactionIds = new ArrayList<>();
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>();
|
||||
|
||||
@@ -476,8 +441,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
}
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, isAccountTransfer);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_REFUND,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, newRefundTransaction));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanRefundBusinessEvent(newRefundTransaction));
|
||||
builderResult.withEntityId(newRefundTransaction.getId()).withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId())
|
||||
.withGroupId(loan.getGroupId());
|
||||
|
||||
@@ -646,8 +610,6 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
public CommandProcessingResultBuilder creditBalanceRefund(Long loanId, LocalDate transactionDate, BigDecimal transactionAmount,
|
||||
String noteText, String externalId) {
|
||||
final Loan loan = this.loanAccountAssembler.assembleFrom(loanId);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_CREDIT_BALANCE_REFUND,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
final List<Long> existingTransactionIds = new ArrayList<>();
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>();
|
||||
AppUser currentUser = getAppUserIfPresent();
|
||||
@@ -668,8 +630,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, false);
|
||||
recalculateAccruals(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_CREDIT_BALANCE_REFUND,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, newCreditBalanceRefundTransaction));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanCreditBalanceRefundBusinessEvent(newCreditBalanceRefundTransaction));
|
||||
|
||||
return new CommandProcessingResultBuilder().withEntityId(newCreditBalanceRefundTransaction.getId()) //
|
||||
.withOfficeId(loan.getOfficeId()) //
|
||||
@@ -682,8 +643,6 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
BigDecimal transactionAmount, PaymentDetail paymentDetail, String noteText, String txnExternalId) {
|
||||
final Loan loan = this.loanAccountAssembler.assembleFrom(accountId);
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_REFUND,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
final List<Long> existingTransactionIds = new ArrayList<>();
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>();
|
||||
AppUser currentUser = getAppUserIfPresent();
|
||||
@@ -709,8 +668,7 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, false);
|
||||
recalculateAccruals(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_REFUND,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, newRefundTransaction));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanRefundBusinessEvent(newRefundTransaction));
|
||||
|
||||
builderResult.withEntityId(newRefundTransaction.getId()).withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId())
|
||||
.withGroupId(loan.getGroupId());
|
||||
@@ -720,8 +678,6 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> foreCloseLoan(final Loan loan, final LocalDate foreClosureDate, final String noteText) {
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_FORECLOSURE,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
MonetaryCurrency currency = loan.getCurrency();
|
||||
LocalDateTime createdDate = DateUtils.getLocalDateTimeOfTenant();
|
||||
final Map<String, Object> changes = new LinkedHashMap<>();
|
||||
@@ -820,18 +776,11 @@ public class LoanAccountDomainServiceJpa implements LoanAccountDomainService {
|
||||
}
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds, false);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_FORECLOSURE,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, payment));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanForeClosureBusinessEvent(payment));
|
||||
return changes;
|
||||
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void disableStandingInstructionsLinkedToClosedLoan(Loan loan) {
|
||||
|
||||
+66
-112
@@ -40,8 +40,13 @@ import org.apache.fineract.portfolio.account.domain.AccountTransferDetails;
|
||||
import org.apache.fineract.portfolio.account.domain.AccountTransferType;
|
||||
import org.apache.fineract.portfolio.account.service.AccountTransfersWritePlatformService;
|
||||
import org.apache.fineract.portfolio.businessevent.BusinessEventListener;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanAdjustTransactionBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApprovedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanUndoApprovalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanUndoDisbursalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanUndoWrittenOffBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWrittenOffBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
@@ -78,18 +83,14 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService {
|
||||
|
||||
@PostConstruct
|
||||
public void addListeners() {
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_APPROVED, new ValidateOnBusinessEvent());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_APPROVED, new HoldFundsOnBusinessEvent());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_UNDO_APPROVAL, new UndoAllFundTransactions());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_UNDO_DISBURSAL,
|
||||
new ReverseAllFundsOnBusinessEvent());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_ADJUST_TRANSACTION,
|
||||
new AdjustFundsOnBusinessEvent());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_MAKE_REPAYMENT,
|
||||
new ReleaseFundsOnBusinessEvent());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_WRITTEN_OFF, new ReleaseAllFunds());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_UNDO_WRITTEN_OFF,
|
||||
new ReverseFundsOnBusinessEvent());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new ValidateOnBusinessEvent());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanApprovedBusinessEvent.class, new HoldFundsOnBusinessEvent());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanUndoApprovalBusinessEvent.class, new UndoAllFundTransactions());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanUndoDisbursalBusinessEvent.class, new ReverseAllFundsOnBusinessEvent());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanAdjustTransactionBusinessEvent.class, new AdjustFundsOnBusinessEvent());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new ReleaseFundsOnBusinessEvent());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanWrittenOffBusinessEvent.class, new ReleaseAllFunds());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanUndoWrittenOffBusinessEvent.class, new ReverseFundsOnBusinessEvent());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -509,138 +510,91 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService {
|
||||
}
|
||||
}
|
||||
|
||||
private class ValidateOnBusinessEvent implements BusinessEventListener {
|
||||
private class ValidateOnBusinessEvent implements BusinessEventListener<LoanApprovedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(@SuppressWarnings("unused") Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity instanceof Loan) {
|
||||
Loan loan = (Loan) entity;
|
||||
validateGuarantorBusinessRules(loan);
|
||||
}
|
||||
public void onBusinessEvent(LoanApprovedBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
validateGuarantorBusinessRules(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class HoldFundsOnBusinessEvent implements BusinessEventListener {
|
||||
private class HoldFundsOnBusinessEvent implements BusinessEventListener<LoanApprovedBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(@SuppressWarnings("unused") Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity instanceof Loan) {
|
||||
Loan loan = (Loan) entity;
|
||||
holdGuarantorFunds(loan);
|
||||
}
|
||||
public void onBusinessEvent(LoanApprovedBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
holdGuarantorFunds(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class ReleaseFundsOnBusinessEvent implements BusinessEventListener {
|
||||
private class ReleaseFundsOnBusinessEvent implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(@SuppressWarnings("unused") Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN_TRANSACTION);
|
||||
if (entity instanceof LoanTransaction) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) entity;
|
||||
if (releaseLoanIds.containsKey(loanTransaction.getLoan().getId())) {
|
||||
completeGuarantorFund(loanTransaction);
|
||||
} else {
|
||||
releaseGuarantorFunds(loanTransaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ReverseFundsOnBusinessEvent implements BusinessEventListener {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(@SuppressWarnings("unused") Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN_TRANSACTION);
|
||||
if (entity instanceof LoanTransaction) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) entity;
|
||||
List<Long> reersedTransactions = new ArrayList<>(1);
|
||||
reersedTransactions.add(loanTransaction.getId());
|
||||
reverseTransaction(reersedTransactions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class AdjustFundsOnBusinessEvent implements BusinessEventListener {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(@SuppressWarnings("unused") Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN_ADJUSTED_TRANSACTION);
|
||||
if (entity instanceof LoanTransaction) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) entity;
|
||||
List<Long> reersedTransactions = new ArrayList<>(1);
|
||||
reersedTransactions.add(loanTransaction.getId());
|
||||
reverseTransaction(reersedTransactions);
|
||||
}
|
||||
Object transactionentity = businessEventEntity.get(BusinessEntity.LOAN_TRANSACTION);
|
||||
if (transactionentity != null && transactionentity instanceof LoanTransaction) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) transactionentity;
|
||||
public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
if (releaseLoanIds.containsKey(loanTransaction.getLoan().getId())) {
|
||||
completeGuarantorFund(loanTransaction);
|
||||
} else {
|
||||
releaseGuarantorFunds(loanTransaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ReverseAllFundsOnBusinessEvent implements BusinessEventListener {
|
||||
private class ReverseFundsOnBusinessEvent implements BusinessEventListener<LoanUndoWrittenOffBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(@SuppressWarnings("unused") Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
public void onBusinessEvent(LoanUndoWrittenOffBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
List<Long> reversedTransactions = new ArrayList<>();
|
||||
reversedTransactions.add(loanTransaction.getId());
|
||||
reverseTransaction(reversedTransactions);
|
||||
}
|
||||
}
|
||||
|
||||
private class AdjustFundsOnBusinessEvent implements BusinessEventListener<LoanAdjustTransactionBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity instanceof Loan) {
|
||||
Loan loan = (Loan) entity;
|
||||
List<Long> reersedTransactions = new ArrayList<>(1);
|
||||
reersedTransactions.addAll(loan.findExistingTransactionIds());
|
||||
reverseTransaction(reersedTransactions);
|
||||
public void onBusinessEvent(LoanAdjustTransactionBusinessEvent event) {
|
||||
LoanAdjustTransactionBusinessEvent.Data eventData = event.get();
|
||||
|
||||
LoanTransaction loanTransaction = eventData.getTransactionToAdjust();
|
||||
List<Long> reersedTransactions = new ArrayList<>(1);
|
||||
reersedTransactions.add(loanTransaction.getId());
|
||||
reverseTransaction(reersedTransactions);
|
||||
|
||||
LoanTransaction newTransaction = event.get().getNewTransactionDetail();
|
||||
if (newTransaction != null) {
|
||||
releaseGuarantorFunds(newTransaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class UndoAllFundTransactions implements BusinessEventListener {
|
||||
private class ReverseAllFundsOnBusinessEvent implements BusinessEventListener<LoanUndoDisbursalBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(@SuppressWarnings("unused") Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (entity instanceof Loan) {
|
||||
Loan loan = (Loan) entity;
|
||||
reverseAllFundTransaction(loan);
|
||||
}
|
||||
public void onBusinessEvent(LoanUndoDisbursalBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
List<Long> reversedTransactions = new ArrayList<>(loan.findExistingTransactionIds());
|
||||
reverseTransaction(reversedTransactions);
|
||||
}
|
||||
}
|
||||
|
||||
private class ReleaseAllFunds implements BusinessEventListener {
|
||||
private class UndoAllFundTransactions implements BusinessEventListener<LoanUndoApprovalBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventToBeExecuted(@SuppressWarnings("unused") Map<BusinessEntity, Object> businessEventEntity) {}
|
||||
public void onBusinessEvent(LoanUndoApprovalBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
reverseAllFundTransaction(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class ReleaseAllFunds implements BusinessEventListener<LoanWrittenOffBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object entity = businessEventEntity.get(BusinessEntity.LOAN_TRANSACTION);
|
||||
if (entity instanceof LoanTransaction) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) entity;
|
||||
releaseAllGuarantors(loanTransaction);
|
||||
}
|
||||
public void onBusinessEvent(LoanWrittenOffBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
releaseAllGuarantors(loanTransaction);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-16
@@ -67,8 +67,10 @@ import org.apache.fineract.portfolio.account.domain.AccountAssociationType;
|
||||
import org.apache.fineract.portfolio.account.domain.AccountAssociations;
|
||||
import org.apache.fineract.portfolio.account.domain.AccountAssociationsRepository;
|
||||
import org.apache.fineract.portfolio.accountdetails.domain.AccountType;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApprovedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCreatedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanRejectedBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanUndoApprovalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.calendar.domain.Calendar;
|
||||
import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType;
|
||||
@@ -588,8 +590,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
StatusEnum.CREATE.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(),
|
||||
newLoanApplication.productId());
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_CREATE,
|
||||
constructEntityMap(BusinessEntity.LOAN, newLoanApplication));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanCreatedBusinessEvent(newLoanApplication));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -1476,8 +1477,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
this.noteRepository.save(note);
|
||||
}
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_APPROVED,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanApprovedBusinessEvent(loan));
|
||||
}
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
@@ -1555,8 +1555,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
final Note note = Note.loanNote(loan, noteText);
|
||||
this.noteRepository.save(note);
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_UNDO_APPROVAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanUndoApprovalBusinessEvent(loan));
|
||||
}
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
@@ -1626,8 +1625,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
this.noteRepository.save(note);
|
||||
}
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_REJECTED,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanRejectedBusinessEvent(loan));
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
.withEntityId(loan.getId()) //
|
||||
@@ -1762,12 +1760,6 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
return user;
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
|
||||
private void officeSpecificLoanProductValidation(final Long productId, final Long officeId) {
|
||||
final GlobalConfigurationProperty restrictToUserOfficeProperty = this.globalConfigurationRepository
|
||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS);
|
||||
|
||||
+136
-65
@@ -28,6 +28,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
|
||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
|
||||
@@ -35,8 +37,17 @@ import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecific
|
||||
import org.apache.fineract.infrastructure.jobs.annotation.CronTarget;
|
||||
import org.apache.fineract.infrastructure.jobs.service.JobName;
|
||||
import org.apache.fineract.portfolio.businessevent.BusinessEventListener;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanAdjustTransactionBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApplyOverdueChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanDisbursalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanAddChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanWaiveChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanChargePaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanForeClosureBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanMakeRepaymentBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanRefundBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanUndoWrittenOffBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWaiveInterestBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanCharge;
|
||||
@@ -44,9 +55,6 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanRepaymentScheduleIns
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanSummary;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.data.LoanSchedulePeriodData;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.ResultSetExtractor;
|
||||
@@ -54,35 +62,31 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, BusinessEventListener {
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(LoanArrearsAgingServiceImpl.class);
|
||||
private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
private final BusinessEventNotifierService businessEventNotifierService;
|
||||
private final DatabaseSpecificSQLGenerator sqlGenerator;
|
||||
private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Autowired
|
||||
public LoanArrearsAgingServiceImpl(final JdbcTemplate jdbcTemplate, final BusinessEventNotifierService businessEventNotifierService,
|
||||
DatabaseSpecificSQLGenerator sqlGenerator) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
this.businessEventNotifierService = businessEventNotifierService;
|
||||
this.sqlGenerator = sqlGenerator;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void registerForNotification() {
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_REFUND, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_ADJUST_TRANSACTION, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_MAKE_REPAYMENT, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_UNDO_WRITTEN_OFF, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_WAIVE_INTEREST, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_ADD_CHARGE, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_WAIVE_CHARGE, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_CHARGE_PAYMENT, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_APPLY_OVERDUE_CHARGE, this);
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_DISBURSAL, new DisbursementEventListener());
|
||||
this.businessEventNotifierService.addBusinessEventPostListeners(BusinessEvent.LOAN_FORECLOSURE, this);
|
||||
businessEventNotifierService.addBusinessEventListener(LoanRefundBusinessEvent.class, new RefundEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanAdjustTransactionBusinessEvent.class,
|
||||
new AdjustTransactionBusinessEventEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanMakeRepaymentBusinessEvent.class, new MakeRepaymentEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanUndoWrittenOffBusinessEvent.class, new UndoWrittenOffEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanWaiveInterestBusinessEvent.class, new WaiveInterestEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanAddChargeBusinessEvent.class, new AddChargeEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanWaiveChargeBusinessEvent.class, new WaiveChargeEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanChargePaymentBusinessEvent.class, new LoanChargePaymentEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanApplyOverdueChargeBusinessEvent.class,
|
||||
new ApplyOverdueChargeEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanDisbursalBusinessEvent.class, new DisbursementEventListener());
|
||||
businessEventNotifierService.addBusinessEventListener(LoanForeClosureBusinessEvent.class, new LoanForeClosureEventListener());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -129,7 +133,7 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, Bus
|
||||
result += i;
|
||||
}
|
||||
|
||||
LOG.info("{}: Records affected by updateLoanArrearsAgeingDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||
log.info("{}: Records affected by updateLoanArrearsAgeingDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -474,32 +478,7 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, Bus
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Override
|
||||
public void businessEventToBeExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Loan loan = null;
|
||||
Object loanEntity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
Object loanTransactionEntity = businessEventEntity.get(BusinessEntity.LOAN_TRANSACTION);
|
||||
Object loanAdjustTransactionEntity = businessEventEntity.get(BusinessEntity.LOAN_ADJUSTED_TRANSACTION);
|
||||
Object loanChargeEntity = businessEventEntity.get(BusinessEntity.LOAN_CHARGE);
|
||||
if (loanEntity != null) {
|
||||
loan = (Loan) loanEntity;
|
||||
} else if (loanTransactionEntity != null) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) loanTransactionEntity;
|
||||
loan = loanTransaction.getLoan();
|
||||
} else if (loanAdjustTransactionEntity != null) {
|
||||
LoanTransaction loanTransaction = (LoanTransaction) loanAdjustTransactionEntity;
|
||||
loan = loanTransaction.getLoan();
|
||||
} else if (loanChargeEntity != null) {
|
||||
LoanCharge loanCharge = (LoanCharge) loanChargeEntity;
|
||||
loan = loanCharge.getLoan();
|
||||
}
|
||||
private void handleArrearsForLoan(Loan loan) {
|
||||
if (loan != null && loan.isOpen() && loan.repaymentScheduleDetail().isInterestRecalculationEnabled()
|
||||
&& loan.loanProduct().isArrearsBasedOnOriginalSchedule()) {
|
||||
updateLoanArrearsAgeingDetailsWithOriginalSchedule(loan);
|
||||
@@ -508,24 +487,116 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, Bus
|
||||
}
|
||||
}
|
||||
|
||||
private class DisbursementEventListener implements BusinessEventListener {
|
||||
private class RefundEventListener implements BusinessEventListener<LoanRefundBusinessEvent> {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Override
|
||||
public void businessEventToBeExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
public void onBusinessEvent(LoanRefundBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
Loan loan = loanTransaction.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class AdjustTransactionBusinessEventEventListener implements BusinessEventListener<LoanAdjustTransactionBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void businessEventWasExecuted(Map<BusinessEntity, Object> businessEventEntity) {
|
||||
Object loanEntity = businessEventEntity.get(BusinessEntity.LOAN);
|
||||
if (loanEntity != null) {
|
||||
Loan loan = (Loan) loanEntity;
|
||||
updateLoanArrearsAgeingDetails(loan);
|
||||
public void onBusinessEvent(LoanAdjustTransactionBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get().getTransactionToAdjust();
|
||||
if (loanTransaction == null) {
|
||||
loanTransaction = event.get().getNewTransactionDetail();
|
||||
}
|
||||
|
||||
Loan loan = loanTransaction.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class MakeRepaymentEventListener implements BusinessEventListener<LoanMakeRepaymentBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanMakeRepaymentBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
Loan loan = loanTransaction.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class UndoWrittenOffEventListener implements BusinessEventListener<LoanUndoWrittenOffBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanUndoWrittenOffBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
Loan loan = loanTransaction.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class WaiveInterestEventListener implements BusinessEventListener<LoanWaiveInterestBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanWaiveInterestBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
Loan loan = loanTransaction.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class LoanForeClosureEventListener implements BusinessEventListener<LoanForeClosureBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanForeClosureBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
Loan loan = loanTransaction.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class LoanChargePaymentEventListener implements BusinessEventListener<LoanChargePaymentBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanChargePaymentBusinessEvent event) {
|
||||
LoanTransaction loanTransaction = event.get();
|
||||
Loan loan = loanTransaction.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class AddChargeEventListener implements BusinessEventListener<LoanAddChargeBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanAddChargeBusinessEvent event) {
|
||||
LoanCharge loanCharge = event.get();
|
||||
Loan loan = loanCharge.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class WaiveChargeEventListener implements BusinessEventListener<LoanWaiveChargeBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanWaiveChargeBusinessEvent event) {
|
||||
LoanCharge loanCharge = event.get();
|
||||
Loan loan = loanCharge.getLoan();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class ApplyOverdueChargeEventListener implements BusinessEventListener<LoanApplyOverdueChargeBusinessEvent> {
|
||||
|
||||
@Override
|
||||
public void onBusinessEvent(LoanApplyOverdueChargeBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
handleArrearsForLoan(loan);
|
||||
}
|
||||
}
|
||||
|
||||
private class DisbursementEventListener implements BusinessEventListener<LoanDisbursalBusinessEvent> {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Override
|
||||
public void onBusinessEvent(LoanDisbursalBusinessEvent event) {
|
||||
Loan loan = event.get();
|
||||
updateLoanArrearsAgeingDetails(loan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+65
-202
@@ -37,6 +37,8 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.accounting.journalentry.service.JournalEntryWritePlatformService;
|
||||
import org.apache.fineract.infrastructure.codes.domain.CodeValue;
|
||||
@@ -90,8 +92,28 @@ import org.apache.fineract.portfolio.account.service.AccountAssociationsReadPlat
|
||||
import org.apache.fineract.portfolio.account.service.AccountTransfersReadPlatformService;
|
||||
import org.apache.fineract.portfolio.account.service.AccountTransfersWritePlatformService;
|
||||
import org.apache.fineract.portfolio.accountdetails.domain.AccountType;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanAcceptTransferBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanAdjustTransactionBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanApplyOverdueChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCloseAsRescheduleBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanCloseBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanDisbursalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanInitiateTransferBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanInterestRecalculationBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanReassignOfficerBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanRejectTransferBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanRemoveOfficerBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanUndoDisbursalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanUndoLastDisbursalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanWithdrawTransferBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanAddChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanDeleteChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanUpdateChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanWaiveChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanWaiveChargeUndoBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanUndoWrittenOffBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWaiveInterestBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanWrittenOffBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.calendar.domain.Calendar;
|
||||
import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType;
|
||||
@@ -198,19 +220,16 @@ import org.apache.fineract.portfolio.repaymentwithpostdatedchecks.service.Repaym
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
|
||||
import org.apache.fineract.portfolio.transfer.api.TransferApiConstants;
|
||||
import org.apache.fineract.useradministration.domain.AppUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatformService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(LoanWritePlatformServiceJpaRepositoryImpl.class);
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final LoanEventApiJsonValidator loanEventApiJsonValidator;
|
||||
private final LoanUpdateCommandFromApiJsonDeserializer loanUpdateCommandFromApiJsonDeserializer;
|
||||
@@ -253,78 +272,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
private final RepaymentWithPostDatedChecksAssembler repaymentWithPostDatedChecksAssembler;
|
||||
private final PostDatedChecksRepository postDatedChecksRepository;
|
||||
|
||||
@Autowired
|
||||
public LoanWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context,
|
||||
final LoanEventApiJsonValidator loanEventApiJsonValidator,
|
||||
final LoanUpdateCommandFromApiJsonDeserializer loanUpdateCommandFromApiJsonDeserializer, final LoanAssembler loanAssembler,
|
||||
final LoanAccountDomainService loanAccountDomainService, final LoanTransactionRepository loanTransactionRepository,
|
||||
final NoteRepository noteRepository, final ChargeRepositoryWrapper chargeRepository,
|
||||
final LoanChargeRepository loanChargeRepository, final ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository,
|
||||
final JournalEntryWritePlatformService journalEntryWritePlatformService,
|
||||
final CalendarInstanceRepository calendarInstanceRepository,
|
||||
final PaymentDetailWritePlatformService paymentDetailWritePlatformService, final HolidayRepositoryWrapper holidayRepository,
|
||||
final ConfigurationDomainService configurationDomainService, final WorkingDaysRepositoryWrapper workingDaysRepository,
|
||||
final AccountTransfersWritePlatformService accountTransfersWritePlatformService,
|
||||
final AccountTransfersReadPlatformService accountTransfersReadPlatformService,
|
||||
final AccountAssociationsReadPlatformService accountAssociationsReadPlatformService,
|
||||
final LoanChargeReadPlatformService loanChargeReadPlatformService, final LoanReadPlatformService loanReadPlatformService,
|
||||
final FromJsonHelper fromApiJsonHelper, final AccountTransferRepository accountTransferRepository,
|
||||
final CalendarRepository calendarRepository,
|
||||
final LoanScheduleHistoryWritePlatformService loanScheduleHistoryWritePlatformService,
|
||||
final LoanApplicationCommandFromApiJsonHelper loanApplicationCommandFromApiJsonHelper,
|
||||
final AccountAssociationsRepository accountAssociationRepository,
|
||||
final AccountTransferDetailRepository accountTransferDetailRepository,
|
||||
final BusinessEventNotifierService businessEventNotifierService, final GuarantorDomainService guarantorDomainService,
|
||||
final LoanUtilService loanUtilService, final LoanSummaryWrapper loanSummaryWrapper,
|
||||
final EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService,
|
||||
final LoanRepaymentScheduleTransactionProcessorFactory transactionProcessingStrategy,
|
||||
final CodeValueRepositoryWrapper codeValueRepository, final LoanRepositoryWrapper loanRepositoryWrapper,
|
||||
final CashierTransactionDataValidator cashierTransactionDataValidator, final GLIMAccountInfoRepository glimRepository,
|
||||
final LoanRepository loanRepository, final RepaymentWithPostDatedChecksAssembler repaymentWithPostDatedChecksAssembler,
|
||||
final PostDatedChecksRepository postDatedChecksRepository) {
|
||||
this.context = context;
|
||||
this.loanEventApiJsonValidator = loanEventApiJsonValidator;
|
||||
this.loanAssembler = loanAssembler;
|
||||
this.loanRepositoryWrapper = loanRepositoryWrapper;
|
||||
this.loanAccountDomainService = loanAccountDomainService;
|
||||
this.loanTransactionRepository = loanTransactionRepository;
|
||||
this.noteRepository = noteRepository;
|
||||
this.chargeRepository = chargeRepository;
|
||||
this.loanChargeRepository = loanChargeRepository;
|
||||
this.applicationCurrencyRepository = applicationCurrencyRepository;
|
||||
this.journalEntryWritePlatformService = journalEntryWritePlatformService;
|
||||
this.loanUpdateCommandFromApiJsonDeserializer = loanUpdateCommandFromApiJsonDeserializer;
|
||||
this.calendarInstanceRepository = calendarInstanceRepository;
|
||||
this.paymentDetailWritePlatformService = paymentDetailWritePlatformService;
|
||||
this.holidayRepository = holidayRepository;
|
||||
this.configurationDomainService = configurationDomainService;
|
||||
this.workingDaysRepository = workingDaysRepository;
|
||||
this.accountTransfersWritePlatformService = accountTransfersWritePlatformService;
|
||||
this.accountTransfersReadPlatformService = accountTransfersReadPlatformService;
|
||||
this.accountAssociationsReadPlatformService = accountAssociationsReadPlatformService;
|
||||
this.loanChargeReadPlatformService = loanChargeReadPlatformService;
|
||||
this.loanReadPlatformService = loanReadPlatformService;
|
||||
this.fromApiJsonHelper = fromApiJsonHelper;
|
||||
this.accountTransferRepository = accountTransferRepository;
|
||||
this.calendarRepository = calendarRepository;
|
||||
this.loanScheduleHistoryWritePlatformService = loanScheduleHistoryWritePlatformService;
|
||||
this.loanApplicationCommandFromApiJsonHelper = loanApplicationCommandFromApiJsonHelper;
|
||||
this.accountAssociationRepository = accountAssociationRepository;
|
||||
this.accountTransferDetailRepository = accountTransferDetailRepository;
|
||||
this.businessEventNotifierService = businessEventNotifierService;
|
||||
this.guarantorDomainService = guarantorDomainService;
|
||||
this.loanUtilService = loanUtilService;
|
||||
this.loanSummaryWrapper = loanSummaryWrapper;
|
||||
this.transactionProcessingStrategy = transactionProcessingStrategy;
|
||||
this.entityDatatableChecksWritePlatformService = entityDatatableChecksWritePlatformService;
|
||||
this.codeValueRepository = codeValueRepository;
|
||||
this.cashierTransactionDataValidator = cashierTransactionDataValidator;
|
||||
this.loanRepository = loanRepository;
|
||||
this.glimRepository = glimRepository;
|
||||
this.repaymentWithPostDatedChecksAssembler = repaymentWithPostDatedChecksAssembler;
|
||||
this.postDatedChecksRepository = postDatedChecksRepository;
|
||||
}
|
||||
|
||||
private LoanLifecycleStateMachine defaultLoanLifecycleStateMachine() {
|
||||
final List<LoanStatus> allowedLoanStatuses = Arrays.asList(LoanStatus.values());
|
||||
return new DefaultLoanLifecycleStateMachine(allowedLoanStatuses);
|
||||
@@ -430,9 +377,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
scheduleGeneratorDTO.isSkipRepaymentOnFirstDayofMonth(), scheduleGeneratorDTO.getNumberOfdays());
|
||||
}
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_DISBURSAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
final List<Long> existingTransactionIds = new ArrayList<>();
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>();
|
||||
|
||||
@@ -581,8 +525,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
updatePostDatedChecks(postDatedChecks);
|
||||
}
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_DISBURSAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanDisbursalBusinessEvent(loan));
|
||||
|
||||
Long entityId = loan.getId();
|
||||
|
||||
@@ -736,8 +679,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
syncExpectedDateWithActualDisbursementDate(loan, actualDisbursementDate);
|
||||
}
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_DISBURSAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
final List<Long> existingTransactionIds = new ArrayList<>();
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>();
|
||||
@@ -827,9 +768,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
||||
}
|
||||
updateRecurringCalendarDatesForInterestRecalculation(loan);
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_DISBURSAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
loanAccountDomainService.recalculateAccruals(loan);
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanDisbursalBusinessEvent(loan));
|
||||
}
|
||||
|
||||
return changes;
|
||||
@@ -867,8 +807,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
final AppUser currentUser = getAppUserIfPresent();
|
||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_UNDO_DISBURSAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
removeLoanCycle(loan);
|
||||
final List<Long> existingTransactionIds = new ArrayList<>();
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>();
|
||||
@@ -909,9 +847,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
boolean isAccountTransfer = false;
|
||||
final Map<String, Object> accountingBridgeData = loan.deriveAccountingBridgeData(applicationCurrency.toData(),
|
||||
existingTransactionIds, existingReversedTransactionIds, isAccountTransfer);
|
||||
this.journalEntryWritePlatformService.createJournalEntriesForLoan(accountingBridgeData);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_UNDO_DISBURSAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
journalEntryWritePlatformService.createJournalEntriesForLoan(accountingBridgeData);
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanUndoDisbursalBusinessEvent(loan));
|
||||
}
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
@@ -941,7 +878,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
Long[] childLoanId = new Long[repayments.size()];
|
||||
for (int i = 0; i < repayments.size(); i++) {
|
||||
jsonObject = repayments.get(i).getAsJsonObject();
|
||||
LOG.info("{}", jsonObject.toString());
|
||||
log.info("{}", jsonObject.toString());
|
||||
childLoanId[i] = jsonObject.get("loanId").getAsLong();
|
||||
}
|
||||
int j = 0;
|
||||
@@ -1080,8 +1017,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
checkClientOrGroupActive(loan);
|
||||
final LoanTransaction transactionToAdjust = this.loanTransactionRepository.findById(transactionId)
|
||||
.orElseThrow(() -> new LoanTransactionNotFoundException(transactionId));
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_ADJUST_TRANSACTION,
|
||||
constructEntityMap(BusinessEntity.LOAN_ADJUSTED_TRANSACTION, transactionToAdjust));
|
||||
if (this.accountTransfersReadPlatformService.isAccountTransfer(transactionId, PortfolioAccountType.LOAN)) {
|
||||
throw new PlatformServiceUnavailableException("error.msg.loan.transfer.transaction.update.not.allowed",
|
||||
"Loan transaction:" + transactionId + " update not allowed as it involves in account transfer", transactionId);
|
||||
@@ -1190,11 +1125,11 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
Map<BusinessEntity, Object> entityMap = constructEntityMap(BusinessEntity.LOAN_ADJUSTED_TRANSACTION, transactionToAdjust);
|
||||
LoanAdjustTransactionBusinessEvent.Data eventData = new LoanAdjustTransactionBusinessEvent.Data(transactionToAdjust);
|
||||
if (newTransactionDetail.isRepaymentType() && newTransactionDetail.isGreaterThanZero(loan.getPrincpal().getCurrency())) {
|
||||
entityMap.put(BusinessEntity.LOAN_TRANSACTION, newTransactionDetail);
|
||||
eventData.setNewTransactionDetail(newTransactionDetail);
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_ADJUST_TRANSACTION, entityMap);
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanAdjustTransactionBusinessEvent(eventData));
|
||||
|
||||
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(transactionId)
|
||||
.withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId()).withGroupId(loan.getGroupId()).withLoanId(loanId)
|
||||
@@ -1235,8 +1170,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
}
|
||||
final LoanTransaction waiveInterestTransaction = LoanTransaction.waiver(loan.getOffice(), loan, transactionAmountAsMoney,
|
||||
transactionDate, interestComponent, unrecognizedIncome, DateUtils.getLocalDateTimeOfTenant(), currentUser);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_WAIVE_INTEREST,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, waiveInterestTransaction));
|
||||
LocalDate recalculateFrom = null;
|
||||
if (loan.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
|
||||
recalculateFrom = transactionDate;
|
||||
@@ -1272,9 +1205,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
}
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_WAIVE_INTEREST,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, waiveInterestTransaction));
|
||||
loanAccountDomainService.recalculateAccruals(loan);
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanWaiveInterestBusinessEvent(waiveInterestTransaction));
|
||||
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(waiveInterestTransaction.getId())
|
||||
.withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId()).withGroupId(loan.getGroupId()).withLoanId(loanId)
|
||||
.with(changes).build();
|
||||
@@ -1301,8 +1233,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
}
|
||||
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_WRITTEN_OFF,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
entityDatatableChecksWritePlatformService.runTheCheckForProduct(loanId, EntityTables.LOAN.getName(),
|
||||
StatusEnum.WRITE_OFF.getCode().longValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
||||
|
||||
@@ -1322,8 +1252,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
|
||||
final ChangedTransactionDetail changedTransactionDetail = loan.closeAsWrittenOff(command, defaultLoanLifecycleStateMachine(),
|
||||
changes, existingTransactionIds, existingReversedTransactionIds, currentUser, scheduleGeneratorDTO);
|
||||
LoanTransaction writeoff = changedTransactionDetail.getNewTransactionMappings().remove(0L);
|
||||
this.loanTransactionRepository.saveAndFlush(writeoff);
|
||||
LoanTransaction writeOff = changedTransactionDetail.getNewTransactionMappings().remove(0L);
|
||||
this.loanTransactionRepository.saveAndFlush(writeOff);
|
||||
for (final Map.Entry<Long, LoanTransaction> mapEntry : changedTransactionDetail.getNewTransactionMappings().entrySet()) {
|
||||
this.loanTransactionRepository.save(mapEntry.getValue());
|
||||
this.accountTransfersWritePlatformService.updateLoanTransaction(mapEntry.getKey(), mapEntry.getValue());
|
||||
@@ -1332,15 +1262,14 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
final String noteText = command.stringValueOfParameterNamed("note");
|
||||
if (StringUtils.isNotBlank(noteText)) {
|
||||
changes.put("note", noteText);
|
||||
final Note note = Note.loanTransactionNote(loan, writeoff, noteText);
|
||||
final Note note = Note.loanTransactionNote(loan, writeOff, noteText);
|
||||
this.noteRepository.save(note);
|
||||
}
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_WRITTEN_OFF,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, writeoff));
|
||||
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(writeoff.getId())
|
||||
loanAccountDomainService.recalculateAccruals(loan);
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanWrittenOffBusinessEvent(writeOff));
|
||||
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(writeOff.getId())
|
||||
.withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId()).withGroupId(loan.getGroupId()).withLoanId(loanId)
|
||||
.with(changes).build();
|
||||
}
|
||||
@@ -1355,8 +1284,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
|
||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_CLOSE,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
final Map<String, Object> changes = new LinkedHashMap<>();
|
||||
changes.put("transactionDate", command.stringValueOfParameterNamed("transactionDate"));
|
||||
@@ -1396,10 +1323,9 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
if (possibleClosingTransaction != null) {
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
}
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
loanAccountDomainService.recalculateAccruals(loan);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_CLOSE,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanCloseBusinessEvent(loan));
|
||||
|
||||
// Update loan transaction on repayment.
|
||||
if (AccountType.fromInt(loan.getLoanType()).isIndividualAccount()) {
|
||||
@@ -1444,8 +1370,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||
checkClientOrGroupActive(loan);
|
||||
removeLoanCycle(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_CLOSE_AS_RESCHEDULE,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
final Map<String, Object> changes = new LinkedHashMap<>();
|
||||
changes.put("transactionDate", command.stringValueOfParameterNamed("transactionDate"));
|
||||
@@ -1462,8 +1386,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
final Note note = Note.loanNote(loan, noteText);
|
||||
this.noteRepository.save(note);
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_CLOSE_AS_RESCHEDULE,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanCloseAsRescheduleBusinessEvent(loan));
|
||||
|
||||
// disable all active standing instructions linked to the loan
|
||||
this.loanAccountDomainService.disableStandingInstructionsLinkedToClosedLoan(loan);
|
||||
@@ -1541,8 +1464,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
disbursementDetail.expectedDisbursementDateAsLocalDate(), null, null);
|
||||
loanTrancheDisbursementCharge = new LoanTrancheDisbursementCharge(loanCharge, disbursementDetail);
|
||||
loanCharge.updateLoanTrancheDisbursementCharge(loanTrancheDisbursementCharge);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_ADD_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
validateAddLoanCharge(loan, chargeDefinition, loanCharge);
|
||||
addCharge(loan, chargeDefinition, loanCharge);
|
||||
isAppliedOnBackDate = true;
|
||||
@@ -1554,8 +1475,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
loan.addTrancheLoanCharge(chargeDefinition);
|
||||
} else {
|
||||
loanCharge = LoanCharge.createNewFromJson(loan, chargeDefinition, command);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_ADD_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
|
||||
validateAddLoanCharge(loan, chargeDefinition, loanCharge);
|
||||
isAppliedOnBackDate = addCharge(loan, chargeDefinition, loanCharge);
|
||||
@@ -1594,8 +1513,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
&& loan.isFeeCompoundingEnabledForInterestRecalculation()) {
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_ADD_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanAddChargeBusinessEvent(loanCharge));
|
||||
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(loanCharge.getId())
|
||||
.withOfficeId(loan.getOfficeId()).withClientId(loan.getClientId()).withGroupId(loan.getGroupId()).withLoanId(loanId)
|
||||
.build();
|
||||
@@ -1711,14 +1629,10 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
loanCharge.getId());
|
||||
}
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_UPDATE_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
|
||||
final Map<String, Object> changes = loan.updateLoanCharge(loanCharge, command);
|
||||
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_UPDATE_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanUpdateChargeBusinessEvent(loanCharge));
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
.withEntityId(loanChargeId) //
|
||||
@@ -1770,9 +1684,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
|
||||
final Map<String, Object> changes = new LinkedHashMap<>(3);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_WAIVE_CHARGE_UNDO,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
|
||||
if (loanCharge.isInstalmentFee()) {
|
||||
LoanInstallmentCharge chargePerInstallment = null;
|
||||
|
||||
@@ -1859,8 +1770,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_WAIVE_CHARGE_UNDO,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanWaiveChargeUndoBusinessEvent(loanCharge));
|
||||
|
||||
LoanTransaction loanTransactionData = this.loanTransactionRepository.getById(command.entityId());
|
||||
changes.put("principalPortion", loanTransactionData.getPrincipalPortion());
|
||||
@@ -1901,8 +1811,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
} else if (loanCharge.isPaid()) {
|
||||
throw new LoanChargeCannotBeWaivedException(LoanChargeCannotBeWaivedReason.ALREADY_PAID, loanCharge.getId());
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_WAIVE_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
Integer loanInstallmentNumber = null;
|
||||
if (loanCharge.isInstalmentFee()) {
|
||||
LoanInstallmentCharge chargePerInstallment = null;
|
||||
@@ -1951,8 +1859,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_WAIVE_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanWaiveChargeBusinessEvent(loanCharge));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -1979,13 +1886,10 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
throw new LoanChargeCannotBeDeletedException(LoanChargeCannotBeDeletedReason.LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE,
|
||||
loanCharge.getId());
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_DELETE_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
|
||||
loan.removeLoanCharge(loanCharge);
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_DELETE_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN_CHARGE, loanCharge));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanDeleteChargeBusinessEvent(loanCharge));
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
.withEntityId(loanChargeId) //
|
||||
@@ -2172,7 +2076,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
try {
|
||||
this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
||||
} catch (RuntimeException e) {
|
||||
LOG.error("Exception while paying charge {} for loan id {}", accountTransferDTO.getChargeId(),
|
||||
log.error("Exception while paying charge {} for loan id {}", accountTransferDTO.getChargeId(),
|
||||
accountTransferDTO.getToAccountId(), e);
|
||||
errors.add(e);
|
||||
}
|
||||
@@ -2197,9 +2101,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
checkClientOrGroupActive(loan);
|
||||
validateTransactionsForTransfer(loan, transferDate);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_INITIATE_TRANSFER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
final List<Long> existingTransactionIds = new ArrayList<>(loan.findExistingTransactionIds());
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>(loan.findExistingReversedTransactionIds());
|
||||
|
||||
@@ -2212,8 +2113,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_INITIATE_TRANSFER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanInitiateTransferBusinessEvent(loan));
|
||||
return newTransferTransaction;
|
||||
}
|
||||
|
||||
@@ -2223,8 +2123,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
final Staff loanOfficer) {
|
||||
AppUser currentUser = getAppUserIfPresent();
|
||||
this.loanAssembler.setHelpers(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_ACCEPT_TRANSFER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
final List<Long> existingTransactionIds = new ArrayList<>(loan.findExistingTransactionIds());
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>(loan.findExistingReversedTransactionIds());
|
||||
|
||||
@@ -2244,8 +2142,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_ACCEPT_TRANSFER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanAcceptTransferBusinessEvent(loan));
|
||||
|
||||
return newTransferAcceptanceTransaction;
|
||||
}
|
||||
@@ -2255,8 +2152,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
public LoanTransaction withdrawLoanTransfer(final Loan loan, final LocalDate transferDate) {
|
||||
AppUser currentUser = getAppUserIfPresent();
|
||||
this.loanAssembler.setHelpers(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_WITHDRAW_TRANSFER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
final List<Long> existingTransactionIds = new ArrayList<>(loan.findExistingTransactionIds());
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>(loan.findExistingReversedTransactionIds());
|
||||
@@ -2270,8 +2165,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_WITHDRAW_TRANSFER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanWithdrawTransferBusinessEvent(loan));
|
||||
|
||||
return newTransferAcceptanceTransaction;
|
||||
}
|
||||
@@ -2280,12 +2174,9 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
@Override
|
||||
public void rejectLoanTransfer(final Loan loan) {
|
||||
this.loanAssembler.setHelpers(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_REJECT_TRANSFER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
loan.setLoanStatus(LoanStatus.TRANSFER_ON_HOLD.getValue());
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_REJECT_TRANSFER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanRejectTransferBusinessEvent(loan));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -2303,8 +2194,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
|
||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_REASSIGN_OFFICER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
if (!loan.hasLoanOfficer(fromLoanOfficer)) {
|
||||
throw new LoanOfficerAssignmentException(loanId, fromLoanOfficerId);
|
||||
}
|
||||
@@ -2312,8 +2201,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
loan.reassignLoanOfficer(toLoanOfficer, dateOfLoanOfficerAssignment);
|
||||
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_REASSIGN_OFFICER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanReassignOfficerBusinessEvent(loan));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -2343,8 +2231,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
for (final String loanIdString : loanIds) {
|
||||
final Long loanId = Long.valueOf(loanIdString);
|
||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_REASSIGN_OFFICER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
checkClientOrGroupActive(loan);
|
||||
|
||||
if (!loan.hasLoanOfficer(fromLoanOfficer)) {
|
||||
@@ -2353,8 +2239,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
|
||||
loan.reassignLoanOfficer(toLoanOfficer, dateOfLoanOfficerAssignment);
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_REASSIGN_OFFICER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanReassignOfficerBusinessEvent(loan));
|
||||
}
|
||||
this.loanRepositoryWrapper.flush();
|
||||
|
||||
@@ -2379,14 +2264,10 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
if (loan.getLoanOfficer() == null) {
|
||||
throw new LoanOfficerUnassignmentException(loanId);
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_REMOVE_OFFICER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
loan.removeLoanOfficer(dateOfLoanOfficerunAssigned);
|
||||
|
||||
saveLoanWithDataIntegrityViolationChecks(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_REMOVE_OFFICER,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanRemoveOfficerBusinessEvent(loan));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -2754,8 +2635,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
&& loan.isFeeCompoundingEnabledForInterestRecalculation()) {
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_APPLY_OVERDUE_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanApplyOverdueChargeBusinessEvent(loan));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2835,8 +2715,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
LocalDate recalculateFrom = DateUtils.getLocalDateOfTenant();
|
||||
|
||||
if (loan != null) {
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_APPLY_OVERDUE_CHARGE,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
for (Map.Entry<Integer, LocalDate> entry : scheduleDates.entrySet()) {
|
||||
|
||||
final LoanCharge loanCharge = LoanCharge.createNewFromJson(loan, chargeDefinition, command, entry.getValue());
|
||||
@@ -2876,8 +2754,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
}
|
||||
LocalDate recalculateFrom = null;
|
||||
LoanTransaction writeOffTransaction = loan.findWriteOffTransaction();
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_UNDO_WRITTEN_OFF,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, writeOffTransaction));
|
||||
|
||||
ScheduleGeneratorDTO scheduleGeneratorDTO = this.loanUtilService.buildScheduleGeneratorDTO(loan, recalculateFrom);
|
||||
|
||||
@@ -2894,8 +2770,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
if (writeOffTransaction != null) {
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_UNDO_WRITTEN_OFF,
|
||||
constructEntityMap(BusinessEntity.LOAN_TRANSACTION, writeOffTransaction));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanUndoWrittenOffBusinessEvent(writeOffTransaction));
|
||||
}
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withOfficeId(loan.getOfficeId()) //
|
||||
@@ -3147,8 +3022,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||
LocalDate recalculateFrom = loan.fetchInterestRecalculateFromDate();
|
||||
AppUser currentUser = getAppUserIfPresent();
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_INTEREST_RECALCULATION,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
final List<Long> existingTransactionIds = new ArrayList<>();
|
||||
final List<Long> existingReversedTransactionIds = new ArrayList<>();
|
||||
|
||||
@@ -3169,9 +3042,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
}
|
||||
}
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
this.loanAccountDomainService.recalculateAccruals(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_INTEREST_RECALCULATION,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
loanAccountDomainService.recalculateAccruals(loan);
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanInterestRecalculationBusinessEvent(loan));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3309,12 +3181,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
return user;
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public CommandProcessingResult undoLastLoanDisbursal(Long loanId, JsonCommand command) {
|
||||
@@ -3324,8 +3190,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
final LocalDate recalculateFromDate = loan.getLastRepaymentDate();
|
||||
validateIsMultiDisbursalLoanAndDisbursedMoreThanOneTranche(loan);
|
||||
checkClientOrGroupActive(loan);
|
||||
this.businessEventNotifierService.notifyBusinessEventToBeExecuted(BusinessEvent.LOAN_UNDO_LASTDISBURSAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
|
||||
final MonetaryCurrency currency = loan.getCurrency();
|
||||
final ApplicationCurrency applicationCurrency = this.applicationCurrencyRepository.findOneWithNotFoundDetection(currency);
|
||||
@@ -3349,9 +3213,8 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
boolean isAccountTransfer = false;
|
||||
final Map<String, Object> accountingBridgeData = loan.deriveAccountingBridgeData(applicationCurrency.toData(),
|
||||
existingTransactionIds, existingReversedTransactionIds, isAccountTransfer);
|
||||
this.journalEntryWritePlatformService.createJournalEntriesForLoan(accountingBridgeData);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_UNDO_LASTDISBURSAL,
|
||||
constructEntityMap(BusinessEntity.LOAN, loan));
|
||||
journalEntryWritePlatformService.createJournalEntriesForLoan(accountingBridgeData);
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanUndoLastDisbursalBusinessEvent(loan));
|
||||
}
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
|
||||
+8
-20
@@ -22,7 +22,6 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.persistence.PersistenceException;
|
||||
@@ -35,8 +34,7 @@ import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityEx
|
||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
|
||||
import org.apache.fineract.infrastructure.entityaccess.service.FineractEntityAccessUtil;
|
||||
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.product.LoanProductCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.charge.domain.Charge;
|
||||
import org.apache.fineract.portfolio.charge.domain.ChargeRepositoryWrapper;
|
||||
@@ -136,29 +134,25 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro
|
||||
floatingRate = this.floatingRateRepository
|
||||
.findOneWithNotFoundDetection(command.longValueOfParameterNamed("floatingRatesId"));
|
||||
}
|
||||
final LoanProduct loanproduct = LoanProduct.assembleFromJson(fund, loanTransactionProcessingStrategy, charges, command,
|
||||
final LoanProduct loanProduct = LoanProduct.assembleFromJson(fund, loanTransactionProcessingStrategy, charges, command,
|
||||
this.aprCalculator, floatingRate, rates);
|
||||
loanproduct.updateLoanProductInRelatedClasses();
|
||||
loanProduct.updateLoanProductInRelatedClasses();
|
||||
|
||||
this.loanProductRepository.saveAndFlush(loanproduct);
|
||||
this.loanProductRepository.saveAndFlush(loanProduct);
|
||||
|
||||
// save accounting mappings
|
||||
this.accountMappingWritePlatformService.createLoanProductToGLAccountMapping(loanproduct.getId(), command);
|
||||
this.accountMappingWritePlatformService.createLoanProductToGLAccountMapping(loanProduct.getId(), command);
|
||||
// check if the office specific products are enabled. If yes, then
|
||||
// save this savings product against a specific office
|
||||
// i.e. this savings product is specific for this office.
|
||||
fineractEntityAccessUtil.checkConfigurationAndAddProductResrictionsForUserOffice(
|
||||
FineractEntityAccessType.OFFICE_ACCESS_TO_LOAN_PRODUCTS, loanproduct.getId());
|
||||
FineractEntityAccessType.OFFICE_ACCESS_TO_LOAN_PRODUCTS, loanProduct.getId());
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_PRODUCT_CREATE,
|
||||
constructEntityMap(BusinessEntity.LOAN_PRODUCT, loanproduct));
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.LOAN_PRODUCT_CREATE,
|
||||
constructEntityMap(BusinessEntity.LOAN_PRODUCT, loanproduct));
|
||||
businessEventNotifierService.notifyBusinessEvent(new LoanProductCreateBusinessEvent(loanProduct));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
.withEntityId(loanproduct.getId()) //
|
||||
.withEntityId(loanProduct.getId()) //
|
||||
.build();
|
||||
|
||||
} catch (final JpaSystemException | DataIntegrityViolationException dve) {
|
||||
@@ -381,10 +375,4 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||
LOG.error("Error occured.", dve);
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-13
@@ -24,7 +24,6 @@ import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -38,8 +37,8 @@ import org.apache.fineract.organisation.monetary.domain.ApplicationCurrencyRepos
|
||||
import org.apache.fineract.organisation.monetary.domain.MonetaryCurrency;
|
||||
import org.apache.fineract.organisation.monetary.domain.Money;
|
||||
import org.apache.fineract.organisation.monetary.domain.MoneyHelper;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.transaction.SavingsDepositBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.transaction.SavingsWithdrawalBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.paymentdetail.domain.PaymentDetail;
|
||||
import org.apache.fineract.portfolio.savings.SavingsAccountTransactionType;
|
||||
@@ -139,8 +138,7 @@ public class SavingsAccountDomainServiceJpa implements SavingsAccountDomainServi
|
||||
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds, transactionBooleanValues.isAccountTransfer(),
|
||||
backdatedTxnsAllowedTill);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SAVINGS_WITHDRAWAL,
|
||||
constructEntityMap(BusinessEntity.SAVINGS_TRANSACTION, withdrawal));
|
||||
businessEventNotifierService.notifyBusinessEvent(new SavingsWithdrawalBusinessEvent(withdrawal));
|
||||
return withdrawal;
|
||||
}
|
||||
|
||||
@@ -215,8 +213,7 @@ public class SavingsAccountDomainServiceJpa implements SavingsAccountDomainServi
|
||||
this.savingsAccountRepository.saveAndFlush(account);
|
||||
|
||||
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds, isAccountTransfer, backdatedTxnsAllowedTill);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SAVINGS_DEPOSIT,
|
||||
constructEntityMap(BusinessEntity.SAVINGS_TRANSACTION, deposit));
|
||||
businessEventNotifierService.notifyBusinessEvent(new SavingsDepositBusinessEvent(deposit));
|
||||
return deposit;
|
||||
}
|
||||
|
||||
@@ -285,12 +282,6 @@ public class SavingsAccountDomainServiceJpa implements SavingsAccountDomainServi
|
||||
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds, isAccountTransfer, backdatedTxnsAllowedTill);
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SavingsAccountTransaction handleReversal(SavingsAccount account, SavingsAccountTransaction savingsAccountTransaction,
|
||||
boolean backdatedTxnsAllowedTill) {
|
||||
|
||||
+5
-20
@@ -27,7 +27,6 @@ import java.math.MathContext;
|
||||
import java.time.LocalDate;
|
||||
import java.time.temporal.ChronoField;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -55,8 +54,8 @@ import org.apache.fineract.organisation.staff.domain.StaffRepositoryWrapper;
|
||||
import org.apache.fineract.portfolio.account.domain.AccountAssociationType;
|
||||
import org.apache.fineract.portfolio.account.domain.AccountAssociations;
|
||||
import org.apache.fineract.portfolio.account.domain.AccountAssociationsRepository;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.deposit.FixedDepositAccountCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.deposit.RecurringDepositAccountCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.calendar.domain.Calendar;
|
||||
import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType;
|
||||
@@ -231,11 +230,7 @@ public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
}
|
||||
|
||||
final Long savingsId = account.getId();
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.FIXED_DEPOSIT_ACCOUNT_CREATE,
|
||||
constructEntityMap(BusinessEntity.DEPOSIT_ACCOUNT, account));
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.FIXED_DEPOSIT_ACCOUNT_CREATE,
|
||||
constructEntityMap(BusinessEntity.DEPOSIT_ACCOUNT, account));
|
||||
businessEventNotifierService.notifyBusinessEvent(new FixedDepositAccountCreateBusinessEvent(account));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -293,12 +288,8 @@ public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
account.updateMaturityDateAndAmount(mc, isPreMatureClosure, isSavingsInterestPostingAtCurrentPeriodEnd,
|
||||
financialYearBeginningMonth);
|
||||
account.validateApplicableInterestRate();
|
||||
this.savingAccountRepository.save(account);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.RECURRING_DEPOSIT_ACCOUNT_CREATE,
|
||||
constructEntityMap(BusinessEntity.DEPOSIT_ACCOUNT, account));
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.RECURRING_DEPOSIT_ACCOUNT_CREATE,
|
||||
constructEntityMap(BusinessEntity.DEPOSIT_ACCOUNT, account));
|
||||
savingAccountRepository.save(account);
|
||||
businessEventNotifierService.notifyBusinessEvent(new RecurringDepositAccountCreateBusinessEvent(account));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -792,10 +783,4 @@ public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-15
@@ -79,8 +79,9 @@ import org.apache.fineract.portfolio.account.domain.StandingInstructionRepositor
|
||||
import org.apache.fineract.portfolio.account.domain.StandingInstructionStatus;
|
||||
import org.apache.fineract.portfolio.account.service.AccountAssociationsReadPlatformService;
|
||||
import org.apache.fineract.portfolio.account.service.AccountTransfersReadPlatformService;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsActivateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsCloseBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsPostInterestBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.charge.domain.Charge;
|
||||
import org.apache.fineract.portfolio.charge.domain.ChargeRepositoryWrapper;
|
||||
@@ -272,8 +273,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
}
|
||||
|
||||
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds, false);
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SAVINGS_ACTIVATE,
|
||||
constructEntityMap(BusinessEntity.SAVING, account));
|
||||
businessEventNotifierService.notifyBusinessEvent(new SavingsActivateBusinessEvent(account));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withEntityId(savingsId) //
|
||||
@@ -577,8 +577,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
}
|
||||
postInterest(account, postInterestAs, transactionDate, backdatedTxnsAllowedTill);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SAVINGS_POST_INTEREST,
|
||||
constructEntityMap(BusinessEntity.SAVING, account));
|
||||
businessEventNotifierService.notifyBusinessEvent(new SavingsPostInterestBusinessEvent(account));
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withEntityId(savingsId) //
|
||||
.withOfficeId(account.officeId()) //
|
||||
@@ -1032,10 +1031,9 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
|
||||
}
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SAVINGS_CLOSE,
|
||||
constructEntityMap(BusinessEntity.SAVING, account));
|
||||
businessEventNotifierService.notifyBusinessEvent(new SavingsCloseBusinessEvent(account));
|
||||
// disable all standing orders linked to the savings account
|
||||
this.disableStandingInstructionsLinkedToClosedSavings(account);
|
||||
disableStandingInstructionsLinkedToClosedSavings(account);
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withEntityId(savingsId) //
|
||||
.withOfficeId(account.officeId()) //
|
||||
@@ -1760,12 +1758,6 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
}
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandProcessingResult blockAccount(final Long savingsId, final JsonCommand command) {
|
||||
|
||||
|
||||
+11
-60
@@ -26,13 +26,14 @@ import java.math.BigDecimal;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.persistence.PersistenceException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.fineract.commands.domain.CommandWrapper;
|
||||
@@ -56,8 +57,9 @@ import org.apache.fineract.infrastructure.security.service.PlatformSecurityConte
|
||||
import org.apache.fineract.organisation.monetary.domain.Money;
|
||||
import org.apache.fineract.organisation.staff.domain.Staff;
|
||||
import org.apache.fineract.organisation.staff.domain.StaffRepositoryWrapper;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsApproveBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsRejectBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.client.domain.AccountNumberGenerator;
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
@@ -87,18 +89,15 @@ import org.apache.fineract.portfolio.savings.domain.SavingsProduct;
|
||||
import org.apache.fineract.portfolio.savings.domain.SavingsProductRepository;
|
||||
import org.apache.fineract.portfolio.savings.exception.SavingsProductNotFoundException;
|
||||
import org.apache.fineract.useradministration.domain.AppUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl implements SavingsApplicationProcessWritePlatformService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.class);
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final SavingsAccountRepositoryWrapper savingAccountRepository;
|
||||
private final SavingsAccountAssembler savingAccountAssembler;
|
||||
@@ -121,45 +120,6 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
private final GroupRepositoryWrapper groupRepositoryWrapper;
|
||||
private final GroupSavingsIndividualMonitoringWritePlatformService gsimWritePlatformService;
|
||||
|
||||
@Autowired
|
||||
public SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context,
|
||||
final SavingsAccountRepositoryWrapper savingAccountRepository, final SavingsAccountAssembler savingAccountAssembler,
|
||||
final SavingsAccountDataValidator savingsAccountDataValidator, final AccountNumberGenerator accountNumberGenerator,
|
||||
final ClientRepositoryWrapper clientRepository, final GroupRepository groupRepository,
|
||||
final SavingsProductRepository savingsProductRepository, final NoteRepository noteRepository,
|
||||
final StaffRepositoryWrapper staffRepository,
|
||||
final SavingsAccountApplicationTransitionApiJsonValidator savingsAccountApplicationTransitionApiJsonValidator,
|
||||
final SavingsAccountChargeAssembler savingsAccountChargeAssembler, final CommandProcessingService commandProcessingService,
|
||||
final SavingsAccountDomainService savingsAccountDomainService,
|
||||
final SavingsAccountWritePlatformService savingsAccountWritePlatformService,
|
||||
final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository,
|
||||
final BusinessEventNotifierService businessEventNotifierService,
|
||||
final EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService, final GSIMRepositoy gsimRepository,
|
||||
final GroupRepositoryWrapper groupRepositoryWrapper,
|
||||
final GroupSavingsIndividualMonitoringWritePlatformService gsimWritePlatformService) {
|
||||
this.context = context;
|
||||
this.savingAccountRepository = savingAccountRepository;
|
||||
this.savingAccountAssembler = savingAccountAssembler;
|
||||
this.accountNumberGenerator = accountNumberGenerator;
|
||||
this.savingsAccountDataValidator = savingsAccountDataValidator;
|
||||
this.clientRepository = clientRepository;
|
||||
this.groupRepository = groupRepository;
|
||||
this.savingsProductRepository = savingsProductRepository;
|
||||
this.noteRepository = noteRepository;
|
||||
this.staffRepository = staffRepository;
|
||||
this.savingsAccountApplicationTransitionApiJsonValidator = savingsAccountApplicationTransitionApiJsonValidator;
|
||||
this.savingsAccountChargeAssembler = savingsAccountChargeAssembler;
|
||||
this.commandProcessingService = commandProcessingService;
|
||||
this.savingsAccountDomainService = savingsAccountDomainService;
|
||||
this.accountNumberFormatRepository = accountNumberFormatRepository;
|
||||
this.savingsAccountWritePlatformService = savingsAccountWritePlatformService;
|
||||
this.businessEventNotifierService = businessEventNotifierService;
|
||||
this.entityDatatableChecksWritePlatformService = entityDatatableChecksWritePlatformService;
|
||||
this.gsimRepository = gsimRepository;
|
||||
this.groupRepositoryWrapper = groupRepositoryWrapper;
|
||||
this.gsimWritePlatformService = gsimWritePlatformService;
|
||||
}
|
||||
|
||||
/*
|
||||
* Guaranteed to throw an exception no matter what the data integrity issue is.
|
||||
*/
|
||||
@@ -182,7 +142,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
}
|
||||
|
||||
errorCodeBuilder.append(".unknown.data.integrity.issue");
|
||||
LOG.error("Error occured.", dve);
|
||||
log.error("Error occured.", dve);
|
||||
throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account.");
|
||||
}
|
||||
|
||||
@@ -305,8 +265,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
this.entityDatatableChecksWritePlatformService.runTheCheckForProduct(savingsId, EntityTables.SAVING.getName(),
|
||||
StatusEnum.CREATE.getCode().longValue(), EntityTables.SAVING.getForeignKeyColumnNameOnDatatable(), account.productId());
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SAVINGS_CREATE,
|
||||
constructEntityMap(BusinessEntity.SAVING, account));
|
||||
businessEventNotifierService.notifyBusinessEvent(new SavingsCreateBusinessEvent(account));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -534,8 +493,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
}
|
||||
}
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SAVINGS_APPROVE,
|
||||
constructEntityMap(BusinessEntity.SAVING, savingsAccount));
|
||||
businessEventNotifierService.notifyBusinessEvent(new SavingsApproveBusinessEvent(savingsAccount));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
@@ -657,8 +615,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
this.noteRepository.save(note);
|
||||
}
|
||||
}
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SAVINGS_REJECT,
|
||||
constructEntityMap(BusinessEntity.SAVING, savingsAccount));
|
||||
businessEventNotifierService.notifyBusinessEvent(new SavingsRejectBusinessEvent(savingsAccount));
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(command.commandId()) //
|
||||
.withEntityId(savingsId) //
|
||||
@@ -759,10 +716,4 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
||||
.setRollbackTransaction(rollbackTransaction)//
|
||||
.build();
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-12
@@ -42,8 +42,8 @@ import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
import org.apache.fineract.organisation.monetary.domain.MonetaryCurrency;
|
||||
import org.apache.fineract.portfolio.accounts.constants.ShareAccountApiConstants;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.share.ShareAccountApproveBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.share.ShareAccountCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.client.domain.AccountNumberGenerator;
|
||||
import org.apache.fineract.portfolio.note.domain.Note;
|
||||
@@ -105,8 +105,7 @@ public class ShareAccountWritePlatformServiceJpaRepositoryImpl implements ShareA
|
||||
journalEntryWritePlatformService.createJournalEntriesForShares(
|
||||
populateJournalEntries(account, account.getPendingForApprovalSharePurchaseTransactions()));
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SHARE_ACCOUNT_CREATE,
|
||||
constructEntityMap(BusinessEntity.SHARE_ACCOUNT, account));
|
||||
businessEventNotifierService.notifyBusinessEvent(new ShareAccountCreateBusinessEvent(account));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(jsonCommand.commandId()) //
|
||||
@@ -282,8 +281,7 @@ public class ShareAccountWritePlatformServiceJpaRepositoryImpl implements ShareA
|
||||
|
||||
this.journalEntryWritePlatformService.createJournalEntriesForShares(populateJournalEntries(account, journalTransactions));
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SHARE_ACCOUNT_APPROVE,
|
||||
constructEntityMap(BusinessEntity.SHARE_ACCOUNT, account));
|
||||
businessEventNotifierService.notifyBusinessEvent(new ShareAccountApproveBusinessEvent(account));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(jsonCommand.commandId()) //
|
||||
@@ -529,10 +527,4 @@ public class ShareAccountWritePlatformServiceJpaRepositoryImpl implements ShareA
|
||||
throw new PlatformDataIntegrityException("error.msg.shareaccount.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+8
-35
@@ -21,9 +21,10 @@ package org.apache.fineract.portfolio.shareproducts.service;
|
||||
import com.google.gson.JsonElement;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.persistence.PersistenceException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.fineract.accounting.producttoaccountmapping.service.ProductToGLAccountMappingWritePlatformService;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||
@@ -31,8 +32,7 @@ import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
|
||||
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEntity;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.share.ShareProductDividentsCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.service.BusinessEventNotifierService;
|
||||
import org.apache.fineract.portfolio.shareproducts.constants.ShareProductApiConstants;
|
||||
import org.apache.fineract.portfolio.shareproducts.domain.ShareProduct;
|
||||
@@ -41,18 +41,15 @@ import org.apache.fineract.portfolio.shareproducts.domain.ShareProductDividentPa
|
||||
import org.apache.fineract.portfolio.shareproducts.domain.ShareProductRepositoryWrapper;
|
||||
import org.apache.fineract.portfolio.shareproducts.exception.DividentProcessingException;
|
||||
import org.apache.fineract.portfolio.shareproducts.serialization.ShareProductDataSerializer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ShareProductWritePlatformServiceJpaRepositoryImpl implements ShareProductWritePlatformService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ShareProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||
|
||||
private final ShareProductRepositoryWrapper repository;
|
||||
private final ShareProductDataSerializer serializer;
|
||||
private final FromJsonHelper fromApiJsonHelper;
|
||||
@@ -61,22 +58,6 @@ public class ShareProductWritePlatformServiceJpaRepositoryImpl implements ShareP
|
||||
private final ProductToGLAccountMappingWritePlatformService accountMappingWritePlatformService;
|
||||
private final BusinessEventNotifierService businessEventNotifierService;
|
||||
|
||||
@Autowired
|
||||
public ShareProductWritePlatformServiceJpaRepositoryImpl(final ShareProductRepositoryWrapper repository,
|
||||
final ShareProductDataSerializer serializer, final FromJsonHelper fromApiJsonHelper,
|
||||
final ShareProductDividentPayOutDetailsRepositoryWrapper shareProductDividentPayOutDetailsRepositor,
|
||||
final ShareProductDividendAssembler shareProductDividendAssembler,
|
||||
final ProductToGLAccountMappingWritePlatformService accountMappingWritePlatformService,
|
||||
final BusinessEventNotifierService businessEventNotifierService) {
|
||||
this.repository = repository;
|
||||
this.serializer = serializer;
|
||||
this.fromApiJsonHelper = fromApiJsonHelper;
|
||||
this.shareProductDividentPayOutDetailsRepository = shareProductDividentPayOutDetailsRepositor;
|
||||
this.shareProductDividendAssembler = shareProductDividendAssembler;
|
||||
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
||||
this.businessEventNotifierService = businessEventNotifierService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandProcessingResult createShareProduct(JsonCommand jsonCommand) {
|
||||
try {
|
||||
@@ -150,8 +131,7 @@ public class ShareProductWritePlatformServiceJpaRepositoryImpl implements ShareP
|
||||
}
|
||||
this.shareProductDividentPayOutDetailsRepository.save(dividendPayOutDetails);
|
||||
|
||||
this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvent.SHARE_PRODUCT_DIVIDENDS_CREATE,
|
||||
constructEntityMap(BusinessEntity.SHARE_PRODUCT, productId));
|
||||
businessEventNotifierService.notifyBusinessEvent(new ShareProductDividentsCreateBusinessEvent(productId));
|
||||
|
||||
return new CommandProcessingResultBuilder() //
|
||||
.withCommandId(jsonCommand.commandId()) //
|
||||
@@ -202,7 +182,7 @@ public class ShareProductWritePlatformServiceJpaRepositoryImpl implements ShareP
|
||||
}
|
||||
|
||||
private void handleDataIntegrityIssues(final Exception e) {
|
||||
LOG.error("Unknown data integrity issue with resource", e);
|
||||
log.error("Unknown data integrity issue with resource", e);
|
||||
throw new PlatformDataIntegrityException("error.msg.shareproduct.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
@@ -215,15 +195,8 @@ public class ShareProductWritePlatformServiceJpaRepositoryImpl implements ShareP
|
||||
"Share Product with name `" + name + "` already exists", "name", name);
|
||||
}
|
||||
|
||||
LOG.error("Unknown data integrity issue with resource", dve);
|
||||
log.error("Unknown data integrity issue with resource", dve);
|
||||
throw new PlatformDataIntegrityException("error.msg.shareproduct.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
private Map<BusinessEntity, Object> constructEntityMap(final BusinessEntity entityEvent, Object entity) {
|
||||
Map<BusinessEntity, Object> map = new HashMap<>(1);
|
||||
map.put(entityEvent, entity);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user