fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject [4/6] fineract git commit: Completed the sonar fixes in FINERATC-436
Date Fri, 16 Jun 2017 14:51:02 GMT
Completed the sonar fixes in FINERATC-436


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

Branch: refs/heads/develop
Commit: 50048151a82a966adf45b7f8297a3601e7f69f9f
Parents: 20db9d4
Author: ThisuraThejith <ttcphilips@gmail.com>
Authored: Thu Jun 8 13:27:45 2017 +0530
Committer: ThisuraThejith <ttcphilips@gmail.com>
Committed: Thu Jun 8 13:27:45 2017 +0530

----------------------------------------------------------------------
 .../api/ProvisioningEntriesApiResource.java     |  15 +-
 .../ProvisioningEntriesApiConstants.java        |   7 -
 ...ioningEntriesDefinitionJsonDeserializer.java |   6 +
 .../holiday/api/HolidayApiConstants.java        |  10 +-
 .../holiday/data/HolidayDataValidator.java      |  14 +-
 .../api/ProvisioningCriteriaApiResource.java    |  22 +-
 .../ProvisioningCriteriaConstants.java          |  75 ++-----
 ...oningCriteriaDefinitionJsonDeserializer.java |  21 +-
 .../teller/domain/CashierTxnType.java           |   8 +-
 .../api/WorkingDaysApiConstants.java            |   9 +-
 .../workingdays/data/WorkingDayValidator.java   |  11 +-
 .../api/AccountTransfersApiConstants.java       |  12 +-
 .../api/StandingInstructionApiConstants.java    |  18 +-
 .../data/AccountTransfersDataValidator.java     |  40 ++--
 .../data/StandingInstructionDataValidator.java  | 219 +++++++++++--------
 .../constants/ShareAccountApiConstants.java     |   7 -
 .../client/api/ClientApiConstants.java          |  56 +----
 .../data/ClientApiCollectionConstants.java      |  86 ++++++++
 .../client/data/ClientChargeDataValidator.java  |   6 +-
 .../client/data/ClientDataValidator.java        |  49 +++--
 .../CollectionSheetConstants.java               |  15 --
 ...CollectionSheetTransactionDataValidator.java | 140 +++++++-----
 ...tGenerateCommandFromApiJsonDeserializer.java |   8 +-
 .../group/api/GroupingTypesApiConstants.java    |  30 +--
 .../serialization/GroupRolesDataValidator.java  |   9 +-
 .../GroupingTypesDataValidator.java             |  42 +++-
 .../InterestIncentiveApiConstants.java          |   8 -
 .../InterestRateChartApiConstants.java          |  16 +-
 .../InterestRateChartSlabApiConstants.java      |  14 --
 .../api/InterestRateChartSlabsApiResource.java  |  21 +-
 .../api/InterestRateChartsApiResource.java      |  23 +-
 .../data/InterestIncentiveDataValidator.java    |  14 +-
 .../data/InterestRateChartDataValidator.java    |  15 +-
 .../InterestRateChartSlabDataValidator.java     |  17 +-
 .../guarantor/api/GuarantorsApiResource.java    |  10 +-
 .../RescheduleLoansApiConstants.java            |  11 -
 .../LoanRescheduleRequestDataValidator.java     |  30 ++-
 .../LoanProductConfigurableAttributes.java      |   9 +-
 .../serialization/LoanProductDataValidator.java |  15 +-
 .../portfolio/meeting/MeetingApiConstants.java  |   6 -
 .../meeting/api/MeetingsApiResource.java        |   9 +-
 .../meeting/data/MeetingDataValidator.java      |  11 +-
 .../paymentdetail/PaymentDetailConstants.java   |   4 -
 .../api/PaymentTypeApiResourceConstants.java    |   9 +-
 .../data/PaymentTypeDataValidator.java          |  17 +-
 .../portfolio/savings/DepositsApiConstants.java |  55 ++---
 .../portfolio/savings/SavingsApiConstants.java  | 145 ++----------
 ...ccountOnHoldFundTransactionsApiResource.java |   4 +-
 ...edDepositAccountTransactionsApiResource.java |   2 +-
 ...ngDepositAccountTransactionsApiResource.java |   2 +-
 .../api/SavingsAccountChargesApiResource.java   |   9 +-
 .../SavingsAccountTransactionsApiResource.java  |   4 +-
 .../savings/api/SavingsAccountsApiResource.java |   8 +-
 .../savings/api/SavingsApiSetConstants.java     |  84 +++++++
 .../savings/api/SavingsProductsApiResource.java |  10 +-
 .../DepositAccountTransactionDataValidator.java |  39 +++-
 .../data/SavingsAccountChargeDataValidator.java |   9 +-
 .../savings/data/SavingsAccountConstant.java    |  76 +++++++
 .../data/SavingsAccountDataValidator.java       |   7 +-
 .../SavingsAccountTransactionDataValidator.java |   6 +-
 .../data/SavingsProductDataValidator.java       |  33 ++-
 .../search/data/AdHocQueryDataValidator.java    |  41 +++-
 .../search/data/AdHocQuerySearchConstants.java  |  23 +-
 .../api/SelfBeneficiariesTPTApiConstants.java   |  14 --
 .../api/SelfBeneficiariesTPTApiResource.java    |  15 +-
 .../data/SelfBeneficiariesTPTDataValidator.java |  13 +-
 .../ShareAccountDataSerializer.java             |  37 +++-
 .../constants/ShareProductApiConstants.java     |  15 --
 .../ShareProductDataSerializer.java             |  40 +++-
 .../transfer/api/TransferApiConstants.java      |  17 --
 .../transfer/data/TransfersDataValidator.java   |  44 +++-
 .../api/PasswordPreferencesApiConstants.java    |   5 +-
 .../data/PasswordPreferencesDataValidator.java  |   9 +-
 73 files changed, 1166 insertions(+), 794 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java
index 1a7b4a5..d5369c2 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/api/ProvisioningEntriesApiResource.java
@@ -48,6 +48,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
 @Path("/provisioningentries")
 @Component
 @Scope("singleton")
