fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100...@apache.org
Subject [3/5] incubator-fineract git commit: Revert "Merge branch 'develop' into openmf_develop"
Date Wed, 09 Mar 2016 10:33:28 GMT
http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java
index 64bd4c8..fa48717 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java
@@ -72,7 +72,6 @@ public class FixedDepositAccountHelper {
     private static final String DAYS_360 = "360";
     private static final String DAYS_365 = "365";
     public final static String depositAmount = "100000";
-    private String newDepositAmount = null;
 
     private String interestCompoundingPeriodType = MONTHLY;
     private String interestPostingPeriodType = MONTHLY;
@@ -91,15 +90,64 @@ public class FixedDepositAccountHelper {
     private final boolean isActiveChart = true;
     private final String currencyCode = USD;
 
-    private String depositPeriod = "14";
+    private final String depositPeriod = "14";
     private final String depositPeriodFrequencyId = MONTHS;
     private String submittedOnDate = "";
     private String savingsId = null;
     private boolean transferInterest = false;
 
-    public String build(final String clientId, final String productId, final String penalInterestType) {
+    public String build(final String clientId, final String productId, final String validFrom, final String validTo,
+            final String penalInterestType) {
         final HashMap<String, Object> map = new HashMap<>();
 
+        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
+        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
+        chartSlabsMap1.put("description", "First");
+        chartSlabsMap1.put("periodType", MONTHS);
+        chartSlabsMap1.put("fromPeriod", "1");
+        chartSlabsMap1.put("toPeriod", "6");
+        chartSlabsMap1.put("annualInterestRate", "5");
+        chartSlabsMap1.put("locale", LOCALE);
+        chartSlabs.add(0, chartSlabsMap1);
+
+        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
+        chartSlabsMap2.put("description", "Second");
+        chartSlabsMap2.put("periodType", MONTHS);
+        chartSlabsMap2.put("fromPeriod", "7");
+        chartSlabsMap2.put("toPeriod", "12");
+        chartSlabsMap2.put("annualInterestRate", "6");
+        chartSlabsMap2.put("locale", LOCALE);
+        chartSlabs.add(1, chartSlabsMap2);
+
+        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
+        chartSlabsMap3.put("description", "Third");
+        chartSlabsMap3.put("periodType", MONTHS);
+        chartSlabsMap3.put("fromPeriod", "13");
+        chartSlabsMap3.put("toPeriod", "18");
+        chartSlabsMap3.put("annualInterestRate", "7");
+        chartSlabsMap3.put("locale", LOCALE);
+        chartSlabs.add(2, chartSlabsMap3);
+
+        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
+        chartSlabsMap4.put("description", "Fourth");
+        chartSlabsMap4.put("periodType", MONTHS);
+        chartSlabsMap4.put("fromPeriod", "19");
+        chartSlabsMap4.put("toPeriod", "24");
+        chartSlabsMap4.put("annualInterestRate", "8");
+        chartSlabsMap4.put("locale", LOCALE);
+        chartSlabs.add(3, chartSlabsMap4);
+
+        List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
+        HashMap<String, Object> chartsMap = new HashMap<>();
+        chartsMap.put("fromDate", validFrom);
+        chartsMap.put("endDate", validTo);
+        chartsMap.put("dateFormat", "dd MMMM yyyy");
+        chartsMap.put("locale", LOCALE);
+        chartsMap.put("isActiveChart", this.isActiveChart);
+        chartsMap.put("chartSlabs", chartSlabs);
+        charts.add(chartsMap);
+
+        map.put("charts", charts);
         map.put("productId", productId);
         map.put("clientId", clientId);
         map.put("interestCalculationDaysInYearType", this.interestCalculationDaysInYearType);
@@ -121,7 +169,7 @@ public class FixedDepositAccountHelper {
         map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
         map.put("preClosurePenalInterest", this.preClosurePenalInterest);
         map.put("preClosurePenalInterestOnTypeId", penalInterestType);
-        map.put("depositAmount", getDepositAmount());
+        map.put("depositAmount", depositAmount);
         map.put("depositPeriod", this.depositPeriod);
         map.put("depositPeriodFrequencyId", this.depositPeriodFrequencyId);
         map.put("submittedOnDate", this.submittedOnDate);
@@ -148,16 +196,8 @@ public class FixedDepositAccountHelper {
     }
 
     public HashMap getFixedDepositSummary(final Integer accountID) {
-        return getFixedDepositDetails(accountID, "summary");
-    }
-
-    public HashMap getFixedDepositDetails(final Integer accountID) {
-        return getFixedDepositDetails(accountID, "");
-    }
-
-    private HashMap getFixedDepositDetails(final Integer accountID, final String jsonAttributeToGetBack) {
         final String URL = FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?" + Utils.TENANT_IDENTIFIER;
-        final HashMap response = Utils.performServerGet(requestSpec, responseSpec, URL, jsonAttributeToGetBack);
+        final HashMap response = Utils.performServerGet(requestSpec, responseSpec, URL, "summary");
         return response;
     }
 
@@ -211,7 +251,7 @@ public class FixedDepositAccountHelper {
 
         final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
                 .withSubmittedOnDate(submittedOnDate) //
-                .build(clientID, productID, penalInterestType);
+                .build(clientID, productID, validFrom, validTo, penalInterestType);
 
         return Utils.performServerPut(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
                 + Utils.TENANT_IDENTIFIER, fixedDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
@@ -228,7 +268,7 @@ public class FixedDepositAccountHelper {
                 .withInterestCalculationPeriodType(interestCalculationType) //
                 .withInterestCompoundingPeriodType(interestCompoundingPeriodType) //
                 .withInterestPostingPeriodType(interestPostingPeriodType) //
-                .build(clientID, productID, penalInterestType);
+                .build(clientID, productID, validFrom, validTo, penalInterestType);
 
         return Utils.performServerPut(this.requestSpec, this.responseSpec, FIXED_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
                 + Utils.TENANT_IDENTIFIER, fixedDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
@@ -447,19 +487,4 @@ public class FixedDepositAccountHelper {
         this.lockinPeriodFrequency = lockinPeriodFrequency;
         return this;
     }
-
-    public FixedDepositAccountHelper withDepositPeriod(final String depositPeriod) {
-        this.depositPeriod = depositPeriod;
-        return this;
-    }
-
-    public FixedDepositAccountHelper withDepositAmount(final String depositAmount) {
-        this.newDepositAmount = depositAmount;
-        return this;
-    }
-
-    private String getDepositAmount() {
-        if (this.newDepositAmount == null) { return depositAmount; }
-        return this.newDepositAmount;
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java
index b20b6f9..2703340 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java
@@ -97,20 +97,54 @@ public class FixedDepositProductHelper {
     private final String currencyCode = USD;
     private final String interestCalculationDaysInYearType = DAYS_365;
     private Account[] accountList = null;
-    private List<HashMap<String, String>> chartSlabs = null;
-    private boolean isPrimaryGroupingByAmount = false;
 
     public String build(final String validFrom, final String validTo) {
         final HashMap<String, Object> map = new HashMap<>();
 
+        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
+        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
+        chartSlabsMap1.put("description", "First");
+        chartSlabsMap1.put("periodType", MONTHS);
+        chartSlabsMap1.put("fromPeriod", "1");
+        chartSlabsMap1.put("toPeriod", "6");
+        chartSlabsMap1.put("annualInterestRate", "5");
+        chartSlabsMap1.put("locale", LOCALE);
+        chartSlabs.add(0, chartSlabsMap1);
+
+        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
+        chartSlabsMap2.put("description", "Second");
+        chartSlabsMap2.put("periodType", MONTHS);
+        chartSlabsMap2.put("fromPeriod", "7");
+        chartSlabsMap2.put("toPeriod", "12");
+        chartSlabsMap2.put("annualInterestRate", "6");
+        chartSlabsMap2.put("locale", LOCALE);
+        chartSlabs.add(1, chartSlabsMap2);
+
+        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
+        chartSlabsMap3.put("description", "Third");
+        chartSlabsMap3.put("periodType", MONTHS);
+        chartSlabsMap3.put("fromPeriod", "13");
+        chartSlabsMap3.put("toPeriod", "18");
+        chartSlabsMap3.put("annualInterestRate", "7");
+        chartSlabsMap3.put("locale", LOCALE);
+        chartSlabs.add(2, chartSlabsMap3);
+
+        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
+        chartSlabsMap4.put("description", "Fourth");
+        chartSlabsMap4.put("periodType", MONTHS);
+        chartSlabsMap4.put("fromPeriod", "19");
+        chartSlabsMap4.put("toPeriod", "24");
+        chartSlabsMap4.put("annualInterestRate", "8");
+        chartSlabsMap4.put("locale", LOCALE);
+        chartSlabs.add(3, chartSlabsMap4);
+
         List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
         HashMap<String, Object> chartsMap = new HashMap<>();
         chartsMap.put("fromDate", validFrom);
         chartsMap.put("endDate", validTo);
         chartsMap.put("dateFormat", "dd MMMM yyyy");
         chartsMap.put("locale", LOCALE);
-        chartsMap.put("chartSlabs", this.chartSlabs);
-        chartsMap.put("isPrimaryGroupingByAmount", this.isPrimaryGroupingByAmount);
+        chartsMap.put("chartSlabs", chartSlabs);
         charts.add(chartsMap);
 
         map.put("charts", charts);
@@ -139,7 +173,6 @@ public class FixedDepositProductHelper {
         map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId);
         map.put("preClosurePenalInterest", this.preClosurePenalInterest);
         map.put("preClosurePenalInterestOnTypeId", this.preClosurePenalInterestOnTypeId);
-        
 
         if (this.accountingRule.equals(CASH_BASED)) {
             map.putAll(getAccountMappingForCashBased());
@@ -150,207 +183,6 @@ public class FixedDepositProductHelper {
         return FixedDepositProductCreateJson;
     }
 
-    public List<HashMap<String, String>> constructChartSlabWithPeriodRange() {
-        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
-        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
-        chartSlabsMap1.put("description", "First");
-        chartSlabsMap1.put("periodType", MONTHS);
-        chartSlabsMap1.put("fromPeriod", "1");
-        chartSlabsMap1.put("toPeriod", "6");
-        chartSlabsMap1.put("annualInterestRate", "5");
-        chartSlabsMap1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1);
-
-        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
-        chartSlabsMap2.put("description", "Second");
-        chartSlabsMap2.put("periodType", MONTHS);
-        chartSlabsMap2.put("fromPeriod", "7");
-        chartSlabsMap2.put("toPeriod", "12");
-        chartSlabsMap2.put("annualInterestRate", "6");
-        chartSlabsMap2.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap2);
-
-        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
-        chartSlabsMap3.put("description", "Third");
-        chartSlabsMap3.put("periodType", MONTHS);
-        chartSlabsMap3.put("fromPeriod", "13");
-        chartSlabsMap3.put("toPeriod", "18");
-        chartSlabsMap3.put("annualInterestRate", "7");
-        chartSlabsMap3.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap3);
-
-        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
-        chartSlabsMap4.put("description", "Fourth");
-        chartSlabsMap4.put("periodType", MONTHS);
-        chartSlabsMap4.put("fromPeriod", "19");
-        chartSlabsMap4.put("annualInterestRate", "8");
-        chartSlabsMap4.put("locale", LOCALE);
-        chartSlabs.add(3, chartSlabsMap4);
-        return chartSlabs;
-    }
-
-    public List<HashMap<String, String>> constructChartSlabWithPeriodAndAmountRange() {
-        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
-        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
-        chartSlabsMap1.put("description", "First");
-        chartSlabsMap1.put("periodType", MONTHS);
-        chartSlabsMap1.put("fromPeriod", "1");
-        chartSlabsMap1.put("toPeriod", "6");
-        chartSlabsMap1.put("amountRangeFrom", "1");
-        chartSlabsMap1.put("amountRangeTo", "5000");
-        chartSlabsMap1.put("annualInterestRate", "5");
-        chartSlabsMap1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1);
-
-        HashMap<String, String> chartSlabsMap1_1 = new HashMap<>();
-        chartSlabsMap1_1.put("description", "First");
-        chartSlabsMap1_1.put("periodType", MONTHS);
-        chartSlabsMap1_1.put("fromPeriod", "1");
-        chartSlabsMap1_1.put("toPeriod", "6");
-        chartSlabsMap1_1.put("amountRangeFrom", "5001");
-        chartSlabsMap1_1.put("annualInterestRate", "6");
-        chartSlabsMap1_1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1_1);
-
-        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
-        chartSlabsMap2.put("description", "Second");
-        chartSlabsMap2.put("periodType", MONTHS);
-        chartSlabsMap2.put("fromPeriod", "7");
-        chartSlabsMap2.put("toPeriod", "12");
-        chartSlabsMap2.put("amountRangeFrom", "1");
-        chartSlabsMap2.put("amountRangeTo", "5000");
-        chartSlabsMap2.put("annualInterestRate", "6");
-        chartSlabsMap2.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap2);
-
-        HashMap<String, String> chartSlabsMap2_2 = new HashMap<>();
-        chartSlabsMap2_2.put("description", "Second");
-        chartSlabsMap2_2.put("periodType", MONTHS);
-        chartSlabsMap2_2.put("fromPeriod", "7");
-        chartSlabsMap2_2.put("toPeriod", "12");
-        chartSlabsMap2_2.put("amountRangeFrom", "5001");
-        chartSlabsMap2_2.put("annualInterestRate", "7");
-        chartSlabsMap2_2.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap2_2);
-
-        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
-        chartSlabsMap3.put("description", "Third");
-        chartSlabsMap3.put("periodType", MONTHS);
-        chartSlabsMap3.put("fromPeriod", "13");
-        chartSlabsMap3.put("toPeriod", "18");
-        chartSlabsMap3.put("amountRangeFrom", "1");
-        chartSlabsMap3.put("amountRangeTo", "5000");
-        chartSlabsMap3.put("annualInterestRate", "7");
-        chartSlabsMap3.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap3);
-
-        HashMap<String, String> chartSlabsMap3_1 = new HashMap<>();
-        chartSlabsMap3_1.put("description", "Third");
-        chartSlabsMap3_1.put("periodType", MONTHS);
-        chartSlabsMap3_1.put("fromPeriod", "13");
-        chartSlabsMap3_1.put("toPeriod", "18");
-        chartSlabsMap3_1.put("amountRangeFrom", "5001");
-        chartSlabsMap3_1.put("annualInterestRate", "8");
-        chartSlabsMap3_1.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap3_1);
-
-        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
-        chartSlabsMap4.put("description", "Fourth");
-        chartSlabsMap4.put("periodType", MONTHS);
-        chartSlabsMap4.put("fromPeriod", "19");
-        chartSlabsMap4.put("amountRangeFrom", "1");
-        chartSlabsMap4.put("amountRangeTo", "5000");
-        chartSlabsMap4.put("annualInterestRate", "8");
-        chartSlabsMap4.put("locale", LOCALE);
-        chartSlabs.add(3, chartSlabsMap4);
-
-        HashMap<String, String> chartSlabsMap4_1 = new HashMap<>();
-        chartSlabsMap4_1.put("description", "Fourth");
-        chartSlabsMap4_1.put("periodType", MONTHS);
-        chartSlabsMap4_1.put("fromPeriod", "19");
-        chartSlabsMap4_1.put("amountRangeFrom", "5001");
-        chartSlabsMap4_1.put("annualInterestRate", "9");
-        chartSlabsMap4_1.put("locale", LOCALE);
-        chartSlabs.add(3, chartSlabsMap4_1);
-
-        return chartSlabs;
-    }
-
-    public List<HashMap<String, String>> constructChartSlabWithAmountAndPeriodRange() {
-        this.isPrimaryGroupingByAmount = true;
-        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
-        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
-        chartSlabsMap1.put("description", "First");
-        chartSlabsMap1.put("periodType", MONTHS);
-        chartSlabsMap1.put("amountRangeFrom", "1");
-        chartSlabsMap1.put("amountRangeTo", "5000");
-        chartSlabsMap1.put("fromPeriod", "1");
-        chartSlabsMap1.put("toPeriod", "6");
-        chartSlabsMap1.put("annualInterestRate", "5");
-        chartSlabsMap1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1);
-
-        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
-        chartSlabsMap2.put("description", "Second");
-        chartSlabsMap2.put("periodType", MONTHS);
-        chartSlabsMap2.put("fromPeriod", "7");
-        chartSlabsMap2.put("amountRangeFrom", "1");
-        chartSlabsMap2.put("amountRangeTo", "5000");
-        chartSlabsMap2.put("annualInterestRate", "6");
-        chartSlabsMap2.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap2);
-
-        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
-        chartSlabsMap3.put("description", "Third");
-        chartSlabsMap3.put("periodType", MONTHS);
-        chartSlabsMap3.put("fromPeriod", "1");
-        chartSlabsMap3.put("toPeriod", "6");
-        chartSlabsMap3.put("amountRangeFrom", "5001");
-        chartSlabsMap3.put("annualInterestRate", "7");
-        chartSlabsMap3.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap3);
-
-        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
-        chartSlabsMap4.put("description", "Fourth");
-        chartSlabsMap4.put("periodType", MONTHS);
-        chartSlabsMap4.put("fromPeriod", "7");
-        chartSlabsMap4.put("amountRangeFrom", "5001");
-        chartSlabsMap4.put("annualInterestRate", "8");
-        chartSlabsMap4.put("locale", LOCALE);
-        chartSlabs.add(3, chartSlabsMap4);
-
-        return chartSlabs;
-    }
-
-    public List<HashMap<String, String>> constructChartSlabWithAmountRange() {
-        this.isPrimaryGroupingByAmount = true;
-        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
-        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
-        chartSlabsMap1.put("description", "First");
-        chartSlabsMap1.put("amountRangeFrom", "1");
-        chartSlabsMap1.put("amountRangeTo", "5000");
-        chartSlabsMap1.put("annualInterestRate", "5");
-        chartSlabsMap1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1);
-
-        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
-        chartSlabsMap3.put("description", "Third");
-        chartSlabsMap3.put("amountRangeFrom", "5001");
-        chartSlabsMap3.put("amountRangeTo", "10000");
-        chartSlabsMap3.put("annualInterestRate", "7");
-        chartSlabsMap3.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap3);
-
-        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
-        chartSlabsMap4.put("description", "Fourth");
-        chartSlabsMap4.put("amountRangeFrom", "10001");
-        chartSlabsMap4.put("annualInterestRate", "8");
-        chartSlabsMap4.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap4);
-
-        return chartSlabs;
-    }
-
     public FixedDepositProductHelper withAccountingRuleAsNone() {
         this.accountingRule = NONE;
         return this;
@@ -362,26 +194,6 @@ public class FixedDepositProductHelper {
         return this;
     }
 
-    public FixedDepositProductHelper withPeriodRangeChart() {
-        this.chartSlabs = constructChartSlabWithPeriodRange();
-        return this;
-    }
-
-    public FixedDepositProductHelper withPeriodAndAmountRangeChart() {
-        this.chartSlabs = constructChartSlabWithPeriodAndAmountRange();
-        return this;
-    }
-
-    public FixedDepositProductHelper withAmountRangeChart() {
-        this.chartSlabs = constructChartSlabWithAmountRange();
-        return this;
-    }
-
-    public FixedDepositProductHelper withAmountAndPeriodRangeChart() {
-        this.chartSlabs = constructChartSlabWithAmountAndPeriodRange();
-        return this;
-    }
-
     private Map<String, String> getAccountMappingForCashBased() {
         final Map<String, String> map = new HashMap<>();
         if (accountList != null) {

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java
index d556cd8..5ec7cfd 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java
@@ -28,7 +28,6 @@ import java.util.Locale;
 
 import org.apache.fineract.integrationtests.common.CommonConstants;
 import org.apache.fineract.integrationtests.common.Utils;
-import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositAccountHelper;
 
 import com.google.gson.Gson;
 import com.jayway.restassured.specification.RequestSpecification;
@@ -100,18 +99,67 @@ public class RecurringDepositAccountHelper {
     private final String currencyCode = USD;
     private String interestCalculationDaysInYearType = DAYS_365;
     private final String depositAmount = "2000";
-    private String depositPeriod = "14";
+    private final String depositPeriod = "14";
     private final String depositPeriodFrequencyId = MONTHS;
     private final String recurringFrequency = "1";
     private final String recurringFrequencyType = MONTHS;
-    private String mandatoryRecommendedDepositAmount = "2000";
+    private final String mandatoryRecommendedDepositAmount = "2000";
     private String submittedOnDate = "";
     private String expectedFirstDepositOnDate = "";
     private boolean isCalendarInherited = false;
 
-    public String build(final String clientId, final String productId, final String penalInterestType) {
+    public String build(final String clientId, final String productId, final String validFrom, final String validTo,
+            final String penalInterestType) {
         final HashMap<String, Object> map = new HashMap<>();
 
+        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
+        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
+        chartSlabsMap1.put("description", "First");
+        chartSlabsMap1.put("periodType", MONTHS);
+        chartSlabsMap1.put("fromPeriod", "1");
+        chartSlabsMap1.put("toPeriod", "6");
+        chartSlabsMap1.put("annualInterestRate", "5");
+        chartSlabsMap1.put("locale", LOCALE);
+        chartSlabs.add(0, chartSlabsMap1);
+
+        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
+        chartSlabsMap2.put("description", "Second");
+        chartSlabsMap2.put("periodType", MONTHS);
+        chartSlabsMap2.put("fromPeriod", "7");
+        chartSlabsMap2.put("toPeriod", "12");
+        chartSlabsMap2.put("annualInterestRate", "6");
+        chartSlabsMap2.put("locale", LOCALE);
+        chartSlabs.add(1, chartSlabsMap2);
+
+        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
+        chartSlabsMap3.put("description", "Third");
+        chartSlabsMap3.put("periodType", MONTHS);
+        chartSlabsMap3.put("fromPeriod", "13");
+        chartSlabsMap3.put("toPeriod", "18");
+        chartSlabsMap3.put("annualInterestRate", "7");
+        chartSlabsMap3.put("locale", LOCALE);
+        chartSlabs.add(2, chartSlabsMap3);
+
+        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
+        chartSlabsMap4.put("description", "Fourth");
+        chartSlabsMap4.put("periodType", MONTHS);
+        chartSlabsMap4.put("fromPeriod", "19");
+        chartSlabsMap4.put("toPeriod", "24");
+        chartSlabsMap4.put("annualInterestRate", "8");
+        chartSlabsMap4.put("locale", LOCALE);
+        chartSlabs.add(3, chartSlabsMap4);
+
+        List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
+        HashMap<String, Object> chartsMap = new HashMap<>();
+        chartsMap.put("fromDate", validFrom);
+        chartsMap.put("endDate", validTo);
+        chartsMap.put("dateFormat", "dd MMMM yyyy");
+        chartsMap.put("locale", LOCALE);
+        chartsMap.put("isActiveChart", this.isActiveChart);
+        chartsMap.put("chartSlabs", chartSlabs);
+        charts.add(chartsMap);
+
+        map.put("charts", charts);
         map.put("productId", productId);
         map.put("clientId", clientId);
         map.put("interestCalculationDaysInYearType", this.interestCalculationDaysInYearType);
@@ -183,8 +231,8 @@ public class RecurringDepositAccountHelper {
         return annualInterestRate;
     }
 
-    public static Float getPrincipalAfterCompoundingInterest(Calendar currentDate, Float principal, Float depositAmount,
-            Integer depositPeriod, double interestPerDay, Integer compoundingInterval, Integer postingInterval) {
+    public static Float getPrincipalAfterCompoundingInterest(Calendar currentDate, Float principal, Float depositAmount, Integer depositPeriod,
+            double interestPerDay, Integer compoundingInterval, Integer postingInterval) {
 
         Float totalInterest = 0.0f;
         Float interestEarned = 0.0f;
@@ -226,7 +274,7 @@ public class RecurringDepositAccountHelper {
         final String EXPECTED_FIRST_DEPOSIT_ON_ON_DATE = SUBMITTED_ON_DATE;
         final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
                 .withSubmittedOnDate(SUBMITTED_ON_DATE).withExpectedFirstDepositOnDate(EXPECTED_FIRST_DEPOSIT_ON_ON_DATE)
-                .build(clientID, productID, penalInterestType);
+                .build(clientID, productID, validFrom, validTo, penalInterestType);
 
         return Utils.performServerPut(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
                 + Utils.TENANT_IDENTIFIER, recurringDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
@@ -244,7 +292,7 @@ public class RecurringDepositAccountHelper {
                 .withInterestCompoundingPeriodType(interestCompoundingPeriodType) //
                 .withInterestPostingPeriodType(interestPostingPeriodType) //
                 .withExpectedFirstDepositOnDate(expectedFirstDepositOnDate) //
-                .build(clientID, productID, penalInterestType);
+                .build(clientID, productID, validFrom, validTo, penalInterestType);
 
         return Utils.performServerPut(this.requestSpec, this.responseSpec, RECURRING_DEPOSIT_ACCOUNT_URL + "/" + accountID + "?"
                 + Utils.TENANT_IDENTIFIER, recurringDepositApplicationJSON, CommonConstants.RESPONSE_CHANGES);
@@ -504,15 +552,5 @@ public class RecurringDepositAccountHelper {
         this.interestPostingPeriodType = interestPostingPeriodTypeId;
         return this;
     }
-    
-    public RecurringDepositAccountHelper withDepositPeriod(final String depositPeriod) {
-        this.depositPeriod = depositPeriod;
-        return this;
-    }
-
-    public RecurringDepositAccountHelper withMandatoryDepositAmount(final String depositAmount) {
-        this.mandatoryRecommendedDepositAmount = depositAmount;
-        return this;
-    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java
index 16dc1d2..71a92f8 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java
@@ -25,7 +25,6 @@ import java.util.Map;
 
 import org.apache.fineract.integrationtests.common.Utils;
 import org.apache.fineract.integrationtests.common.accounting.Account;
-import org.apache.fineract.integrationtests.common.fixeddeposit.FixedDepositProductHelper;
 
 import com.google.gson.Gson;
 import com.jayway.restassured.specification.RequestSpecification;
@@ -96,12 +95,47 @@ public class RecurringDepositProductHelper {
     private final String minDepositAmount = "100";
     private final String maxDepositAmount = "1000000";
     private Account[] accountList = null;
-    private List<HashMap<String, String>> chartSlabs = null;
-    private boolean isPrimaryGroupingByAmount = false;
 
     public String build(final String validFrom, final String validTo) {
         final HashMap<String, Object> map = new HashMap<>();
 
+        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
+        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
+        chartSlabsMap1.put("description", "First");
+        chartSlabsMap1.put("periodType", MONTHS);
+        chartSlabsMap1.put("fromPeriod", "1");
+        chartSlabsMap1.put("toPeriod", "6");
+        chartSlabsMap1.put("annualInterestRate", "5");
+        chartSlabsMap1.put("locale", LOCALE);
+        chartSlabs.add(0, chartSlabsMap1);
+
+        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
+        chartSlabsMap2.put("description", "Second");
+        chartSlabsMap2.put("periodType", MONTHS);
+        chartSlabsMap2.put("fromPeriod", "7");
+        chartSlabsMap2.put("toPeriod", "12");
+        chartSlabsMap2.put("annualInterestRate", "6");
+        chartSlabsMap2.put("locale", LOCALE);
+        chartSlabs.add(1, chartSlabsMap2);
+
+        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
+        chartSlabsMap3.put("description", "Third");
+        chartSlabsMap3.put("periodType", MONTHS);
+        chartSlabsMap3.put("fromPeriod", "13");
+        chartSlabsMap3.put("toPeriod", "18");
+        chartSlabsMap3.put("annualInterestRate", "7");
+        chartSlabsMap3.put("locale", LOCALE);
+        chartSlabs.add(2, chartSlabsMap3);
+
+        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
+        chartSlabsMap4.put("description", "Fourth");
+        chartSlabsMap4.put("periodType", MONTHS);
+        chartSlabsMap4.put("fromPeriod", "19");
+        chartSlabsMap4.put("toPeriod", "24");
+        chartSlabsMap4.put("annualInterestRate", "8");
+        chartSlabsMap4.put("locale", LOCALE);
+        chartSlabs.add(3, chartSlabsMap4);
+
         List<HashMap<String, Object>> charts = new ArrayList<HashMap<String, Object>>();
         HashMap<String, Object> chartsMap = new HashMap<>();
         chartsMap.put("fromDate", validFrom);
@@ -109,7 +143,6 @@ public class RecurringDepositProductHelper {
         chartsMap.put("dateFormat", "dd MMMM yyyy");
         chartsMap.put("locale", LOCALE);
         chartsMap.put("chartSlabs", chartSlabs);
-        chartsMap.put("isPrimaryGroupingByAmount", this.isPrimaryGroupingByAmount);
         charts.add(chartsMap);
 
         map.put("charts", charts);
@@ -165,26 +198,6 @@ public class RecurringDepositProductHelper {
         return this;
     }
 
-    public RecurringDepositProductHelper withPeriodRangeChart() {
-        this.chartSlabs = constructChartSlabWithPeriodRange();
-        return this;
-    }
-
-    public RecurringDepositProductHelper withPeriodAndAmountRangeChart() {
-        this.chartSlabs = constructChartSlabWithPeriodAndAmountRange();
-        return this;
-    }
-
-    public RecurringDepositProductHelper withAmountRangeChart() {
-        this.chartSlabs = constructChartSlabWithAmountRange();
-        return this;
-    }
-
-    public RecurringDepositProductHelper withAmountAndPeriodRangeChart() {
-        this.chartSlabs = constructChartSlabWithAmountAndPeriodRange();
-        return this;
-    }
-
     private Map<String, String> getAccountMappingForCashBased() {
         final Map<String, String> map = new HashMap<>();
         if (accountList != null) {
@@ -243,205 +256,4 @@ public class RecurringDepositProductHelper {
         return response;
     }
 
-    public List<HashMap<String, String>> constructChartSlabWithPeriodRange() {
-        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
-        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
-        chartSlabsMap1.put("description", "First");
-        chartSlabsMap1.put("periodType", MONTHS);
-        chartSlabsMap1.put("fromPeriod", "1");
-        chartSlabsMap1.put("toPeriod", "6");
-        chartSlabsMap1.put("annualInterestRate", "5");
-        chartSlabsMap1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1);
-
-        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
-        chartSlabsMap2.put("description", "Second");
-        chartSlabsMap2.put("periodType", MONTHS);
-        chartSlabsMap2.put("fromPeriod", "7");
-        chartSlabsMap2.put("toPeriod", "12");
-        chartSlabsMap2.put("annualInterestRate", "6");
-        chartSlabsMap2.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap2);
-
-        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
-        chartSlabsMap3.put("description", "Third");
-        chartSlabsMap3.put("periodType", MONTHS);
-        chartSlabsMap3.put("fromPeriod", "13");
-        chartSlabsMap3.put("toPeriod", "18");
-        chartSlabsMap3.put("annualInterestRate", "7");
-        chartSlabsMap3.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap3);
-
-        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
-        chartSlabsMap4.put("description", "Fourth");
-        chartSlabsMap4.put("periodType", MONTHS);
-        chartSlabsMap4.put("fromPeriod", "19");
-        chartSlabsMap4.put("annualInterestRate", "8");
-        chartSlabsMap4.put("locale", LOCALE);
-        chartSlabs.add(3, chartSlabsMap4);
-        return chartSlabs;
-    }
-
-    public List<HashMap<String, String>> constructChartSlabWithPeriodAndAmountRange() {
-        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
-        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
-        chartSlabsMap1.put("description", "First");
-        chartSlabsMap1.put("periodType", MONTHS);
-        chartSlabsMap1.put("fromPeriod", "1");
-        chartSlabsMap1.put("toPeriod", "6");
-        chartSlabsMap1.put("amountRangeFrom", "1");
-        chartSlabsMap1.put("amountRangeTo", "5000");
-        chartSlabsMap1.put("annualInterestRate", "5");
-        chartSlabsMap1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1);
-
-        HashMap<String, String> chartSlabsMap1_1 = new HashMap<>();
-        chartSlabsMap1_1.put("description", "First");
-        chartSlabsMap1_1.put("periodType", MONTHS);
-        chartSlabsMap1_1.put("fromPeriod", "1");
-        chartSlabsMap1_1.put("toPeriod", "6");
-        chartSlabsMap1_1.put("amountRangeFrom", "5001");
-        chartSlabsMap1_1.put("annualInterestRate", "6");
-        chartSlabsMap1_1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1_1);
-
-        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
-        chartSlabsMap2.put("description", "Second");
-        chartSlabsMap2.put("periodType", MONTHS);
-        chartSlabsMap2.put("fromPeriod", "7");
-        chartSlabsMap2.put("toPeriod", "12");
-        chartSlabsMap2.put("amountRangeFrom", "1");
-        chartSlabsMap2.put("amountRangeTo", "5000");
-        chartSlabsMap2.put("annualInterestRate", "6");
-        chartSlabsMap2.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap2);
-
-        HashMap<String, String> chartSlabsMap2_2 = new HashMap<>();
-        chartSlabsMap2_2.put("description", "Second");
-        chartSlabsMap2_2.put("periodType", MONTHS);
-        chartSlabsMap2_2.put("fromPeriod", "7");
-        chartSlabsMap2_2.put("toPeriod", "12");
-        chartSlabsMap2_2.put("amountRangeFrom", "5001");
-        chartSlabsMap2_2.put("annualInterestRate", "7");
-        chartSlabsMap2_2.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap2_2);
-
-        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
-        chartSlabsMap3.put("description", "Third");
-        chartSlabsMap3.put("periodType", MONTHS);
-        chartSlabsMap3.put("fromPeriod", "13");
-        chartSlabsMap3.put("toPeriod", "18");
-        chartSlabsMap3.put("amountRangeFrom", "1");
-        chartSlabsMap3.put("amountRangeTo", "5000");
-        chartSlabsMap3.put("annualInterestRate", "7");
-        chartSlabsMap3.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap3);
-
-        HashMap<String, String> chartSlabsMap3_1 = new HashMap<>();
-        chartSlabsMap3_1.put("description", "Third");
-        chartSlabsMap3_1.put("periodType", MONTHS);
-        chartSlabsMap3_1.put("fromPeriod", "13");
-        chartSlabsMap3_1.put("toPeriod", "18");
-        chartSlabsMap3_1.put("amountRangeFrom", "5001");
-        chartSlabsMap3_1.put("annualInterestRate", "8");
-        chartSlabsMap3_1.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap3_1);
-
-        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
-        chartSlabsMap4.put("description", "Fourth");
-        chartSlabsMap4.put("periodType", MONTHS);
-        chartSlabsMap4.put("fromPeriod", "19");
-        chartSlabsMap4.put("amountRangeFrom", "1");
-        chartSlabsMap4.put("amountRangeTo", "5000");
-        chartSlabsMap4.put("annualInterestRate", "8");
-        chartSlabsMap4.put("locale", LOCALE);
-        chartSlabs.add(3, chartSlabsMap4);
-
-        HashMap<String, String> chartSlabsMap4_1 = new HashMap<>();
-        chartSlabsMap4_1.put("description", "Fourth");
-        chartSlabsMap4_1.put("periodType", MONTHS);
-        chartSlabsMap4_1.put("fromPeriod", "19");
-        chartSlabsMap4_1.put("amountRangeFrom", "5001");
-        chartSlabsMap4_1.put("annualInterestRate", "9");
-        chartSlabsMap4_1.put("locale", LOCALE);
-        chartSlabs.add(3, chartSlabsMap4_1);
-
-        return chartSlabs;
-    }
-
-    public List<HashMap<String, String>> constructChartSlabWithAmountAndPeriodRange() {
-        this.isPrimaryGroupingByAmount = true;
-        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
-        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
-        chartSlabsMap1.put("description", "First");
-        chartSlabsMap1.put("periodType", MONTHS);
-        chartSlabsMap1.put("amountRangeFrom", "1");
-        chartSlabsMap1.put("amountRangeTo", "5000");
-        chartSlabsMap1.put("fromPeriod", "1");
-        chartSlabsMap1.put("toPeriod", "6");
-        chartSlabsMap1.put("annualInterestRate", "5");
-        chartSlabsMap1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1);
-
-        HashMap<String, String> chartSlabsMap2 = new HashMap<>();
-        chartSlabsMap2.put("description", "Second");
-        chartSlabsMap2.put("periodType", MONTHS);
-        chartSlabsMap2.put("fromPeriod", "7");
-        chartSlabsMap2.put("amountRangeFrom", "1");
-        chartSlabsMap2.put("amountRangeTo", "5000");
-        chartSlabsMap2.put("annualInterestRate", "6");
-        chartSlabsMap2.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap2);
-
-        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
-        chartSlabsMap3.put("description", "Third");
-        chartSlabsMap3.put("periodType", MONTHS);
-        chartSlabsMap3.put("fromPeriod", "1");
-        chartSlabsMap3.put("toPeriod", "6");
-        chartSlabsMap3.put("amountRangeFrom", "5001");
-        chartSlabsMap3.put("annualInterestRate", "7");
-        chartSlabsMap3.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap3);
-
-        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
-        chartSlabsMap4.put("description", "Fourth");
-        chartSlabsMap4.put("periodType", MONTHS);
-        chartSlabsMap4.put("fromPeriod", "7");
-        chartSlabsMap4.put("amountRangeFrom", "5001");
-        chartSlabsMap4.put("annualInterestRate", "8");
-        chartSlabsMap4.put("locale", LOCALE);
-        chartSlabs.add(3, chartSlabsMap4);
-
-        return chartSlabs;
-    }
-
-    public List<HashMap<String, String>> constructChartSlabWithAmountRange() {
-        this.isPrimaryGroupingByAmount = true;
-        List<HashMap<String, String>> chartSlabs = new ArrayList<HashMap<String, String>>();
-        HashMap<String, String> chartSlabsMap1 = new HashMap<>();
-        chartSlabsMap1.put("description", "First");
-        chartSlabsMap1.put("amountRangeFrom", "1");
-        chartSlabsMap1.put("amountRangeTo", "5000");
-        chartSlabsMap1.put("annualInterestRate", "5");
-        chartSlabsMap1.put("locale", LOCALE);
-        chartSlabs.add(0, chartSlabsMap1);
-
-        HashMap<String, String> chartSlabsMap3 = new HashMap<>();
-        chartSlabsMap3.put("description", "Third");
-        chartSlabsMap3.put("amountRangeFrom", "5001");
-        chartSlabsMap3.put("amountRangeTo", "10000");
-        chartSlabsMap3.put("annualInterestRate", "7");
-        chartSlabsMap3.put("locale", LOCALE);
-        chartSlabs.add(1, chartSlabsMap3);
-
-        HashMap<String, String> chartSlabsMap4 = new HashMap<>();
-        chartSlabsMap4.put("description", "Fourth");
-        chartSlabsMap4.put("amountRangeFrom", "10001");
-        chartSlabsMap4.put("annualInterestRate", "8");
-        chartSlabsMap4.put("locale", LOCALE);
-        chartSlabs.add(2, chartSlabsMap4);
-
-        return chartSlabs;
-    }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiConstant.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiConstant.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiConstant.java
index b1a12fe..93c3345 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiConstant.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/api/GlobalConfigurationApiConstant.java
@@ -26,13 +26,9 @@ public class GlobalConfigurationApiConstant {
 
     public static final String ENABLED = "enabled";
     public static final String VALUE = "value";
-    public static final String DATE_VALUE = "dateValue";
     public static final String ID = "id";
     public static final String CONFIGURATION_RESOURCE_NAME = "globalConfiguration";
-    public static final String localeParamName = "locale";
-    public static final String dateFormatParamName = "dateFormat";
 
-    public static final Set<String> UPDATE_CONFIGURATION_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName, dateFormatParamName, 
-            ENABLED, VALUE, DATE_VALUE));
+    public static final Set<String> UPDATE_CONFIGURATION_DATA_PARAMETERS = new HashSet<>(Arrays.asList(ENABLED, VALUE));
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationDataValidator.java
index 15376b5..9472832 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationDataValidator.java
@@ -22,7 +22,6 @@ import static org.apache.fineract.infrastructure.configuration.api.GlobalConfigu
 import static org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationApiConstant.ENABLED;
 import static org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationApiConstant.UPDATE_CONFIGURATION_DATA_PARAMETERS;
 import static org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationApiConstant.VALUE;
-import static org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationApiConstant.DATE_VALUE;
 
 import java.lang.reflect.Type;
 import java.util.ArrayList;
@@ -30,7 +29,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
-import org.joda.time.LocalDate;
 import org.apache.fineract.infrastructure.core.api.JsonCommand;
 import org.apache.fineract.infrastructure.core.data.ApiParameterError;
 import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
@@ -73,11 +71,6 @@ public class GlobalConfigurationDataValidator {
             final Long valueStr = this.fromApiJsonHelper.extractLongNamed(VALUE, element);
             baseDataValidator.reset().parameter(ENABLED).value(valueStr).zeroOrPositiveAmount();
         }
-        
-        if (this.fromApiJsonHelper.parameterExists(DATE_VALUE, element)) {
-            final LocalDate dateValue = this.fromApiJsonHelper.extractLocalDateNamed(DATE_VALUE, element);
-            baseDataValidator.reset().parameter(DATE_VALUE).value(dateValue).notNull();
-        }
 
         if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
 

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationPropertyData.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationPropertyData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationPropertyData.java
index 7b3a0ab..855c1c5 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationPropertyData.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/data/GlobalConfigurationPropertyData.java
@@ -17,7 +17,6 @@
  * under the License.
  */
 package org.apache.fineract.infrastructure.configuration.data;
-import java.util.Date;
 
 /**
  * Immutable data object for global configuration property.
@@ -31,31 +30,26 @@ public class GlobalConfigurationPropertyData {
     @SuppressWarnings("unused")
     private final Long value;
     @SuppressWarnings("unused")
-    private final Date dateValue;
-    @SuppressWarnings("unused")
     private final Long id;
     @SuppressWarnings("unused")
     private final String description;
     @SuppressWarnings("unused")
     private final boolean trapDoor;
 
-    public GlobalConfigurationPropertyData(final String name, final boolean enabled, final Long value, final Date dateValue, final String description, 
-            final boolean trapDoor) {
+    public GlobalConfigurationPropertyData(final String name, final boolean enabled, final Long value, final String description, final boolean trapDoor) {
         this.name = name;
         this.enabled = enabled;
         this.value = value;
-        this.dateValue = dateValue;
         this.id = null;
         this.description = description;
         this.trapDoor = trapDoor;
     }
 
-    public GlobalConfigurationPropertyData(final String name, final boolean enabled, final Long value, Date dateValue, final Long id,
+    public GlobalConfigurationPropertyData(final String name, final boolean enabled, final Long value, final Long id,
             final String description, final boolean isTrapDoor) {
         this.name = name;
         this.enabled = enabled;
         this.value = value;
-        this.dateValue = dateValue;
         this.id = id;
         this.description = description;
         this.trapDoor = isTrapDoor;

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java
index 3985fc5..087ce3d 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainService.java
@@ -18,7 +18,6 @@
  */
 package org.apache.fineract.infrastructure.configuration.domain;
 
-import java.util.Date;
 import org.apache.fineract.infrastructure.cache.domain.CacheType;
 
 public interface ConfigurationDomainService {
@@ -64,10 +63,4 @@ public interface ConfigurationDomainService {
     int getRoundingMode();
 
     boolean isBackdatePenaltiesEnabled();
-    
-    boolean isOrganisationstartDateEnabled();
-    
-    Date retrieveOrganisationStartDate();
-    
-    boolean isPaymnetypeApplicableforDisbursementCharge();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java
index 45906af..70e5494 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ConfigurationDomainServiceJpa.java
@@ -18,7 +18,6 @@
  */
 package org.apache.fineract.infrastructure.configuration.domain;
 
-import java.util.Date;
 import org.apache.commons.lang.StringUtils;
 import org.apache.fineract.infrastructure.cache.domain.CacheType;
 import org.apache.fineract.infrastructure.cache.domain.PlatformCache;
@@ -215,25 +214,4 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
         return property.isEnabled();
     }
 
-    @Override
-    public boolean isOrganisationstartDateEnabled() {
-        final String propertyName = "organisation-start-date";
-        final GlobalConfigurationProperty property = this.globalConfigurationRepository.findOneByNameWithNotFoundDetection(propertyName);
-        return property.isEnabled();
-    }
-
-    @Override
-    public Date retrieveOrganisationStartDate() {
-        final String propertyName = "organisation-start-date";
-        final GlobalConfigurationProperty property = this.globalConfigurationRepository.findOneByNameWithNotFoundDetection(propertyName);
-        return property.getDateValue();
-    }
-
-	@Override
-	public boolean isPaymnetypeApplicableforDisbursementCharge() {
-		final String propertyName = "paymenttype-applicable-for-disbursement-charges";
-        final GlobalConfigurationProperty property = this.globalConfigurationRepository.findOneByNameWithNotFoundDetection(propertyName);
-        return property.isEnabled();
-	}
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java
index 169d532..b29f1f8 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/GlobalConfigurationProperty.java
@@ -18,7 +18,6 @@
  */
 package org.apache.fineract.infrastructure.configuration.domain;
 
-import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -43,9 +42,6 @@ public class GlobalConfigurationProperty extends AbstractPersistable<Long> {
 
     @Column(name = "value", nullable = true)
     private Long value;
-    
-    @Column(name = "date_value", nullable = true)
-    private Date dateValue;
 
     @Column(name = "description", nullable = true)
     private final String description;
@@ -57,17 +53,15 @@ public class GlobalConfigurationProperty extends AbstractPersistable<Long> {
         this.name = null;
         this.enabled = false;
         this.value = null;
-        this.dateValue = null;
         this.description = null;
         this.isTrapDoor = false;
     }
 
-    public GlobalConfigurationProperty(final String name, final boolean enabled, final Long value, final Date dateValue ,final String description,
+    public GlobalConfigurationProperty(final String name, final boolean enabled, final Long value, final String description,
             final boolean isTrapDoor) {
         this.name = name;
         this.enabled = enabled;
         this.value = value;
-        this.dateValue = dateValue;
         this.description = description;
         this.isTrapDoor = isTrapDoor;
     }
@@ -79,10 +73,6 @@ public class GlobalConfigurationProperty extends AbstractPersistable<Long> {
     public Long getValue() {
         return this.value;
     }
-    
-    public Date getDateValue(){
-        return this.dateValue;
-    }
 
     public boolean updateTo(final boolean value) {
         final boolean updated = this.enabled != value;
@@ -110,13 +100,6 @@ public class GlobalConfigurationProperty extends AbstractPersistable<Long> {
             actualChanges.put(valueParamName, newValue);
             this.value = newValue;
         }
-        
-        final String dateValueParamName = "dateValue";
-        if(command.isChangeInDateParameterNamed(dateValueParamName, this.dateValue)){
-            final Date newDateValue = command.DateValueOfParameterNamed(dateValueParamName);
-            actualChanges.put(dateValueParamName, newDateValue);
-            this.dateValue = newDateValue;
-        }
 
         final String passwordPropertyName = "force-password-reset-days";
         if (this.name.equalsIgnoreCase(passwordPropertyName)) {
@@ -129,7 +112,7 @@ public class GlobalConfigurationProperty extends AbstractPersistable<Long> {
     }
 
     public static GlobalConfigurationProperty newSurveyConfiguration(final String name) {
-        return new GlobalConfigurationProperty(name, false, null, null, null, false);
+        return new GlobalConfigurationProperty(name, false, null, null, false);
     }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ConfigurationReadPlatformServiceImpl.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ConfigurationReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ConfigurationReadPlatformServiceImpl.java
index 80c7047..d5c51f9 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ConfigurationReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ConfigurationReadPlatformServiceImpl.java
@@ -30,7 +30,6 @@ import org.springframework.stereotype.Service;
 
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.Date;
 import java.util.List;
 
 @Service
@@ -53,7 +52,7 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
 
         this.context.authenticatedUser();
 
-        String sql = "SELECT c.id, c.name, c.enabled, c.value, c.date_value, c.description, c.is_trap_door FROM c_configuration c ";
+        String sql = "SELECT c.id, c.name, c.enabled, c.value, c.description, c.is_trap_door FROM c_configuration c ";
 
         if (survey) {
             sql += " JOIN x_registered_table on x_registered_table.registered_table_name = c.name ";
@@ -72,7 +71,7 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
 
         this.context.authenticatedUser();
 
-        final String sql = "SELECT c.id, c.name, c.enabled, c.value, c.date_value, c.description, c.is_trap_door FROM "
+        final String sql = "SELECT c.id, c.name, c.enabled, c.value, c.description, c.is_trap_door FROM "
                 + "c_configuration c where c.id=? order by c.id";
         final GlobalConfigurationPropertyData globalConfiguration = this.jdbcTemplate.queryForObject(sql, this.rm,
                 new Object[] { configId });
@@ -89,11 +88,10 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
             final String name = rs.getString("name");
             final boolean enabled = rs.getBoolean("enabled");
             final Long value = rs.getLong("value");
-            final Date dateValue = rs.getDate("date_value");
             final String description = rs.getString("description");
             final Long id = rs.getLong("id");
             final boolean isTrapDoor = rs.getBoolean("is_trap_door");
-            return new GlobalConfigurationPropertyData(name, enabled, value, dateValue, id, description, isTrapDoor);
+            return new GlobalConfigurationPropertyData(name, enabled, value, id, description, isTrapDoor);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarHistoryDataWrapper.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarHistoryDataWrapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarHistoryDataWrapper.java
deleted file mode 100644
index 6e8e678..0000000
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarHistoryDataWrapper.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * 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.calendar.data;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.fineract.portfolio.calendar.domain.CalendarHistory;
-import org.joda.time.LocalDate;
-
-
-public class CalendarHistoryDataWrapper {
-    
-    private final List<CalendarHistory> calendarHistoryList;
-    
-    public CalendarHistoryDataWrapper(final Set<CalendarHistory> calendarHistoryList){
-        this.calendarHistoryList = new ArrayList<>();       
-        this.calendarHistoryList.addAll(calendarHistoryList);
-        final Comparator<CalendarHistory> orderByDate = new Comparator<CalendarHistory>() {
-            @Override
-            public int compare(CalendarHistory calendarHistory1, CalendarHistory calendarHistory2) {
-                return calendarHistory1.getEndDateLocalDate().compareTo(calendarHistory2.getEndDateLocalDate());
-            }
-        };
-        Collections.sort(this.calendarHistoryList, orderByDate);
-    }
-    
-    public CalendarHistory getCalendarHistory(final LocalDate dueRepaymentPeriodDate) {
-        CalendarHistory calendarHistory = null;
-        for (CalendarHistory history : this.calendarHistoryList) {
-            if (history.getEndDateLocalDate().isAfter(dueRepaymentPeriodDate)) {
-                calendarHistory = history;
-               break;
-            }
-        }
-        return calendarHistory;
-    }
-        
-    public List<CalendarHistory> getCalendarHistoryList(){
-        return this.calendarHistoryList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java
index 52d072d..103b96f 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java
@@ -95,7 +95,7 @@ public class Calendar extends AbstractAuditableCustom<AppUser, Long> {
 
     @OneToMany(fetch = FetchType.EAGER)
     @JoinColumn(name = "calendar_id")
-    private Set<CalendarHistory> calendarHistory = new HashSet<>();
+    private final Set<CalendarHistory> calendarHistory = new HashSet<>();
 
     protected Calendar() {
 
@@ -142,12 +142,7 @@ public class Calendar extends AbstractAuditableCustom<AppUser, Long> {
 
     public static Calendar createRepeatingCalendar(final String title, final LocalDate startDate, final Integer typeId,
             final CalendarFrequencyType frequencyType, final Integer interval, final Integer repeatsOnDay) {
-        final String recurrence = constructRecurrence(frequencyType, interval, repeatsOnDay);
-        return createRepeatingCalendar(title, startDate, typeId, recurrence);
-    }
 
-    public static Calendar createRepeatingCalendar(final String title, final LocalDate startDate, final Integer typeId,
-            final String recurrence) {
         final String description = null;
         final String location = null;
         final LocalDate endDate = null;
@@ -156,6 +151,8 @@ public class Calendar extends AbstractAuditableCustom<AppUser, Long> {
         final Integer remindById = null;
         final Integer firstReminder = null;
         final Integer secondReminder = null;
+        final String recurrence = constructRecurrence(frequencyType, interval, repeatsOnDay);
+
         return new Calendar(title, description, location, startDate, endDate, duration, typeId, repeating, recurrence, remindById,
                 firstReminder, secondReminder);
     }
@@ -236,7 +233,7 @@ public class Calendar extends AbstractAuditableCustom<AppUser, Long> {
 
     }
 
-    public Map<String, Object> update(final JsonCommand command, final Boolean areActiveEntitiesSynced) {
+    public Map<String, Object> update(final JsonCommand command, final Boolean areActiveEntitiesSynced ) {
 
         final Map<String, Object> actualChanges = new LinkedHashMap<>(9);
 
@@ -348,7 +345,7 @@ public class Calendar extends AbstractAuditableCustom<AppUser, Long> {
              * calendar then do not allow to change meeting frequency
              */
 
-            if (areActiveEntitiesSynced && !CalendarUtils.isFrequencySame(this.recurrence, newRecurrence)) {
+            if ( areActiveEntitiesSynced && !CalendarUtils.isFrequencySame(this.recurrence, newRecurrence)) {
                 final String defaultUserMessage = "Update of meeting frequency is not supported";
                 throw new CalendarParameterUpdateNotSupportedException("meeting.frequency", defaultUserMessage);
             }
@@ -584,12 +581,4 @@ public class Calendar extends AbstractAuditableCustom<AppUser, Long> {
         this.startDate = startDate.toDate();
         this.endDate = endDate.toDate();
     }
-    
-    public Set<CalendarHistory> getCalendarHistory(){
-    	return this.calendarHistory;
-    }
-    
-    public void updateCalendarHistory(final Set<CalendarHistory> calendarHistory){
-    	this.calendarHistory = calendarHistory;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java
index 438c687..7e59642 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java
@@ -24,7 +24,6 @@ import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
 import org.apache.fineract.infrastructure.core.api.JsonCommand;
@@ -240,6 +239,7 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr
         if (calendarForUpdate == null) { throw new CalendarNotFoundException(calendarId); }
         
         final Date oldStartDate = calendarForUpdate.getStartDate();
+        final LocalDate currentDate = DateUtils.getLocalDateOfTenant();
         // create calendar history before updating calendar
         final CalendarHistory calendarHistory = new CalendarHistory(calendarForUpdate, oldStartDate);
 
@@ -288,12 +288,12 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr
         if (!changes.isEmpty()) {
             // update calendar history table only if there is a change in
             // calendar start date.
-            final Date endDate = presentMeetingDate.minusDays(1).toDate();
-            calendarHistory.updateEndDate(endDate);
-            this.calendarHistoryRepository.save(calendarHistory);
-            Set<CalendarHistory> history = calendarForUpdate.getCalendarHistory();
-            history.add(calendarHistory);
-            calendarForUpdate.updateCalendarHistory(history);
+            if (currentDate.isAfter(new LocalDate(oldStartDate))) {
+                final Date endDate = calendarForUpdate.getStartDateLocalDate().minusDays(1).toDate();
+                calendarHistory.updateEndDate(endDate);
+                this.calendarHistoryRepository.save(calendarHistory);
+            }
+
             this.calendarRepository.saveAndFlush(calendarForUpdate);
 
             if (this.configurationDomainService.isRescheduleFutureRepaymentsEnabled() && calendarForUpdate.isRepeating()) {

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/InterestRateChartApiConstants.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/InterestRateChartApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/InterestRateChartApiConstants.java
index 20f760b..7bce4ee 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/InterestRateChartApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/InterestRateChartApiConstants.java
@@ -44,7 +44,6 @@ public class InterestRateChartApiConstants {
     public static final String endDateParamName = "endDate";
     public static final String productIdParamName = "productId";
     public static final String productNameParamName = "productName";
-    public static final String isPrimaryGroupingByAmountParamName = "isPrimaryGroupingByAmount";
 
     // interest rate chart Slabs parameters
 //    public static final String periodTypeParamName = "periodType";
@@ -64,14 +63,13 @@ public class InterestRateChartApiConstants {
     public static final String deleteParamName = "delete";
 
     public static final Set<String> INTERESTRATE_CHART_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
-            dateFormatParamName, nameParamName, descriptionParamName, fromDateParamName, endDateParamName, productIdParamName, chartSlabs,
-            isPrimaryGroupingByAmountParamName));
+            dateFormatParamName, nameParamName, descriptionParamName, fromDateParamName, endDateParamName, productIdParamName,
+            chartSlabs));
 
     public static final Set<String> INTERESTRATE_CHART_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
             dateFormatParamName, idParamName, nameParamName, descriptionParamName, fromDateParamName, endDateParamName, chartSlabs,
-            deleteParamName, isPrimaryGroupingByAmountParamName));
+            deleteParamName));
 
     public static final Set<String> INTERESTRATE_CHART_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
-            dateFormatParamName, idParamName, nameParamName, descriptionParamName, fromDateParamName, endDateParamName, chartSlabs,
-            isPrimaryGroupingByAmountParamName));
+            dateFormatParamName, idParamName, nameParamName, descriptionParamName, fromDateParamName, endDateParamName, chartSlabs));
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartData.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartData.java
index 1b31287..f7aef96 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartData.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartData.java
@@ -18,8 +18,9 @@
  */
 package org.apache.fineract.portfolio.interestratechart.data;
 
-import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
 
 import org.apache.fineract.infrastructure.codes.data.CodeValueData;
 import org.apache.fineract.infrastructure.core.data.EnumOptionData;
@@ -37,10 +38,9 @@ public class InterestRateChartData {
     private final LocalDate endDate;
     private final Long productId;
     private final String productName;
-    private final boolean isPrimaryGroupingByAmount;
 
     // associations
-    private Collection<InterestRateChartSlabData> chartSlabs;
+    private Set<InterestRateChartSlabData> chartSlabs;
 
     // template
     private final Collection<EnumOptionData> periodTypes;
@@ -53,9 +53,9 @@ public class InterestRateChartData {
     private final Collection<CodeValueData> clientClassificationOptions;
 
     public static InterestRateChartData instance(Long id, String name, String description, LocalDate fromDate, LocalDate endDate,
-            boolean isPrimaryGroupingByAmount, Long savingsProductId, String savingsProductName) {
+            Long savingsProductId, String savingsProductName) {
         Collection<EnumOptionData> periodTypes = null;
-        Collection<InterestRateChartSlabData> chartSlabs = null;
+        Set<InterestRateChartSlabData> chartSlabs = null;
         final Collection<EnumOptionData> entityTypeOptions = null;
         final Collection<EnumOptionData> attributeNameOptions = null;
         final Collection<EnumOptionData> conditionTypeOptions = null;
@@ -63,18 +63,17 @@ public class InterestRateChartData {
         final Collection<CodeValueData> genderOptions = null;
         final Collection<CodeValueData> clientTypeOptions = null;
         final Collection<CodeValueData> clientClassificationOptions = null;
-        return new InterestRateChartData(id, name, description, fromDate, endDate, isPrimaryGroupingByAmount, savingsProductId,
-                savingsProductName, chartSlabs, periodTypes, entityTypeOptions, attributeNameOptions, conditionTypeOptions,
-                incentiveTypeOptions, genderOptions, clientTypeOptions, clientClassificationOptions);
+        return new InterestRateChartData(id, name, description, fromDate, endDate, savingsProductId, savingsProductName, chartSlabs,
+                periodTypes, entityTypeOptions, attributeNameOptions, conditionTypeOptions, incentiveTypeOptions, genderOptions,
+                clientTypeOptions, clientClassificationOptions);
     }
 
-    public static InterestRateChartData withSlabs(InterestRateChartData interestRateChartData, Collection<InterestRateChartSlabData> chartSlabs) {
+    public static InterestRateChartData withSlabs(InterestRateChartData interestRateChartData, Set<InterestRateChartSlabData> chartSlabs) {
         return new InterestRateChartData(interestRateChartData.id, interestRateChartData.name, interestRateChartData.description,
-                interestRateChartData.fromDate, interestRateChartData.endDate, interestRateChartData.isPrimaryGroupingByAmount,
-                interestRateChartData.productId, interestRateChartData.productName, chartSlabs, interestRateChartData.periodTypes,
-                interestRateChartData.entityTypeOptions, interestRateChartData.attributeNameOptions,
-                interestRateChartData.conditionTypeOptions, interestRateChartData.incentiveTypeOptions,
-                interestRateChartData.genderOptions, interestRateChartData.clientTypeOptions,
+                interestRateChartData.fromDate, interestRateChartData.endDate, interestRateChartData.productId,
+                interestRateChartData.productName, chartSlabs, interestRateChartData.periodTypes, interestRateChartData.entityTypeOptions,
+                interestRateChartData.attributeNameOptions, interestRateChartData.conditionTypeOptions,
+                interestRateChartData.incentiveTypeOptions, interestRateChartData.genderOptions, interestRateChartData.clientTypeOptions,
                 interestRateChartData.clientClassificationOptions);
     }
 
@@ -84,10 +83,9 @@ public class InterestRateChartData {
             final Collection<CodeValueData> genderOptions, final Collection<CodeValueData> clientTypeOptions,
             final Collection<CodeValueData> clientClassificationOptions) {
         return new InterestRateChartData(interestRateChartData.id, interestRateChartData.name, interestRateChartData.description,
-                interestRateChartData.fromDate, interestRateChartData.endDate, interestRateChartData.isPrimaryGroupingByAmount,
-                interestRateChartData.productId, interestRateChartData.productName, interestRateChartData.chartSlabs, periodTypes,
-                entityTypeOptions, attributeNameOptions, conditionTypeOptions, incentiveTypeOptions, genderOptions, clientTypeOptions,
-                clientClassificationOptions);
+                interestRateChartData.fromDate, interestRateChartData.endDate, interestRateChartData.productId,
+                interestRateChartData.productName, interestRateChartData.chartSlabs, periodTypes, entityTypeOptions, attributeNameOptions,
+                conditionTypeOptions, incentiveTypeOptions, genderOptions, clientTypeOptions, clientClassificationOptions);
     }
 
     public static InterestRateChartData template(Collection<EnumOptionData> periodTypes,
@@ -100,28 +98,26 @@ public class InterestRateChartData {
         final String description = null;
         final LocalDate fromDate = null;
         final LocalDate endDate = null;
-        final boolean isPrimaryGroupingByAmount = false;
         final Long savingsProductId = null;
         final String savingsProductName = null;
-        final Collection<InterestRateChartSlabData> chartSlabs = null;
+        final Set<InterestRateChartSlabData> chartSlabs = null;
 
-        return new InterestRateChartData(id, name, description, fromDate, endDate, isPrimaryGroupingByAmount, savingsProductId,
-                savingsProductName, chartSlabs, periodTypes, entityTypeOptions, attributeNameOptions, conditionTypeOptions,
-                incentiveTypeOptions, genderOptions, clientTypeOptions, clientClassificationOptions);
+        return new InterestRateChartData(id, name, description, fromDate, endDate, savingsProductId, savingsProductName, chartSlabs,
+                periodTypes, entityTypeOptions, attributeNameOptions, conditionTypeOptions, incentiveTypeOptions, genderOptions,
+                clientTypeOptions, clientClassificationOptions);
     }
 
-    private InterestRateChartData(Long id, String name, String description, LocalDate fromDate, LocalDate endDate,
-            boolean isPrimaryGroupingByAmount, Long savingsProductId, String savingsProductName, Collection<InterestRateChartSlabData> chartSlabs,
-            Collection<EnumOptionData> periodTypes, final Collection<EnumOptionData> entityTypeOptions,
-            final Collection<EnumOptionData> attributeNameOptions, final Collection<EnumOptionData> conditionTypeOptions,
-            final Collection<EnumOptionData> incentiveTypeOptions, final Collection<CodeValueData> genderOptions,
-            final Collection<CodeValueData> clientTypeOptions, final Collection<CodeValueData> clientClassificationOptions) {
+    private InterestRateChartData(Long id, String name, String description, LocalDate fromDate, LocalDate endDate, Long savingsProductId,
+            String savingsProductName, Set<InterestRateChartSlabData> chartSlabs, Collection<EnumOptionData> periodTypes,
+            final Collection<EnumOptionData> entityTypeOptions, final Collection<EnumOptionData> attributeNameOptions,
+            final Collection<EnumOptionData> conditionTypeOptions, final Collection<EnumOptionData> incentiveTypeOptions,
+            final Collection<CodeValueData> genderOptions, final Collection<CodeValueData> clientTypeOptions,
+            final Collection<CodeValueData> clientClassificationOptions) {
         this.id = id;
         this.name = name;
         this.description = description;
         this.fromDate = fromDate;
         this.endDate = endDate;
-        this.isPrimaryGroupingByAmount = isPrimaryGroupingByAmount;
         this.chartSlabs = chartSlabs;
         this.productId = savingsProductId;
         this.productName = savingsProductName;
@@ -137,7 +133,7 @@ public class InterestRateChartData {
 
     public void addChartSlab(final InterestRateChartSlabData chartSlab) {
         if (this.chartSlabs == null) {
-            this.chartSlabs = new ArrayList<>();
+            this.chartSlabs = new HashSet<>();
         }
 
         this.chartSlabs.add(chartSlab);
@@ -163,7 +159,7 @@ public class InterestRateChartData {
         return this.description;
     }
 
-    public Collection<InterestRateChartSlabData> chartSlabs() {
+    public Set<InterestRateChartSlabData> chartSlabs() {
         return this.chartSlabs;
     }
 
@@ -199,9 +195,4 @@ public class InterestRateChartData {
         return this.clientClassificationOptions;
     }
 
-    
-    public boolean isPrimaryGroupingByAmount() {
-        return this.isPrimaryGroupingByAmount;
-    }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/5ed50615/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartDataValidator.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartDataValidator.java
index a325175..04c4d22 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartDataValidator.java
@@ -26,7 +26,6 @@ import static org.apache.fineract.portfolio.interestratechart.InterestRateChartA
 import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.endDateParamName;
 import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.fromDateParamName;
 import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.idParamName;
-import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.isPrimaryGroupingByAmountParamName;
 import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.nameParamName;
 import static org.apache.fineract.portfolio.interestratechart.InterestRateChartApiConstants.productIdParamName;
 
@@ -99,11 +98,6 @@ public class InterestRateChartDataValidator {
             toDate = this.fromApiJsonHelper.extractLocalDateNamed(endDateParamName, element);
             baseDataValidator.reset().parameter(endDateParamName).value(toDate).notNull();
         }
-        
-        Boolean isPrimaryGroupingByAmount = this.fromApiJsonHelper.extractBooleanNamed(isPrimaryGroupingByAmountParamName, element);
-        if (isPrimaryGroupingByAmount == null) {
-            isPrimaryGroupingByAmount = false;
-        }
 
         if (fromDate != null && toDate != null) {
             if (fromDate.isAfter(toDate)) {
@@ -112,7 +106,7 @@ public class InterestRateChartDataValidator {
         }
 
         // validate chart Slabs
-        validateChartSlabs(element, baseDataValidator, isPrimaryGroupingByAmount);
+        validateChartSlabs(element, baseDataValidator);
     }
 
     public void validateUpdate(final String json) {
@@ -157,11 +151,6 @@ public class InterestRateChartDataValidator {
             toDate = this.fromApiJsonHelper.extractLocalDateNamed(endDateParamName, element);
             baseDataValidator.reset().parameter(endDateParamName).value(toDate).notNull();
         }
-        
-        Boolean isPrimaryGroupingByAmount = this.fromApiJsonHelper.extractBooleanNamed(isPrimaryGroupingByAmountParamName, element);
-        if (isPrimaryGroupingByAmount == null) {
-            isPrimaryGroupingByAmount = false;
-        }
 
         if (fromDate != null && toDate != null) {
             if (fromDate.isAfter(toDate)) {
@@ -169,7 +158,7 @@ public class InterestRateChartDataValidator {
             }
         }
 
-        validateChartSlabs(element, baseDataValidator, isPrimaryGroupingByAmount);
+        validateChartSlabs(element, baseDataValidator);
 
     }
 
@@ -177,7 +166,7 @@ public class InterestRateChartDataValidator {
         if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
     }
 
-    private void validateChartSlabs(JsonElement element, DataValidatorBuilder baseDataValidator,final boolean isPrimaryGroupingByAmount) {
+    private void validateChartSlabs(JsonElement element, DataValidatorBuilder baseDataValidator) {
 
         if (element.isJsonObject()) {
             final JsonObject topLevelJsonElement = element.getAsJsonObject();
@@ -189,9 +178,9 @@ public class InterestRateChartDataValidator {
                     if (this.fromApiJsonHelper.parameterExists(idParamName, interstRateChartElement)) {
                         final Long id = this.fromApiJsonHelper.extractLongNamed(idParamName, interstRateChartElement);
                         baseDataValidator.reset().parameter(idParamName).value(id).notNull().integerGreaterThanZero();
-                        this.chartSlabDataValidator.validateChartSlabsUpdate(interstRateChartElement, baseDataValidator, locale, isPrimaryGroupingByAmount);
+                        this.chartSlabDataValidator.validateChartSlabsUpdate(interstRateChartElement, baseDataValidator, locale);
                     } else {
-                        this.chartSlabDataValidator.validateChartSlabsCreate(interstRateChartElement, baseDataValidator, locale, isPrimaryGroupingByAmount);
+                        this.chartSlabDataValidator.validateChartSlabsCreate(interstRateChartElement, baseDataValidator, locale);
                     }
                 }
             }



Mime
View raw message