fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject [2/2] fineract git commit: Resolving compilation issues with Email Campaigns Feature and resolving 322.2 migration script issue
Date Tue, 21 Nov 2017 13:21:54 GMT
Resolving compilation issues with Email Campaigns Feature and resolving 322.2 migration script issue


Project: http://git-wip-us.apache.org/repos/asf/fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/fineract/commit/4dbecc7f
Tree: http://git-wip-us.apache.org/repos/asf/fineract/tree/4dbecc7f
Diff: http://git-wip-us.apache.org/repos/asf/fineract/diff/4dbecc7f

Branch: refs/heads/develop
Commit: 4dbecc7f0eda0c519c0014e4864088b7a538c5f6
Parents: 2614ffd
Author: Nazeer Hussain Shaik <nazeer.shaik@confluxtechnologies.com>
Authored: Tue Nov 21 18:51:18 2017 +0530
Committer: Nazeer Hussain Shaik <nazeer.shaik@confluxtechnologies.com>
Committed: Tue Nov 21 18:51:18 2017 +0530

----------------------------------------------------------------------
 .../commands/service/CommandWrapperBuilder.java |   3 +-
 .../campaigns/email/api/EmailApiResource.java   |  70 +--
 ...CampaignWritePlatformCommandHandlerImpl.java | 520 ++++++++++---------
 .../email/service/EmailReadPlatformService.java |   7 +-
 .../service/EmailReadPlatformServiceImpl.java   |  13 +-
 .../service/ReadReportingServiceImpl.java       |  16 +-
 .../resources/META-INF/spring/appContext.xml    |   7 +-
 .../core_db/V322_2__email_business_rules.sql    |  85 ++-
 8 files changed, 366 insertions(+), 355 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/fineract/blob/4dbecc7f/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java
