fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject [1/2] fineract git commit: resolved the rest of the issues related to FINERACT-470
Date Thu, 13 Jul 2017 09:33:05 GMT
Repository: fineract
Updated Branches:
  refs/heads/develop 6946f1c3f -> 1ef276be5


resolved the rest of the issues related to FINERACT-470


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

Branch: refs/heads/develop
Commit: e590ed61c4b5ebfe7e6f66723a9c56e4740a8116
Parents: ee150b1
Author: ThisuraThejith <ttcphilips@gmail.com>
Authored: Wed Jul 5 06:45:06 2017 +0530
Committer: ThisuraThejith <ttcphilips@gmail.com>
Committed: Wed Jul 5 06:45:06 2017 +0530

----------------------------------------------------------------------
 .../accrual/api/AccrualAccountingConstants.java |  3 --
 .../AccrualAccountingDataValidator.java         |  7 +++-
 .../api/AccountNumberFormatsApiResource.java    | 19 ++++++---
 .../data/AccountNumberFormatDataValidator.java  | 14 +++++--
 .../service/AccountNumberFormatConstants.java   |  7 ----
 .../infrastructure/cache/CacheApiConstants.java |  1 -
 .../command/UpdateCacheCommandHandler.java      |  7 +++-
 .../portfolio/savings/DepositsApiConstants.java | 44 ++++++++++----------
 .../portfolio/savings/SavingsApiConstants.java  |  5 +--
 ...edDepositAccountTransactionsApiResource.java | 15 +++++--
 ...ngDepositAccountTransactionsApiResource.java | 13 +++++-
 .../SavingsAccountTransactionDataValidator.java |  4 +-
 .../DepositAccountReadPlatformServiceImpl.java  |  8 +++-
 13 files changed, 91 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingConstants.java
b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingConstants.java
index 000b3e4..5ed32c3 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/api/AccrualAccountingConstants.java
@@ -30,7 +30,4 @@ public class AccrualAccountingConstants {
     
     public static final String PERIODIC_ACCRUAL_ACCOUNTING_RESOURCE_NAME = "periodicaccrual";
     public static final String PERIODIC_ACCRUAL_ACCOUNTING_EXECUTION_ERROR_CODE = "execution.failed";
-
-    public static final Set<String> LOAN_PERIODIC_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(accrueTillParamName,
-            localeParamName, dateFormatParamName));
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java
b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java
index e3f48c7..f024c1c 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/accrual/serialization/AccrualAccountingDataValidator.java
@@ -18,14 +18,16 @@
  */
 package org.apache.fineract.accounting.accrual.serialization;
 
-import static org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants.LOAN_PERIODIC_REQUEST_DATA_PARAMETERS;
 import static org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants.PERIODIC_ACCRUAL_ACCOUNTING_RESOURCE_NAME;
 import static org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants.accrueTillParamName;
 
 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.accounting.accrual.api.AccrualAccountingConstants;
