renumber patches, remove getters from data object for savings account data. add fixes for madhukar around spelling mistakes and unused parameters.
This commit is contained in:
+74
-229
@@ -24,9 +24,11 @@ public class SavingAccountData {
|
||||
private final String productName;
|
||||
private final EnumOptionData productType;
|
||||
private final CurrencyData currencyData;
|
||||
// FIXME - Madhukar - spelling mistake on word 'deposit' - directly affects api and how people use it.
|
||||
private final BigDecimal savingsDepostiAmountPerPeriod;
|
||||
private final EnumOptionData savingsFrequencyType;
|
||||
private final BigDecimal totalDepositAmount;
|
||||
// FIXME - Madhukar - spelling mistake on work 'recurring' - directly affects api and how people use it.
|
||||
private final BigDecimal reccuringInterestRate;
|
||||
private final BigDecimal savingInterestRate;
|
||||
private final EnumOptionData interestType;
|
||||
@@ -49,15 +51,27 @@ public class SavingAccountData {
|
||||
private final Integer lockinPeriod;
|
||||
private final EnumOptionData lockinPeriodType;
|
||||
private final Integer depositEvery;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final List<SavingProductLookup> productOptions;
|
||||
@SuppressWarnings("unused")
|
||||
private final List<CurrencyData> currencyOptions;
|
||||
@SuppressWarnings("unused")
|
||||
private final List<EnumOptionData> savingsProductTypeOptions;
|
||||
@SuppressWarnings("unused")
|
||||
private final List<EnumOptionData> tenureTypeOptions;
|
||||
@SuppressWarnings("unused")
|
||||
private final List<EnumOptionData> savingFrequencyOptions;
|
||||
@SuppressWarnings("unused")
|
||||
private final List<EnumOptionData> savingsInterestTypeOptions;
|
||||
@SuppressWarnings("unused")
|
||||
private final List<EnumOptionData> lockinPeriodTypeOptions;
|
||||
@SuppressWarnings("unused")
|
||||
private final List<EnumOptionData> interestCalculationOptions;
|
||||
|
||||
public static SavingAccountData createFrom(final Long clientId, final String clientDisplayName) {
|
||||
return new SavingAccountData(clientId, clientDisplayName);
|
||||
}
|
||||
|
||||
public SavingAccountData(Long id, EnumOptionData status, String externalId, Long clientId, String clientName, Long productId,
|
||||
String productName, EnumOptionData productType, CurrencyData currencyData, BigDecimal savingsDepostiAmountPerPeriod,
|
||||
@@ -67,7 +81,7 @@ public class SavingAccountData {
|
||||
BigDecimal projectedInterestAccuredOnMaturity, BigDecimal actualInterestAccured, BigDecimal projectedMaturityAmount,
|
||||
BigDecimal actualMaturityAmount, boolean preClosureAllowed, BigDecimal preClosureInterestRate, LocalDate withdrawnonDate,
|
||||
LocalDate rejectedonDate, LocalDate closedonDate, boolean isLockinPeriodAllowed, Integer lockinPeriod,
|
||||
EnumOptionData lockinPeriodType,Integer depositEvery) {
|
||||
EnumOptionData lockinPeriodType, Integer depositEvery) {
|
||||
this.id = id;
|
||||
this.status = status;
|
||||
this.externalId = externalId;
|
||||
@@ -110,11 +124,11 @@ public class SavingAccountData {
|
||||
this.savingsInterestTypeOptions = null;
|
||||
this.lockinPeriodTypeOptions = null;
|
||||
this.interestCalculationOptions = null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SavingAccountData(Long clientId, String clientName) {
|
||||
this.id = null;
|
||||
public SavingAccountData(Long clientId, String clientName) {
|
||||
this.id = null;
|
||||
this.status = null;
|
||||
this.externalId = null;
|
||||
this.clientId = clientId;
|
||||
@@ -122,7 +136,8 @@ public class SavingAccountData {
|
||||
this.productId = null;
|
||||
this.productName = null;
|
||||
this.productType = null;
|
||||
this.currencyData = new CurrencyData("USD", "US Dollar", 2, "$", "currency.USD");;
|
||||
this.currencyData = new CurrencyData("USD", "US Dollar", 2, "$", "currency.USD");
|
||||
;
|
||||
this.savingsDepostiAmountPerPeriod = null;
|
||||
this.savingsFrequencyType = null;
|
||||
this.totalDepositAmount = null;
|
||||
@@ -146,8 +161,8 @@ public class SavingAccountData {
|
||||
this.closedonDate = null;
|
||||
this.isLockinPeriodAllowed = false;
|
||||
this.lockinPeriod = null;
|
||||
this.lockinPeriodType = null;
|
||||
this.depositEvery=null;
|
||||
this.lockinPeriodType = null;
|
||||
this.depositEvery = null;
|
||||
this.productOptions = new ArrayList<SavingProductLookup>();
|
||||
this.currencyOptions = null;
|
||||
this.savingsProductTypeOptions = null;
|
||||
@@ -156,46 +171,47 @@ public class SavingAccountData {
|
||||
this.savingsInterestTypeOptions = null;
|
||||
this.lockinPeriodTypeOptions = null;
|
||||
this.interestCalculationOptions = null;
|
||||
}
|
||||
}
|
||||
|
||||
public SavingAccountData(SavingAccountData account, Collection<SavingProductLookup> productOptions, List<CurrencyData> currencyOptions,
|
||||
List<EnumOptionData> savingsProductTypeOptions, List<EnumOptionData> tenureTypeOptions,
|
||||
List<EnumOptionData> savingFrequencyOptions, List<EnumOptionData> savingsInterestTypeOptions,
|
||||
List<EnumOptionData> lockinPeriodTypeOptions, List<EnumOptionData> interestCalculationOptions) {
|
||||
this.id = account.id;
|
||||
this.status = account.status;
|
||||
this.externalId = account.externalId;
|
||||
this.clientId = account.clientId;
|
||||
this.clientName = account.clientName;
|
||||
this.productId = account.productId;
|
||||
this.productName = account.productName;
|
||||
this.productType = account.productType;
|
||||
this.currencyData = account.currencyData;
|
||||
this.savingsDepostiAmountPerPeriod = account.savingsDepostiAmountPerPeriod;
|
||||
this.savingsFrequencyType = account.savingsFrequencyType;
|
||||
this.totalDepositAmount = account.totalDepositAmount;
|
||||
this.reccuringInterestRate = account.reccuringInterestRate;
|
||||
this.savingInterestRate = account.savingInterestRate;
|
||||
this.interestType = account.interestType;
|
||||
this.interestCalculationMethod = account.interestCalculationMethod;
|
||||
this.tenure = account.tenure;
|
||||
this.tenureType = account.tenureType;
|
||||
this.projectedCommencementDate = account.projectedCommencementDate;
|
||||
this.actualCommencementDate = account.actualCommencementDate;
|
||||
this.maturesOnDate = account.maturesOnDate;
|
||||
this.projectedInterestAccuredOnMaturity = account.projectedInterestAccuredOnMaturity;
|
||||
this.actualInterestAccured = account.actualInterestAccured;
|
||||
this.projectedMaturityAmount = account.projectedMaturityAmount;
|
||||
this.actualMaturityAmount = account.actualMaturityAmount;
|
||||
this.preClosureAllowed = account.preClosureAllowed;
|
||||
this.preClosureInterestRate = account.preClosureInterestRate;
|
||||
this.withdrawnonDate = account.withdrawnonDate;
|
||||
this.rejectedonDate = account.rejectedonDate;
|
||||
this.closedonDate = account.closedonDate;
|
||||
this.isLockinPeriodAllowed = account.isLockinPeriodAllowed;
|
||||
this.lockinPeriod = account.lockinPeriod;
|
||||
this.lockinPeriodType = account.lockinPeriodType;
|
||||
this.depositEvery = account.depositEvery;
|
||||
|
||||
public SavingAccountData(SavingAccountData account, Collection<SavingProductLookup> productOptions, List<CurrencyData> currencyOptions,
|
||||
List<EnumOptionData> savingsProductTypeOptions, List<EnumOptionData> tenureTypeOptions, List<EnumOptionData> savingFrequencyOptions,
|
||||
List<EnumOptionData> savingsInterestTypeOptions, List<EnumOptionData> lockinPeriodTypeOptions, List<EnumOptionData> interestCalculationOptions) {
|
||||
this.id = account.getId();
|
||||
this.status = account.getStatus();
|
||||
this.externalId = account.getExternalId();
|
||||
this.clientId = account.getClientId();
|
||||
this.clientName = account.getClientName();
|
||||
this.productId = account.getProductId();
|
||||
this.productName = account.getProductName();
|
||||
this.productType = account.getProductType();
|
||||
this.currencyData = account.getCurrencyData();
|
||||
this.savingsDepostiAmountPerPeriod = account.getSavingsDepostiAmountPerPeriod();
|
||||
this.savingsFrequencyType = account.getSavingsFrequencyType();
|
||||
this.totalDepositAmount = account.getTotalDepositAmount();
|
||||
this.reccuringInterestRate = account.getReccuringInterestRate();
|
||||
this.savingInterestRate = account.getSavingInterestRate();
|
||||
this.interestType = account.getInterestType();
|
||||
this.interestCalculationMethod = account.getInterestCalculationMethod();
|
||||
this.tenure = account.getTenure();
|
||||
this.tenureType = account.getTenureType();
|
||||
this.projectedCommencementDate = account.getProjectedCommencementDate();
|
||||
this.actualCommencementDate = account.getActualCommencementDate();
|
||||
this.maturesOnDate = account.getMaturesOnDate();
|
||||
this.projectedInterestAccuredOnMaturity = account.getProjectedInterestAccuredOnMaturity();
|
||||
this.actualInterestAccured = account.getActualInterestAccured();
|
||||
this.projectedMaturityAmount = account.getProjectedMaturityAmount();
|
||||
this.actualMaturityAmount = account.getActualMaturityAmount();
|
||||
this.preClosureAllowed = account.isPreClosureAllowed();
|
||||
this.preClosureInterestRate = account.getPreClosureInterestRate();
|
||||
this.withdrawnonDate = account.getWithdrawnonDate();
|
||||
this.rejectedonDate = account.getRejectedonDate();
|
||||
this.closedonDate = account.getClosedonDate();
|
||||
this.isLockinPeriodAllowed = account.isLockinPeriodAllowed();
|
||||
this.lockinPeriod = account.getLockinPeriod();
|
||||
this.lockinPeriodType = account.getLockinPeriodType();
|
||||
this.depositEvery = account.getDepositEvery();
|
||||
|
||||
this.productOptions = (List<SavingProductLookup>) productOptions;
|
||||
this.currencyOptions = currencyOptions;
|
||||
this.savingsProductTypeOptions = savingsProductTypeOptions;
|
||||
@@ -204,14 +220,16 @@ public class SavingAccountData {
|
||||
this.savingsInterestTypeOptions = savingsInterestTypeOptions;
|
||||
this.lockinPeriodTypeOptions = lockinPeriodTypeOptions;
|
||||
this.interestCalculationOptions = interestCalculationOptions;
|
||||
}
|
||||
}
|
||||
|
||||
public SavingAccountData( Long clientId, String clientName, Long productId, String productName, CurrencyData currency, BigDecimal interestRate,
|
||||
BigDecimal savingsDepostiAmountPerPeriod, EnumOptionData productType, EnumOptionData tenureType, Integer tenure, EnumOptionData savingsFrequencyType,
|
||||
EnumOptionData interestType, EnumOptionData interestCalculationMethod, BigDecimal minimumBalanceForWithdrawal, boolean partialDepositAllowed,
|
||||
boolean lockinPeriodAllowed, Integer lockinPeriod, EnumOptionData lockinPeriodType, Integer depositEvery) {
|
||||
|
||||
this.id = null;
|
||||
// FIXME - Madhukar - unused variables been passed into construction - why?
|
||||
public SavingAccountData(Long clientId, String clientName, Long productId, String productName, CurrencyData currency,
|
||||
BigDecimal interestRate, BigDecimal savingsDepostiAmountPerPeriod, EnumOptionData productType, EnumOptionData tenureType,
|
||||
Integer tenure, EnumOptionData savingsFrequencyType, EnumOptionData interestType, EnumOptionData interestCalculationMethod,
|
||||
BigDecimal minimumBalanceForWithdrawal, boolean partialDepositAllowed, boolean lockinPeriodAllowed, Integer lockinPeriod,
|
||||
EnumOptionData lockinPeriodType, Integer depositEvery) {
|
||||
|
||||
this.id = null;
|
||||
this.status = null;
|
||||
this.externalId = null;
|
||||
this.clientId = clientId;
|
||||
@@ -244,7 +262,7 @@ public class SavingAccountData {
|
||||
this.isLockinPeriodAllowed = false;
|
||||
this.lockinPeriod = lockinPeriod;
|
||||
this.lockinPeriodType = lockinPeriodType;
|
||||
this.depositEvery=depositEvery;
|
||||
this.depositEvery = depositEvery;
|
||||
this.productOptions = null;
|
||||
this.currencyOptions = null;
|
||||
this.savingsProductTypeOptions = null;
|
||||
@@ -253,179 +271,6 @@ public class SavingAccountData {
|
||||
this.savingsInterestTypeOptions = null;
|
||||
this.lockinPeriodTypeOptions = null;
|
||||
this.interestCalculationOptions = null;
|
||||
|
||||
}
|
||||
|
||||
public static SavingAccountData createFrom(final Long clientId, final String clientDisplayName) {
|
||||
return new SavingAccountData(clientId,clientDisplayName);
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public EnumOptionData getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public String getExternalId() {
|
||||
return this.externalId;
|
||||
}
|
||||
|
||||
public Long getClientId() {
|
||||
return this.clientId;
|
||||
}
|
||||
|
||||
public String getClientName() {
|
||||
return this.clientName;
|
||||
}
|
||||
|
||||
public Long getProductId() {
|
||||
return this.productId;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return this.productName;
|
||||
}
|
||||
|
||||
public EnumOptionData getProductType() {
|
||||
return this.productType;
|
||||
}
|
||||
|
||||
public CurrencyData getCurrencyData() {
|
||||
return this.currencyData;
|
||||
}
|
||||
|
||||
public BigDecimal getSavingsDepostiAmountPerPeriod() {
|
||||
return this.savingsDepostiAmountPerPeriod;
|
||||
}
|
||||
|
||||
public EnumOptionData getSavingsFrequencyType() {
|
||||
return this.savingsFrequencyType;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalDepositAmount() {
|
||||
return this.totalDepositAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getReccuringInterestRate() {
|
||||
return this.reccuringInterestRate;
|
||||
}
|
||||
|
||||
public BigDecimal getSavingInterestRate() {
|
||||
return this.savingInterestRate;
|
||||
}
|
||||
|
||||
public EnumOptionData getInterestType() {
|
||||
return this.interestType;
|
||||
}
|
||||
|
||||
public EnumOptionData getInterestCalculationMethod() {
|
||||
return this.interestCalculationMethod;
|
||||
}
|
||||
|
||||
public Integer getTenure() {
|
||||
return this.tenure;
|
||||
}
|
||||
|
||||
public EnumOptionData getTenureType() {
|
||||
return this.tenureType;
|
||||
}
|
||||
|
||||
public LocalDate getProjectedCommencementDate() {
|
||||
return this.projectedCommencementDate;
|
||||
}
|
||||
|
||||
public LocalDate getActualCommencementDate() {
|
||||
return this.actualCommencementDate;
|
||||
}
|
||||
|
||||
public LocalDate getMaturesOnDate() {
|
||||
return this.maturesOnDate;
|
||||
}
|
||||
|
||||
public BigDecimal getProjectedInterestAccuredOnMaturity() {
|
||||
return this.projectedInterestAccuredOnMaturity;
|
||||
}
|
||||
|
||||
public BigDecimal getActualInterestAccured() {
|
||||
return this.actualInterestAccured;
|
||||
}
|
||||
|
||||
public BigDecimal getProjectedMaturityAmount() {
|
||||
return this.projectedMaturityAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getActualMaturityAmount() {
|
||||
return this.actualMaturityAmount;
|
||||
}
|
||||
|
||||
public boolean isPreClosureAllowed() {
|
||||
return this.preClosureAllowed;
|
||||
}
|
||||
|
||||
public BigDecimal getPreClosureInterestRate() {
|
||||
return this.preClosureInterestRate;
|
||||
}
|
||||
|
||||
public LocalDate getWithdrawnonDate() {
|
||||
return this.withdrawnonDate;
|
||||
}
|
||||
|
||||
public LocalDate getRejectedonDate() {
|
||||
return this.rejectedonDate;
|
||||
}
|
||||
|
||||
public LocalDate getClosedonDate() {
|
||||
return this.closedonDate;
|
||||
}
|
||||
|
||||
public boolean isLockinPeriodAllowed() {
|
||||
return this.isLockinPeriodAllowed;
|
||||
}
|
||||
|
||||
public Integer getLockinPeriod() {
|
||||
return this.lockinPeriod;
|
||||
}
|
||||
|
||||
public EnumOptionData getLockinPeriodType() {
|
||||
return this.lockinPeriodType;
|
||||
}
|
||||
|
||||
public Integer getDepositEvery() {
|
||||
return this.depositEvery;
|
||||
}
|
||||
|
||||
public List<SavingProductLookup> getProductOptions() {
|
||||
return this.productOptions;
|
||||
}
|
||||
|
||||
public List<CurrencyData> getCurrencyOptions() {
|
||||
return this.currencyOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getSavingsProductTypeOptions() {
|
||||
return this.savingsProductTypeOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getTenureTypeOptions() {
|
||||
return this.tenureTypeOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getSavingFrequencyOptions() {
|
||||
return this.savingFrequencyOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getSavingsInterestTypeOptions() {
|
||||
return this.savingsInterestTypeOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getLockinPeriodTypeOptions() {
|
||||
return this.lockinPeriodTypeOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getInterestCalculationOptions() {
|
||||
return this.interestCalculationOptions;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -76,6 +76,7 @@ public class SavingAccount extends AbstractAuditableCustom<AppUser, Long> {
|
||||
@Column(name = "tenure", nullable = false)
|
||||
private Integer tenure;
|
||||
|
||||
// FIXME - MADHUKAR - Do not use the actual enum type here use integer representation
|
||||
@Column(name = "tenure_type", nullable = false)
|
||||
private TenureTypeEnum tenureType;
|
||||
|
||||
|
||||
+3
-1
@@ -2,7 +2,9 @@ package org.mifosplatform.portfolio.savingsaccountproduct.domain;
|
||||
|
||||
public enum SavingProductType {
|
||||
|
||||
INVALID(0, "savingProductType.invalid"), RECCURING(1, "savingProductType.reccuring"), REGULAR(2, "savingProductType.regular");
|
||||
INVALID(0, "savingProductType.invalid"), //
|
||||
RECCURING(1, "savingProductType.reccuring"), //
|
||||
REGULAR(2, "savingProductType.regular");
|
||||
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
|
||||
+2
-2
@@ -166,6 +166,7 @@ public class SavingProductEnumerations {
|
||||
final String codePrefix = "savings.product.";
|
||||
EnumOptionData optionData = null;
|
||||
switch (type) {
|
||||
// FIXME - Madhukar - spelling mistake on 'Recurring'
|
||||
case RECCURING:
|
||||
optionData = new EnumOptionData(SavingProductType.RECCURING.getValue().longValue(), codePrefix
|
||||
+ SavingProductType.RECCURING.getCode(), "Reccuring");
|
||||
@@ -185,5 +186,4 @@ public class SavingProductEnumerations {
|
||||
}
|
||||
return optionData;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user