-
Notifications
You must be signed in to change notification settings - Fork 24
feat: implement bank account system with audit logging to BankATM #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this is WIP, so keep going.
|
||
import java.util.ArrayList; | ||
|
||
public class AuditLog { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a bad implementation, good work. You might be interested in a library called Log4j
that could be useful to you as well, but this is good enough for your homework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored AuditLog class to Implement Log4j logic instead of custom implementation.
lesson_17/bank/bank_app/src/main/java/com/codedifferently/lesson17/bank/BankAccount.java
Outdated
Show resolved
Hide resolved
@@ -11,6 +11,7 @@ public class BankAtm { | |||
|
|||
private final Map<UUID, Customer> customerById = new HashMap<>(); | |||
private final Map<String, CheckingAccount> accountByNumber = new HashMap<>(); | |||
private final AuditLog auditLog = new AuditLog(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Violates the D in SOLID, no?
* The {@code SavingsAccount} class represents a savings account in a banking system. It extends the | ||
* {@code CheckingAccount} class and provides additional functionality specific to savings accounts. | ||
*/ | ||
public class SavingsAccount extends CheckingAccount { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A savings accounts is not a checking account.
@@ -68,9 +68,11 @@ public void withdraw(double amount) throws InsufficientFundsException { | |||
if (isClosed()) { | |||
throw new IllegalStateException("Cannot withdraw from a closed account"); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
I have started the assignment, yet have not completed it. I have a savings account made that will override the withdraw method to not allow withdrawls if the user is on the savings account. I need to implement a feature that checks which account the user is on. I also have plans to add an Audit log feature because I think it will be a good way to teach me SOLID principles.