@@ -52,6 +54,9 @@ import com.google.gson.reflect.TypeToken;
 public final class AccrualAccountingDataValidator {
 
     private final FromJsonHelper fromApiJsonHelper;
+	private static final Set<String> LOAN_PERIODIC_REQUEST_DATA_PARAMETERS = new HashSet<>(
+			Arrays.asList(accrueTillParamName, AccrualAccountingConstants.localeParamName,
+					AccrualAccountingConstants.dateFormatParamName));
 
     @Autowired
     public AccrualAccountingDataValidator(final FromJsonHelper fromApiJsonfromApiJsonHelper)
{

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java
index a420e2e..5d9601f 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/api/AccountNumberFormatsApiResource.java
@@ -18,7 +18,10 @@
  */
 package org.apache.fineract.infrastructure.accountnumberformat.api;
 
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
@@ -58,6 +61,10 @@ public class AccountNumberFormatsApiResource {
     private final ToApiJsonSerializer<AccountNumberFormatData> toApiJsonSerializer;
     private final ApiRequestParameterHelper apiRequestParameterHelper;
     private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
+	private static final Set<String> ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS =
new HashSet<>(Arrays.asList(
+			AccountNumberFormatConstants.idParamName, AccountNumberFormatConstants.accountTypeParamName,
+			AccountNumberFormatConstants.prefixTypeParamName, AccountNumberFormatConstants.accountTypeOptionsParamName,
+			AccountNumberFormatConstants.prefixTypeOptionsParamName));
 
     @Autowired
     public AccountNumberFormatsApiResource(final PlatformSecurityContext context,
@@ -84,8 +91,8 @@ public class AccountNumberFormatsApiResource {
         AccountNumberFormatData accountNumberFormatData = this.accountNumberFormatReadPlatformService.retrieveTemplate(accountType);
 
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
-        return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
-                AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
+		return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
+				ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
     }
 
     @GET
@@ -99,8 +106,8 @@ public class AccountNumberFormatsApiResource {
                 .getAllAccountNumberFormats();
 
         final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
-        return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
-                AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
+		return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
+				ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
     }
 
     @GET
@@ -121,8 +128,8 @@ public class AccountNumberFormatsApiResource {
             accountNumberFormatData.templateOnTop(templateData.getAccountTypeOptions(), templateData.getPrefixTypeOptions());
         }
 
-        return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
-                AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
+		return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
+				ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
     }
 
     @POST

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java
index 90cac29..a9b90f7 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/data/AccountNumberFormatDataValidator.java
@@ -20,6 +20,7 @@ package org.apache.fineract.infrastructure.accountnumberformat.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 AccountNumberFormatDataValidator {
 
     private final FromJsonHelper fromApiJsonHelper;
+    private static final Set<String> ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(
+            AccountNumberFormatConstants.accountTypeParamName, AccountNumberFormatConstants.prefixTypeParamName));
+
+	private static final Set<String> ACCOUNT_NUMBER_FORMAT_UPDATE_REQUEST_DATA_PARAMETERS
= new HashSet<>(
+			Arrays.asList(AccountNumberFormatConstants.prefixTypeParamName));
 
     @Autowired
     public AccountNumberFormatDataValidator(final FromJsonHelper fromApiJsonHelper) {
@@ -55,8 +61,8 @@ public class AccountNumberFormatDataValidator {
 
         if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
-        this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
-                AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS);
+		this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
+				ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS);
         final JsonElement element = this.fromApiJsonHelper.parse(json);
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
 
@@ -137,8 +143,8 @@ public class AccountNumberFormatDataValidator {
         if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
 
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
-        this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
-                AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_UPDATE_REQUEST_DATA_PARAMETERS);
+		this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
+				ACCOUNT_NUMBER_FORMAT_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/e590ed61/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java
index 4836d8b..722f6be 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/accountnumberformat/service/AccountNumberFormatConstants.java
@@ -49,18 +49,11 @@ public class AccountNumberFormatConstants {
     public static final String accountTypeOptionsParamName = "accountTypeOptions";
     public static final String prefixTypeOptionsParamName = "prefixTypeOptions";
 
-    public static final Set<String> ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(
-            accountTypeParamName, prefixTypeParamName));
-
-    public static final Set<String> ACCOUNT_NUMBER_FORMAT_UPDATE_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(prefixTypeParamName));
-
     /**
      * These parameters will match the class level parameters of
      * {@link AccountNumberFormatData}. Where possible, we try to get response
      * parameters to match those of request parameters.
      */
-    public static final Set<String> ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(idParamName,
-            accountTypeParamName, prefixTypeParamName, accountTypeOptionsParamName, prefixTypeOptionsParamName));
 
     // Error messages codes
     public static final String EXCEPTION_DUPLICATE_ACCOUNT_TYPE = "error.msg.account.number.format.duplicate.account.type";

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/CacheApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/CacheApiConstants.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/CacheApiConstants.java
index ccbc7fd..7351980 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/CacheApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/CacheApiConstants.java
@@ -26,6 +26,5 @@ public class CacheApiConstants {
 
     public static final String RESOURCE_NAME = "CACHE";
     public static final String cacheTypeParameter = "cacheType";
-    public static final Set<String> REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(cacheTypeParameter));
 
 }

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/command/UpdateCacheCommandHandler.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/command/UpdateCacheCommandHandler.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/command/UpdateCacheCommandHandler.java
index 7d7e9fc..9cea2c2 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/command/UpdateCacheCommandHandler.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/command/UpdateCacheCommandHandler.java
@@ -20,8 +20,11 @@ package org.apache.fineract.infrastructure.cache.command;
 
 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.commands.annotation.CommandType;
