Skip to content

Commit

Permalink
Add AccountAuditor#getTransactions (#5914)
Browse files Browse the repository at this point in the history
* API: Add AccountAuditor#getTransactions

* Remove explicit type
  • Loading branch information
Warriorrrr authored May 22, 2022
1 parent eef4b9f commit c6e4c8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@

public interface AccountAuditor extends AccountObserver {
/**
* Gets the transactions associated with this account. This should
* Gets the formatted transactions associated with this account. This should
* return the history in chronological order.
*
* @return The transaction history from this account.
* @return The formatted transaction history from this account.
*/
List<String> getAuditHistory();

/**
* Gets the transactions associated with this account. This should
* return the history in chronological order.
*
* @return The transaction history from this account.
*/
List<BankTransaction> getTransactions();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class GovernmentAccountAuditor implements AccountAuditor {

private List<BankTransaction> transactions = new ArrayList<BankTransaction>();
private final List<BankTransaction> transactions = new ArrayList<>();

@Override
public void withdrew(Account account, double amount, String reason) {
Expand Down Expand Up @@ -43,4 +43,9 @@ public List<String> getAuditHistory() {

return history;
}

@Override
public List<BankTransaction> getTransactions() {
return this.transactions;
}
}

0 comments on commit c6e4c8b

Please sign in to comment.