@@ -59,7 +63,10 @@ public class ProvisioningEntriesApiResource {
     private final DefaultToApiJsonSerializer<Object> entriesApiJsonSerializer;
     private final ProvisioningEntriesReadPlatformService provisioningEntriesReadPlatformService;
     private final ApiRequestParameterHelper apiRequestParameterHelper;
-
+	private static final Set<String> PROVISIONING_ENTRY_PARAMETERS = new HashSet<>(Arrays.asList(
+			ProvisioningEntriesApiConstants.PROVISIONINGENTRY_PARAM, ProvisioningEntriesApiConstants.ENTRIES_PARAM));
+    private static final Set<String> ALL_PROVISIONING_ENTRIES = new HashSet<>(Arrays.asList
+            (ProvisioningEntriesApiConstants.PROVISIONINGENTRY_PARAM));
     @Autowired
     public ProvisioningEntriesApiResource(final PlatformSecurityContext platformSecurityContext,
             final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
@@ -115,7 +122,7 @@ public class ProvisioningEntriesApiResource {
         platformSecurityContext.authenticatedUser();
         ProvisioningEntryData data = this.provisioningEntriesReadPlatformService.retrieveProvisioningEntryData(entryId);
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
-        return this.toApiJsonSerializer.serialize(settings, data, ProvisioningEntriesApiConstants.PROVISIONING_ENTRY_PARAMETERS);
+        return this.toApiJsonSerializer.serialize(settings, data, PROVISIONING_ENTRY_PARAMETERS);
     }
 
     @GET
@@ -129,7 +136,7 @@ public class ProvisioningEntriesApiResource {
         SearchParameters params = SearchParameters.forProvisioningEntries(entryId, officeId, productId, categoryId, offset, limit);
         Page<LoanProductProvisioningEntryData> entries = this.provisioningEntriesReadPlatformService.retrieveProvisioningEntries(params);
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
-        return this.entriesApiJsonSerializer.serialize(settings, entries, ProvisioningEntriesApiConstants.PROVISIONING_ENTRY_PARAMETERS);
+        return this.entriesApiJsonSerializer.serialize(settings, entries, PROVISIONING_ENTRY_PARAMETERS);
     }
 
     @GET
@@ -140,6 +147,6 @@ public class ProvisioningEntriesApiResource {
         platformSecurityContext.authenticatedUser();
         Page<ProvisioningEntryData> data = this.provisioningEntriesReadPlatformService.retrieveAllProvisioningEntries(offset, limit);
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
-        return this.entriesApiJsonSerializer.serialize(settings, data, ProvisioningEntriesApiConstants.ALL_PROVISIONING_ENTRIES);
+        return this.entriesApiJsonSerializer.serialize(settings, data, ALL_PROVISIONING_ENTRIES);
     }
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/constant/ProvisioningEntriesApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/constant/ProvisioningEntriesApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/constant/ProvisioningEntriesApiConstants.java
index 69cfec4..5149c84 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/constant/ProvisioningEntriesApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/constant/ProvisioningEntriesApiConstants.java
@@ -35,12 +35,5 @@ public interface ProvisioningEntriesApiConstants {
     public final static String PROVISIONINGENTRY_PARAM = "provisioningentry";
 
     public final static String ENTRIES_PARAM = "entries";
-    
-	Set<String> supportedParameters = new HashSet<>(
-			Arrays.asList(JSON_DATE_PARAM, JSON_DATEFORMAT_PARAM, JSON_LOCALE_PARAM, JSON_CREATEJOURNALENTRIES_PARAM));
-    
-    Set<String> PROVISIONING_ENTRY_PARAMETERS = new HashSet<>(Arrays.asList(PROVISIONINGENTRY_PARAM, ENTRIES_PARAM));
-
-    Set<String> ALL_PROVISIONING_ENTRIES = new HashSet<>(Arrays.asList(PROVISIONINGENTRY_PARAM));
 
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/serialization/ProvisioningEntriesDefinitionJsonDeserializer.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/serialization/ProvisioningEntriesDefinitionJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/serialization/ProvisioningEntriesDefinitionJsonDeserializer.java
index 4e61c78..43067fb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/serialization/ProvisioningEntriesDefinitionJsonDeserializer.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/serialization/ProvisioningEntriesDefinitionJsonDeserializer.java
@@ -20,9 +20,12 @@ package org.apache.fineract.accounting.provisioning.serialization;
 
 import java.lang.reflect.Type;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.fineract.accounting.provisioning.constant.ProvisioningEntriesApiConstants;
@@ -43,6 +46,9 @@ import com.google.gson.reflect.TypeToken;
 public class ProvisioningEntriesDefinitionJsonDeserializer implements ProvisioningEntriesApiConstants {
 
     private final FromJsonHelper fromApiJsonHelper;
+	private static final Set<String> supportedParameters = new HashSet<>(
+			Arrays.asList(JSON_DATE_PARAM, JSON_DATEFORMAT_PARAM, JSON_LOCALE_PARAM, JSON_CREATEJOURNALENTRIES_PARAM));
+
 
     @Autowired
     public ProvisioningEntriesDefinitionJsonDeserializer(final FromJsonHelper fromApiJsonHelper) {

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidayApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidayApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidayApiConstants.java
index 5bf2ba7..27fa538 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidayApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/api/HolidayApiConstants.java
@@ -42,11 +42,7 @@ public class HolidayApiConstants {
     public static final String processed = "processed";
     public static final String status = "status";
 
-    public static final Set<String> HOLIDAY_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
-            dateFormatParamName, nameParamName, fromDateParamName, toDateParamName, descriptionParamName, officesParamName,
-            repaymentsRescheduledToParamName));
-
-    public static final Set<String> HOLIDAY_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName, nameParamName,
-            fromDateParamName, descriptionParamName, toDateParamName, repaymentsRescheduledToParamName, localeParamName,
-            dateFormatParamName, status));
+	protected static final Set<String> HOLIDAY_RESPONSE_DATA_PARAMETERS = new HashSet<>(
+			Arrays.asList(idParamName, nameParamName, fromDateParamName, descriptionParamName, toDateParamName,
+					repaymentsRescheduledToParamName, localeParamName, dateFormatParamName, status));
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/data/HolidayDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/data/HolidayDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/data/HolidayDataValidator.java
index 264af0e..e99eafb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/data/HolidayDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/data/HolidayDataValidator.java
@@ -20,6 +20,7 @@ package org.apache.fineract.organisation.holiday.data;
 
 import java.lang.reflect.Type;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -45,6 +46,11 @@ import com.google.gson.reflect.TypeToken;
 public class HolidayDataValidator {
 
     private final FromJsonHelper fromApiJsonHelper;
+	private static final Set<String> HOLIDAY_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(
+			Arrays.asList(HolidayApiConstants.localeParamName, HolidayApiConstants.dateFormatParamName,
+					HolidayApiConstants.nameParamName, HolidayApiConstants.fromDateParamName,
+					HolidayApiConstants.toDateParamName, HolidayApiConstants.descriptionParamName,
+					HolidayApiConstants.officesParamName, HolidayApiConstants.repaymentsRescheduledToParamName));
 
     @Autowired
     public HolidayDataValidator(final FromJsonHelper fromApiJsonHelper) {
@@ -56,8 +62,8 @@ public class HolidayDataValidator {
         if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
 
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
-        this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
-                HolidayApiConstants.HOLIDAY_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS);
+		this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
+				HOLIDAY_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS);
         final JsonElement element = this.fromApiJsonHelper.parse(json);
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
@@ -104,8 +110,8 @@ public class HolidayDataValidator {
         if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
 
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
-        this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
-                HolidayApiConstants.HOLIDAY_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS);
+		this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
+				HOLIDAY_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS);
         final JsonElement element = this.fromApiJsonHelper.parse(json);
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java
index d627d99..46efdb0 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/api/ProvisioningCriteriaApiResource.java
@@ -18,7 +18,10 @@
  */
 package org.apache.fineract.organisation.provisioning.api;
 
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
@@ -57,6 +60,19 @@ public class ProvisioningCriteriaApiResource {
     private final ProvisioningCriteriaReadPlatformService provisioningCriteriaReadPlatformService;
     private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
     private final DefaultToApiJsonSerializer<ProvisioningCriteriaData> toApiJsonSerializer;
+
+	private static final Set<String> PROVISIONING_CRITERIA_TEMPLATE_PARAMETER = new HashSet<>(
+			Arrays.asList(ProvisioningCriteriaConstants.DEFINITIONS_PARAM,
+					ProvisioningCriteriaConstants.LOANPRODUCTS_PARAM, ProvisioningCriteriaConstants.GLACCOUNTS_PARAM));
+
+	private static final Set<String> PROVISIONING_CRITERIA_PARAMETERS = new HashSet<>(
+			Arrays.asList(ProvisioningCriteriaConstants.CRITERIA_PARAM,
+					ProvisioningCriteriaConstants.LOANPRODUCTS_PARAM, ProvisioningCriteriaConstants.DEFINITIONS_PARAM));
+
+	private static final Set<String> ALL_PROVISIONING_CRITERIA_PARAMETERS = new HashSet<>(
+			Arrays.asList(ProvisioningCriteriaConstants.CRITERIA_ID_PARAM,
+					ProvisioningCriteriaConstants.CRITERIA_NAME_PARAM, ProvisioningCriteriaConstants.CREATED_BY_PARAM));
+
     @Autowired
     public ProvisioningCriteriaApiResource(final PlatformSecurityContext platformSecurityContext,
             final ApiRequestParameterHelper apiRequestParameterHelper,
@@ -78,7 +94,7 @@ public class ProvisioningCriteriaApiResource {
         this.platformSecurityContext.authenticatedUser();
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
         ProvisioningCriteriaData data = this.provisioningCriteriaReadPlatformService.retrievePrivisiongCriteriaTemplate();
-        return this.toApiJsonSerializer.serialize(settings, data, ProvisioningCriteriaConstants.PROVISIONING_CRITERIA_TEMPLATE_PARAMETER);
+        return this.toApiJsonSerializer.serialize(settings, data, PROVISIONING_CRITERIA_TEMPLATE_PARAMETER);
     }
     
     @GET
@@ -92,7 +108,7 @@ public class ProvisioningCriteriaApiResource {
         if(settings.isTemplate()) {
             criteria = this.provisioningCriteriaReadPlatformService.retrievePrivisiongCriteriaTemplate(criteria);   
         }
-        return this.toApiJsonSerializer.serialize(settings, criteria, ProvisioningCriteriaConstants.PROVISIONING_CRITERIA_PARAMETERS); 
+        return this.toApiJsonSerializer.serialize(settings, criteria, PROVISIONING_CRITERIA_PARAMETERS);
     }
         
     @GET
@@ -102,7 +118,7 @@ public class ProvisioningCriteriaApiResource {
         platformSecurityContext.authenticatedUser() ;
         Collection<ProvisioningCriteriaData> data = this.provisioningCriteriaReadPlatformService.retrieveAllProvisioningCriterias() ;
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
-        return this.toApiJsonSerializer.serialize(settings, data, ProvisioningCriteriaConstants.ALL_PROVISIONING_CRITERIA_PARAMETERS); 
+        return this.toApiJsonSerializer.serialize(settings, data, ALL_PROVISIONING_CRITERIA_PARAMETERS);
     }
     
     @POST

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/constants/ProvisioningCriteriaConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/constants/ProvisioningCriteriaConstants.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/constants/ProvisioningCriteriaConstants.java
index 87b6d7d..b0c7898 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/constants/ProvisioningCriteriaConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/constants/ProvisioningCriteriaConstants.java
@@ -23,57 +23,26 @@ import java.util.HashSet;
 import java.util.Set;
 
 public interface ProvisioningCriteriaConstants {
-
-    public final static String JSON_LOCALE_PARAM = "locale" ;
-    
-    public final static String JSON_CRITERIAID_PARAM = "criteriaId" ;
-    
-    public final static String JSON_CRITERIANAME_PARAM = "criteriaName";
-    
-    public final static String JSON_LOANPRODUCTS_PARAM = "loanProducts";
-
-    public final static String JSON_LOAN_PRODUCT_ID_PARAM = "id" ;
-    
-    public final static String JSON_LOAN_PRODUCTNAME_PARAM = "name" ;
-    
-    public final static String JSON_LOAN_PRODUCT_BORROWERCYCLE_PARAM = "includeInBorrowerCycle" ;
-    
-    public final static String JSON_PROVISIONING_DEFINITIONS_PARAM = "definitions";
-    
-    public final static String JSON_CATEOGRYID_PARAM = "categoryId";
-
-    public final static String JSON_CATEOGRYNAME_PARAM = "categoryName";
-    
-    public final static String JSON_MINIMUM_AGE_PARAM = "minAge";
-
-    public final static String JSON_MAXIMUM_AGE_PARAM = "maxAge";
-
-    public final static String JSON_PROVISIONING_PERCENTAGE_PARAM = "provisioningPercentage";
-    
-    public final static String JSON_LIABILITY_ACCOUNT_PARAM = "liabilityAccount";
-
-    public final static String JSON_EXPENSE_ACCOUNT_PARAM = "expenseAccount";
-    
-    Set<String> supportedParametersForCreate = new HashSet<>(Arrays.asList(JSON_LOCALE_PARAM, JSON_CRITERIANAME_PARAM,
-            JSON_LOANPRODUCTS_PARAM, JSON_PROVISIONING_DEFINITIONS_PARAM));
-
-    Set<String> supportedParametersForUpdate = new HashSet<>(Arrays.asList(JSON_CRITERIAID_PARAM, JSON_LOCALE_PARAM, JSON_CRITERIANAME_PARAM,
-            JSON_LOANPRODUCTS_PARAM, JSON_PROVISIONING_DEFINITIONS_PARAM));
-
-    Set<String> loanProductSupportedParams = new HashSet<>(Arrays.asList(JSON_LOAN_PRODUCT_ID_PARAM,
-            JSON_LOAN_PRODUCTNAME_PARAM, JSON_LOAN_PRODUCT_BORROWERCYCLE_PARAM)) ;
-    
-    Set<String> provisioningcriteriaSupportedParams = new HashSet<>(Arrays.asList(JSON_CATEOGRYID_PARAM,
-            JSON_CATEOGRYNAME_PARAM, JSON_MINIMUM_AGE_PARAM, JSON_MAXIMUM_AGE_PARAM, JSON_MINIMUM_AGE_PARAM, JSON_PROVISIONING_PERCENTAGE_PARAM, JSON_EXPENSE_ACCOUNT_PARAM, JSON_LIABILITY_ACCOUNT_PARAM)) ;
-    
-    
-    Set<String> PROVISIONING_CRITERIA_TEMPLATE_PARAMETER = new HashSet<>(Arrays.asList("definitions", "loanProducts",
-            "glAccounts"));
-
-    Set<String> PROVISIONING_CRITERIA_PARAMETERS = new HashSet<>(Arrays.asList("criteriaName", "loanProducts",
-            "definitions"));
-    
-    Set<String> ALL_PROVISIONING_CRITERIA_PARAMETERS = new HashSet<>(Arrays.asList("criteriaId", "criterianame",
-            "createdby"));
-    
+	public final static String JSON_LOCALE_PARAM = "locale";
+	public final static String JSON_CRITERIAID_PARAM = "criteriaId";
+	public final static String JSON_CRITERIANAME_PARAM = "criteriaName";
+	public final static String JSON_LOANPRODUCTS_PARAM = "loanProducts";
+	public final static String JSON_LOAN_PRODUCT_ID_PARAM = "id";
+	public final static String JSON_LOAN_PRODUCTNAME_PARAM = "name";
+	public final static String JSON_LOAN_PRODUCT_BORROWERCYCLE_PARAM = "includeInBorrowerCycle";
+	public final static String JSON_PROVISIONING_DEFINITIONS_PARAM = "definitions";
+	public final static String JSON_CATEOGRYID_PARAM = "categoryId";
+	public final static String JSON_CATEOGRYNAME_PARAM = "categoryName";
+	public final static String JSON_MINIMUM_AGE_PARAM = "minAge";
+	public final static String JSON_MAXIMUM_AGE_PARAM = "maxAge";
+	public final static String JSON_PROVISIONING_PERCENTAGE_PARAM = "provisioningPercentage";
+	public final static String JSON_LIABILITY_ACCOUNT_PARAM = "liabilityAccount";
+	public final static String JSON_EXPENSE_ACCOUNT_PARAM = "expenseAccount";
+	public final static String DEFINITIONS_PARAM = "definitions";
+	public final static String LOANPRODUCTS_PARAM = "loanProducts";
+	public final static String GLACCOUNTS_PARAM = "glAccounts";
+	public final static String CRITERIA_PARAM = "criteriaName";
+	public final static String CRITERIA_ID_PARAM = "criteriaId";
+	public final static String CRITERIA_NAME_PARAM = "criterianame";
+	public final static String CREATED_BY_PARAM = "createdby";
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/serialization/ProvisioningCriteriaDefinitionJsonDeserializer.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/serialization/ProvisioningCriteriaDefinitionJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/serialization/ProvisioningCriteriaDefinitionJsonDeserializer.java
index 4e7b051..6c0ca78 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/serialization/ProvisioningCriteriaDefinitionJsonDeserializer.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/serialization/ProvisioningCriteriaDefinitionJsonDeserializer.java
@@ -21,9 +21,12 @@ package org.apache.fineract.organisation.provisioning.serialization;
 import java.lang.reflect.Type;
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.fineract.infrastructure.core.data.ApiParameterError;
@@ -41,9 +44,23 @@ import com.google.gson.JsonObject;
 import com.google.gson.reflect.TypeToken;
 
 @Component
-public class ProvisioningCriteriaDefinitionJsonDeserializer implements ProvisioningCriteriaConstants{
+public class ProvisioningCriteriaDefinitionJsonDeserializer implements ProvisioningCriteriaConstants {
 
-    private final FromJsonHelper fromApiJsonHelper;
+	private final FromJsonHelper fromApiJsonHelper;
+
+	private final static Set<String> supportedParametersForCreate = new HashSet<>(Arrays.asList(JSON_LOCALE_PARAM,
+			JSON_CRITERIANAME_PARAM, JSON_LOANPRODUCTS_PARAM, JSON_PROVISIONING_DEFINITIONS_PARAM));
+
+	private final static Set<String> supportedParametersForUpdate = new HashSet<>(Arrays.asList(JSON_CRITERIAID_PARAM,
+			JSON_LOCALE_PARAM, JSON_CRITERIANAME_PARAM, JSON_LOANPRODUCTS_PARAM, JSON_PROVISIONING_DEFINITIONS_PARAM));
+
+	private final static Set<String> loanProductSupportedParams = new HashSet<>(Arrays
+			.asList(JSON_LOAN_PRODUCT_ID_PARAM, JSON_LOAN_PRODUCTNAME_PARAM, JSON_LOAN_PRODUCT_BORROWERCYCLE_PARAM));
+
+	private final static Set<String> provisioningcriteriaSupportedParams = new HashSet<>(
+			Arrays.asList(JSON_CATEOGRYID_PARAM, JSON_CATEOGRYNAME_PARAM, JSON_MINIMUM_AGE_PARAM,
+					JSON_MAXIMUM_AGE_PARAM, JSON_MINIMUM_AGE_PARAM, JSON_PROVISIONING_PERCENTAGE_PARAM,
+					JSON_EXPENSE_ACCOUNT_PARAM, JSON_LIABILITY_ACCOUNT_PARAM));
 
     @Autowired
     public ProvisioningCriteriaDefinitionJsonDeserializer(final FromJsonHelper fromApiJsonHelper) {

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTxnType.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTxnType.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTxnType.java
index 8b1ddb7..1141deb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTxnType.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/domain/CashierTxnType.java
@@ -25,10 +25,10 @@ public class CashierTxnType {
 	private Integer id;
 	private String value;
 	
-	public static CashierTxnType ALLOCATE 			= new CashierTxnType (101, "Allocate Cash");
-	public static CashierTxnType SETTLE 			= new CashierTxnType (102, "Settle Cash");
-	public static CashierTxnType INWARD_CASH_TXN 	= new CashierTxnType (103, "Cash In");
-	public static CashierTxnType OUTWARD_CASH_TXN 	= new CashierTxnType (104, "Cash Out");
+	public static final CashierTxnType ALLOCATE 			= new CashierTxnType (101, "Allocate Cash");
+	public static final CashierTxnType SETTLE 			= new CashierTxnType (102, "Settle Cash");
+	public static final CashierTxnType INWARD_CASH_TXN 	= new CashierTxnType (103, "Cash In");
+	public static final CashierTxnType OUTWARD_CASH_TXN 	= new CashierTxnType (104, "Cash Out");
 	
 	private CashierTxnType () {
 	}

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiConstants.java
index fda39bb..5cfef90 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/api/WorkingDaysApiConstants.java
@@ -38,13 +38,10 @@ public class WorkingDaysApiConstants {
     public static final String extendTermForDailyRepayments = "extendTermForDailyRepayments";
     public static final String extendTermForRepaymentsOnHolidays = "extendTermForRepaymentsOnHolidays";
 
-
-    public static final Set<String> WORKING_DAYS_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS =new HashSet<>(Arrays.asList(
-            recurrence,repayment_rescheduling_enum,localeParamName,extendTermForDailyRepayments,extendTermForRepaymentsOnHolidays
-    ));
-    public static final Set<String> WORKING_DAYS_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName,
+    protected static final Set<String> WORKING_DAYS_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName,
             recurrence,repayment_rescheduling_enum,extendTermForDailyRepayments,extendTermForRepaymentsOnHolidays
     ));
 
-    public static final Set<String> WORKING_DAYS_TEMPLATE_PARAMETERS = new HashSet<>(Arrays.asList(rescheduleRepaymentTemplate));
+    protected static final Set<String> WORKING_DAYS_TEMPLATE_PARAMETERS = new HashSet<>(Arrays.asList
+            (rescheduleRepaymentTemplate));
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/WorkingDayValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/WorkingDayValidator.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/WorkingDayValidator.java
index 466ca0f..77bd3f7 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/WorkingDayValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/workingdays/data/WorkingDayValidator.java
@@ -20,8 +20,11 @@ package org.apache.fineract.organisation.workingdays.data;
 
 import java.lang.reflect.Type;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.fineract.infrastructure.core.data.ApiParameterError;
@@ -40,6 +43,10 @@ import com.google.gson.reflect.TypeToken;
 public class WorkingDayValidator {
 
     private final FromJsonHelper fromApiJsonHelper;
+	private static final Set<String> WORKING_DAYS_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(
+			Arrays.asList(WorkingDaysApiConstants.recurrence, WorkingDaysApiConstants.repayment_rescheduling_enum,
+					WorkingDaysApiConstants.localeParamName, WorkingDaysApiConstants.extendTermForDailyRepayments,
+					WorkingDaysApiConstants.extendTermForRepaymentsOnHolidays));
 
     @Autowired
     public WorkingDayValidator(FromJsonHelper fromApiJsonHelper) {
@@ -50,8 +57,8 @@ public class WorkingDayValidator {
         if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
 
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
-        this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
-                WorkingDaysApiConstants.WORKING_DAYS_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS);
+		this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
+				WORKING_DAYS_CREATE_OR_UPDATE_REQUEST_DATA_PARAMETERS);
         final JsonElement element = this.fromApiJsonHelper.parse(json);
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java
index 08cc368..84eeba6 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiConstants.java
@@ -33,19 +33,13 @@ public class AccountTransfersApiConstants {
     public static final String transferDateParamName = "transferDate";
     public static final String transferAmountParamName = "transferAmount";
     public static final String transferDescriptionParamName = "transferDescription";
-
-    public static final Set<String> REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(AccountDetailConstants.localeParamName,
-            AccountDetailConstants.dateFormatParamName, AccountDetailConstants.fromOfficeIdParamName,
-            AccountDetailConstants.fromClientIdParamName, AccountDetailConstants.fromAccountTypeParamName,
-            AccountDetailConstants.fromAccountIdParamName, AccountDetailConstants.toOfficeIdParamName,
-            AccountDetailConstants.toClientIdParamName, AccountDetailConstants.toAccountTypeParamName,
-            AccountDetailConstants.toAccountIdParamName, transferDateParamName, transferAmountParamName, transferDescriptionParamName));
+    public static final String currencyParamName = "currency";
 
     /**
      * These parameters will match the class level parameters of
      * {@link AccountTransferData}. Where possible, we try to get response
      * parameters to match those of request parameters.
      */
-    public static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(AccountDetailConstants.idParamName,
-            transferDescriptionParamName, "currency"));
+	protected static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
+			Arrays.asList(AccountDetailConstants.idParamName, transferDescriptionParamName, currencyParamName));
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiConstants.java
index fae6cbd..f29b7f9 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/StandingInstructionApiConstants.java
@@ -41,22 +41,8 @@ public class StandingInstructionApiConstants {
     public static final String recurrenceOnMonthDayParamName = "recurrenceOnMonthDay";
     public static final String monthDayFormatParamName = "monthDayFormat";
 
-    public static final Set<String> CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
-            AccountDetailConstants.localeParamName, AccountDetailConstants.dateFormatParamName,
-            AccountDetailConstants.fromOfficeIdParamName, AccountDetailConstants.fromClientIdParamName,
-            AccountDetailConstants.fromAccountTypeParamName, AccountDetailConstants.fromAccountIdParamName,
-            AccountDetailConstants.toOfficeIdParamName, AccountDetailConstants.toClientIdParamName,
-            AccountDetailConstants.toAccountTypeParamName, AccountDetailConstants.toAccountIdParamName,
-            AccountDetailConstants.transferTypeParamName, priorityParamName, instructionTypeParamName, statusParamName, amountParamName,
-            validFromParamName, validTillParamName, recurrenceTypeParamName, recurrenceFrequencyParamName, recurrenceIntervalParamName,
-            recurrenceOnMonthDayParamName, nameParamName, monthDayFormatParamName));
-
-    public static final Set<String> UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
-            AccountDetailConstants.localeParamName, AccountDetailConstants.dateFormatParamName, priorityParamName,
-            instructionTypeParamName, statusParamName, amountParamName, validFromParamName, validTillParamName, recurrenceTypeParamName,
-            recurrenceFrequencyParamName, recurrenceIntervalParamName, recurrenceOnMonthDayParamName, monthDayFormatParamName));
-
-    public static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(AccountDetailConstants.idParamName,
+    protected static final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(AccountDetailConstants
+                    .idParamName,
             nameParamName, priorityParamName, instructionTypeParamName, statusParamName, AccountDetailConstants.transferTypeParamName,
             validFromParamName, validTillParamName));
 

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/AccountTransfersDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/AccountTransfersDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/AccountTransfersDataValidator.java
index 0b79597..f7002d1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/AccountTransfersDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/AccountTransfersDataValidator.java
@@ -18,17 +18,14 @@
  */
 package org.apache.fineract.portfolio.account.data;
 
-import static org.apache.fineract.portfolio.account.api.AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME;
-import static org.apache.fineract.portfolio.account.api.AccountTransfersApiConstants.REQUEST_DATA_PARAMETERS;
-import static org.apache.fineract.portfolio.account.api.AccountTransfersApiConstants.transferAmountParamName;
-import static org.apache.fineract.portfolio.account.api.AccountTransfersApiConstants.transferDateParamName;
-import static org.apache.fineract.portfolio.account.api.AccountTransfersApiConstants.transferDescriptionParamName;
-
 import java.lang.reflect.Type;
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.fineract.infrastructure.core.api.JsonCommand;
@@ -37,6 +34,8 @@ import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
 import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
 import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
 import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
+import org.apache.fineract.portfolio.account.AccountDetailConstants;
+import org.apache.fineract.portfolio.account.api.AccountTransfersApiConstants;
 import org.joda.time.LocalDate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -49,6 +48,15 @@ public class AccountTransfersDataValidator {
 
     private final FromJsonHelper fromApiJsonHelper;
     private final AccountTransfersDetailDataValidator accountTransfersDetailDataValidator;
+	private static final Set<String> REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
+			AccountDetailConstants.localeParamName, AccountDetailConstants.dateFormatParamName,
+			AccountDetailConstants.fromOfficeIdParamName, AccountDetailConstants.fromClientIdParamName,
+			AccountDetailConstants.fromAccountTypeParamName, AccountDetailConstants.fromAccountIdParamName,
+			AccountDetailConstants.toOfficeIdParamName, AccountDetailConstants.toClientIdParamName,
+			AccountDetailConstants.toAccountTypeParamName, AccountDetailConstants.toAccountIdParamName,
+			AccountTransfersApiConstants.transferDateParamName, AccountTransfersApiConstants.transferAmountParamName,
+			AccountTransfersApiConstants.transferDescriptionParamName));
+
 
     @Autowired
     public AccountTransfersDataValidator(final FromJsonHelper fromApiJsonHelper,
@@ -68,20 +76,26 @@ public class AccountTransfersDataValidator {
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
         final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
-                .resource(ACCOUNT_TRANSFER_RESOURCE_NAME);
+                .resource(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
 
         final JsonElement element = command.parsedJson();
 
         this.accountTransfersDetailDataValidator.validate(command, baseDataValidator);
 
-        final LocalDate transactionDate = this.fromApiJsonHelper.extractLocalDateNamed(transferDateParamName, element);
-        baseDataValidator.reset().parameter(transferDateParamName).value(transactionDate).notNull();
+		final LocalDate transactionDate = this.fromApiJsonHelper
+				.extractLocalDateNamed(AccountTransfersApiConstants.transferDateParamName, element);
+        baseDataValidator.reset().parameter(AccountTransfersApiConstants.transferDateParamName).value
+                (transactionDate).notNull();
 
-        final BigDecimal transactionAmount = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(transferAmountParamName, element);
-        baseDataValidator.reset().parameter(transferAmountParamName).value(transactionAmount).notNull().positiveAmount();
+        final BigDecimal transactionAmount = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed
+                (AccountTransfersApiConstants.transferAmountParamName, element);
+        baseDataValidator.reset().parameter(AccountTransfersApiConstants.transferAmountParamName).value
+                (transactionAmount).notNull().positiveAmount();
 
-        final String transactionDescription = this.fromApiJsonHelper.extractStringNamed(transferDescriptionParamName, element);
-        baseDataValidator.reset().parameter(transferDescriptionParamName).value(transactionDescription).notBlank()
+        final String transactionDescription = this.fromApiJsonHelper.extractStringNamed(AccountTransfersApiConstants
+                .transferDescriptionParamName, element);
+        baseDataValidator.reset().parameter(AccountTransfersApiConstants.transferDescriptionParamName).value
+                (transactionDescription).notBlank()
                 .notExceedingLengthOf(200);
 
         throwExceptionIfValidationWarningsExist(dataValidationErrors);

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/StandingInstructionDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/StandingInstructionDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/StandingInstructionDataValidator.java
index 92e6042..ccdba4c 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/StandingInstructionDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/StandingInstructionDataValidator.java
@@ -21,27 +21,16 @@ package org.apache.fineract.portfolio.account.data;
 import static org.apache.fineract.portfolio.account.AccountDetailConstants.fromAccountTypeParamName;
 import static org.apache.fineract.portfolio.account.AccountDetailConstants.toAccountTypeParamName;
 import static org.apache.fineract.portfolio.account.AccountDetailConstants.transferTypeParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.CREATE_REQUEST_DATA_PARAMETERS;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.UPDATE_REQUEST_DATA_PARAMETERS;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.amountParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.instructionTypeParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.nameParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.priorityParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.recurrenceFrequencyParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.recurrenceIntervalParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.recurrenceOnMonthDayParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.recurrenceTypeParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.statusParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.validFromParamName;
-import static org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants.validTillParamName;
 
 import java.lang.reflect.Type;
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.fineract.infrastructure.core.api.JsonCommand;
@@ -50,7 +39,9 @@ import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
 import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
 import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
 import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
+import org.apache.fineract.portfolio.account.AccountDetailConstants;
 import org.apache.fineract.portfolio.account.PortfolioAccountType;
+import org.apache.fineract.portfolio.account.api.StandingInstructionApiConstants;
 import org.apache.fineract.portfolio.account.domain.AccountTransferRecurrenceType;
 import org.apache.fineract.portfolio.account.domain.AccountTransferType;
 import org.apache.fineract.portfolio.account.domain.StandingInstructionType;
@@ -64,10 +55,36 @@ import com.google.gson.JsonElement;
 import com.google.gson.reflect.TypeToken;
 
 @Component
-public class StandingInstructionDataValidator {
+    public class StandingInstructionDataValidator {
 
     private final FromJsonHelper fromApiJsonHelper;
     private final AccountTransfersDetailDataValidator accountTransfersDetailDataValidator;
+	private static final Set<String> CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
+			AccountDetailConstants.localeParamName, AccountDetailConstants.dateFormatParamName,
+			AccountDetailConstants.fromOfficeIdParamName, AccountDetailConstants.fromClientIdParamName,
+			AccountDetailConstants.fromAccountTypeParamName, AccountDetailConstants.fromAccountIdParamName,
+			AccountDetailConstants.toOfficeIdParamName, AccountDetailConstants.toClientIdParamName,
+			AccountDetailConstants.toAccountTypeParamName, AccountDetailConstants.toAccountIdParamName,
+			AccountDetailConstants.transferTypeParamName, StandingInstructionApiConstants.priorityParamName,
+			StandingInstructionApiConstants.instructionTypeParamName, StandingInstructionApiConstants.statusParamName,
+			StandingInstructionApiConstants.amountParamName, StandingInstructionApiConstants.validFromParamName,
+			StandingInstructionApiConstants.validTillParamName, StandingInstructionApiConstants.recurrenceTypeParamName,
+			StandingInstructionApiConstants.recurrenceFrequencyParamName,
+			StandingInstructionApiConstants.recurrenceIntervalParamName,
+			StandingInstructionApiConstants.recurrenceOnMonthDayParamName,
+			StandingInstructionApiConstants.nameParamName, StandingInstructionApiConstants.monthDayFormatParamName));
+
+	private static final Set<String> UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
+			AccountDetailConstants.localeParamName, AccountDetailConstants.dateFormatParamName,
+			StandingInstructionApiConstants.priorityParamName, StandingInstructionApiConstants.instructionTypeParamName,
+			StandingInstructionApiConstants.statusParamName, StandingInstructionApiConstants.amountParamName,
+			StandingInstructionApiConstants.validFromParamName, StandingInstructionApiConstants.validTillParamName,
+			StandingInstructionApiConstants.recurrenceTypeParamName,
+			StandingInstructionApiConstants.recurrenceFrequencyParamName,
+			StandingInstructionApiConstants.recurrenceIntervalParamName,
+			StandingInstructionApiConstants.recurrenceOnMonthDayParamName,
+			StandingInstructionApiConstants.monthDayFormatParamName));
+
 
     @Autowired
     public StandingInstructionDataValidator(final FromJsonHelper fromApiJsonHelper,
@@ -86,71 +103,82 @@ public class StandingInstructionDataValidator {
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
         final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
-                .resource(STANDING_INSTRUCTION_RESOURCE_NAME);
+                .resource(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
         this.accountTransfersDetailDataValidator.validate(command, baseDataValidator);
 
         final JsonElement element = command.parsedJson();
 
-        final Integer status = this.fromApiJsonHelper.extractIntegerNamed(statusParamName, element, Locale.getDefault());
-        baseDataValidator.reset().parameter(statusParamName).value(status).notNull().inMinMaxRange(1, 2);
+		final Integer status = this.fromApiJsonHelper
+				.extractIntegerNamed(StandingInstructionApiConstants.statusParamName, element, Locale.getDefault());
+        baseDataValidator.reset().parameter(StandingInstructionApiConstants.statusParamName).value(status).notNull()
+                .inMinMaxRange(1, 2);
 
-        final LocalDate validFrom = this.fromApiJsonHelper.extractLocalDateNamed(validFromParamName, element);
-        baseDataValidator.reset().parameter(validFromParamName).value(validFrom).notNull();
+		final LocalDate validFrom = this.fromApiJsonHelper
+				.extractLocalDateNamed(StandingInstructionApiConstants.validFromParamName, element);
+		baseDataValidator.reset().parameter(StandingInstructionApiConstants.validFromParamName).value(validFrom)
+				.notNull();
 
-        final LocalDate validTill = this.fromApiJsonHelper.extractLocalDateNamed(validTillParamName, element);
-        baseDataValidator.reset().parameter(validTillParamName).value(validTill).validateDateAfter(validFrom);
+		final LocalDate validTill = this.fromApiJsonHelper
+				.extractLocalDateNamed(StandingInstructionApiConstants.validTillParamName, element);
+        baseDataValidator.reset().parameter(StandingInstructionApiConstants.validTillParamName).value(validTill)
+                .validateDateAfter(validFrom);
 
-        final BigDecimal transferAmount = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(amountParamName, element);
-        baseDataValidator.reset().parameter(amountParamName).value(transferAmount).positiveAmount();
+        final BigDecimal transferAmount = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(StandingInstructionApiConstants.amountParamName, element);
+        baseDataValidator.reset().parameter(StandingInstructionApiConstants.amountParamName).value(transferAmount).positiveAmount();
 
         final Integer transferType = this.fromApiJsonHelper.extractIntegerNamed(transferTypeParamName, element, Locale.getDefault());
         baseDataValidator.reset().parameter(transferTypeParamName).value(transferType).notNull().inMinMaxRange(1, 3);
 
-        final Integer priority = this.fromApiJsonHelper.extractIntegerNamed(priorityParamName, element, Locale.getDefault());
-        baseDataValidator.reset().parameter(priorityParamName).value(priority).notNull().inMinMaxRange(1, 4);
+        final Integer priority = this.fromApiJsonHelper.extractIntegerNamed(StandingInstructionApiConstants.priorityParamName, element, Locale.getDefault());
+        baseDataValidator.reset().parameter(StandingInstructionApiConstants.priorityParamName).value(priority).notNull().inMinMaxRange(1, 4);
 
-        final Integer standingInstructionType = this.fromApiJsonHelper.extractIntegerNamed(instructionTypeParamName, element,
+        final Integer standingInstructionType = this.fromApiJsonHelper.extractIntegerNamed(StandingInstructionApiConstants.instructionTypeParamName, element,
                 Locale.getDefault());
-        baseDataValidator.reset().parameter(instructionTypeParamName).value(standingInstructionType).notNull().inMinMaxRange(1, 2);
+        baseDataValidator.reset().parameter(StandingInstructionApiConstants.instructionTypeParamName).value(standingInstructionType).notNull().inMinMaxRange(1, 2);
 
-        final Integer recurrenceType = this.fromApiJsonHelper.extractIntegerNamed(recurrenceTypeParamName, element, Locale.getDefault());
-        baseDataValidator.reset().parameter(recurrenceTypeParamName).value(recurrenceType).notNull().inMinMaxRange(1, 2);
+        final Integer recurrenceType = this.fromApiJsonHelper.extractIntegerNamed(StandingInstructionApiConstants.recurrenceTypeParamName, element, Locale.getDefault());
+        baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceTypeParamName).value(recurrenceType).notNull().inMinMaxRange(1, 2);
         boolean isPeriodic = false;
         if (recurrenceType != null) {
             isPeriodic = AccountTransferRecurrenceType.fromInt(recurrenceType).isPeriodicRecurrence();
         }
 
-        final Integer recurrenceFrequency = this.fromApiJsonHelper.extractIntegerNamed(recurrenceFrequencyParamName, element,
+		final Integer recurrenceFrequency = this.fromApiJsonHelper.extractIntegerNamed(
+				StandingInstructionApiConstants.recurrenceFrequencyParamName, element,
                 Locale.getDefault());
-        baseDataValidator.reset().parameter(recurrenceFrequencyParamName).value(recurrenceFrequency).inMinMaxRange(0, 3);
+		baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceFrequencyParamName)
+				.value(recurrenceFrequency).inMinMaxRange(0, 3);
 
         if (recurrenceFrequency != null) {
             PeriodFrequencyType frequencyType = PeriodFrequencyType.fromInt(recurrenceFrequency);
             if (frequencyType.isMonthly() || frequencyType.isYearly()) {
-                final MonthDay monthDay = this.fromApiJsonHelper.extractMonthDayNamed(recurrenceOnMonthDayParamName, element);
-                baseDataValidator.reset().parameter(recurrenceOnMonthDayParamName).value(monthDay).notNull();
+				final MonthDay monthDay = this.fromApiJsonHelper
+						.extractMonthDayNamed(StandingInstructionApiConstants.recurrenceOnMonthDayParamName, element);
+				baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceOnMonthDayParamName)
+						.value(monthDay).notNull();
             }
         }
 
-        final Integer recurrenceInterval = this.fromApiJsonHelper.extractIntegerNamed(recurrenceIntervalParamName, element,
+		final Integer recurrenceInterval = this.fromApiJsonHelper.extractIntegerNamed(
+				StandingInstructionApiConstants.recurrenceIntervalParamName, element,
                 Locale.getDefault());
         if (isPeriodic) {
-            baseDataValidator.reset().parameter(recurrenceIntervalParamName).value(recurrenceInterval).notNull();
-            baseDataValidator.reset().parameter(recurrenceFrequencyParamName).value(recurrenceFrequency).notNull();
+            baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceIntervalParamName).value(recurrenceInterval).notNull();
+            baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceFrequencyParamName).value(recurrenceFrequency).notNull();
         }
-        baseDataValidator.reset().parameter(recurrenceIntervalParamName).value(recurrenceInterval).integerGreaterThanZero();
+        baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceIntervalParamName).value(recurrenceInterval).integerGreaterThanZero();
 
-        final String name = this.fromApiJsonHelper.extractStringNamed(nameParamName, element);
-        baseDataValidator.reset().parameter(nameParamName).value(name).notNull();
+        final String name = this.fromApiJsonHelper.extractStringNamed(StandingInstructionApiConstants.nameParamName, element);
+        baseDataValidator.reset().parameter(StandingInstructionApiConstants.nameParamName).value(name).notNull();
 
         final Integer toAccountType = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(toAccountTypeParamName, element);
         if (toAccountType != null && PortfolioAccountType.fromInt(toAccountType).isSavingsAccount()) {
-            baseDataValidator.reset().parameter(instructionTypeParamName).value(standingInstructionType).notNull().inMinMaxRange(1, 1);
-            baseDataValidator.reset().parameter(recurrenceTypeParamName).value(recurrenceType).notNull().inMinMaxRange(1, 1);
+            baseDataValidator.reset().parameter(StandingInstructionApiConstants.instructionTypeParamName).value(standingInstructionType).notNull().inMinMaxRange(1, 1);
+            baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceTypeParamName).value(recurrenceType).notNull().inMinMaxRange(1, 1);
 
         }
         if (standingInstructionType != null && StandingInstructionType.fromInt(standingInstructionType).isFixedAmoutTransfer()) {
-            baseDataValidator.reset().parameter(amountParamName).value(transferAmount).notNull();
+            baseDataValidator.reset().parameter(StandingInstructionApiConstants.amountParamName).value(transferAmount).notNull();
         }
 
         String errorCode = null;
@@ -184,62 +212,79 @@ public class StandingInstructionDataValidator {
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
         final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
-                .resource(STANDING_INSTRUCTION_RESOURCE_NAME);
+                .resource(StandingInstructionApiConstants.STANDING_INSTRUCTION_RESOURCE_NAME);
 
         final JsonElement element = command.parsedJson();
-        if (this.fromApiJsonHelper.parameterExists(validFromParamName, element)) {
-            final LocalDate validFrom = this.fromApiJsonHelper.extractLocalDateNamed(validFromParamName, element);
-            baseDataValidator.reset().parameter(validFromParamName).value(validFrom).notNull();
-        }
-
-        if (this.fromApiJsonHelper.parameterExists(validTillParamName, element)) {
-            final LocalDate validTill = this.fromApiJsonHelper.extractLocalDateNamed(validTillParamName, element);
-            baseDataValidator.reset().parameter(validTillParamName).value(validTill).notNull();
-        }
-
-        if (this.fromApiJsonHelper.parameterExists(amountParamName, element)) {
-            final BigDecimal transferAmount = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(amountParamName, element);
-            baseDataValidator.reset().parameter(amountParamName).value(transferAmount).positiveAmount();
+        if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.validFromParamName, element)) {
+			final LocalDate validFrom = this.fromApiJsonHelper
+					.extractLocalDateNamed(StandingInstructionApiConstants.validFromParamName, element);
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.validFromParamName).value(validFrom)
+					.notNull();
         }
 
-        if (this.fromApiJsonHelper.parameterExists(statusParamName, element)) {
-            final Integer status = this.fromApiJsonHelper.extractIntegerNamed(statusParamName, element, Locale.getDefault());
-            baseDataValidator.reset().parameter(statusParamName).value(status).notNull().inMinMaxRange(1, 2);
+        if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.validTillParamName, element)) {
+			final LocalDate validTill = this.fromApiJsonHelper
+					.extractLocalDateNamed(StandingInstructionApiConstants.validTillParamName, element);
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.validTillParamName).value(validTill)
+					.notNull();
         }
 
