mutiple-withdraw-charges-fineract-1386
This commit is contained in:
-17
@@ -2583,14 +2583,6 @@ public class SavingsAccount extends AbstractPersistableCustom {
|
|||||||
throw new PlatformApiDataValidationException(dataValidationErrors);
|
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
|
// Only one annual fee is supported per account
|
||||||
if (savingsAccountCharge.isAnnualFee()) {
|
if (savingsAccountCharge.isAnnualFee()) {
|
||||||
if (this.isAnnualFeeExists()) {
|
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() {
|
private boolean isAnnualFeeExists() {
|
||||||
for (SavingsAccountCharge charge : this.charges()) {
|
for (SavingsAccountCharge charge : this.charges()) {
|
||||||
if (charge.isAnnualFee()) {
|
if (charge.isAnnualFee()) {
|
||||||
|
|||||||
-7
@@ -176,13 +176,6 @@ public class SavingsAccountChargeAssembler {
|
|||||||
.failWithCodeNoParameterAddedToErrorCode("currency.and.charge.currency.not.same");
|
.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 (charge.isAnnualFee()) {
|
||||||
if (isOneAnnualPresent) {
|
if (isOneAnnualPresent) {
|
||||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("multiple.annual.fee.per.account.not.supported");
|
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("multiple.annual.fee.per.account.not.supported");
|
||||||
|
|||||||
Reference in New Issue
Block a user