mutiple-withdraw-charges-fineract-1386

This commit is contained in:
rrpawar96
2021-10-09 08:02:31 +08:00
committed by Petri Tuomola
parent d0cadc6ac9
commit bcdf9df136
2 changed files with 0 additions and 24 deletions
@@ -2583,14 +2583,6 @@ public class SavingsAccount extends AbstractPersistableCustom {
throw new PlatformApiDataValidationException(dataValidationErrors);
}
// Only one withdrawal fee is supported per account
if (savingsAccountCharge.isWithdrawalFee()) {
if (this.isWithDrawalFeeExists()) {
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("multiple.withdrawal.fee.per.account.not.supported");
throw new PlatformApiDataValidationException(dataValidationErrors);
}
}
// Only one annual fee is supported per account
if (savingsAccountCharge.isAnnualFee()) {
if (this.isAnnualFeeExists()) {
@@ -2619,15 +2611,6 @@ public class SavingsAccount extends AbstractPersistableCustom {
}
private boolean isWithDrawalFeeExists() {
for (SavingsAccountCharge charge : this.charges()) {
if (charge.isWithdrawalFee()) {
return true;
}
}
return false;
}
private boolean isAnnualFeeExists() {
for (SavingsAccountCharge charge : this.charges()) {
if (charge.isAnnualFee()) {
@@ -176,13 +176,6 @@ public class SavingsAccountChargeAssembler {
.failWithCodeNoParameterAddedToErrorCode("currency.and.charge.currency.not.same");
}
if (charge.isWithdrawalFee()) {
if (isOneWithdrawalPresent) {
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("multiple.withdrawal.fee.per.account.not.supported");
}
isOneWithdrawalPresent = true;
}
if (charge.isAnnualFee()) {
if (isOneAnnualPresent) {
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("multiple.annual.fee.per.account.not.supported");