@@ -47,6 +50,8 @@ import com.google.gson.reflect.TypeToken;
 public class UpdateCacheCommandHandler implements NewCommandSourceHandler {
 
     private final CacheWritePlatformService cacheService;
+    private static final Set<String> REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(CacheApiConstants
+            .cacheTypeParameter));
 
     @Autowired
     public UpdateCacheCommandHandler(final CacheWritePlatformService cacheService) {
@@ -62,7 +67,7 @@ public class UpdateCacheCommandHandler implements NewCommandSourceHandler
{
         if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
 
         final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
-        command.checkForUnsupportedParameters(typeOfMap, json, CacheApiConstants.REQUEST_DATA_PARAMETERS);
+        command.checkForUnsupportedParameters(typeOfMap, json, REQUEST_DATA_PARAMETERS);
 
         final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
         final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositsApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositsApiConstants.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositsApiConstants.java
index c886128..a84a2b3 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositsApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/DepositsApiConstants.java
@@ -151,6 +151,7 @@ public class DepositsApiConstants {
     public static final String runningBalanceParamName = "runningBalance";
     public static final String reversedParamName = "reversed";
     public static final String dateParamName = "date";
+    public static final String accountIdParamName = "accountId";
 
     // recurring deposits update parameters
     public static final String effectiveDateParamName = "effectiveDate";
@@ -199,9 +200,6 @@ public class DepositsApiConstants {
     // template
     public static final String chartTemplate = "chartTemplate";
 
-    // allowed column names for sorting the query result
-    public final static Set<String> supportedOrderByValues = new HashSet<>(Arrays.asList("id",
"accountNumbr", "officeId", "officeName"));
-
     /**
      * Deposit Product Parameters
      */
@@ -244,7 +242,7 @@ public class DepositsApiConstants {
             adjustAdvanceTowardsFuturePaymentsParamName, recurringFrequencyTypeParamName,
recurringFrequencyParamName,
             isCalendarInheritedParamName));
 
-    public static final Set<String> DEPOSIT_PRECLOSURE_CALCULATION_REQUEST_DATA_PARAMETERS
= new HashSet<>(
+    private static final Set<String> DEPOSIT_PRECLOSURE_CALCULATION_REQUEST_DATA_PARAMETERS
= new HashSet<>(
             Arrays.asList(preMatureCloseOnDateParamName));
 
     public static final Set<String> FIXED_DEPOSIT_PRODUCT_REQUEST_DATA_PARAMETERS =
fixedDepositProductRequestData();
@@ -293,13 +291,15 @@ public class DepositsApiConstants {
      * Depost Account parameters
      */
 
-    public static final Set<String> DEPOSIT_ACCOUNT_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
-            dateFormatParamName, monthDayFormatParamName, accountNoParamName, externalIdParamName,
clientIdParamName, groupIdParamName,
-            productIdParamName, fieldOfficerIdParamName, submittedOnDateParamName, nominalAnnualInterestRateParamName,
-            interestCompoundingPeriodTypeParamName, interestPostingPeriodTypeParamName, interestCalculationTypeParamName,
-            interestCalculationDaysInYearTypeParamName, lockinPeriodFrequencyParamName, lockinPeriodFrequencyTypeParamName,
-            chargesParamName, chartsParamName, depositAmountParamName, depositPeriodParamName,
depositPeriodFrequencyIdParamName,
-            savingsAccounts, expectedFirstDepositOnDateParamName, SavingsApiConstants.withHoldTaxParamName));
+	private static final Set<String> DEPOSIT_ACCOUNT_REQUEST_DATA_PARAMETERS = new HashSet<>(
+			Arrays.asList(localeParamName, dateFormatParamName, monthDayFormatParamName, accountNoParamName,
+					externalIdParamName, clientIdParamName, groupIdParamName, productIdParamName,
+					fieldOfficerIdParamName, submittedOnDateParamName, nominalAnnualInterestRateParamName,
+					interestCompoundingPeriodTypeParamName, interestPostingPeriodTypeParamName,
+					interestCalculationTypeParamName, interestCalculationDaysInYearTypeParamName,
+					lockinPeriodFrequencyParamName, lockinPeriodFrequencyTypeParamName, chargesParamName,
+					chartsParamName, depositAmountParamName, depositPeriodParamName, depositPeriodFrequencyIdParamName,
+					savingsAccounts, expectedFirstDepositOnDateParamName, SavingsApiConstants.withHoldTaxParamName));
 
     public static final Set<String> FIXED_DEPOSIT_ACCOUNT_REQUEST_DATA_PARAMETERS =
fixedDepositAccountRequestData();
     public static final Set<String> FIXED_DEPOSIT_ACCOUNT_RESPONSE_DATA_PARAMETERS
= fixedDepositAccountResponseData();
@@ -345,27 +345,27 @@ public class DepositsApiConstants {
         return recurringDepositResponseData;
     }
 
-    public static final Set<String> FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(idParamName,
-            "accountId", accountNoParamName, "currency", "amount", dateParamName, paymentDetailDataParamName,
runningBalanceParamName,
-            reversedParamName));
-
-    public static final Set<String> RECURRING_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(idParamName,
-            "accountId", accountNoParamName, "currency", "amount", dateParamName, paymentDetailDataParamName,
runningBalanceParamName,
-            reversedParamName));
+	private static final Set<String> RECURRING_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS
= new HashSet<>(
+			Arrays.asList(idParamName, "accountId", accountNoParamName, "currency", "amount", dateParamName,
+					paymentDetailDataParamName, runningBalanceParamName, reversedParamName));
 
-    public static final Set<String> SAVINGS_ACCOUNT_ACTIVATION_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(localeParamName,
+    private static final Set<String> SAVINGS_ACCOUNT_ACTIVATION_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays.asList
+            (localeParamName,
             dateFormatParamName, activatedOnDateParamName));
 
-    public static final Set<String> SAVINGS_ACCOUNT_CHARGES_RESPONSE_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(chargeIdParamName,
+    private static final Set<String> SAVINGS_ACCOUNT_CHARGES_RESPONSE_DATA_PARAMETERS
= new HashSet<>(Arrays.asList
+            (chargeIdParamName,
             savingsAccountChargeIdParamName, chargeNameParamName, penaltyParamName, chargeTimeTypeParamName,
dueAsOfDateParamName,
             chargeCalculationTypeParamName, percentageParamName, amountPercentageAppliedToParamName,
currencyParamName,
             amountWaivedParamName, amountWrittenOffParamName, amountOutstandingParamName,
amountOrPercentageParamName, amountParamName,
             amountPaidParamName, chargeOptionsParamName));
 
-    public static final Set<String> SAVINGS_ACCOUNT_CHARGES_ADD_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(chargeIdParamName,
+    private static final Set<String> SAVINGS_ACCOUNT_CHARGES_ADD_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays.asList
+            (chargeIdParamName,
             amountParamName, dueAsOfDateParamName, dateFormatParamName, localeParamName,
feeOnMonthDayParamName, monthDayFormatParamName,
             feeIntervalParamName));
 
-    public static final Set<String> SAVINGS_ACCOUNT_CHARGES_PAY_CHARGE_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays.asList(
+    private static final Set<String> SAVINGS_ACCOUNT_CHARGES_PAY_CHARGE_REQUEST_DATA_PARAMETERS
= new HashSet<>(Arrays
+            .asList(
             amountParamName, dueAsOfDateParamName, dateFormatParamName, localeParamName));
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsApiConstants.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsApiConstants.java
index 1b8aa53..2a43a8b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/SavingsApiConstants.java
@@ -26,7 +26,7 @@ import org.apache.fineract.accounting.common.AccountingConstants.SAVINGS_PRODUCT
 import org.apache.fineract.portfolio.savings.data.SavingsAccountData;
 import org.apache.fineract.portfolio.savings.data.SavingsProductData;
 
-public class SavingsApiConstants {
+public class    SavingsApiConstants {
 
     public static final String SAVINGS_PRODUCT_RESOURCE_NAME = "savingsproduct";
     public static final String SAVINGS_ACCOUNT_RESOURCE_NAME = "savingsaccount";
@@ -186,7 +186,4 @@ public class SavingsApiConstants {
     public static final String datatables = "datatables";
     
     public static final String ERROR_MSG_SAVINGS_ACCOUNT_NOT_ACTIVE = "not.in.active.state";
-    
-    public static final Set<String> SAVINGS_ACCOUNT_HOLD_AMOUNT_REQUEST_DATA_PARAMETERS
= new HashSet<>(
-            Arrays.asList(transactionDateParamName, dateFormatParamName, localeParamName,
transactionAmountParamName));
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java
index fadf019..d0785f9 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/FixedDepositAccountTransactionsApiResource.java
@@ -18,7 +18,10 @@
  */
 package org.apache.fineract.portfolio.savings.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.GET;
@@ -62,7 +65,13 @@ public class FixedDepositAccountTransactionsApiResource {
     private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
     private final ApiRequestParameterHelper apiRequestParameterHelper;
     private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
-    private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
+	private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
+	private static final Set<String> FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS
= new HashSet<>(
+			Arrays.asList(DepositsApiConstants.idParamName, DepositsApiConstants.accountIdParamName,
+					DepositsApiConstants.accountNoParamName, DepositsApiConstants.currencyParamName,
+					DepositsApiConstants.amountParamName, DepositsApiConstants.dateParamName,
+					DepositsApiConstants.paymentDetailDataParamName, DepositsApiConstants.runningBalanceParamName,
+					DepositsApiConstants.reversedParamName));
 
     @Autowired
     public FixedDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
@@ -120,8 +129,8 @@ public class FixedDepositAccountTransactionsApiResource {
             transactionData = SavingsAccountTransactionData.templateOnTop(transactionData,
paymentTypeOptions);
         }
 
-        return this.toApiJsonSerializer.serialize(settings, transactionData,
-                DepositsApiConstants.FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS);
+		return this.toApiJsonSerializer.serialize(settings, transactionData,
+				FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS);
     }
 
     @POST

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java
index 24353c7..089dc2b 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositAccountTransactionsApiResource.java
@@ -18,7 +18,10 @@
  */
 package org.apache.fineract.portfolio.savings.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.GET;
@@ -65,6 +68,12 @@ public class RecurringDepositAccountTransactionsApiResource {
     private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
     private final DepositAccountReadPlatformService depositAccountReadPlatformService;
     private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
+    private static final Set<String> FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS
= new HashSet<>(
+            Arrays.asList(DepositsApiConstants.idParamName, DepositsApiConstants.accountIdParamName,
+                    DepositsApiConstants.accountNoParamName, DepositsApiConstants.currencyParamName,
+                    DepositsApiConstants.amountParamName, DepositsApiConstants.dateParamName,
+                    DepositsApiConstants.paymentDetailDataParamName, DepositsApiConstants.runningBalanceParamName,
+                    DepositsApiConstants.reversedParamName));
 
     @Autowired
     public RecurringDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
@@ -141,8 +150,8 @@ public class RecurringDepositAccountTransactionsApiResource {
             transactionData = SavingsAccountTransactionData.templateOnTop(transactionData,
paymentTypeOptions);
         }
 
-        return this.toApiJsonSerializer.serialize(settings, transactionData,
-                DepositsApiConstants.FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS);
+		return this.toApiJsonSerializer.serialize(settings, transactionData,
+				FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS);
     }
 
     @POST

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
index fcd7a88..0ea0165 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionDataValidator.java
@@ -29,7 +29,6 @@ import static org.apache.fineract.portfolio.savings.SavingsApiConstants.transact
 import static org.apache.fineract.portfolio.savings.SavingsApiConstants.transactionAmountParamName;
 import static org.apache.fineract.portfolio.savings.SavingsApiConstants.transactionDateParamName;
 import static org.apache.fineract.portfolio.savings.SavingsApiConstants.withdrawBalanceParamName;
-import static org.apache.fineract.portfolio.savings.SavingsApiConstants.SAVINGS_ACCOUNT_HOLD_AMOUNT_REQUEST_DATA_PARAMETERS;
 import static org.apache.fineract.portfolio.savings.SavingsApiConstants.SAVINGS_ACCOUNT_RESOURCE_NAME;
 
 import java.lang.reflect.Type;
@@ -67,6 +66,9 @@ import com.google.gson.reflect.TypeToken;
 public class SavingsAccountTransactionDataValidator {
 
     private final FromJsonHelper fromApiJsonHelper;
+	private static final Set<String> SAVINGS_ACCOUNT_HOLD_AMOUNT_REQUEST_DATA_PARAMETERS
= new HashSet<>(
+			Arrays.asList(transactionDateParamName, SavingsApiConstants.dateFormatParamName,
+					SavingsApiConstants.localeParamName, transactionAmountParamName));
 
     @Autowired
     public SavingsAccountTransactionDataValidator(final FromJsonHelper fromApiJsonHelper)
{

http://git-wip-us.apache.org/repos/asf/fineract/blob/e590ed61/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java
index 011256a..b38ca37 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java
@@ -22,8 +22,11 @@ import java.math.BigDecimal;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.fineract.infrastructure.core.data.EnumOptionData;
 import org.apache.fineract.infrastructure.core.data.PaginationParameters;
@@ -122,6 +125,9 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
     private final CalendarReadPlatformService calendarReadPlatformService;
     private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
     private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
+    // allowed column names for sorting the query result
+    private final static Set<String> supportedOrderByValues = new HashSet<>(Arrays.asList("id",
"accountNumbr",
+            "officeId", "officeName"));
 
     @Autowired
     public DepositAccountReadPlatformServiceImpl(final PlatformSecurityContext context, final
RoutingDataSource dataSource,
@@ -178,7 +184,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
     public Page<DepositAccountData> retrieveAllPaged(final DepositAccountType depositAccountType,
             final PaginationParameters paginationParameters) {
 
-        this.paginationParametersDataValidator.validateParameterValues(paginationParameters,
DepositsApiConstants.supportedOrderByValues,
+        this.paginationParametersDataValidator.validateParameterValues(paginationParameters,
supportedOrderByValues,
                 depositAccountType.resourceName());
 
         final DepositAccountMapper depositAccountMapper = this.getDepositAccountMapper(depositAccountType);


Mime
View raw message