-        if (this.fromApiJsonHelper.parameterExists(priorityParamName, element)) {
-            final Integer priority = this.fromApiJsonHelper.extractIntegerNamed(priorityParamName, element, Locale.getDefault());
-            baseDataValidator.reset().parameter(priorityParamName).value(priority).notNull().inMinMaxRange(1, 4);
+        if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.amountParamName, element)) {
+			final BigDecimal transferAmount = this.fromApiJsonHelper
+					.extractBigDecimalWithLocaleNamed(StandingInstructionApiConstants.amountParamName, element);
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.amountParamName).value(transferAmount)
+					.positiveAmount();
         }
 
-        if (this.fromApiJsonHelper.parameterExists(instructionTypeParamName, element)) {
-            final Integer standingInstructionType = this.fromApiJsonHelper.extractIntegerNamed(instructionTypeParamName, element,
-                    Locale.getDefault());
-            baseDataValidator.reset().parameter(instructionTypeParamName).value(standingInstructionType).notNull().inMinMaxRange(1, 2);
+        if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.statusParamName, element)) {
+			final Integer status = this.fromApiJsonHelper
+					.extractIntegerNamed(StandingInstructionApiConstants.statusParamName, element, Locale.getDefault());
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.statusParamName).value(status).notNull()
+					.inMinMaxRange(1, 2);
         }
 