index a2ac7f0..359e427 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java
@@ -3039,7 +3039,8 @@ public class CommandWrapperBuilder {
         this.entityId = adHocId;
         this.href = "/adhocquery/" + adHocId;
         this.json = "{}";
-
+        return this ;
+    }
     public CommandWrapperBuilder createEmail() {
         this.actionName = "CREATE";
         this.entityName = "EMAIL";

http://git-wip-us.apache.org/repos/asf/fineract/blob/4dbecc7f/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java
index 575ee37..6bdae7b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/api/EmailApiResource.java
@@ -29,9 +29,7 @@ import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSer
 import org.apache.fineract.infrastructure.core.service.Page;
 import org.apache.fineract.infrastructure.core.service.SearchParameters;
 import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
-import org.apache.fineract.infrastructure.campaigns.email.data.EmailConfigurationData;
 import org.apache.fineract.infrastructure.campaigns.email.data.EmailData;
-import org.apache.fineract.infrastructure.campaigns.email.service.EmailConfigurationReadPlatformService;
 import org.apache.fineract.infrastructure.campaigns.email.service.EmailReadPlatformService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
@@ -41,9 +39,9 @@ import javax.ws.rs.*;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
+
+import java.util.Collection;
 import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
 
 @Path("/email")
 @Consumes({ MediaType.APPLICATION_JSON })
@@ -58,71 +56,61 @@ public class EmailApiResource {
     private final DefaultToApiJsonSerializer<EmailData> toApiJsonSerializer;
     private final ApiRequestParameterHelper apiRequestParameterHelper;
     private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
-    private final EmailConfigurationReadPlatformService emailConfigurationReadPlatformService;
 
     @Autowired
     public EmailApiResource(final PlatformSecurityContext context, final EmailReadPlatformService readPlatformService,
             final DefaultToApiJsonSerializer<EmailData> toApiJsonSerializer, final ApiRequestParameterHelper apiRequestParameterHelper,
-            final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
-            EmailConfigurationReadPlatformService emailConfigurationReadPlatformService) {
+            final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService) {
         this.context = context;
         this.readPlatformService = readPlatformService;
         this.toApiJsonSerializer = toApiJsonSerializer;
         this.apiRequestParameterHelper = apiRequestParameterHelper;
         this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
-        this.emailConfigurationReadPlatformService = emailConfigurationReadPlatformService;
     }
 
     @GET
-	public String retrieveAllEmails(@Context final UriInfo uriInfo) {
-
+    public String retrieveAllEmails(@Context final UriInfo uriInfo) {
         this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
-
         final Collection<EmailData> emailMessages = this.readPlatformService.retrieveAll();
-
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
         return this.toApiJsonSerializer.serialize(settings, emailMessages);
     }
 
     @GET
     @Path("pendingEmail")
-	public String retrievePendingEmail(@QueryParam("sqlSearch") final String sqlSearch,
-             @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit,
-             @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) {
+    public String retrievePendingEmail(@QueryParam("sqlSearch") final String sqlSearch, @QueryParam("offset") final Integer offset,
+            @QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy,
+            @QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) {
 
         this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
-
-		final SearchParameters searchParameters = SearchParameters.forEmailCampaign(sqlSearch, offset, limit, orderBy, sortOrder);
-         Page<EmailData> emailMessages = this.readPlatformService.retrieveAllPending(searchParameters);
-
+        final SearchParameters searchParameters = SearchParameters.forEmailCampaign(sqlSearch, offset, limit, orderBy, sortOrder);
+        Collection<EmailData> emailMessages = this.readPlatformService.retrieveAllPending(searchParameters);
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
         return this.toApiJsonSerializer.serialize(settings, emailMessages);
     }
-    
+
     @GET
     @Path("sentEmail")
-	public String retrieveSentEmail(@QueryParam("sqlSearch") final String sqlSearch,
-             @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit,
-             @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) {
+    public String retrieveSentEmail(@QueryParam("sqlSearch") final String sqlSearch, @QueryParam("offset") final Integer offset,
+            @QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy,
+            @QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) {
 
         this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
 
-		final SearchParameters searchParameters = SearchParameters.forEmailCampaign(sqlSearch, offset, limit, orderBy, sortOrder);
-         Page<EmailData> emailMessages = this.readPlatformService.retrieveAllSent(searchParameters);
+        final SearchParameters searchParameters = SearchParameters.forEmailCampaign(sqlSearch, offset, limit, orderBy, sortOrder);
+        Collection<EmailData> emailMessages = this.readPlatformService.retrieveAllSent(searchParameters);
 
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
         return this.toApiJsonSerializer.serialize(settings, emailMessages);
     }
 
-
     @GET
     @Path("messageByStatus")
-	public String retrieveAllEmailByStatus(@QueryParam("sqlSearch") final String sqlSearch,
-             @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit,
-			 @QueryParam("status") final Long status,
-             @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder, 
-			 @QueryParam("fromDate") final DateParam fromDateParam, @QueryParam("toDate") final DateParam toDateParam,
-             @QueryParam("locale") final String locale, @QueryParam("dateFormat") final String dateFormat,@Context final UriInfo uriInfo) {
+    public String retrieveAllEmailByStatus(@QueryParam("sqlSearch") final String sqlSearch, @QueryParam("offset") final Integer offset,
+            @QueryParam("limit") final Integer limit, @QueryParam("status") final Integer status,
+            @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder,
+            @QueryParam("fromDate") final DateParam fromDateParam, @QueryParam("toDate") final DateParam toDateParam,
+            @QueryParam("locale") final String locale, @QueryParam("dateFormat") final String dateFormat, @Context final UriInfo uriInfo) {
 
         this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
         Date fromDate = null;
@@ -133,30 +121,26 @@ public class EmailApiResource {
         if (toDateParam != null) {
             toDate = toDateParam.getDate("toDate", dateFormat, locale);
         }
-
-		final SearchParameters searchParameters = SearchParameters.forEmailCampaign(sqlSearch, offset, limit, status, fromDate,toDate, orderBy, sortOrder);
-         Page<EmailData> emailMessages = this.readPlatformService.retrieveEmailByStatus(searchParameters);
-
+        Page<EmailData> emailMessages = this.readPlatformService.retrieveEmailByStatus(limit, status, fromDate, toDate);
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
         return this.toApiJsonSerializer.serialize(settings, emailMessages);
     }
-    
+
     @GET
     @Path("failedEmail")
-	public String retrieveFailedEmail(@QueryParam("sqlSearch") final String sqlSearch,
-             @QueryParam("offset") final Integer offset, @QueryParam("limit") final Integer limit,
-             @QueryParam("orderBy") final String orderBy, @QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) {
+    public String retrieveFailedEmail(@QueryParam("sqlSearch") final String sqlSearch, @QueryParam("offset") final Integer offset,
+            @QueryParam("limit") final Integer limit, @QueryParam("orderBy") final String orderBy,
+            @QueryParam("sortOrder") final String sortOrder, @Context final UriInfo uriInfo) {
 
         this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
 
-		final SearchParameters searchParameters = SearchParameters.forEmailCampaign(sqlSearch, offset, limit, orderBy, sortOrder);
-         Page<EmailData> emailMessages = this.readPlatformService.retrieveAllFailed(searchParameters);
+        final SearchParameters searchParameters = SearchParameters.forEmailCampaign(sqlSearch, offset, limit, orderBy, sortOrder);
+        Collection<EmailData> emailMessages = this.readPlatformService.retrieveAllFailed(searchParameters);
 
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
         return this.toApiJsonSerializer.serialize(settings, emailMessages);
     }
 
-    
     @POST
     public String create(final String apiRequestBodyAsJson) {
 

http://git-wip-us.apache.org/repos/asf/fineract/blob/4dbecc7f/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java
index 66bd97b..cada88b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailCampaignWritePlatformCommandHandlerImpl.java
@@ -45,9 +45,6 @@ import org.apache.fineract.infrastructure.dataqueries.exception.ReportNotFoundEx
 import org.apache.fineract.infrastructure.dataqueries.service.GenericDataService;
 import org.apache.fineract.infrastructure.dataqueries.service.ReadReportingService;
 import org.apache.fineract.infrastructure.documentmanagement.contentrepository.FileSystemContentRepository;
-import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJobEmailData;
-import org.apache.fineract.infrastructure.reportmailingjob.domain.ReportMailingJob;
-import org.apache.fineract.infrastructure.reportmailingjob.domain.ReportMailingJobEmailAttachmentFileFormat;
 import org.apache.fineract.infrastructure.reportmailingjob.helper.IPv4Helper;
 import org.apache.fineract.infrastructure.campaigns.email.data.EmailMessageWithAttachmentData;
 import org.apache.fineract.infrastructure.campaigns.email.domain.*;
@@ -57,22 +54,17 @@ import org.apache.fineract.infrastructure.campaigns.email.exception.EmailCampaig
 import org.apache.fineract.infrastructure.jobs.annotation.CronTarget;
 import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException;
 import org.apache.fineract.infrastructure.jobs.service.JobName;
-import org.apache.fineract.infrastructure.jobs.service.SchedularWritePlatformService;
 import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
 import org.apache.fineract.infrastructure.campaigns.email.data.PreviewCampaignMessage;
 import org.apache.fineract.infrastructure.campaigns.email.data.EmailCampaignData;
 import org.apache.fineract.infrastructure.campaigns.email.data.EmailCampaignValidator;
-import org.apache.fineract.organisation.staff.domain.Staff;
 import org.apache.fineract.portfolio.calendar.service.CalendarUtils;
 import org.apache.fineract.portfolio.client.domain.Client;
 import org.apache.fineract.portfolio.client.domain.ClientRepositoryWrapper;
 import org.apache.fineract.portfolio.loanaccount.domain.Loan;
 import org.apache.fineract.portfolio.loanaccount.domain.LoanRepository;
-import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService;
 import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
 import org.apache.fineract.portfolio.savings.domain.SavingsAccountRepository;
-import org.apache.fineract.template.domain.TemplateRepository;
-import org.apache.fineract.template.service.TemplateMergeService;
 import org.apache.fineract.useradministration.domain.AppUser;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -89,7 +81,6 @@ import java.util.*;
 @Service
 public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampaignWritePlatformService {
 
-
     private final static Logger logger = LoggerFactory.getLogger(EmailCampaignWritePlatformCommandHandlerImpl.class);
 
     private final PlatformSecurityContext context;
@@ -98,43 +89,33 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
     private final EmailCampaignValidator emailCampaignValidator;
     private final EmailCampaignReadPlatformService emailCampaignReadPlatformService;
     private final ReportRepository reportRepository;
-    private final TemplateRepository templateRepository;
-    private final TemplateMergeService templateMergeService;
     private final EmailMessageRepository emailMessageRepository;
     private final ClientRepositoryWrapper clientRepositoryWrapper;
-    private final SchedularWritePlatformService schedularWritePlatformService;
     private final ReadReportingService readReportingService;
     private final GenericDataService genericDataService;
     private final FromJsonHelper fromJsonHelper;
-    private final ReportParameterUsageRepository reportParameterUsageRepository;
     private final LoanRepository loanRepository;
     private final SavingsAccountRepository savingsAccountRepository;
     private final EmailMessageJobEmailService emailMessageJobEmailService;
 
-
-
-
     @Autowired
-    public EmailCampaignWritePlatformCommandHandlerImpl(final PlatformSecurityContext context, final EmailCampaignRepository emailCampaignRepository,
-        final EmailCampaignValidator emailCampaignValidator,final EmailCampaignReadPlatformService emailCampaignReadPlatformService,final ReportParameterUsageRepository reportParameterUsageRepository,
-        final ReportRepository reportRepository,final TemplateRepository templateRepository, final TemplateMergeService templateMergeService,
-        final EmailMessageRepository emailMessageRepository,final ClientRepositoryWrapper clientRepositoryWrapper,final SchedularWritePlatformService schedularWritePlatformService,
-        final ReadReportingService readReportingService, final GenericDataService genericDataService,final FromJsonHelper fromJsonHelper,
-        final LoanRepository loanRepository,final SavingsAccountRepository savingsAccountRepository,final EmailMessageJobEmailService emailMessageJobEmailService) {
+    public EmailCampaignWritePlatformCommandHandlerImpl(final PlatformSecurityContext context,
+            final EmailCampaignRepository emailCampaignRepository, final EmailCampaignValidator emailCampaignValidator,
+            final EmailCampaignReadPlatformService emailCampaignReadPlatformService, final ReportRepository reportRepository,
+            final EmailMessageRepository emailMessageRepository, final ClientRepositoryWrapper clientRepositoryWrapper,
+            final ReadReportingService readReportingService, final GenericDataService genericDataService,
+            final FromJsonHelper fromJsonHelper, final LoanRepository loanRepository,
+            final SavingsAccountRepository savingsAccountRepository, final EmailMessageJobEmailService emailMessageJobEmailService) {
         this.context = context;
         this.emailCampaignRepository = emailCampaignRepository;
         this.emailCampaignValidator = emailCampaignValidator;
         this.emailCampaignReadPlatformService = emailCampaignReadPlatformService;
         this.reportRepository = reportRepository;
-        this.templateRepository = templateRepository;
-        this.templateMergeService = templateMergeService;
         this.emailMessageRepository = emailMessageRepository;
         this.clientRepositoryWrapper = clientRepositoryWrapper;
-        this.schedularWritePlatformService = schedularWritePlatformService;
         this.readReportingService = readReportingService;
         this.genericDataService = genericDataService;
         this.fromJsonHelper = fromJsonHelper;
-        this.reportParameterUsageRepository = reportParameterUsageRepository;
         this.loanRepository = loanRepository;
         this.savingsAccountRepository = savingsAccountRepository;
         this.emailMessageJobEmailService = emailMessageJobEmailService;
@@ -150,29 +131,24 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
 
         final Long businessRuleId = command.longValueOfParameterNamed(EmailCampaignValidator.businessRuleId);
 
-        final Report businessRule  = this.reportRepository.findOne(businessRuleId);
-        if(businessRule == null){
-            throw new ReportNotFoundException(businessRuleId);
-        }
+        final Report businessRule = this.reportRepository.findOne(businessRuleId);
+        if (businessRule == null) { throw new ReportNotFoundException(businessRuleId); }
 
         final Long reportId = command.longValueOfParameterNamed(EmailCampaignValidator.stretchyReportId);
 
-        final Report report  = this.reportRepository.findOne(reportId);
-        if(report == null){
-            throw new ReportNotFoundException(reportId);
-        }
-        //find all report parameters and store them as json string
+        final Report report = this.reportRepository.findOne(reportId);
+        if (report == null) { throw new ReportNotFoundException(reportId); }
+        // find all report parameters and store them as json string
         final Set<ReportParameterUsage> reportParameterUsages = report.getReportParameterUsages();
-        final Map<String,String> stretchyReportParams = new HashMap<>();
+        final Map<String, String> stretchyReportParams = new HashMap<>();
 
-        if(reportParameterUsages !=null && !reportParameterUsages.isEmpty()){
-            for(final ReportParameterUsage reportParameterUsage : reportParameterUsages){
-               stretchyReportParams.put(reportParameterUsage.getReportParameterName(),"");
+        if (reportParameterUsages != null && !reportParameterUsages.isEmpty()) {
+            for (final ReportParameterUsage reportParameterUsage : reportParameterUsages) {
+                stretchyReportParams.put(reportParameterUsage.getReportParameterName(), "");
             }
         }
 
-
-        EmailCampaign emailCampaign = EmailCampaign.instance(currentUser,businessRule,report,command);
+        EmailCampaign emailCampaign = EmailCampaign.instance(currentUser, businessRule, report, command);
         emailCampaign.setStretchyReportParamMap(new Gson().toJson(stretchyReportParams));
 
         this.emailCampaignRepository.save(emailCampaign);
@@ -182,28 +158,28 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
                 .withEntityId(emailCampaign.getId()) //
                 .build();
     }
+
     @Transactional
     @Override
     public CommandProcessingResult update(final Long resourceId, final JsonCommand command) {
-        try{
-            final AppUser currentUser = this.context.authenticatedUser();
-
+        try {
+            this.context.authenticatedUser();
             this.emailCampaignValidator.validateForUpdate(command.json());
             final EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(resourceId);
 
-            if(emailCampaign == null){ throw new EmailCampaignNotFound(resourceId);}
-            if(emailCampaign.isActive()){ throw new EmailCampaignMustBeClosedToEditException(emailCampaign.getId());}
+            if (emailCampaign == null) { throw new EmailCampaignNotFound(resourceId); }
+            if (emailCampaign.isActive()) { throw new EmailCampaignMustBeClosedToEditException(emailCampaign.getId()); }
             final Map<String, Object> changes = emailCampaign.update(command);
 
-            if(changes.containsKey(EmailCampaignValidator.businessRuleId)){
+            if (changes.containsKey(EmailCampaignValidator.businessRuleId)) {
                 final Long newValue = command.longValueOfParameterNamed(EmailCampaignValidator.businessRuleId);
                 final Report reportId = this.reportRepository.findOne(newValue);
-                if(reportId == null){ throw new ReportNotFoundException(newValue);}
+                if (reportId == null) { throw new ReportNotFoundException(newValue); }
                 emailCampaign.updateBusinessRuleId(reportId);
 
             }
 
-            if(!changes.isEmpty()){
+            if (!changes.isEmpty()) {
                 this.emailCampaignRepository.saveAndFlush(emailCampaign);
             }
             return new CommandProcessingResultBuilder() //
@@ -211,24 +187,24 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
                     .withEntityId(resourceId) //
                     .with(changes) //
                     .build();
-        }catch(final DataIntegrityViolationException dve){
+        } catch (final DataIntegrityViolationException dve) {
             handleDataIntegrityIssues(command, dve);
             return CommandProcessingResult.empty();
         }
 
     }
+
     @Transactional
     @Override
     public CommandProcessingResult delete(final Long resourceId) {
-        final AppUser currentUser = this.context.authenticatedUser();
-
+        this.context.authenticatedUser();
         final EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(resourceId);
 
-        if(emailCampaign == null){ throw new EmailCampaignNotFound(resourceId);}
-        if(emailCampaign.isActive()){ throw new EmailCampaignMustBeClosedToBeDeletedException(emailCampaign.getId());}
+        if (emailCampaign == null) { throw new EmailCampaignNotFound(resourceId); }
+        if (emailCampaign.isActive()) { throw new EmailCampaignMustBeClosedToBeDeletedException(emailCampaign.getId()); }
 
         /*
-          Do not delete but set a boolean is_visible to zero
+         * Do not delete but set a boolean is_visible to zero
          */
         emailCampaign.delete();
         this.emailCampaignRepository.saveAndFlush(emailCampaign);
@@ -239,31 +215,34 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
 
     }
 
-
     private void insertDirectCampaignIntoEmailOutboundTable(final String emailParams, final String emailSubject,
-                                                          final String messageTemplate,final String campaignName,final Long campaignId){
-        try{
-            HashMap<String,String> campaignParams = new ObjectMapper().readValue(emailParams, new TypeReference<HashMap<String,String>>(){});
+            final String messageTemplate, final String campaignName, final Long campaignId) {
+        try {
+            HashMap<String, String> campaignParams = new ObjectMapper().readValue(emailParams,
+                    new TypeReference<HashMap<String, String>>() {});
 
-            HashMap<String,String> queryParamForRunReport =  new ObjectMapper().readValue(emailParams, new TypeReference<HashMap<String,String>>(){});
+            HashMap<String, String> queryParamForRunReport = new ObjectMapper().readValue(emailParams,
+                    new TypeReference<HashMap<String, String>>() {});
 
-            List<HashMap<String,Object>> runReportObject = this.getRunReportByServiceImpl(campaignParams.get("reportName"),queryParamForRunReport);
+            List<HashMap<String, Object>> runReportObject = this.getRunReportByServiceImpl(campaignParams.get("reportName"),
+                    queryParamForRunReport);
 
-            if(runReportObject !=null){
-                for(HashMap<String,Object> entry : runReportObject){
+            if (runReportObject != null) {
+                for (HashMap<String, Object> entry : runReportObject) {
                     String message = this.compileEmailTemplate(messageTemplate, campaignName, entry);
-                    Integer clientId = (Integer)entry.get("id");
+                    Integer clientId = (Integer) entry.get("id");
                     EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(campaignId);
-                    Client client =  this.clientRepositoryWrapper.findOneWithNotFoundDetection(clientId.longValue());
+                    Client client = this.clientRepositoryWrapper.findOneWithNotFoundDetection(clientId.longValue());
                     String emailAddress = client.emailAddress();
 
-                    if(emailAddress !=null && isValidEmail(emailAddress)) {
-                        EmailMessage emailMessage = EmailMessage.pendingEmail(null,client,null,emailCampaign,emailSubject,message,emailAddress,campaignName);
+                    if (emailAddress != null && isValidEmail(emailAddress)) {
+                        EmailMessage emailMessage = EmailMessage.pendingEmail(null, client, null, emailCampaign, emailSubject, message,
+                                emailAddress, campaignName);
                         this.emailMessageRepository.save(emailMessage);
                     }
                 }
             }
-        }catch(final IOException e){
+        } catch (final IOException e) {
             // TODO throw something here
         }
 
@@ -288,42 +267,54 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
     @Override
     @CronTarget(jobName = JobName.UPDATE_EMAIL_OUTBOUND_WITH_CAMPAIGN_MESSAGE)
     public void storeTemplateMessageIntoEmailOutBoundTable() throws JobExecutionException {
-        final Collection<EmailCampaignData>  emailCampaignDataCollection = this.emailCampaignReadPlatformService.retrieveAllScheduleActiveCampaign();
-        if(emailCampaignDataCollection != null){
-            for(EmailCampaignData  emailCampaignData : emailCampaignDataCollection){
+        final Collection<EmailCampaignData> emailCampaignDataCollection = this.emailCampaignReadPlatformService
+                .retrieveAllScheduleActiveCampaign();
+        if (emailCampaignDataCollection != null) {
+            for (EmailCampaignData emailCampaignData : emailCampaignDataCollection) {
                 LocalDateTime tenantDateNow = tenantDateTime();
                 LocalDateTime nextTriggerDate = emailCampaignData.getNextTriggerDate().toLocalDateTime();
 
-                logger.info("tenant time " + tenantDateNow.toString() + " trigger time "+nextTriggerDate.toString());
-                if(nextTriggerDate.isBefore(tenantDateNow)){
-                    insertDirectCampaignIntoEmailOutboundTable(emailCampaignData.getParamValue(),emailCampaignData.getEmailSubject(), emailCampaignData.getMessage(),emailCampaignData.getCampaignName(),emailCampaignData.getId());
+                logger.info("tenant time " + tenantDateNow.toString() + " trigger time " + nextTriggerDate.toString());
+                if (nextTriggerDate.isBefore(tenantDateNow)) {
+                    insertDirectCampaignIntoEmailOutboundTable(emailCampaignData.getParamValue(), emailCampaignData.getEmailSubject(),
+                            emailCampaignData.getMessage(), emailCampaignData.getCampaignName(), emailCampaignData.getId());
                     this.updateTriggerDates(emailCampaignData.getId());
                 }
             }
         }
     }
 
-    private void updateTriggerDates(Long campaignId){
+    private void updateTriggerDates(Long campaignId) {
         final EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(campaignId);
-        if(emailCampaign == null){
-            throw new EmailCampaignNotFound(campaignId);
-        }
+        if (emailCampaign == null) { throw new EmailCampaignNotFound(campaignId); }
         LocalDateTime nextTriggerDate = emailCampaign.getNextTriggerDate();
         emailCampaign.setLastTriggerDate(nextTriggerDate.toDate());
-        //calculate new trigger date and insert into next trigger date
+        // calculate new trigger date and insert into next trigger date
 
         /**
-         * next run time has to be in the future if not calculate a new future date
+         * next run time has to be in the future if not calculate a new future
+         * date
          */
-        LocalDate nextRuntime = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(), emailCampaign.getNextTriggerDate().toLocalDate(), nextTriggerDate.toLocalDate()) ;
-        if(nextRuntime.isBefore(DateUtils.getLocalDateOfTenant())){ // means next run time is in the past calculate a new future date
-            nextRuntime = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(), emailCampaign.getNextTriggerDate().toLocalDate(),DateUtils.getLocalDateOfTenant()) ;
+        LocalDate nextRuntime = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(),
+                emailCampaign.getNextTriggerDate().toLocalDate(), nextTriggerDate.toLocalDate());
+        if (nextRuntime.isBefore(DateUtils.getLocalDateOfTenant())) { // means
+                                                                      // next
+                                                                      // run
+                                                                      // time is
+                                                                      // in the
+                                                                      // past
+                                                                      // calculate
+                                                                      // a new
+                                                                      // future
+                                                                      // date
+            nextRuntime = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(),
+                    emailCampaign.getNextTriggerDate().toLocalDate(), DateUtils.getLocalDateOfTenant());
         }
         final LocalDateTime getTime = emailCampaign.getRecurrenceStartDateTime();
-        final String dateString = nextRuntime.toString() + " " + getTime.getHourOfDay()+":"+getTime.getMinuteOfHour()+":"+getTime.getSecondOfMinute();
+        final String dateString = nextRuntime.toString() + " " + getTime.getHourOfDay() + ":" + getTime.getMinuteOfHour() + ":"
+                + getTime.getSecondOfMinute();
         final DateTimeFormatter simpleDateFormat = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
-        final LocalDateTime newTriggerDateWithTime = LocalDateTime.parse(dateString,simpleDateFormat);
-
+        final LocalDateTime newTriggerDateWithTime = LocalDateTime.parse(dateString, simpleDateFormat);
 
         emailCampaign.setNextTriggerDate(newTriggerDateWithTime.toDate());
         this.emailCampaignRepository.saveAndFlush(emailCampaign);
@@ -338,11 +329,7 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
 
         final EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(campaignId);
 
-        if(emailCampaign == null){
-            throw new EmailCampaignNotFound(campaignId);
-        }
-
-
+        if (emailCampaign == null) { throw new EmailCampaignNotFound(campaignId); }
 
         final Locale locale = command.extractLocale();
         final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
@@ -352,28 +339,31 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
 
         this.emailCampaignRepository.saveAndFlush(emailCampaign);
 
-        if(emailCampaign.isDirect()){
-            insertDirectCampaignIntoEmailOutboundTable(emailCampaign.getParamValue(),emailCampaign.getEmailSubject(),emailCampaign.getEmailMessage(),emailCampaign.getCampaignName(), emailCampaign.getId());
-        }else {
+        if (emailCampaign.isDirect()) {
+            insertDirectCampaignIntoEmailOutboundTable(emailCampaign.getParamValue(), emailCampaign.getEmailSubject(),
+                    emailCampaign.getEmailMessage(), emailCampaign.getCampaignName(), emailCampaign.getId());
+        } else {
             if (emailCampaign.isSchedule()) {
 
                 /**
-                 * if recurrence start date is in the future calculate
-                 * next trigger date if not use recurrence start date us next trigger
+                 * if recurrence start date is in the future calculate next
+                 * trigger date if not use recurrence start date us next trigger
                  * date when activating
                  */
                 LocalDate nextTriggerDate = null;
-                if(emailCampaign.getRecurrenceStartDateTime().isBefore(tenantDateTime())){
-                    nextTriggerDate = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(), emailCampaign.getRecurrenceStartDate(), DateUtils.getLocalDateOfTenant());
-                }else{
+                if (emailCampaign.getRecurrenceStartDateTime().isBefore(tenantDateTime())) {
+                    nextTriggerDate = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(),
+                            emailCampaign.getRecurrenceStartDate(), DateUtils.getLocalDateOfTenant());
+                } else {
                     nextTriggerDate = emailCampaign.getRecurrenceStartDate();
                 }
                 // to get time of tenant
                 final LocalDateTime getTime = emailCampaign.getRecurrenceStartDateTime();
 
-                final String dateString = nextTriggerDate.toString() + " " + getTime.getHourOfDay()+":"+getTime.getMinuteOfHour()+":"+getTime.getSecondOfMinute();
+                final String dateString = nextTriggerDate.toString() + " " + getTime.getHourOfDay() + ":" + getTime.getMinuteOfHour() + ":"
+                        + getTime.getSecondOfMinute();
                 final DateTimeFormatter simpleDateFormat = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
-                final LocalDateTime nextTriggerDateWithTime = LocalDateTime.parse(dateString,simpleDateFormat);
+                final LocalDateTime nextTriggerDateWithTime = LocalDateTime.parse(dateString, simpleDateFormat);
 
                 emailCampaign.setNextTriggerDate(nextTriggerDateWithTime.toDate());
                 this.emailCampaignRepository.saveAndFlush(emailCampaign);
@@ -381,8 +371,8 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
         }
 
         /*
-          if campaign is direct insert campaign message into email outbound table
-          else if its a schedule create a job process for it
+         * if campaign is direct insert campaign message into email outbound
+         * table else if its a schedule create a job process for it
          */
         return new CommandProcessingResultBuilder() //
                 .withCommandId(command.commandId()) //
@@ -398,15 +388,13 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
         this.emailCampaignValidator.validateClosedDate(command.json());
 
         final EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(campaignId);
-        if(emailCampaign == null){
-            throw new EmailCampaignNotFound(campaignId);
-        }
+        if (emailCampaign == null) { throw new EmailCampaignNotFound(campaignId); }
 
         final Locale locale = command.extractLocale();
         final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
         final LocalDate closureDate = command.localDateValueOfParameterNamed("closureDate");
 
-        emailCampaign.close(currentUser,fmt,closureDate);
+        emailCampaign.close(currentUser, fmt, closureDate);
 
         this.emailCampaignRepository.saveAndFlush(emailCampaign);
 
@@ -416,7 +404,8 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
                 .build();
     }
 
-    private String compileEmailTemplate(final String textMessageTemplate,final String campaignName , final Map<String, Object> emailParams)  {
+    private String compileEmailTemplate(final String textMessageTemplate, final String campaignName,
+            final Map<String, Object> emailParams) {
         final MustacheFactory mf = new DefaultMustacheFactory();
         final Mustache mustache = mf.compile(new StringReader(textMessageTemplate), campaignName);
 
@@ -426,22 +415,25 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
         return stringWriter.toString();
     }
 
-    private List<HashMap<String,Object>> getRunReportByServiceImpl(final String reportName,final Map<String, String> queryParams) throws IOException {
-        final String reportType ="report";
+    @SuppressWarnings({ "unused", "rawtypes" })
+    private List<HashMap<String, Object>> getRunReportByServiceImpl(final String reportName, final Map<String, String> queryParams)
+            throws IOException {
+        final String reportType = "report";
 
         List<HashMap<String, Object>> resultList = new ArrayList<HashMap<String, Object>>();
-        final GenericResultsetData results = this.readReportingService.retrieveGenericResultSetForSmsEmailCampaign(reportName,
-                reportType, queryParams);
+        final GenericResultsetData results = this.readReportingService.retrieveGenericResultSetForSmsEmailCampaign(reportName, reportType,
+                queryParams);
         final String response = this.genericDataService.generateJsonFromGenericResultsetData(results);
-        resultList = new ObjectMapper().readValue(response, new TypeReference<List<HashMap<String,Object>>>(){});
-        //loop changes array date to string date
-        for(HashMap<String,Object> entry : resultList){
-            for(Map.Entry<String,Object> map: entry.entrySet()){
+        resultList = new ObjectMapper().readValue(response, new TypeReference<List<HashMap<String, Object>>>() {});
+        // loop changes array date to string date
+        for (HashMap<String, Object> entry : resultList) {
+            for (Map.Entry<String, Object> map : entry.entrySet()) {
                 String key = map.getKey();
-                Object ob  = map.getValue();
-                if(ob instanceof ArrayList && ((ArrayList) ob).size() == 3){
-                    String changeArrayDateToStringDate =  ((ArrayList) ob).get(2).toString() +"-"+((ArrayList) ob).get(1).toString() +"-"+((ArrayList) ob).get(0).toString();
-                    entry.put(key,changeArrayDateToStringDate);
+                Object ob = map.getValue();
+                if (ob instanceof ArrayList && ((ArrayList) ob).size() == 3) {
+                    String changeArrayDateToStringDate = ((ArrayList) ob).get(2).toString() + "-" + ((ArrayList) ob).get(1).toString() + "-"
+                            + ((ArrayList) ob).get(0).toString();
+                    entry.put(key, changeArrayDateToStringDate);
                 }
             }
         }
@@ -451,36 +443,40 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
     @Override
     public PreviewCampaignMessage previewMessage(final JsonQuery query) {
         PreviewCampaignMessage campaignMessage = null;
-        final AppUser currentUser = this.context.authenticatedUser();
+        this.context.authenticatedUser();
         this.emailCampaignValidator.validatePreviewMessage(query.json());
-        final String emailParams = this.fromJsonHelper.extractStringNamed("paramValue", query.parsedJson()) ;
+        final String emailParams = this.fromJsonHelper.extractStringNamed("paramValue", query.parsedJson());
         final String textMessageTemplate = this.fromJsonHelper.extractStringNamed("emailMessage", query.parsedJson());
 
-        try{
-            HashMap<String,String> campaignParams = new ObjectMapper().readValue(emailParams, new TypeReference<HashMap<String,String>>(){});
+        try {
+            HashMap<String, String> campaignParams = new ObjectMapper().readValue(emailParams,
+                    new TypeReference<HashMap<String, String>>() {});
 
-            HashMap<String,String> queryParamForRunReport =  new ObjectMapper().readValue(emailParams, new TypeReference<HashMap<String,String>>(){});
+            HashMap<String, String> queryParamForRunReport = new ObjectMapper().readValue(emailParams,
+                    new TypeReference<HashMap<String, String>>() {});
 
-            List<HashMap<String,Object>> runReportObject = this.getRunReportByServiceImpl(campaignParams.get("reportName"),queryParamForRunReport);
+            List<HashMap<String, Object>> runReportObject = this.getRunReportByServiceImpl(campaignParams.get("reportName"),
+                    queryParamForRunReport);
 
-            if(runReportObject !=null){
-                for(HashMap<String,Object> entry : runReportObject){
+            if (runReportObject != null) {
+                for (HashMap<String, Object> entry : runReportObject) {
                     // add string object to campaignParam object
-                    String textMessage = this.compileEmailTemplate(textMessageTemplate,"EmailCampaign", entry);
-                    if(!textMessage.isEmpty()) {
+                    String textMessage = this.compileEmailTemplate(textMessageTemplate, "EmailCampaign", entry);
+                    if (!textMessage.isEmpty()) {
                         final Integer totalMessage = runReportObject.size();
-                        campaignMessage = new PreviewCampaignMessage(textMessage,totalMessage);
+                        campaignMessage = new PreviewCampaignMessage(textMessage, totalMessage);
                         break;
                     }
                 }
             }
-        }catch(final IOException e){
+        } catch (final IOException e) {
             // TODO throw something here
         }
 
         return campaignMessage;
 
     }
+
     @Transactional
     @Override
     public CommandProcessingResult reactivateEmailCampaign(final Long campaignId, JsonCommand command) {
@@ -491,51 +487,53 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
 
         final EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(campaignId);
 
-        if(emailCampaign == null){ throw new EmailCampaignNotFound(campaignId);}
+        if (emailCampaign == null) { throw new EmailCampaignNotFound(campaignId); }
 
         final Locale locale = command.extractLocale();
         final DateTimeFormatter fmt = DateTimeFormat.forPattern(command.dateFormat()).withLocale(locale);
         final LocalDate reactivationDate = command.localDateValueOfParameterNamed("activationDate");
-        emailCampaign.reactivate(currentUser,fmt,reactivationDate);
+        emailCampaign.reactivate(currentUser, fmt, reactivationDate);
         if (emailCampaign.isSchedule()) {
 
             /**
-             * if recurrence start date is in the future calculate
-             * next trigger date if not use recurrence start date us next trigger date when activating
+             * if recurrence start date is in the future calculate next trigger
+             * date if not use recurrence start date us next trigger date when
+             * activating
              */
             LocalDate nextTriggerDate = null;
-            if(emailCampaign.getRecurrenceStartDateTime().isBefore(tenantDateTime())){
-                nextTriggerDate = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(), emailCampaign.getRecurrenceStartDate(), DateUtils.getLocalDateOfTenant());
-            }else{
+            if (emailCampaign.getRecurrenceStartDateTime().isBefore(tenantDateTime())) {
+                nextTriggerDate = CalendarUtils.getNextRecurringDate(emailCampaign.getRecurrence(), emailCampaign.getRecurrenceStartDate(),
+                        DateUtils.getLocalDateOfTenant());
+            } else {
                 nextTriggerDate = emailCampaign.getRecurrenceStartDate();
             }
             // to get time of tenant
             final LocalDateTime getTime = emailCampaign.getRecurrenceStartDateTime();
 
-            final String dateString = nextTriggerDate.toString() + " " + getTime.getHourOfDay()+":"+getTime.getMinuteOfHour()+":"+getTime.getSecondOfMinute();
+            final String dateString = nextTriggerDate.toString() + " " + getTime.getHourOfDay() + ":" + getTime.getMinuteOfHour() + ":"
+                    + getTime.getSecondOfMinute();
             final DateTimeFormatter simpleDateFormat = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
-            final LocalDateTime nextTriggerDateWithTime = LocalDateTime.parse(dateString,simpleDateFormat);
+            final LocalDateTime nextTriggerDateWithTime = LocalDateTime.parse(dateString, simpleDateFormat);
 
             emailCampaign.setNextTriggerDate(nextTriggerDateWithTime.toDate());
             this.emailCampaignRepository.saveAndFlush(emailCampaign);
         }
 
-
-
         return new CommandProcessingResultBuilder() //
                 .withEntityId(emailCampaign.getId()) //
                 .build();
 
     }
 
-    private void handleDataIntegrityIssues(@SuppressWarnings("unused") final JsonCommand command, final DataIntegrityViolationException dve) {
+    private void handleDataIntegrityIssues(@SuppressWarnings("unused") final JsonCommand command,
+            final DataIntegrityViolationException dve) {
         final Throwable realCause = dve.getMostSpecificCause();
 
         throw new PlatformDataIntegrityException("error.msg.email.campaign.unknown.data.integrity.issue",
                 "Unknown data integrity issue with resource: " + realCause.getMessage());
     }
 
-    private LocalDateTime tenantDateTime(){
+    private LocalDateTime tenantDateTime() {
         LocalDateTime today = new LocalDateTime();
         final FineractPlatformTenant tenant = ThreadLocalContextUtil.getTenant();
 
@@ -545,137 +543,164 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
                 today = new LocalDateTime(zone);
             }
         }
-        return  today;
+        return today;
     }
 
     @Override
     @CronTarget(jobName = JobName.EXECUTE_EMAIL)
     public void sendEmailMessage() throws JobExecutionException {
-        if (IPv4Helper.applicationIsNotRunningOnLocalMachine()){ //remove when testing locally
-            final List<EmailMessage> emailMessages = this.emailMessageRepository.findByStatusType(EmailMessageStatusType.PENDING.getValue()); //retrieve all pending message
-
-            for(final EmailMessage emailMessage : emailMessages) {
+        if (IPv4Helper.applicationIsNotRunningOnLocalMachine()) { // remove when
+                                                                  // testing
+                                                                  // locally
+            final List<EmailMessage> emailMessages = this.emailMessageRepository
+                    .findByStatusType(EmailMessageStatusType.PENDING.getValue()); // retrieve
+                                                                                  // all
+                                                                                  // pending
+                                                                                  // message
 
+            for (final EmailMessage emailMessage : emailMessages) {
 
                 if (isValidEmail(emailMessage.getEmailAddress())) {
 
+                    final EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(emailMessage.getEmailCampaign().getId()); //
 
-                        final EmailCampaign emailCampaign = this.emailCampaignRepository.findOne(emailMessage.getEmailCampaign().getId()); //
+                    final ScheduledEmailAttachmentFileFormat emailAttachmentFileFormat = ScheduledEmailAttachmentFileFormat
+                            .instance(emailCampaign.getEmailAttachmentFileFormat());
 
-                        final ScheduledEmailAttachmentFileFormat emailAttachmentFileFormat = ScheduledEmailAttachmentFileFormat.instance(emailCampaign.getEmailAttachmentFileFormat());
+                    final List<File> attachmentList = new ArrayList<>();
 
-                        final List<File> attachmentList = new ArrayList<>();
+                    final StringBuilder errorLog = new StringBuilder();
 
-                        final StringBuilder errorLog = new StringBuilder();
+                    // check if email attachment format exist
+                    if (emailAttachmentFileFormat != null && Arrays.asList(ScheduledEmailAttachmentFileFormat.validValues())
+                            .contains(emailAttachmentFileFormat.getId())) {
 
-                        //check if email attachment format exist
-                        if (emailAttachmentFileFormat != null && Arrays.asList(ScheduledEmailAttachmentFileFormat.validValues()).
-                                contains(emailAttachmentFileFormat.getId())) {
+                        final Report stretchyReport = emailCampaign.getStretchyReport();
 
-                            final Report stretchyReport = emailCampaign.getStretchyReport();
+                        final String reportName = (stretchyReport != null) ? stretchyReport.getReportName() : null;
 
-                            final String reportName = (stretchyReport != null) ? stretchyReport.getReportName() : null;
+                        final HashMap<String, String> reportStretchyParams = this
+                                .validateStretchyReportParamMap(emailCampaign.getStretchyReportParamMap());
 
-                            final HashMap<String, String> reportStretchyParams = this.validateStretchyReportParamMap(emailCampaign.getStretchyReportParamMap());
+                        // there is a probability that a client has one or more
+                        // loans or savings therefore we need to send two or
+                        // more attachments
+                        if (reportStretchyParams.containsKey("selectLoan") || reportStretchyParams.containsKey("loanId")) {
+                            // get all ids of the client loans
+                            if (emailMessage.getClient() != null) {
 
-                            // there is a probability that a client has one or more loans or savings therefore we need to send two or more attachments
-                            if (reportStretchyParams.containsKey("selectLoan") || reportStretchyParams.containsKey("loanId")) {
-                                //get all ids of the client loans
-                                if (emailMessage.getClient() != null) {
+                                final List<Loan> loans = this.loanRepository.findLoanByClientId(emailMessage.getClient().getId());
 
-                                    final List<Loan> loans = this.loanRepository.findLoanByClientId(emailMessage.getClient().getId());
+                                HashMap<String, String> reportParams = this
+                                        .replaceStretchyParamsWithActualClientParams(reportStretchyParams, emailMessage.getClient());
 
-                                    HashMap<String, String> reportParams = this.replaceStretchyParamsWithActualClientParams(reportStretchyParams, emailMessage.getClient());
+                                for (final Loan loan : loans) {
+                                    if (loan.isOpen()) { // only send attachment
+                                                         // for active loan
 
-                                    for (final Loan loan : loans) {
-                                        if (loan.isOpen()) { // only send attachment for active loan
+                                        if (reportStretchyParams.containsKey("selectLoan")) {
 
-                                            if (reportStretchyParams.containsKey("selectLoan")) {
+                                            reportParams.put("SelectLoan", loan.getId().toString());
 
-                                                reportParams.put("SelectLoan", loan.getId().toString());
+                                        } else if (reportStretchyParams.containsKey("loanId")) {
 
-                                            } else if (reportStretchyParams.containsKey("loanId")) {
-
-                                                reportParams.put("loanId", loan.getId().toString());
-                                            }
-                                            File file = this.generateAttachments(emailCampaign, emailAttachmentFileFormat, reportParams, reportName, errorLog);
+                                            reportParams.put("loanId", loan.getId().toString());
+                                        }
+                                        File file = this.generateAttachments(emailCampaign, emailAttachmentFileFormat, reportParams,
+                                                reportName, errorLog);
 
-                                            if (file != null) {
-                                                attachmentList.add(file);
-                                            } else {
-                                                errorLog.append(reportParams.toString());
-                                            }
+                                        if (file != null) {
+                                            attachmentList.add(file);
+                                        } else {
+                                            errorLog.append(reportParams.toString());
                                         }
                                     }
-
                                 }
-                            } else if (reportStretchyParams.containsKey("savingId")) {
-                                if (emailMessage.getClient() != null) {
 
-                                    final List<SavingsAccount> savingsAccounts = this.savingsAccountRepository.findSavingAccountByClientId(emailMessage.getClient().getId());
+                            }
+                        } else if (reportStretchyParams.containsKey("savingId")) {
+                            if (emailMessage.getClient() != null) {
+
+                                final List<SavingsAccount> savingsAccounts = this.savingsAccountRepository
+                                        .findSavingAccountByClientId(emailMessage.getClient().getId());
 
-                                    HashMap<String, String> reportParams = this.replaceStretchyParamsWithActualClientParams(reportStretchyParams, emailMessage.getClient());
+                                HashMap<String, String> reportParams = this
+                                        .replaceStretchyParamsWithActualClientParams(reportStretchyParams, emailMessage.getClient());
 
-                                    for (final SavingsAccount savingsAccount : savingsAccounts) {
+                                for (final SavingsAccount savingsAccount : savingsAccounts) {
 
-                                        if (savingsAccount.isActive()) {
+                                    if (savingsAccount.isActive()) {
 
-                                            reportParams.put("savingId", savingsAccount.getId().toString());
+                                        reportParams.put("savingId", savingsAccount.getId().toString());
 
-                                            File file = this.generateAttachments(emailCampaign, emailAttachmentFileFormat, reportParams, reportName, errorLog);
+                                        File file = this.generateAttachments(emailCampaign, emailAttachmentFileFormat, reportParams,
+                                                reportName, errorLog);
 
-                                            if (file != null) {
-                                                attachmentList.add(file);
-                                            } else {
-                                                errorLog.append(reportParams.toString());
-                                            }
+                                        if (file != null) {
+                                            attachmentList.add(file);
+                                        } else {
+                                            errorLog.append(reportParams.toString());
                                         }
                                     }
                                 }
-                            } else {
-                                if (emailMessage.getClient() != null) {
+                            }
+                        } else {
+                            if (emailMessage.getClient() != null) {
 
-                                    HashMap<String, String> reportParams = this.replaceStretchyParamsWithActualClientParams(reportStretchyParams, emailMessage.getClient());
+                                HashMap<String, String> reportParams = this
+                                        .replaceStretchyParamsWithActualClientParams(reportStretchyParams, emailMessage.getClient());
 
-                                    File file = this.generateAttachments(emailCampaign, emailAttachmentFileFormat, reportParams, reportName, errorLog);
+                                File file = this.generateAttachments(emailCampaign, emailAttachmentFileFormat, reportParams, reportName,
+                                        errorLog);
 
-                                    if (file != null) {
-                                        attachmentList.add(file);
-                                    } else {
-                                        errorLog.append(reportParams.toString());
-                                    }
+                                if (file != null) {
+                                    attachmentList.add(file);
+                                } else {
+                                    errorLog.append(reportParams.toString());
                                 }
                             }
-
                         }
 
-                        final EmailMessageWithAttachmentData emailMessageWithAttachmentData = EmailMessageWithAttachmentData.createNew(emailMessage.getEmailAddress(), emailMessage.getMessage(),
-                                emailMessage.getEmailSubject(), attachmentList);
+                    }
 
-                        if (!attachmentList.isEmpty() && attachmentList.size() > 0) { // only send email message if there is an attachment to it
+                    final EmailMessageWithAttachmentData emailMessageWithAttachmentData = EmailMessageWithAttachmentData.createNew(
+                            emailMessage.getEmailAddress(), emailMessage.getMessage(), emailMessage.getEmailSubject(), attachmentList);
 
-                            this.emailMessageJobEmailService.sendEmailWithAttachment(emailMessageWithAttachmentData);
+                    if (!attachmentList.isEmpty() && attachmentList.size() > 0) { // only
+                                                                                  // send
+                                                                                  // email
+                                                                                  // message
+                                                                                  // if
+                                                                                  // there
+                                                                                  // is
+                                                                                  // an
+                                                                                  // attachment
+                                                                                  // to
+                                                                                  // it
 
-                            emailMessage.setStatusType(EmailMessageStatusType.SENT.getValue());
+                        this.emailMessageJobEmailService.sendEmailWithAttachment(emailMessageWithAttachmentData);
 
-                            this.emailMessageRepository.save(emailMessage);
-                        } else {
-                            emailMessage.updateErrorMessage(errorLog.toString());
+                        emailMessage.setStatusType(EmailMessageStatusType.SENT.getValue());
 
-                            emailMessage.setStatusType(EmailMessageStatusType.FAILED.getValue());
+                        this.emailMessageRepository.save(emailMessage);
+                    } else {
+                        emailMessage.updateErrorMessage(errorLog.toString());
 
-                            this.emailMessageRepository.save(emailMessage);
-                        }
+                        emailMessage.setStatusType(EmailMessageStatusType.FAILED.getValue());
+
+                        this.emailMessageRepository.save(emailMessage);
+                    }
                 }
             }
 
         }
 
-
     }
 
     /**
-     * This generates the the report and converts it to a file by passing the parameters below
+     * This generates the the report and converts it to a file by passing the
+     * parameters below
+     * 
      * @param emailCampaign
      * @param emailAttachmentFileFormat
      * @param reportParams
@@ -684,9 +709,9 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
      * @return
      */
     private File generateAttachments(final EmailCampaign emailCampaign, final ScheduledEmailAttachmentFileFormat emailAttachmentFileFormat,
-                                     final Map<String, String> reportParams, final String reportName, final StringBuilder errorLog){
+            final Map<String, String> reportParams, final String reportName, final StringBuilder errorLog) {
 
-        try{
+        try {
             final ByteArrayOutputStream byteArrayOutputStream = this.readReportingService.generatePentahoReportAsOutputStream(reportName,
                     emailAttachmentFileFormat.getValue(), reportParams, null, emailCampaign.getApprovedBy(), errorLog);
 
@@ -700,8 +725,7 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
 
             if (byteArrayOutputStream.size() == 0) {
                 errorLog.append("Pentaho report processing failed, empty output stream created");
-            }
-            else if (errorLog.length() == 0 && (byteArrayOutputStream.size() > 0)) {
+            } else if (errorLog.length() == 0 && (byteArrayOutputStream.size() > 0)) {
                 final String fileName = fileNameWithoutExtension + "." + emailAttachmentFileFormat.getValue();
 
                 final File file = new File(fileName);
@@ -711,59 +735,62 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
                 return file;
             }
 
-        }catch(IOException | PlatformDataIntegrityException e){
-            errorLog.append("The ReportMailingJobWritePlatformServiceImpl.executeReportMailingJobs threw an IOException "
-                    + "exception: " + e.getMessage() + " ---------- ");
+        } catch (IOException | PlatformDataIntegrityException e) {
+            errorLog.append("The ReportMailingJobWritePlatformServiceImpl.executeReportMailingJobs threw an IOException " + "exception: "
+                    + e.getMessage() + " ---------- ");
         }
         return null;
     }
 
     /**
-     * This matches the the actual values to the key in the report stretchy parameters map
+     * This matches the the actual values to the key in the report stretchy
+     * parameters map
+     * 
      * @param stretchyParams
      * @param client
      * @return
      */
-    private HashMap<String,String> replaceStretchyParamsWithActualClientParams(final HashMap<String,String> stretchyParams,final Client client){
+    private HashMap<String, String> replaceStretchyParamsWithActualClientParams(final HashMap<String, String> stretchyParams,
+            final Client client) {
 
-        HashMap<String,String> actualParams = new HashMap<>();
+        HashMap<String, String> actualParams = new HashMap<>();
 
         for (Map.Entry<String, String> entry : stretchyParams.entrySet()) {
-             if(entry.getKey().equals("selectOffice")){
-                 //most at times the reports are run by picking the office of the staff Id
-                 if(client.getStaff() !=null){
-                     actualParams.put(entry.getKey(),client.getStaff().officeId().toString());
-                 }else {
-                     actualParams.put(entry.getKey(), client.getOffice().getId().toString());
-                 }
+            if (entry.getKey().equals("selectOffice")) {
+                // most at times the reports are run by picking the office of
+                // the staff Id
+                if (client.getStaff() != null) {
+                    actualParams.put(entry.getKey(), client.getStaff().officeId().toString());
+                } else {
+                    actualParams.put(entry.getKey(), client.getOffice().getId().toString());
+                }
 
-             }else if(entry.getKey().equals("selectClient")){
+            } else if (entry.getKey().equals("selectClient")) {
 
-                 actualParams.put(entry.getKey(),client.getId().toString());
+                actualParams.put(entry.getKey(), client.getId().toString());
 
-             }else if(entry.getKey().equals("selectLoanofficer")){
+            } else if (entry.getKey().equals("selectLoanofficer")) {
 
-                 actualParams.put(entry.getKey(),client.getStaff().getId().toString());
+                actualParams.put(entry.getKey(), client.getStaff().getId().toString());
 
-             }else if(entry.getKey().equals("environementUrl")){
+            } else if (entry.getKey().equals("environementUrl")) {
 
-                 actualParams.put(entry.getKey(),entry.getKey());
-             }
+                actualParams.put(entry.getKey(), entry.getKey());
+            }
         }
         return actualParams;
     }
 
+    private HashMap<String, String> validateStretchyReportParamMap(final String stretchyParams) {
 
-    private HashMap<String,String> validateStretchyReportParamMap(final String stretchyParams){
-
-        HashMap<String,String> stretchyReportParamHashMap = new HashMap<>();
+        HashMap<String, String> stretchyReportParamHashMap = new HashMap<>();
 
         if (!StringUtils.isEmpty(stretchyParams)) {
             try {
-                stretchyReportParamHashMap = new ObjectMapper().readValue(stretchyParams, new TypeReference<HashMap<String,String>>(){});
+                stretchyReportParamHashMap = new ObjectMapper().readValue(stretchyParams, new TypeReference<HashMap<String, String>>() {});
             }
 
-            catch(Exception e) {
+            catch (Exception e) {
                 stretchyReportParamHashMap = null;
             }
         }
@@ -771,5 +798,4 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
         return stretchyReportParamHashMap;
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/4dbecc7f/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformService.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformService.java
index 6348023..961f969 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformService.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformService.java
@@ -19,6 +19,7 @@
 package org.apache.fineract.infrastructure.campaigns.email.service;
 
 import org.apache.fineract.infrastructure.core.service.Page;
+import org.apache.fineract.infrastructure.core.service.SearchParameters;
 import org.apache.fineract.infrastructure.campaigns.email.data.EmailData;
 
 import java.util.Collection;
@@ -31,13 +32,13 @@ public interface EmailReadPlatformService {
 
     EmailData retrieveOne(Long resourceId);
     
-    Collection<EmailData> retrieveAllPending(Integer limit);
+    Collection<EmailData> retrieveAllPending(final SearchParameters searchParameters);
     
-    Collection<EmailData> retrieveAllSent(Integer limit);
+    Collection<EmailData> retrieveAllSent(final SearchParameters searchParameters);
     
     Collection<EmailData> retrieveAllDelivered(Integer limit);
     
-    Collection<EmailData> retrieveAllFailed(Integer limit);
+    Collection<EmailData> retrieveAllFailed(final SearchParameters searchParameters);
 
     Page<EmailData> retrieveEmailByStatus(Integer limit, Integer status, Date dateFrom, Date dateTo);
     

http://git-wip-us.apache.org/repos/asf/fineract/blob/4dbecc7f/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java
index 98d4dfe..870251b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/service/EmailReadPlatformServiceImpl.java
@@ -24,6 +24,7 @@ import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
 import org.apache.fineract.infrastructure.core.service.Page;
 import org.apache.fineract.infrastructure.core.service.PaginationHelper;
 import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
+import org.apache.fineract.infrastructure.core.service.SearchParameters;
 import org.apache.fineract.infrastructure.campaigns.email.exception.EmailNotFoundException;
 import org.apache.fineract.infrastructure.campaigns.email.data.EmailData;
 import org.apache.fineract.infrastructure.campaigns.email.domain.EmailMessageEnumerations;
@@ -129,8 +130,8 @@ public class EmailReadPlatformServiceImpl implements EmailReadPlatformService {
     }
     
     @Override
-	public Collection<EmailData> retrieveAllPending(final Integer limit) {
-    	final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
+	public Collection<EmailData> retrieveAllPending(final SearchParameters searchParameters) {
+    	final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : "";
     	final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = "
     			+ EmailMessageStatusType.PENDING.getValue() + sqlPlusLimit;
 
@@ -138,8 +139,8 @@ public class EmailReadPlatformServiceImpl implements EmailReadPlatformService {
     }
 
 	@Override
-	public Collection<EmailData> retrieveAllSent(final Integer limit) {
-		final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
+	public Collection<EmailData> retrieveAllSent(final SearchParameters searchParameters) {
+		final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : "";
     	final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = "
     			+ EmailMessageStatusType.SENT.getValue() + sqlPlusLimit;
 
@@ -165,8 +166,8 @@ public class EmailReadPlatformServiceImpl implements EmailReadPlatformService {
     }
 
 	@Override
-	public Collection<EmailData> retrieveAllFailed(final Integer limit) {
-		final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
+	public Collection<EmailData> retrieveAllFailed(final SearchParameters searchParameters) {
+		final String sqlPlusLimit = (searchParameters.getLimit() > 0) ? " limit 0, " + searchParameters.getLimit() : "";
         final String sql = "select " + this.emailRowMapper.schema() + " where emo.status_enum = "
                 + EmailMessageStatusType.FAILED.getValue() + sqlPlusLimit;
 

http://git-wip-us.apache.org/repos/asf/fineract/blob/4dbecc7f/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java
index da0bc01..b7cd352 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadReportingServiceImpl.java
@@ -19,6 +19,7 @@
 package org.apache.fineract.infrastructure.dataqueries.service;
 
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.InputStream;
@@ -49,16 +50,6 @@ import org.apache.fineract.infrastructure.documentmanagement.contentrepository.F
 import org.apache.fineract.infrastructure.report.provider.ReportingProcessServiceProvider;
 import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
 import org.apache.fineract.useradministration.domain.AppUser;
-import org.pentaho.reporting.engine.classic.core.DefaultReportEnvironment;
-import org.pentaho.reporting.engine.classic.core.MasterReport;
-import org.pentaho.reporting.engine.classic.core.ReportProcessingException;
-import org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.PdfReportUtil;
-import org.pentaho.reporting.engine.classic.core.modules.output.table.csv.CSVReportUtil;
-import org.pentaho.reporting.engine.classic.core.modules.output.table.html.HtmlReportUtil;
-import org.pentaho.reporting.engine.classic.core.modules.output.table.xls.ExcelReportUtil;
-import org.pentaho.reporting.libraries.resourceloader.Resource;
-import org.pentaho.reporting.libraries.resourceloader.ResourceException;
-import org.pentaho.reporting.libraries.resourceloader.ResourceManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -530,6 +521,8 @@ public class ReadReportingServiceImpl implements ReadReportingService {
     @Override
     public ByteArrayOutputStream generatePentahoReportAsOutputStream(final String reportName, final String outputTypeParam, final Map<String, String> queryParams,
             final Locale locale, final AppUser runReportAsUser, final StringBuilder errorLog) {
+        //This complete implementation should be moved to Pentaho Report Service
+        /*
         String outputType = "HTML";
         if (StringUtils.isNotBlank(outputTypeParam)) {
             outputType = outputTypeParam;
@@ -600,6 +593,9 @@ public class ReadReportingServiceImpl implements ReadReportingService {
         errorLog.append("ReadReportingServiceImpl.generatePentahoReportAsOutputStream method threw a PlatformDataIntegrityException "
                 + "exception: No matching Output Type: " + outputType + " ---------- ");
         throw new PlatformDataIntegrityException("error.msg.invalid.outputType", "No matching Output Type: " + outputType);
+        
+    */
+        return null ;
     }
 }
 

http://git-wip-us.apache.org/repos/asf/fineract/blob/4dbecc7f/fineract-provider/src/main/resources/META-INF/spring/appContext.xml
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/resources/META-INF/spring/appContext.xml b/fineract-provider/src/main/resources/META-INF/spring/appContext.xml
index e348d8a..3be04cf 100644
--- a/fineract-provider/src/main/resources/META-INF/spring/appContext.xml
+++ b/fineract-provider/src/main/resources/META-INF/spring/appContext.xml
@@ -51,13 +51,14 @@
 										  org.apache.fineract.portfolio.savingsaccount.*,
 										  org.apache.fineract.portfolio.*,
 										  org.apache.fineract.useradministration.*,
-										  org.apache.fineract.mix.*,
+										  org.apache.fineract.mix.*, 
 										  org.apache.fineract.notification.*,
 										  org.apache.fineract.template.*,
 										  org.apache.fineract.template.service.*,
 										  org.apache.fineract.useradministration.*,
 										  org.apache.fineract.batch,
-										  org.apache.fineract.adhocquery.*">
+										  org.apache.fineract.adhocquery.*,
+										  org.apache.fineract.infrastructure.campaigns.**">
 		<context:exclude-filter expression="org.springframework.stereotype.Controller"
 			type="annotation" />
 
@@ -84,6 +85,8 @@
 	<jpa:repositories base-package="org.apache.fineract.infrastructure.campaigns.sms.domain" />
 	<jpa:repositories base-package="org.apache.fineract.adhocquery.domain" />
 	<jpa:repositories base-package="org.apache.fineract.notification.domain"/>
+	<jpa:repositories base-package="org.apache.fineract.infrastructure.campaigns.email.domain"/>
+	
 	
 	<import resource="infrastructure.xml" />
 


Mime
View raw message