charges add module add in the saving account and current account

This commit is contained in:
Nitesh Yadav
2026-05-16 21:20:30 +05:30
parent 28fa6d9615
commit d0c8be4ee9
29 changed files with 91869 additions and 2607 deletions
@@ -291,6 +291,17 @@ public class CurrentAccount extends AbstractAuditableCustom {
@Column(name = "avg_balance_calc_period", length = 10)
private String avgBalanceCalcPeriod;
// Extra fields copied from product (not in m_savings_account dormancy set)
@Column(name = "account_closed_zero_balance_in_day_closing")
private Boolean accountClosedZeroBalanceInDayClosing = false;
@Column(name = "valid_for_period", length = 10)
private String validForPeriod;
@Column(name = "od_account_closed_zero_balance_in_day_closing")
private boolean odAccountClosedZeroBalanceInDayClosing = false;
// Relationships
@OneToMany(mappedBy = "currentAccount", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
private List<CurrentAccountTransaction> transactions = new ArrayList<>();
@@ -383,4 +394,13 @@ public class CurrentAccount extends AbstractAuditableCustom {
this.statusEnum = 600;
this.closedOnDate = closedOnDate;
}
public void setMinRequiredOpeningBalance(java.math.BigDecimal val) { this.minRequiredOpeningBalance = val; }
public void setMinRequiredBalance(java.math.BigDecimal val) { this.minRequiredBalance = val; }
public void setEnforceMinRequiredBalance(boolean val) { this.enforceMinRequiredBalance = val; }
public void setLockinPeriodFrequency(Integer val) { this.lockinPeriodFrequency = val; }
public void setLockinPeriodFrequencyEnum(Integer val) { this.lockinPeriodFrequencyEnum = val; }
public void setNominalAnnualInterestRateOverdraft(java.math.BigDecimal val) { this.nominalAnnualInterestRateOverdraft = val; }
public void setWithdrawalFeeForTransfer(boolean val) { this.withdrawalFeeForTransfer = val; }
public void setMinOverdraftForInterestCalculation(java.math.BigDecimal val) { this.minOverdraftForInterestCalculation = val; }
}
@@ -106,4 +106,22 @@ public class CurrentAccountCharge extends AbstractPersistableCustom<Long> {
private LocalDate chargeResetDate;
protected CurrentAccountCharge() {}
public static CurrentAccountCharge createFromFacility(final CurrentAccount account, final Charge charge) {
final CurrentAccountCharge c = new CurrentAccountCharge();
c.currentAccount = account;
c.charge = charge;
c.chargeTimeEnum = charge.getChargeTimeType();
c.chargeCalculationEnum = charge.getChargeCalculation();
c.amount = charge.getAmount();
c.amountOutstandingDerived = charge.getAmount();
c.penalty = charge.isPenalty();
c.active = true;
if (charge.getFeeOnMonthDay() != null) {
c.feeOnMonth = charge.getFeeOnMonthDay().getMonthValue();
c.feeOnDay = charge.getFeeOnMonthDay().getDayOfMonth();
}
c.feeInterval = charge.getFeeInterval();
return c;
}
}
@@ -92,7 +92,7 @@ public class CurrentAccountFacilityConfig extends AbstractPersistableCustom<Long
@Column(name = "mobile_banking", nullable = false)
private boolean mobileBanking = false;
protected CurrentAccountFacilityConfig() {}
public CurrentAccountFacilityConfig() {}
public static CurrentAccountFacilityConfig createFor(CurrentAccount account) {
CurrentAccountFacilityConfig cfg = new CurrentAccountFacilityConfig();
@@ -122,6 +122,18 @@ public class CurrentAccountTransaction extends AbstractPersistableCustom<Long> {
return txn;
}
public static CurrentAccountTransaction chargeDeduction(CurrentAccount account, Office office,
BigDecimal amount, LocalDate transactionDate) {
CurrentAccountTransaction txn = new CurrentAccountTransaction();
txn.currentAccount = account;
txn.office = office;
txn.transactionTypeEnum = 7; // PAY_CHARGE
txn.amount = amount;
txn.transactionDate = transactionDate;
txn.submittedOnDate = transactionDate;
return txn;
}
public static CurrentAccountTransaction withdrawal(CurrentAccount account, Office office,
BigDecimal amount, LocalDate transactionDate, String refNo) {
CurrentAccountTransaction txn = new CurrentAccountTransaction();
@@ -447,6 +447,10 @@ public class CurrentProduct extends AbstractPersistableCustom<Long> {
return this.withHoldTax;
}
public boolean isLienAllowed() { return this.lienAllowed; }
public BigDecimal getMaxAllowedLienLimit() { return this.maxAllowedLienLimit; }
public BigDecimal getMinBalanceForInterestCalculation() { return this.minBalanceForInterestCalculation; }
public TaxGroup getTaxGroup() {
return this.taxGroup;
}
@@ -867,6 +871,14 @@ public class CurrentProduct extends AbstractPersistableCustom<Long> {
public void setLastInterestDate(LocalDate lastInterestDate) { this.lastInterestDate = lastInterestDate; }
public boolean isEnableLockinPeriod() { return enableLockinPeriod; }
public void setEnableLockinPeriod(boolean enableLockinPeriod) { this.enableLockinPeriod = enableLockinPeriod; }
public BigDecimal getMinRequiredOpeningBalance() { return minRequiredOpeningBalance; }
public BigDecimal getMinRequiredBalance() { return minRequiredBalance; }
public boolean isEnforceMinRequiredBalance() { return enforceMinRequiredBalance; }
public Integer getLockinPeriodFrequency() { return lockinPeriodFrequency; }
public Integer getLockinPeriodFrequencyType() { return lockinPeriodFrequencyType; }
public BigDecimal getNominalAnnualInterestRateOverdraft() { return nominalAnnualInterestRateOverdraft; }
public boolean isWithdrawalFeeApplicableForTransfer() { return withdrawalFeeApplicableForTransfer; }
public BigDecimal getMinOverdraftForInterestCalculation() { return minOverdraftForInterestCalculation; }
public String getBalanceFrequency() { return balanceFrequency; }
public void setBalanceFrequency(String balanceFrequency) { this.balanceFrequency = balanceFrequency; }
public Boolean getAccountClosedZeroBalanceInDayClosing() { return accountClosedZeroBalanceInDayClosing; }