4 create bank account #12
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a feature to create a bank account as part of the bank account management system. The implementation includes robust account creation functionality, validation for input data, and comprehensive unit tests to ensure reliability.
Key Features
Account Creation:
Allows users to create a new bank account with the following details:
Unique account number
Owner's name
Email address
Initial balance set to 0
Validates the input data to ensure correctness and prevent duplicate accounts.
Validation:
Checks for non-empty owner name.
Ensures email addresses are valid using a regex-based validation.
Prevents creation of duplicate accounts based on email address.
Tests:
Comprehensive unit tests using Jest to validate the feature, covering:
Successful account creation.
Prevention of duplicate accounts.
Handling of invalid email addresses.
Ensuring owner name is not empty.
Test cases ensure that the system behaves predictably and handles edge cases appropriately.