-        if (this.fromApiJsonHelper.parameterExists(recurrenceTypeParamName, element)) {
-            final Integer recurrenceType = this.fromApiJsonHelper
-                    .extractIntegerNamed(recurrenceTypeParamName, element, Locale.getDefault());
-            baseDataValidator.reset().parameter(recurrenceTypeParamName).value(recurrenceType).notNull().inMinMaxRange(1, 2);
+        if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.priorityParamName, element)) {
+			final Integer priority = this.fromApiJsonHelper.extractIntegerNamed(
+					StandingInstructionApiConstants.priorityParamName, element, Locale.getDefault());
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.priorityParamName).value(priority)
+					.notNull().inMinMaxRange(1, 4);
         }
 
-        if (this.fromApiJsonHelper.parameterExists(recurrenceFrequencyParamName, element)) {
-            final Integer recurrenceFrequency = this.fromApiJsonHelper.extractIntegerNamed(recurrenceFrequencyParamName, element,
-                    Locale.getDefault());
-            baseDataValidator.reset().parameter(recurrenceFrequencyParamName).value(recurrenceFrequency).inMinMaxRange(0, 3);
-        }
-
-        if (this.fromApiJsonHelper.parameterExists(recurrenceIntervalParamName, element)) {
-            final Integer recurrenceInterval = this.fromApiJsonHelper.extractIntegerNamed(recurrenceIntervalParamName, element,
-                    Locale.getDefault());
-            baseDataValidator.reset().parameter(recurrenceIntervalParamName).value(recurrenceInterval).integerGreaterThanZero();
-        }
-
-        if (this.fromApiJsonHelper.parameterExists(nameParamName, element)) {
-            final String name = this.fromApiJsonHelper.extractStringNamed(nameParamName, element);
-            baseDataValidator.reset().parameter(nameParamName).value(name).notNull();
-        }
+        if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.instructionTypeParamName, element)) {
+			final Integer standingInstructionType = this.fromApiJsonHelper.extractIntegerNamed(
+					StandingInstructionApiConstants.instructionTypeParamName, element, Locale.getDefault());
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.instructionTypeParamName)
+					.value(standingInstructionType).notNull().inMinMaxRange(1, 2);
+		}
+
+		if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.recurrenceTypeParamName, element)) {
+			final Integer recurrenceType = this.fromApiJsonHelper.extractIntegerNamed(
+					StandingInstructionApiConstants.recurrenceTypeParamName, element, Locale.getDefault());
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceTypeParamName)
+					.value(recurrenceType).notNull().inMinMaxRange(1, 2);
+		}
+
+		if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.recurrenceFrequencyParamName,
+				element)) {
+			final Integer recurrenceFrequency = this.fromApiJsonHelper.extractIntegerNamed(
+					StandingInstructionApiConstants.recurrenceFrequencyParamName, element, Locale.getDefault());
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceFrequencyParamName)
+					.value(recurrenceFrequency).inMinMaxRange(0, 3);
+		}
+
+		if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.recurrenceIntervalParamName,
+				element)) {
+			final Integer recurrenceInterval = this.fromApiJsonHelper.extractIntegerNamed(
+					StandingInstructionApiConstants.recurrenceIntervalParamName, element, Locale.getDefault());
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceIntervalParamName)
+					.value(recurrenceInterval).integerGreaterThanZero();
+		}
+
+		if (this.fromApiJsonHelper.parameterExists(StandingInstructionApiConstants.nameParamName, element)) {
+			final String name = this.fromApiJsonHelper.extractStringNamed(StandingInstructionApiConstants.nameParamName,
+					element);
+			baseDataValidator.reset().parameter(StandingInstructionApiConstants.nameParamName).value(name).notNull();
+		}
 
         throwExceptionIfValidationWarningsExist(dataValidationErrors);
     }

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/constants/ShareAccountApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/constants/ShareAccountApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/constants/ShareAccountApiConstants.java
index bbfe50e..7ab98a1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/constants/ShareAccountApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/constants/ShareAccountApiConstants.java
@@ -104,11 +104,4 @@ public interface ShareAccountApiConstants {
 	        allowdividendcalculationforinactiveclients_paramname, charges_paramname, applicationdate_param,
 	        purchaseddate_paramname,numberofshares_paramname,purchasedprice_paramname));
 
