diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/AccountingScenarioIntegrationTest.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/AccountingScenarioIntegrationTest.java index 9fc0dfc58..a7a006115 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/AccountingScenarioIntegrationTest.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/AccountingScenarioIntegrationTest.java @@ -452,7 +452,7 @@ public class AccountingScenarioIntegrationTest { RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap); HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Float depositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId, depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE); Assert.assertNotNull(depositTransactionId); diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/RecurringDepositTest.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/RecurringDepositTest.java index ef1f369f7..2fd36553d 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/RecurringDepositTest.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/RecurringDepositTest.java @@ -681,7 +681,7 @@ public class RecurringDepositTest { HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Float depositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); @@ -761,7 +761,7 @@ public class RecurringDepositTest { HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Float depositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); @@ -938,7 +938,7 @@ public class RecurringDepositTest { HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Float depositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Float preClosurePenalInterestRate = (Float) recurringDepositAccountData.get("preClosurePenalInterest"); @@ -1064,7 +1064,7 @@ public class RecurringDepositTest { HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Float depositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Float preClosurePenalInterestRate = (Float) recurringDepositAccountData.get("preClosurePenalInterest"); @@ -1185,7 +1185,7 @@ public class RecurringDepositTest { HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Float depositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Float preClosurePenalInterestRate = (Float) recurringDepositAccountData.get("preClosurePenalInterest"); Integer daysInYear = (Integer) daysInYearMap.get("id"); @@ -1319,7 +1319,7 @@ public class RecurringDepositTest { HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec, recurringDepositAccountId); - Float depositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Float preClosurePenalInterestRate = (Float) recurringDepositAccountData.get("preClosurePenalInterest"); Integer daysInYear = (Integer) daysInYearMap.get("id"); @@ -1444,7 +1444,7 @@ public class RecurringDepositTest { this.responseSpec, recurringDepositAccountId); HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); Float principal = (Float) recurringDepositSummary.get("accountBalance"); - Float recurringDepositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float recurringDepositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); @@ -1524,7 +1524,7 @@ public class RecurringDepositTest { this.responseSpec, recurringDepositAccountId); HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); Float principal = (Float) recurringDepositSummary.get("accountBalance"); - Float recurringDepositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float recurringDepositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); @@ -1611,7 +1611,7 @@ public class RecurringDepositTest { this.responseSpec, recurringDepositAccountId); HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); Float principal = (Float) recurringDepositSummary.get("accountBalance"); - Float recurringDepositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float recurringDepositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Integer daysInYear = (Integer) daysInYearMap.get("id"); @@ -1697,7 +1697,7 @@ public class RecurringDepositTest { this.responseSpec, recurringDepositAccountId); HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); Float principal = (Float) recurringDepositSummary.get("accountBalance"); - Float recurringDepositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float recurringDepositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Integer daysInYear = (Integer) daysInYearMap.get("id"); @@ -1783,7 +1783,7 @@ public class RecurringDepositTest { HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); Float principal = (Float) recurringDepositSummary.get("accountBalance"); - Float recurringDepositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float recurringDepositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Integer daysInYear = (Integer) daysInYearMap.get("id"); @@ -1869,7 +1869,7 @@ public class RecurringDepositTest { HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); Float principal = (Float) recurringDepositSummary.get("accountBalance"); - Float recurringDepositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float recurringDepositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Integer daysInYear = (Integer) daysInYearMap.get("id"); @@ -1955,7 +1955,7 @@ public class RecurringDepositTest { this.responseSpec, recurringDepositAccountId); HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); Float principal = (Float) recurringDepositSummary.get("accountBalance"); - Float recurringDepositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float recurringDepositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Integer daysInYear = (Integer) daysInYearMap.get("id"); @@ -2041,7 +2041,7 @@ public class RecurringDepositTest { this.responseSpec, recurringDepositAccountId); HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId); Float principal = (Float) recurringDepositSummary.get("accountBalance"); - Float recurringDepositAmount = (Float) recurringDepositAccountData.get("recurringDepositAmount"); + Float recurringDepositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount"); Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod"); HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType"); Integer daysInYear = (Integer) daysInYearMap.get("id"); diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java index cc93b4129..cf6130dab 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositAccountHelper.java @@ -58,7 +58,7 @@ public class FixedDepositAccountHelper { private String interestCompoundingPeriodType = MONTHLY; private String interestPostingPeriodType = MONTHLY; private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE; - private String lockinPeriodFrequency = "6"; + private String lockinPeriodFrequency = "1"; private String lockingPeriodFrequencyType = MONTHS; private final String minDepositTerm = "6"; private final String minDepositTermTypeId = MONTHS; diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java index 1492e5abd..c3ce46307 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/fixeddeposit/FixedDepositProductHelper.java @@ -64,7 +64,7 @@ public class FixedDepositProductHelper { private String interestPostingPeriodType = MONTHLY; private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE; private String accountingRule = NONE; - private String lockinPeriodFrequency = "6"; + private String lockinPeriodFrequency = "1"; private String lockingPeriodFrequencyType = MONTHS; private String minDepositTerm = "6"; private String minDepositTermTypeId = MONTHS; diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java index 7e5ad8841..e9b896992 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/recurringdeposit/RecurringDepositAccountHelper.java @@ -66,7 +66,7 @@ public class RecurringDepositAccountHelper { private String interestCompoundingPeriodType = MONTHLY; private String interestPostingPeriodType = MONTHLY; private String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE; - private final String lockinPeriodFrequency = "6"; + private final String lockinPeriodFrequency = "1"; private final String lockingPeriodFrequencyType = MONTHS; private final String minDepositTerm = "6"; private final String minDepositTermTypeId = MONTHS; @@ -82,11 +82,12 @@ public class RecurringDepositAccountHelper { private final String depositAmount = "2000"; private final String depositPeriod = "14"; private final String depositPeriodFrequencyId = MONTHS; - private final String recurringDepositFrequency = "1"; - private final String recurringDepositFrequencyTypeId = MONTHS; - private final String recurringDepositAmount = "2000"; + private final String recurringFrequency = "1"; + private final String recurringFrequencyType = MONTHS; + 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 validFrom, final String validTo, final String penalInterestType) { @@ -165,10 +166,11 @@ public class RecurringDepositAccountHelper { map.put("depositPeriod", this.depositPeriod); map.put("depositPeriodFrequencyId", this.depositPeriodFrequencyId); map.put("submittedOnDate", this.submittedOnDate); - map.put("recurringDepositFrequency", this.recurringDepositFrequency); - map.put("recurringDepositFrequencyTypeId", this.recurringDepositFrequencyTypeId); - map.put("recurringDepositAmount", this.recurringDepositAmount); + map.put("recurringFrequency", this.recurringFrequency); + map.put("recurringFrequencyType", this.recurringFrequencyType); + map.put("mandatoryRecommendedDepositAmount", this.mandatoryRecommendedDepositAmount); map.put("expectedFirstDepositOnDate", this.expectedFirstDepositOnDate); + map.put("isCalendarInherited", this.isCalendarInherited); String recurringDepositAccountJson = new Gson().toJson(map); System.out.println(recurringDepositAccountJson); diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java index e17859932..0dae6feb4 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/recurringdeposit/RecurringDepositProductHelper.java @@ -49,8 +49,6 @@ public class RecurringDepositProductHelper { private static final String ACCRUAL_UPFRONT = "4"; private static final String WHOLE_TERM = "1"; private static final String TILL_PREMATURE_WITHDRAWAL = "2"; - private static final String VOLUNTARY = "1"; - private static final String MANDATORY = "2"; private final String name = Utils.randomNameGenerator("RECURRING_DEPOSIT_PRODUCT_", 6); private final String shortName = Utils.randomNameGenerator("", 4); @@ -59,7 +57,7 @@ public class RecurringDepositProductHelper { private final String interestPostingPeriodType = MONTHLY; private final String interestCalculationType = INTEREST_CALCULATION_USING_DAILY_BALANCE; private String accountingRule = NONE; - private final String lockinPeriodFrequency = "6"; + private final String lockinPeriodFrequency = "1"; private final String lockingPeriodFrequencyType = MONTHS; private final String minDepositTerm = "6"; private final String minDepositTermTypeId = MONTHS; @@ -72,9 +70,9 @@ public class RecurringDepositProductHelper { private final boolean preClosurePenalApplicable = true; private final String currencyCode = USD; private final String interestCalculationDaysInYearType = DAYS_365; - private final String recurringDepositTypeId = VOLUNTARY; - private final String recurringDepositFrequencyTypeId = MONTHS; - private final String recurringDepositFrequency = "1"; + private final boolean isMandatoryDeposit = false; + private final String recurringFrequencyType = MONTHS; + private final String recurringFrequency = "1"; private final String depositAmount = "100000"; private final String minDepositAmount = "100"; private final String maxDepositAmount = "1000000"; @@ -154,10 +152,10 @@ public class RecurringDepositProductHelper { map.put("inMultiplesOfDepositTermTypeId", this.inMultiplesOfDepositTermTypeId); map.put("preClosurePenalInterest", this.preClosurePenalInterest); map.put("preClosurePenalInterestOnTypeId", this.preClosurePenalInterestOnTypeId); - map.put("recurringDepositTypeId", this.recurringDepositTypeId); - map.put("recurringDepositFrequencyTypeId", this.recurringDepositFrequencyTypeId); + map.put("isMandatoryDeposit", this.isMandatoryDeposit); + map.put("recurringFrequencyType", this.recurringFrequencyType); map.put("depositAmount", this.depositAmount); - map.put("recurringDepositFrequency", this.recurringDepositFrequency); + map.put("recurringFrequency", this.recurringFrequency); map.put("depositAmount", this.depositAmount); map.put("minDepositAmount", this.minDepositAmount); map.put("maxDepositAmount", this.maxDepositAmount); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountAssembler.java index 0d3fe5bbb..6c5050018 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountAssembler.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountAssembler.java @@ -231,7 +231,6 @@ public class DepositAccountAssembler { minRequiredOpeningBalance = product.minRequiredOpeningBalance(); } - @SuppressWarnings("unused") Integer lockinPeriodFrequency = null; if (command.parameterExists(lockinPeriodFrequencyParamName)) { lockinPeriodFrequency = command.integerValueOfParameterNamed(lockinPeriodFrequencyParamName); @@ -280,7 +279,7 @@ public class DepositAccountAssembler { FixedDepositAccount fdAccount = FixedDepositAccount.createNewApplicationForSubmittal(client, group, product, fieldOfficer, accountNo, externalId, accountType, submittedOnDate, submittedBy, interestRate, interestCompoundingPeriodType, interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minRequiredOpeningBalance, - lockinPeriodFrequencyTypeValue, lockinPeriodFrequencyType, iswithdrawalFeeApplicableForTransfer, charges, + lockinPeriodFrequency, lockinPeriodFrequencyType, iswithdrawalFeeApplicableForTransfer, charges, accountTermAndPreClosure, accountChart); accountTermAndPreClosure.updateAccountReference(fdAccount); fdAccount.validateDomainRules(); @@ -298,7 +297,7 @@ public class DepositAccountAssembler { RecurringDepositAccount rdAccount = RecurringDepositAccount.createNewApplicationForSubmittal(client, group, product, fieldOfficer, accountNo, externalId, accountType, submittedOnDate, submittedBy, interestRate, interestCompoundingPeriodType, interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, - minRequiredOpeningBalance, lockinPeriodFrequencyTypeValue, lockinPeriodFrequencyType, + minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType, iswithdrawalFeeApplicableForTransfer, charges, accountTermAndPreClosure, accountRecurringDetail, accountChart); accountTermAndPreClosure.updateAccountReference(rdAccount); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountDomainServiceJpa.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountDomainServiceJpa.java index bc40bc8e6..320186b4e 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountDomainServiceJpa.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/savings/domain/DepositAccountDomainServiceJpa.java @@ -33,7 +33,9 @@ import org.mifosplatform.portfolio.account.service.AccountTransfersWritePlatform import org.mifosplatform.portfolio.client.domain.AccountNumberGenerator; import org.mifosplatform.portfolio.client.domain.AccountNumberGeneratorFactory; import org.mifosplatform.portfolio.paymentdetail.domain.PaymentDetail; +import org.mifosplatform.portfolio.savings.DepositAccountOnClosureType; import org.mifosplatform.portfolio.savings.DepositAccountType; +import org.mifosplatform.portfolio.savings.DepositsApiConstants; import org.mifosplatform.portfolio.savings.SavingsApiConstants; import org.mifosplatform.portfolio.savings.data.SavingsAccountTransactionDTO; import org.mifosplatform.useradministration.domain.AppUser; @@ -272,7 +274,10 @@ public class DepositAccountDomainServiceJpa implements DepositAccountDomainServi // post interest account.postPreMaturityInterest(closedDate); - if (account.isTransferToSavingsOnClosure()) { + final Integer closureTypeValue = command.integerValueOfParameterNamed(DepositsApiConstants.onAccountClosureIdParamName); + DepositAccountOnClosureType closureType = DepositAccountOnClosureType.fromInt(closureTypeValue); + + if (closureType.isTransferToSavings()) { final Long toSavingsId = command.longValueOfParameterNamed(toSavingsAccountIdParamName); final String transferDescription = command.stringValueOfParameterNamed(transferDescriptionParamName); @@ -312,7 +317,10 @@ public class DepositAccountDomainServiceJpa implements DepositAccountDomainServi // post interest account.postPreMaturityInterest(closedDate); - if (account.isTransferToSavingsOnClosure()) { + final Integer closureTypeValue = command.integerValueOfParameterNamed(DepositsApiConstants.onAccountClosureIdParamName); + DepositAccountOnClosureType closureType = DepositAccountOnClosureType.fromInt(closureTypeValue); + + if (closureType.isTransferToSavings()) { final Long toSavingsId = command.longValueOfParameterNamed(toSavingsAccountIdParamName); final String transferDescription = command.stringValueOfParameterNamed(transferDescriptionParamName); final SavingsAccount toSavingsAccount = this.depositAccountAssembler.assembleFrom(toSavingsId,