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) {
3636 * @return The unique set of accounts owned by the customer.
3737 */
3838 public Set <CheckingAccount > findAccountsByCustomerId (UUID customerId ) {
39+ auditLog .log ("Finding accounts for customer " + customerId );
3940 return customerById .containsKey (customerId )
4041 ? customerById .get (customerId ).getAccounts ()
4142 : Set .of ();
@@ -75,6 +76,7 @@ public void depositFunds(String accountNumber, Check check) {
7576 public void withdrawFunds (String accountNumber , double amount ) {
7677 CheckingAccount account = getAccountOrThrow (accountNumber );
7778 account .withdraw (amount );
79+ auditLog .log ("Withdrew " + amount + " from account " + accountNumber );
7880 }
7981
8082 /**
@@ -88,6 +90,7 @@ private CheckingAccount getAccountOrThrow(String accountNumber) {
8890 if (account == null || account .isClosed ()) {
8991 throw new AccountNotFoundException ("Account not found" );
9092 }
93+ auditLog .log ("Retrieved account " + accountNumber );
9194 return account ;
9295 }
9396}
You can’t perform that action at this time.
0 commit comments