-	Set<String> approvalParameters = new HashSet<>(Arrays.asList(locale_paramname, dateformat_paramname, approveddate_paramname, note_paramname));
-	
-	Set<String> activateParameters = new HashSet<>(Arrays.asList(locale_paramname, dateformat_paramname, activatedate_paramname));
-	
-	Set<String> closeParameters = new HashSet<>(Arrays.asList(locale_paramname, dateformat_paramname, closeddate_paramname, note_paramname));
-	
-	Set<String> addtionalSharesParameters = new HashSet<>(Arrays.asList(locale_paramname, requesteddate_paramname, requestedshares_paramname, purchasedprice_paramname, dateformat_paramname));
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java
index bae61d5..b4d248c 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java
@@ -180,33 +180,14 @@ public class ClientApiConstants {
 
     public static final String datatables = "datatables";
 
-    public static final Set<String> CLIENT_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(
-            Arrays.asList(address,localeParamName, dateFormatParamName, groupIdParamName, accountNoParamName, externalIdParamName,
-                    mobileNoParamName, firstnameParamName, middlenameParamName, lastnameParamName, fullnameParamName, officeIdParamName,
-                    activeParamName, activationDateParamName, staffIdParamName, submittedOnDateParamName, savingsProductIdParamName,
-                    dateOfBirthParamName, genderIdParamName, clientTypeIdParamName, clientClassificationIdParamName, 
-                    clientNonPersonDetailsParamName, displaynameParamName, legalFormIdParamName, datatables, isStaffParamName));
-    
-    public static final Set<String> CLIENT_NON_PERSON_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(
-            Arrays.asList(address,localeParamName, dateFormatParamName, incorpNumberParamName, remarksParamName, incorpValidityTillParamName, 
-            		constitutionIdParamName, mainBusinessLineIdParamName, datatables));
-
-    public static final Set<String> CLIENT_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
-            dateFormatParamName, accountNoParamName, externalIdParamName, mobileNoParamName, firstnameParamName, middlenameParamName,
-
-    lastnameParamName, fullnameParamName, activeParamName, activationDateParamName, staffIdParamName, savingsProductIdParamName,
-            dateOfBirthParamName, genderIdParamName, clientTypeIdParamName, clientClassificationIdParamName, submittedOnDateParamName, clientNonPersonDetailsParamName, displaynameParamName, legalFormIdParamName, isStaffParamName));
-    
-    public static final Set<String> CLIENT_NON_PERSON_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
-            dateFormatParamName, incorpNumberParamName, remarksParamName, incorpValidityTillParamName, 
-    		constitutionIdParamName, mainBusinessLineIdParamName));
 
     /**
      * These parameters will match the class level parameters of
      * {@link ClientData}. Where possible, we try to get response parameters to
      * match those of request parameters.
      */
