update fd account
This commit is contained in:
+177
-6
@@ -24,6 +24,7 @@ import java.util.Collection;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
import org.apache.fineract.organisation.staff.data.StaffData;
|
||||
@@ -73,6 +74,48 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
private Collection<PaymentTypeData> paymentTypeOptions;
|
||||
private final Collection<EnumOptionData> maturityInstructionOptions;
|
||||
|
||||
// CBS product/account fields used by the FD UI
|
||||
private String accountType;
|
||||
private String customerSegment;
|
||||
private String fdType;
|
||||
private Collection<CodeValueData> accountTypeOptions;
|
||||
private Collection<CodeValueData> customerSegmentOptions;
|
||||
private String productCode;
|
||||
private LocalDate effectiveDate;
|
||||
private LocalDate effectiveTo;
|
||||
private LocalDate endDate;
|
||||
private Boolean introducerRequired;
|
||||
private Boolean shareLinkingEnabled;
|
||||
private Boolean nominationFacility;
|
||||
private Boolean dormancyAlert;
|
||||
private Boolean isDormancyTrackingActive;
|
||||
private Long daysToInactive;
|
||||
private Long daysToDormancy;
|
||||
private Long daysToEscheat;
|
||||
private Integer interestCalculateSelector;
|
||||
private String interestCalculationTypeName;
|
||||
private String averagePeriod;
|
||||
private Boolean autoPost;
|
||||
private Integer frequencyFixDay;
|
||||
private LocalDate lastInterestDate;
|
||||
private Boolean enableLockinPeriod;
|
||||
private String balanceFrequency;
|
||||
private Boolean accountClosedZeroBalanceInDayClosing;
|
||||
private Boolean balanceSwapOption;
|
||||
private Boolean msme;
|
||||
private Boolean autoDebitFacility;
|
||||
private Boolean loanFacility;
|
||||
private Boolean prematureWithdrawalOption;
|
||||
private Boolean tenureFlexibility;
|
||||
private Boolean lienMarked;
|
||||
private Boolean maturityInstructions;
|
||||
private Boolean creditMaturityProceeds;
|
||||
private Boolean penaltyGracePeriodMissedInstallments;
|
||||
private Boolean panelRequestApplicable;
|
||||
private Boolean noPenaltyNomineeHeirClosure;
|
||||
private Boolean deceasedSettlement;
|
||||
private Boolean allowDebitTxnAfterDueDate;
|
||||
|
||||
// import fields
|
||||
private transient Integer rowIndex;
|
||||
private String dateFormat;
|
||||
@@ -92,6 +135,123 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
locale, dateFormat);
|
||||
}
|
||||
|
||||
public void setAccountType(String accountType) {
|
||||
this.accountType = accountType;
|
||||
}
|
||||
|
||||
public void setCustomerSegment(String customerSegment) {
|
||||
this.customerSegment = customerSegment;
|
||||
}
|
||||
|
||||
public void setAccountTypeOptions(Collection<CodeValueData> accountTypeOptions) {
|
||||
this.accountTypeOptions = accountTypeOptions;
|
||||
}
|
||||
|
||||
public void setCustomerSegmentOptions(Collection<CodeValueData> customerSegmentOptions) {
|
||||
this.customerSegmentOptions = customerSegmentOptions;
|
||||
}
|
||||
|
||||
public void setFdType(String fdType) { this.fdType = fdType; }
|
||||
public String getFdType() { return fdType; }
|
||||
|
||||
public void setCbsProductFields(final String accountType, final String customerSegment, final String fdType, final String productCode,
|
||||
final LocalDate effectiveDate, final LocalDate effectiveTo, final LocalDate endDate, final Boolean introducerRequired,
|
||||
final Boolean shareLinkingEnabled, final Boolean nominationFacility, final Boolean dormancyAlert,
|
||||
final Boolean isDormancyTrackingActive, final Long daysToInactive, final Long daysToDormancy, final Long daysToEscheat,
|
||||
final Integer interestCalculateSelector, final String interestCalculationTypeName, final String averagePeriod,
|
||||
final Boolean autoPost, final Integer frequencyFixDay, final LocalDate lastInterestDate, final Boolean enableLockinPeriod,
|
||||
final String balanceFrequency, final Boolean accountClosedZeroBalanceInDayClosing, final Boolean balanceSwapOption,
|
||||
final Boolean msme, final Boolean autoDebitFacility, final Boolean loanFacility, final Boolean prematureWithdrawalOption,
|
||||
final Boolean tenureFlexibility, final Boolean lienMarked, final Boolean maturityInstructions,
|
||||
final Boolean creditMaturityProceeds, final Boolean penaltyGracePeriodMissedInstallments,
|
||||
final Boolean panelRequestApplicable, final Boolean noPenaltyNomineeHeirClosure, final Boolean deceasedSettlement,
|
||||
final Boolean allowDebitTxnAfterDueDate) {
|
||||
this.accountType = accountType;
|
||||
this.customerSegment = customerSegment;
|
||||
this.fdType = fdType;
|
||||
this.productCode = productCode;
|
||||
this.effectiveDate = effectiveDate;
|
||||
this.effectiveTo = effectiveTo;
|
||||
this.endDate = endDate;
|
||||
this.introducerRequired = introducerRequired;
|
||||
this.shareLinkingEnabled = shareLinkingEnabled;
|
||||
this.nominationFacility = nominationFacility;
|
||||
this.dormancyAlert = dormancyAlert;
|
||||
this.isDormancyTrackingActive = isDormancyTrackingActive;
|
||||
this.daysToInactive = daysToInactive;
|
||||
this.daysToDormancy = daysToDormancy;
|
||||
this.daysToEscheat = daysToEscheat;
|
||||
this.interestCalculateSelector = interestCalculateSelector;
|
||||
this.interestCalculationTypeName = interestCalculationTypeName;
|
||||
this.averagePeriod = averagePeriod;
|
||||
this.autoPost = autoPost;
|
||||
this.frequencyFixDay = frequencyFixDay;
|
||||
this.lastInterestDate = lastInterestDate;
|
||||
this.enableLockinPeriod = enableLockinPeriod;
|
||||
this.balanceFrequency = balanceFrequency;
|
||||
this.accountClosedZeroBalanceInDayClosing = accountClosedZeroBalanceInDayClosing;
|
||||
this.balanceSwapOption = balanceSwapOption;
|
||||
this.msme = msme;
|
||||
this.autoDebitFacility = autoDebitFacility;
|
||||
this.loanFacility = loanFacility;
|
||||
this.prematureWithdrawalOption = prematureWithdrawalOption;
|
||||
this.tenureFlexibility = tenureFlexibility;
|
||||
this.lienMarked = lienMarked;
|
||||
this.maturityInstructions = maturityInstructions;
|
||||
this.creditMaturityProceeds = creditMaturityProceeds;
|
||||
this.penaltyGracePeriodMissedInstallments = penaltyGracePeriodMissedInstallments;
|
||||
this.panelRequestApplicable = panelRequestApplicable;
|
||||
this.noPenaltyNomineeHeirClosure = noPenaltyNomineeHeirClosure;
|
||||
this.deceasedSettlement = deceasedSettlement;
|
||||
this.allowDebitTxnAfterDueDate = allowDebitTxnAfterDueDate;
|
||||
}
|
||||
|
||||
public void copyCbsFieldsFrom(final FixedDepositAccountData src) {
|
||||
if (src == null) {
|
||||
return;
|
||||
}
|
||||
this.accountType = src.accountType;
|
||||
this.customerSegment = src.customerSegment;
|
||||
this.fdType = src.fdType;
|
||||
this.accountTypeOptions = src.accountTypeOptions;
|
||||
this.customerSegmentOptions = src.customerSegmentOptions;
|
||||
this.productCode = src.productCode;
|
||||
this.effectiveDate = src.effectiveDate;
|
||||
this.effectiveTo = src.effectiveTo;
|
||||
this.endDate = src.endDate;
|
||||
this.introducerRequired = src.introducerRequired;
|
||||
this.shareLinkingEnabled = src.shareLinkingEnabled;
|
||||
this.nominationFacility = src.nominationFacility;
|
||||
this.dormancyAlert = src.dormancyAlert;
|
||||
this.isDormancyTrackingActive = src.isDormancyTrackingActive;
|
||||
this.daysToInactive = src.daysToInactive;
|
||||
this.daysToDormancy = src.daysToDormancy;
|
||||
this.daysToEscheat = src.daysToEscheat;
|
||||
this.interestCalculateSelector = src.interestCalculateSelector;
|
||||
this.interestCalculationTypeName = src.interestCalculationTypeName;
|
||||
this.averagePeriod = src.averagePeriod;
|
||||
this.autoPost = src.autoPost;
|
||||
this.frequencyFixDay = src.frequencyFixDay;
|
||||
this.lastInterestDate = src.lastInterestDate;
|
||||
this.enableLockinPeriod = src.enableLockinPeriod;
|
||||
this.balanceFrequency = src.balanceFrequency;
|
||||
this.accountClosedZeroBalanceInDayClosing = src.accountClosedZeroBalanceInDayClosing;
|
||||
this.balanceSwapOption = src.balanceSwapOption;
|
||||
this.msme = src.msme;
|
||||
this.autoDebitFacility = src.autoDebitFacility;
|
||||
this.loanFacility = src.loanFacility;
|
||||
this.prematureWithdrawalOption = src.prematureWithdrawalOption;
|
||||
this.tenureFlexibility = src.tenureFlexibility;
|
||||
this.lienMarked = src.lienMarked;
|
||||
this.maturityInstructions = src.maturityInstructions;
|
||||
this.creditMaturityProceeds = src.creditMaturityProceeds;
|
||||
this.penaltyGracePeriodMissedInstallments = src.penaltyGracePeriodMissedInstallments;
|
||||
this.panelRequestApplicable = src.panelRequestApplicable;
|
||||
this.noPenaltyNomineeHeirClosure = src.noPenaltyNomineeHeirClosure;
|
||||
this.deceasedSettlement = src.deceasedSettlement;
|
||||
this.allowDebitTxnAfterDueDate = src.allowDebitTxnAfterDueDate;
|
||||
}
|
||||
|
||||
private FixedDepositAccountData(Long clientId, Long productId, Long fieldofficerId, LocalDate submittedOnDate,
|
||||
EnumOptionData interestCompoundingPeriodType, EnumOptionData interestPostingPeriodType, EnumOptionData interestCalculationType,
|
||||
EnumOptionData interestCalculationDaysInYearType, Integer lockinPeriodFrequency, EnumOptionData lockinPeriodFrequencyType,
|
||||
@@ -150,7 +310,7 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
||||
|
||||
return new FixedDepositAccountData(depositAccountData.id, depositAccountData.accountNo, depositAccountData.externalId,
|
||||
final FixedDepositAccountData result = new FixedDepositAccountData(depositAccountData.id, depositAccountData.accountNo, depositAccountData.externalId,
|
||||
depositAccountData.groupId, depositAccountData.groupName, depositAccountData.clientId, depositAccountData.clientName,
|
||||
depositAccountData.depositProductId, depositAccountData.depositProductName, depositAccountData.fieldOfficerId,
|
||||
depositAccountData.fieldOfficerName, depositAccountData.status, depositAccountData.timeline, depositAccountData.currency,
|
||||
@@ -170,11 +330,15 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
depositPeriod, depositPeriodFrequency, periodFrequencyTypeOptions, depositType, onAccountClosure, onAccountClosureOptions,
|
||||
paymentTypeOptions, savingsAccountDatas, linkedAccount, transferInterestToSavings, depositAccountData.withHoldTax,
|
||||
depositAccountData.taxGroup, maturityInstructionOptions, transferToSavingsId, transferToSavingsAccount);
|
||||
if (depositAccountData instanceof FixedDepositAccountData) {
|
||||
result.copyCbsFieldsFrom((FixedDepositAccountData) depositAccountData);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static FixedDepositAccountData withInterestChart(final FixedDepositAccountData account,
|
||||
final DepositAccountInterestRateChartData accountChart) {
|
||||
return new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||
final FixedDepositAccountData result = new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||
account.clientId, account.clientName, account.depositProductId, account.depositProductName, account.fieldOfficerId,
|
||||
account.fieldOfficerName, account.status, account.timeline, account.currency, account.nominalAnnualInterestRate,
|
||||
account.interestCompoundingPeriodType, account.interestPostingPeriodType, account.interestCalculationType,
|
||||
@@ -192,6 +356,8 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
account.onAccountClosure, account.onAccountClosureOptions, account.paymentTypeOptions, account.savingsAccounts,
|
||||
account.linkedAccount, account.transferInterestToSavings, account.withHoldTax, account.taxGroup,
|
||||
account.maturityInstructionOptions, account.transferToSavingsId, account.transferToSavingsAccount);
|
||||
result.copyCbsFieldsFrom(account);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static FixedDepositAccountData associationsAndTemplate(final FixedDepositAccountData account, FixedDepositAccountData template,
|
||||
@@ -202,7 +368,7 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
template = account;
|
||||
}
|
||||
|
||||
return new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||
final FixedDepositAccountData result = new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||
account.clientId, account.clientName, account.depositProductId, account.depositProductName, account.fieldOfficerId,
|
||||
account.fieldOfficerName, account.status, account.timeline, account.currency, account.nominalAnnualInterestRate,
|
||||
account.interestCompoundingPeriodType, account.interestPostingPeriodType, account.interestCalculationType,
|
||||
@@ -220,6 +386,8 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
account.onAccountClosure, account.onAccountClosureOptions, account.paymentTypeOptions, template.savingsAccounts,
|
||||
linkedAccount, account.transferInterestToSavings, account.withHoldTax, account.taxGroup, account.maturityInstructionOptions,
|
||||
account.transferToSavingsId, transferToSavingsAccount);
|
||||
result.copyCbsFieldsFrom(account);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static FixedDepositAccountData withTemplateOptions(final FixedDepositAccountData account,
|
||||
@@ -234,7 +402,7 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
final Collection<EnumOptionData> periodFrequencyTypeOptions, final Collection<SavingsAccountData> savingsAccounts,
|
||||
final Collection<EnumOptionData> maturityInstructionOptions) {
|
||||
|
||||
return new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||
final FixedDepositAccountData result = new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||
account.clientId, account.clientName, account.depositProductId, account.depositProductName, account.fieldOfficerId,
|
||||
account.fieldOfficerName, account.status, account.timeline, account.currency, account.nominalAnnualInterestRate,
|
||||
account.interestCompoundingPeriodType, account.interestPostingPeriodType, account.interestCalculationType,
|
||||
@@ -251,6 +419,8 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
account.onAccountClosure, account.onAccountClosureOptions, account.paymentTypeOptions, savingsAccounts,
|
||||
account.linkedAccount, account.transferInterestToSavings, account.withHoldTax, account.taxGroup, maturityInstructionOptions,
|
||||
account.transferToSavingsId, account.transferToSavingsAccount);
|
||||
result.copyCbsFieldsFrom(account);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static FixedDepositAccountData withClientTemplate(final Long clientId, final String clientName, final Long groupId,
|
||||
@@ -427,7 +597,7 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<PaymentTypeData> paymentTypeOptions,
|
||||
final Collection<SavingsAccountData> savingsAccountDatas) {
|
||||
|
||||
return new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||
final FixedDepositAccountData result = new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||
account.clientId, account.clientName, account.depositProductId, account.depositProductName, account.fieldOfficerId,
|
||||
account.fieldOfficerName, account.status, account.timeline, account.currency, account.nominalAnnualInterestRate,
|
||||
account.interestCompoundingPeriodType, account.interestPostingPeriodType, account.interestCalculationType,
|
||||
@@ -445,7 +615,8 @@ public final class FixedDepositAccountData extends DepositAccountData {
|
||||
account.onAccountClosure, onAccountClosureOptions, paymentTypeOptions, savingsAccountDatas, account.linkedAccount,
|
||||
account.transferInterestToSavings, account.withHoldTax, account.taxGroup, account.maturityInstructionOptions,
|
||||
account.transferToSavingsId, account.transferToSavingsAccount);
|
||||
|
||||
result.copyCbsFieldsFrom(account);
|
||||
return result;
|
||||
}
|
||||
|
||||
private FixedDepositAccountData(final Long id, final String accountNo, final String externalId, final Long groupId,
|
||||
|
||||
Reference in New Issue
Block a user