rd and fd product and account code update

This commit is contained in:
Nitesh Yadav
2026-05-08 15:55:22 +05:30
45 changed files with 2154 additions and 98 deletions
@@ -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,
@@ -112,9 +112,9 @@ public final class FixedDepositProductData extends DepositProductData {
}
public static FixedDepositProductData withCharges(final FixedDepositProductData existingProduct, final Collection<ChargeData> charges) {
return new FixedDepositProductData(existingProduct.id, existingProduct.name, existingProduct.shortName, existingProduct.description,
existingProduct.currency, existingProduct.nominalAnnualInterestRate, existingProduct.interestCompoundingPeriodType,
existingProduct.interestPostingPeriodType, existingProduct.interestCalculationType,
final FixedDepositProductData result = new FixedDepositProductData(existingProduct.id, existingProduct.name, existingProduct.shortName,
existingProduct.description, existingProduct.currency, existingProduct.nominalAnnualInterestRate,
existingProduct.interestCompoundingPeriodType, existingProduct.interestPostingPeriodType, existingProduct.interestCalculationType,
existingProduct.interestCalculationDaysInYearType, existingProduct.lockinPeriodFrequency,
existingProduct.lockinPeriodFrequencyType, existingProduct.minBalanceForInterestCalculation, existingProduct.accountingRule,
existingProduct.accountingMappings, existingProduct.paymentChannelToFundSourceMappings, existingProduct.currencyOptions,
@@ -131,6 +131,8 @@ public final class FixedDepositProductData extends DepositProductData {
existingProduct.minDepositAmount, existingProduct.depositAmount, existingProduct.maxDepositAmount,
existingProduct.periodFrequencyTypeOptions, existingProduct.withHoldTax, existingProduct.taxGroup,
existingProduct.taxGroupOptions);
result.copyCbsFieldsFrom(existingProduct);
return result;
}
/**
@@ -152,9 +154,9 @@ public final class FixedDepositProductData extends DepositProductData {
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
final Collection<EnumOptionData> periodFrequencyTypeOptions, final Collection<TaxGroupData> taxGroupOptions) {
return new FixedDepositProductData(existingProduct.id, existingProduct.name, existingProduct.shortName, existingProduct.description,
existingProduct.currency, existingProduct.nominalAnnualInterestRate, existingProduct.interestCompoundingPeriodType,
existingProduct.interestPostingPeriodType, existingProduct.interestCalculationType,
final FixedDepositProductData result = new FixedDepositProductData(existingProduct.id, existingProduct.name, existingProduct.shortName,
existingProduct.description, existingProduct.currency, existingProduct.nominalAnnualInterestRate,
existingProduct.interestCompoundingPeriodType, existingProduct.interestPostingPeriodType, existingProduct.interestCalculationType,
existingProduct.interestCalculationDaysInYearType, existingProduct.lockinPeriodFrequency,
existingProduct.lockinPeriodFrequencyType, existingProduct.minBalanceForInterestCalculation, existingProduct.accountingRule,
existingProduct.accountingMappings, existingProduct.paymentChannelToFundSourceMappings, currencyOptions,
@@ -169,6 +171,8 @@ public final class FixedDepositProductData extends DepositProductData {
existingProduct.inMultiplesOfDepositTermType, existingProduct.minDepositAmount, existingProduct.depositAmount,
existingProduct.maxDepositAmount, periodFrequencyTypeOptions, existingProduct.withHoldTax, existingProduct.taxGroup,
taxGroupOptions);
result.copyCbsFieldsFrom(existingProduct);
return result;
}
public static FixedDepositProductData withAccountingDetails(final FixedDepositProductData existingProduct,
@@ -189,9 +193,9 @@ public final class FixedDepositProductData extends DepositProductData {
final Collection<ChargeData> chargeOptions = null;
final Collection<ChargeData> penaltyOptions = null;
return new FixedDepositProductData(existingProduct.id, existingProduct.name, existingProduct.shortName, existingProduct.description,
existingProduct.currency, existingProduct.nominalAnnualInterestRate, existingProduct.interestCompoundingPeriodType,
existingProduct.interestPostingPeriodType, existingProduct.interestCalculationType,
final FixedDepositProductData result = new FixedDepositProductData(existingProduct.id, existingProduct.name,
existingProduct.shortName, existingProduct.description, existingProduct.currency, existingProduct.nominalAnnualInterestRate,
existingProduct.interestCompoundingPeriodType, existingProduct.interestPostingPeriodType, existingProduct.interestCalculationType,
existingProduct.interestCalculationDaysInYearType, existingProduct.lockinPeriodFrequency,
existingProduct.lockinPeriodFrequencyType, existingProduct.minBalanceForInterestCalculation, existingProduct.accountingRule,
accountingMappings, paymentChannelToFundSourceMappings, currencyOptions, interestCompoundingPeriodTypeOptions,
@@ -206,6 +210,8 @@ public final class FixedDepositProductData extends DepositProductData {
existingProduct.minDepositAmount, existingProduct.depositAmount, existingProduct.maxDepositAmount,
existingProduct.periodFrequencyTypeOptions, existingProduct.withHoldTax, existingProduct.taxGroup,
existingProduct.taxGroupOptions);
result.copyCbsFieldsFrom(existingProduct);
return result;
}
public static FixedDepositProductData instance(final DepositProductData depositProductData, final boolean preClosurePenalApplicable,
@@ -243,7 +249,7 @@ public final class FixedDepositProductData extends DepositProductData {
depositProductData.interestCompoundingPeriodType, depositProductData.interestPostingPeriodType,
depositProductData.interestCalculationType, depositProductData.interestCalculationDaysInYearType,
depositProductData.lockinPeriodFrequency, depositProductData.lockinPeriodFrequencyType,
depositProductData.minBalanceForInterestCalculation, depositProductData.accountingRule, accountingMappings,
depositProductData.getMinBalanceForInterestCalculation(), depositProductData.accountingRule, accountingMappings,
paymentChannelToFundSourceMappings, currencyOptions, interestCompoundingPeriodTypeOptions, interestPostingPeriodTypeOptions,
interestCalculationTypeOptions, interestCalculationDaysInYearTypeOptions, lockinPeriodFrequencyTypeOptions,
withdrawalFeeTypeOptions, paymentTypeOptions, accountingRuleOptions, accountingMappingOptions, charges, chargeOptions,
@@ -321,9 +327,9 @@ public final class FixedDepositProductData extends DepositProductData {
public static FixedDepositProductData withInterestChart(final FixedDepositProductData existingProduct,
final Collection<InterestRateChartData> interestRateCharts) {
return new FixedDepositProductData(existingProduct.id, existingProduct.name, existingProduct.shortName, existingProduct.description,
existingProduct.currency, existingProduct.nominalAnnualInterestRate, existingProduct.interestCompoundingPeriodType,
existingProduct.interestPostingPeriodType, existingProduct.interestCalculationType,
final FixedDepositProductData result = new FixedDepositProductData(existingProduct.id, existingProduct.name,
existingProduct.shortName, existingProduct.description, existingProduct.currency, existingProduct.nominalAnnualInterestRate,
existingProduct.interestCompoundingPeriodType, existingProduct.interestPostingPeriodType, existingProduct.interestCalculationType,
existingProduct.interestCalculationDaysInYearType, existingProduct.lockinPeriodFrequency,
existingProduct.lockinPeriodFrequencyType, existingProduct.minBalanceForInterestCalculation, existingProduct.accountingRule,
existingProduct.accountingMappings, existingProduct.paymentChannelToFundSourceMappings, existingProduct.currencyOptions,
@@ -340,7 +346,8 @@ public final class FixedDepositProductData extends DepositProductData {
existingProduct.minDepositAmount, existingProduct.depositAmount, existingProduct.maxDepositAmount,
existingProduct.periodFrequencyTypeOptions, existingProduct.withHoldTax, existingProduct.taxGroup,
existingProduct.taxGroupOptions);
result.copyCbsFieldsFrom(existingProduct);
return result;
}
private FixedDepositProductData(final Long id, final String name, final String shortName, final String description,
@@ -445,4 +452,160 @@ public final class FixedDepositProductData extends DepositProductData {
return preClosurePenalApplicable;
}
// CBS Custom Fields
private Collection<org.apache.fineract.infrastructure.core.data.EnumOptionData> interestCalculationTypeOption;
private Collection<org.apache.fineract.infrastructure.core.data.EnumOptionData> periodFrequencyOptions;
private java.util.List<org.apache.fineract.infrastructure.codes.data.CodeValueData> yesNoOptions;
private java.util.List<org.apache.fineract.infrastructure.codes.data.CodeValueData> accountTypeOptions;
private java.util.List<org.apache.fineract.infrastructure.codes.data.CodeValueData> customerSegmentOptions;
private String productCode;
private String accountType;
private String fdType;
private Long glAccountId;
private String glAccountName;
private String customerSegment;
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 String effectiveDate;
private String effectiveTo;
private String endDate;
private Integer interestCalculateSelector;
private String averagePeriod;
private Boolean autoPost;
private Integer frequencyFixDay;
private String lastInterestDate;
private Boolean enableLockinPeriod;
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;
private Boolean accountClosedZeroBalanceInDayClosing;
private String balanceFrequency;
// Template option setters
public void setInterestCalculationTypeOption(Collection<org.apache.fineract.infrastructure.core.data.EnumOptionData> v) { this.interestCalculationTypeOption = v; }
public void setPeriodFrequencyOptions(Collection<org.apache.fineract.infrastructure.core.data.EnumOptionData> v) { this.periodFrequencyOptions = v; }
public void setYesNoOptions(java.util.List<org.apache.fineract.infrastructure.codes.data.CodeValueData> v) { this.yesNoOptions = v; }
public void setAccountTypeOptions(java.util.List<org.apache.fineract.infrastructure.codes.data.CodeValueData> v) { this.accountTypeOptions = v; }
public void setCustomerSegmentOptions(java.util.List<org.apache.fineract.infrastructure.codes.data.CodeValueData> v) { this.customerSegmentOptions = v; }
// CBS field setters
public void setProductCode(String v) { this.productCode = v; }
public void setAccountType(String v) { this.accountType = v; }
public void setFdType(String v) { this.fdType = v; }
public void setGlAccountId(Long v) { this.glAccountId = v; }
public void setGlAccountName(String v) { this.glAccountName = v; }
public void setCustomerSegment(String v) { this.customerSegment = v; }
public void setIntroducerRequired(Boolean v) { this.introducerRequired = v; }
public void setShareLinkingEnabled(Boolean v) { this.shareLinkingEnabled = v; }
public void setNominationFacility(Boolean v) { this.nominationFacility = v; }
public void setDormancyAlert(Boolean v) { this.dormancyAlert = v; }
public void setIsDormancyTrackingActive(Boolean v) { this.isDormancyTrackingActive = v; }
public void setDaysToInactive(Long v) { this.daysToInactive = v; }
public void setDaysToDormancy(Long v) { this.daysToDormancy = v; }
public void setDaysToEscheat(Long v) { this.daysToEscheat = v; }
public void setEffectiveDate(String v) { this.effectiveDate = v; }
public void setEffectiveTo(String v) { this.effectiveTo = v; }
public void setEndDate(String v) { this.endDate = v; }
public void setInterestCalculateSelector(Integer v) { this.interestCalculateSelector = v; }
public void setAveragePeriod(String v) { this.averagePeriod = v; }
public void setAutoPost(Boolean v) { this.autoPost = v; }
public void setFrequencyFixDay(Integer v) { this.frequencyFixDay = v; }
public void setLastInterestDate(String v) { this.lastInterestDate = v; }
public void setEnableLockinPeriod(Boolean v) { this.enableLockinPeriod = v; }
public void setAutoDebitFacility(Boolean v) { this.autoDebitFacility = v; }
public void setLoanFacility(Boolean v) { this.loanFacility = v; }
public void setPrematureWithdrawalOption(Boolean v) { this.prematureWithdrawalOption = v; }
public void setTenureFlexibility(Boolean v) { this.tenureFlexibility = v; }
public void setLienMarked(Boolean v) { this.lienMarked = v; }
public void setMaturityInstructions(Boolean v) { this.maturityInstructions = v; }
public void setCreditMaturityProceeds(Boolean v) { this.creditMaturityProceeds = v; }
public void setPenaltyGracePeriodMissedInstallments(Boolean v) { this.penaltyGracePeriodMissedInstallments = v; }
public void setPanelRequestApplicable(Boolean v) { this.panelRequestApplicable = v; }
public void setNoPenaltyNomineeHeirClosure(Boolean v) { this.noPenaltyNomineeHeirClosure = v; }
public void setDeceasedSettlement(Boolean v) { this.deceasedSettlement = v; }
public void setAllowDebitTxnAfterDueDate(Boolean v) { this.allowDebitTxnAfterDueDate = v; }
public void setAccountClosedZeroBalanceInDayClosing(Boolean v) { this.accountClosedZeroBalanceInDayClosing = v; }
public void setBalanceFrequency(String v) { this.balanceFrequency = v; }
// CBS field getters
public String getProductCode() { return productCode; }
public String getAccountType() { return accountType; }
public String getFdType() { return fdType; }
public Long getGlAccountId() { return glAccountId; }
public String getGlAccountName() { return glAccountName; }
public String getCustomerSegment() { return customerSegment; }
public Boolean getIntroducerRequired() { return introducerRequired; }
public Boolean getShareLinkingEnabled() { return shareLinkingEnabled; }
public Boolean getNominationFacility() { return nominationFacility; }
public Boolean getDormancyAlert() { return dormancyAlert; }
public Boolean getIsDormancyTrackingActive() { return isDormancyTrackingActive; }
public Long getDaysToInactive() { return daysToInactive; }
public Long getDaysToDormancy() { return daysToDormancy; }
public Long getDaysToEscheat() { return daysToEscheat; }
public void copyCbsFieldsFrom(FixedDepositProductData src) {
if (src == null) return;
this.accountType = src.accountType;
this.fdType = src.fdType;
this.customerSegmentOptions = src.customerSegmentOptions;
this.productCode = src.productCode;
this.glAccountId = src.glAccountId;
this.glAccountName = src.glAccountName;
this.interestCalculationTypeOption = src.interestCalculationTypeOption;
this.periodFrequencyOptions = src.periodFrequencyOptions;
this.yesNoOptions = src.yesNoOptions;
this.accountTypeOptions = src.accountTypeOptions;
this.customerSegment = src.customerSegment;
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.effectiveDate = src.effectiveDate;
this.effectiveTo = src.effectiveTo;
this.endDate = src.endDate;
this.interestCalculateSelector = src.interestCalculateSelector;
this.averagePeriod = src.averagePeriod;
this.autoPost = src.autoPost;
this.frequencyFixDay = src.frequencyFixDay;
this.lastInterestDate = src.lastInterestDate;
this.enableLockinPeriod = src.enableLockinPeriod;
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;
this.accountClosedZeroBalanceInDayClosing = src.accountClosedZeroBalanceInDayClosing;
this.balanceFrequency = src.balanceFrequency;
this.withdrawalFeeForTransfers = src.withdrawalFeeForTransfers;
}
private Boolean withdrawalFeeForTransfers;
public void setWithdrawalFeeForTransfers(Boolean v) { this.withdrawalFeeForTransfers = v; }
public Boolean getWithdrawalFeeForTransfers() { return withdrawalFeeForTransfers; }
}
@@ -187,6 +187,65 @@ public class DepositProductAssembler {
// update product reference
productTermAndPreClosure.updateProductReference(fixedDepositProduct);
// CBS Custom Fields
fixedDepositProduct.setAccountType(command.stringValueOfParameterNamed("accountType"));
fixedDepositProduct.setCustomerSegment(command.stringValueOfParameterNamed("customerSegment"));
final String fdProductCode = command.stringValueOfParameterNamed("productCode");
fixedDepositProduct.setProductCode((fdProductCode != null && !fdProductCode.isBlank()) ? fdProductCode : null);
final String fdType = command.stringValueOfParameterNamed("fdType");
fixedDepositProduct.setFdType((fdType != null && !fdType.isBlank()) ? fdType : null);
if (command.parameterExists("glAccountId")) {
fixedDepositProduct.setGlAccountId(command.longValueOfParameterNamed("glAccountId"));
}
fixedDepositProduct.setIntroducerRequired(command.booleanPrimitiveValueOfParameterNamed("introducerRequired"));
fixedDepositProduct.setShareLinkingEnabled(command.booleanPrimitiveValueOfParameterNamed("shareLinkingEnabled"));
fixedDepositProduct.setEffectiveDate(parseCbsDate(command.stringValueOfParameterNamed("effectiveDate")));
fixedDepositProduct.setEffectiveTo(parseCbsDate(command.stringValueOfParameterNamed("effectiveTo")));
fixedDepositProduct.setEndDate(parseCbsDate(command.stringValueOfParameterNamed("endDate")));
fixedDepositProduct.setNominationFacility(command.booleanPrimitiveValueOfParameterNamed("nominationFacility"));
final boolean dormancyAlertValue = command.booleanPrimitiveValueOfParameterNamed("dormancyAlert");
fixedDepositProduct.setDormancyAlert(dormancyAlertValue);
// isDormancyTrackingActive is driven by dormancyAlert for FD products (same as RD)
fixedDepositProduct.setIsDormancyTrackingActive(dormancyAlertValue);
if (command.parameterExists("daysToInactive")) {
fixedDepositProduct.setDaysToInactive(command.longValueOfParameterNamed("daysToInactive"));
}
if (command.parameterExists("daysToDormancy")) {
fixedDepositProduct.setDaysToDormancy(command.longValueOfParameterNamed("daysToDormancy"));
}
if (command.parameterExists("daysToEscheat")) {
fixedDepositProduct.setDaysToEscheat(command.longValueOfParameterNamed("daysToEscheat"));
}
fixedDepositProduct.setInterestCalculateSelector(command.integerValueOfParameterNamed("interestCalculateSelector"));
fixedDepositProduct.setAveragePeriod(command.stringValueOfParameterNamed("averagePeriod"));
fixedDepositProduct.setAutoPost(command.booleanPrimitiveValueOfParameterNamed("autoPost"));
fixedDepositProduct.setFrequencyFixDay(command.integerValueOfParameterNamed("frequencyFixDay"));
fixedDepositProduct.setLastInterestDate(parseCbsDate(command.stringValueOfParameterNamed("lastInterestDate")));
fixedDepositProduct.setEnableLockinPeriod(command.booleanPrimitiveValueOfParameterNamed("enableLockinPeriod"));
fixedDepositProduct.setAutoDebitFacility(command.booleanPrimitiveValueOfParameterNamed("autoDebitFacility"));
fixedDepositProduct.setLoanFacility(command.booleanPrimitiveValueOfParameterNamed("loanFacility"));
fixedDepositProduct.setPrematureWithdrawalOption(command.booleanPrimitiveValueOfParameterNamed("prematureWithdrawalOption"));
fixedDepositProduct.setTenureFlexibility(command.booleanPrimitiveValueOfParameterNamed("tenureFlexibility"));
fixedDepositProduct.setLienMarked(command.booleanPrimitiveValueOfParameterNamed("lienMarked"));
fixedDepositProduct.setMaturityInstructions(command.booleanPrimitiveValueOfParameterNamed("maturityInstructions"));
fixedDepositProduct.setCreditMaturityProceeds(command.booleanPrimitiveValueOfParameterNamed("creditMaturityProceeds"));
fixedDepositProduct.setPenaltyGracePeriodMissedInstallments(
command.booleanPrimitiveValueOfParameterNamed("penaltyGracePeriodMissedInstallments"));
fixedDepositProduct.setPanelRequestApplicable(command.booleanPrimitiveValueOfParameterNamed("panelRequestApplicable"));
fixedDepositProduct.setNoPenaltyNomineeHeirClosure(
command.booleanPrimitiveValueOfParameterNamed("noPenaltyNomineeHeirClosure"));
fixedDepositProduct.setDeceasedSettlement(command.booleanPrimitiveValueOfParameterNamed("deceasedSettlement"));
fixedDepositProduct.setAllowDebitTxnAfterDueDate(command.booleanPrimitiveValueOfParameterNamed("allowDebitTxnAfterDueDate"));
if (command.parameterExists("accountClosedZeroBalanceInDayClosing")) {
fixedDepositProduct.setAccountClosedZeroBalanceInDayClosing(
command.booleanPrimitiveValueOfParameterNamed("accountClosedZeroBalanceInDayClosing"));
}
fixedDepositProduct.setBalanceFrequency(command.stringValueOfParameterNamed("balanceFrequency"));
if (command.parameterExists("withdrawalFeeForTransfers")) {
fixedDepositProduct.setWithdrawalFeeApplicableForTransfer(command.booleanPrimitiveValueOfParameterNamed("withdrawalFeeForTransfers"));
}
fixedDepositProduct.validateDomainRules();
return fixedDepositProduct;
@@ -338,6 +397,10 @@ public class DepositProductAssembler {
recurringDepositProduct.setDeceasedSettlement(command.booleanPrimitiveValueOfParameterNamed("deceasedSettlement"));
recurringDepositProduct.setAllowDebitTxnAfterDueDate(command.booleanPrimitiveValueOfParameterNamed("allowDebitTxnAfterDueDate"));
if (command.parameterExists("withdrawalFeeForTransfers")) {
recurringDepositProduct.setWithdrawalFeeApplicableForTransfer(command.booleanPrimitiveValueOfParameterNamed("withdrawalFeeForTransfers"));
}
recurringDepositProduct.validateDomainRules();
return recurringDepositProduct;
@@ -26,6 +26,7 @@ import static org.apache.fineract.portfolio.savings.DepositsApiConstants.maxDepo
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.DiscriminatorValue;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -34,6 +35,7 @@ import jakarta.persistence.JoinTable;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Transient;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
@@ -76,6 +78,17 @@ public class FixedDepositProduct extends SavingsProduct {
@Transient
protected InterestRateChartAssembler chartAssembler;
@Column(name = "fd_type", length = 50)
private String fdType;
public String getFdType() {
return fdType;
}
public void setFdType(String fdType) {
this.fdType = fdType;
}
protected FixedDepositProduct() {
}
@@ -161,6 +174,12 @@ public class FixedDepositProduct extends SavingsProduct {
actualChanges.putAll(super.update(command));
if (command.isChangeInStringParameterNamed("fdType", this.fdType)) {
final String newValue = command.stringValueOfParameterNamed("fdType");
actualChanges.put("fdType", newValue);
this.fdType = (newValue != null && !newValue.isBlank()) ? newValue : null;
}
if (this.productTermAndPreClosure != null) {
actualChanges.putAll(this.productTermAndPreClosure.update(command, baseDataValidator));
}
@@ -3957,6 +3957,13 @@ public class SavingsAccount extends AbstractAuditableWithUTCDateTimeCustom<Long>
@Column(name = "linked_account_no", length = 50)
private String linkedAccountNo;
@Column(name = "nomination_facility")
private Boolean nominationFacility;
@Column(name = "auto_debit_facility")
private Boolean autoDebitFacility;
@jakarta.persistence.OneToOne(cascade = jakarta.persistence.CascadeType.ALL, mappedBy = "savingsAccount", orphanRemoval = true, fetch = FetchType.LAZY)
private SavingsAccountFacilityConfig facilityConfig;
@@ -4022,4 +4029,10 @@ public class SavingsAccount extends AbstractAuditableWithUTCDateTimeCustom<Long>
public List<SavingsAccountJointHolder> getJointHolders() { return jointHolders; }
public void setJointHolders(List<SavingsAccountJointHolder> v) { this.jointHolders = v; }
public Boolean getNominationFacility() { return nominationFacility; }
public void setNominationFacility(Boolean v) { this.nominationFacility = v; }
public Boolean getAutoDebitFacility() { return autoDebitFacility; }
public void setAutoDebitFacility(Boolean v) { this.autoDebitFacility = v; }
}
@@ -246,7 +246,7 @@ public class SavingsProduct extends AbstractPersistableCustom<Long> {
@Column(name = "customer_segment", length = 50)
private String customerSegment;
@Column(name = "product_code", length = 20, unique = true)
@Column(name = "product_code", length = 20)
private String productCode;
@Column(name = "gl_account_id")
@@ -1034,6 +1034,10 @@ public class SavingsProduct extends AbstractPersistableCustom<Long> {
return this.withdrawalFeeApplicableForTransfer;
}
public void setWithdrawalFeeApplicableForTransfer(boolean withdrawalFeeApplicableForTransfer) {
this.withdrawalFeeApplicableForTransfer = withdrawalFeeApplicableForTransfer;
}
public boolean isAllowOverdraft() {
return this.allowOverdraft;
}