-    public static final Set<String> CLIENT_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName, accountNoParamName,
+    protected static final Set<String> CLIENT_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName,
+            accountNoParamName,
             externalIdParamName, statusParamName, activeParamName, activationDateParamName, firstnameParamName, middlenameParamName,
             lastnameParamName, fullnameParamName, displayNameParamName, mobileNoParamName, officeIdParamName, officeNameParamName,
             transferToOfficeIdParamName, transferToOfficeNameParamName, hierarchyParamName, imageIdParamName, imagePresentParamName,
@@ -214,39 +195,14 @@ public class ClientApiConstants {
             dateOfBirthParamName, genderParamName, clientTypeParamName, clientClassificationParamName, legalFormParamName, 
             clientNonPersonDetailsParamName, isStaffParamName));
 
-    public static final Set<String> ACTIVATION_REQUEST_DATA_PARAMETERS = new HashSet<>(
-            Arrays.asList(localeParamName, dateFormatParamName, activationDateParamName));
-    public static final Set<String> REACTIVATION_REQUEST_DATA_PARAMETERS = new HashSet<>(
-            Arrays.asList(localeParamName, dateFormatParamName, reactivationDateParamName));
-
-    public static final Set<String> CLIENT_CLOSE_REQUEST_DATA_PARAMETERS = new HashSet<>(
-            Arrays.asList(localeParamName, dateFormatParamName, closureDateParamName, closureReasonIdParamName));
-
-    public static final Set<String> CLIENT_REJECT_DATA_PARAMETERS = new HashSet<>(
-            Arrays.asList(localeParamName, dateFormatParamName, rejectionDateParamName, rejectionReasonIdParamName));
-
-	public static final Set<String> CLIENT_WITHDRAW_DATA_PARAMETERS = new HashSet<>(
-			Arrays.asList(localeParamName, dateFormatParamName, withdrawalDateParamName, withdrawalReasonIdParamName));
-	
-	public static final Set<String> UNDOREJECTION_REQUEST_DATA_PARAMETERS = new HashSet<>(
-			Arrays.asList(localeParamName, dateFormatParamName, reopenedDateParamName));
-	
-	public static final Set<String> UNDOWITHDRAWN_REQUEST_DATA_PARAMETERS = new HashSet<>(
-			Arrays.asList(localeParamName, dateFormatParamName, reopenedDateParamName));
-
-    public static final Set<String> CLIENT_CHARGES_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(chargeIdParamName,
+    protected static final Set<String> CLIENT_CHARGES_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList
+            (chargeIdParamName,
             clientIdParamName, chargeNameParamName, penaltyParamName, chargeTimeTypeParamName, dueAsOfDateParamName,
             chargeCalculationTypeParamName, currencyParamName, amountWaivedParamName, amountWrittenOffParamName, amountOutstandingParamName,
             amountOrPercentageParamName, amountParamName, amountPaidParamName, chargeOptionsParamName, transactionsParamName));
 
