Skip to content

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

Closed
wants to merge 10 commits into from

Conversation

Dlafferty251
Copy link
Contributor

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.

@Dlafferty251 Dlafferty251 changed the title feat: implement bank account system with audit logging and adds a sav… feat: implement bank account system with audit logging to BankATM Apr 14, 2025
Copy link
Contributor

@anthonydmays anthonydmays left a 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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@@ -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();
Copy link
Contributor

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 {
Copy link
Contributor

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");
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants