Skip to content

ATM low level design #7

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

Merged
merged 8 commits into from
Apr 25, 2025
Merged

ATM low level design #7

merged 8 commits into from
Apr 25, 2025

Conversation

codeimmortal
Copy link
Contributor

This design Consist of,

  1. Different state of ATM (insertCard , insertpin , select-account, cash dispatcher).
  2. State design pattern for different state of ATM.
  3. Chain of responsibility principle for withdrawing cash.
  4. Template pattern for handling error of each place in one place.
  5. Concurrency control, preventing atm to conflict.

Copy link
Owner

@thesaltree thesaltree left a comment

Choose a reason for hiding this comment

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

@codeimmortal thank you for the implementation. I added few potential issues and suggested changes. Please make improvements accordingly.

@codeimmortal
Copy link
Contributor Author

Updated the change provided. @thesaltree

@codeimmortal codeimmortal requested a review from thesaltree April 12, 2025 16:47
@codeimmortal
Copy link
Contributor Author

@thesaltree , Just Reminder

@thesaltree
Copy link
Owner

@codeimmortal thanks for addressing the feedback.
Another question, are we actually using InsertPin in the flow and validating the pin using this logic?

        if pin == "1111" {
		return nil
	} else {
		return errors.New("Pin is not valid")
	}

@codeimmortal
Copy link
Contributor Author

@thesaltree , code was added there. But now it has been added to flow also. ATM will ask for pin also.

@codeimmortal
Copy link
Contributor Author

Let me know if validation is done.

@thesaltree thesaltree merged commit b4c68e6 into thesaltree:main Apr 25, 2025
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