-    public static final Set<String> CLIENT_CHARGES_ADD_REQUEST_DATA_PARAMETERS = new HashSet<>(
-            Arrays.asList(chargeIdParamName, amountParamName, dueAsOfDateParamName, dateFormatParamName, localeParamName));
-
-    public static final Set<String> CLIENT_CHARGES_PAY_CHARGE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(amountParamName,
-            transactionDateParamName, dateFormatParamName, localeParamName, paymentTypeIdParamName, transactionAccountNumberParamName,
-            checkNumberParamName, routingCodeParamName, receiptNumberParamName, bankNumberParamName));
-
-    public static final Set<String> CLIENT_TRANSACTION_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName,
+    protected static final Set<String> CLIENT_TRANSACTION_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList
+            (idParamName,
             transactionAmountParamName, paymentDetailDataParamName, reversedParamName, dateParamName, officeIdParamName,
             officeNameParamName, transactionTypeParamName, transactionCurrencyParamName, externalIdParamName, submittedOnDateParamName));
 

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientApiCollectionConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientApiCollectionConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientApiCollectionConstants.java
new file mode 100644
index 0000000..bf60ba8
--- /dev/null
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientApiCollectionConstants.java
@@ -0,0 +1,86 @@
+/**
+ * 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.client.data;
+
+import org.apache.fineract.portfolio.client.api.ClientApiConstants;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+
+public class ClientApiCollectionConstants extends ClientApiConstants{
+
+    protected static final Set<String> CLIENT_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(address,localeParamName, dateFormatParamName, groupIdParamName, accountNoParamName, externalIdParamName,
+                    mobileNoParamName, firstnameParamName, middlenameParamName, lastnameParamName, fullnameParamName, officeIdParamName,
+                    activeParamName, activationDateParamName, staffIdParamName, submittedOnDateParamName, savingsProductIdParamName,
+                    dateOfBirthParamName, genderIdParamName, clientTypeIdParamName, clientClassificationIdParamName,
+                    clientNonPersonDetailsParamName, displaynameParamName, legalFormIdParamName, datatables, isStaffParamName));
+
+    protected static final Set<String> CLIENT_NON_PERSON_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(address,localeParamName, dateFormatParamName, incorpNumberParamName, remarksParamName, incorpValidityTillParamName,
+                    constitutionIdParamName, mainBusinessLineIdParamName, datatables));
+
+    protected static final Set<String> CLIENT_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
+            dateFormatParamName, accountNoParamName, externalIdParamName, mobileNoParamName, firstnameParamName, middlenameParamName,
+
+            lastnameParamName, fullnameParamName, activeParamName, activationDateParamName, staffIdParamName, savingsProductIdParamName,
+            dateOfBirthParamName, genderIdParamName, clientTypeIdParamName, clientClassificationIdParamName, submittedOnDateParamName, clientNonPersonDetailsParamName, displaynameParamName, legalFormIdParamName, isStaffParamName));
+
+    protected static final Set<String> CLIENT_NON_PERSON_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
+            dateFormatParamName, incorpNumberParamName, remarksParamName, incorpValidityTillParamName,
+            constitutionIdParamName, mainBusinessLineIdParamName));
+
+
+    /**
+     * These parameters will match the class level parameters of
+     * {@link ClientData}. Where possible, we try to get response parameters to
+     * match those of request parameters.
+     */
+
+    protected static final Set<String> ACTIVATION_REQUEST_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(localeParamName, dateFormatParamName, activationDateParamName));
+    protected static final Set<String> REACTIVATION_REQUEST_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(localeParamName, dateFormatParamName, reactivationDateParamName));
+
+    protected static final Set<String> CLIENT_CLOSE_REQUEST_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(localeParamName, dateFormatParamName, closureDateParamName, closureReasonIdParamName));
+
+    protected static final Set<String> CLIENT_REJECT_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(localeParamName, dateFormatParamName, rejectionDateParamName, rejectionReasonIdParamName));
+
+    protected static final Set<String> CLIENT_WITHDRAW_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(localeParamName, dateFormatParamName, withdrawalDateParamName, withdrawalReasonIdParamName));
+
+    protected static final Set<String> UNDOREJECTION_REQUEST_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(localeParamName, dateFormatParamName, reopenedDateParamName));
+
+    protected static final Set<String> UNDOWITHDRAWN_REQUEST_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(localeParamName, dateFormatParamName, reopenedDateParamName));
+
+    protected static final Set<String> CLIENT_CHARGES_ADD_REQUEST_DATA_PARAMETERS = new HashSet<>(
+            Arrays.asList(chargeIdParamName, amountParamName, dueAsOfDateParamName, dateFormatParamName, localeParamName));
+
+    protected static final Set<String> CLIENT_CHARGES_PAY_CHARGE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(amountParamName,
+            transactionDateParamName, dateFormatParamName, localeParamName, paymentTypeIdParamName, transactionAccountNumberParamName,
+            checkNumberParamName, routingCodeParamName, receiptNumberParamName, bankNumberParamName));
+
+
+}

http://git-wip-us.apache.org/repos/asf/fineract/blob/50048151/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientChargeDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientChargeDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientChargeDataValidator.java
index 9310c76..6bd87d2 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientChargeDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientChargeDataValidator.java
@@ -53,7 +53,7 @@ public class ClientChargeDataValidator {
 
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
         this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
-                ClientApiConstants.CLIENT_CHARGES_ADD_REQUEST_DATA_PARAMETERS);
+                ClientApiCollectionConstants.CLIENT_CHARGES_ADD_REQUEST_DATA_PARAMETERS);
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
         final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
@@ -75,7 +75,7 @@ public class ClientChargeDataValidator {
 
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
         this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
-                ClientApiConstants.CLIENT_CHARGES_ADD_REQUEST_DATA_PARAMETERS);
+                ClientApiCollectionConstants.CLIENT_CHARGES_ADD_REQUEST_DATA_PARAMETERS);
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
         final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
@@ -100,7 +100,7 @@ public class ClientChargeDataValidator {
 
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
         this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
-                ClientApiConstants.CLIENT_CHARGES_PAY_CHARGE_REQUEST_DATA_PARAMETERS);
+                ClientApiCollectionConstants.CLIENT_CHARGES_PAY_CHARGE_REQUEST_DATA_PARAMETERS);
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
         final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)


Mime
View raw message