File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
lesson_17/bank/bank_app/src/main/java/com/codedifferently/lesson17/bank Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public void addAccount(CheckingAccount account) {
36
36
* @return The unique set of accounts owned by the customer.
37
37
*/
38
38
public Set <CheckingAccount > findAccountsByCustomerId (UUID customerId ) {
39
+ auditLog .log ("Finding accounts for customer " + customerId );
39
40
return customerById .containsKey (customerId )
40
41
? customerById .get (customerId ).getAccounts ()
41
42
: Set .of ();
@@ -75,6 +76,7 @@ public void depositFunds(String accountNumber, Check check) {
75
76
public void withdrawFunds (String accountNumber , double amount ) {
76
77
CheckingAccount account = getAccountOrThrow (accountNumber );
77
78
account .withdraw (amount );
79
+ auditLog .log ("Withdrew " + amount + " from account " + accountNumber );
78
80
}
79
81
80
82
/**
@@ -88,6 +90,7 @@ private CheckingAccount getAccountOrThrow(String accountNumber) {
88
90
if (account == null || account .isClosed ()) {
89
91
throw new AccountNotFoundException ("Account not found" );
90
92
}
93
+ auditLog .log ("Retrieved account " + accountNumber );
91
94
return account ;
92
95
}
93
96
}
You can’t perform that action at this time.
0 commit comments