Skip to content

Commit

Permalink
Update SavingsAccount.java
Browse files Browse the repository at this point in the history
  • Loading branch information
JitseGoutbeek authored Jun 28, 2024
1 parent 3f24c65 commit 3a4155f
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
public class SavingsAccount extends Account {
CheckingAccount registeredCounterAccount;

@Override
public Transfer makeTransfer(String counterAccount, Money amount)
public Transfer makeTransfer(Money amount)
throws BusinessException {
Transfer result = super.makeTransfer(counterAccount, amount);
if (result.getCounterAccount().equals(this.registeredCounterAccount)) {
CheckingAccount acct = Accounts.findAcctByNumber(counterAccount);
Transfer result = new Transfer(this, acct, amount);
return result;
} else {
throw new BusinessException("Counter-account not registered!");
Expand Down

0 comments on commit 3a4155f

Please sign in to comment.