- I created the
BankAccountService class to provide the functionalities outlined in the spec:
- Account creation ->
createBankAccount()
- Deposit ->
deposit()
- Withdrawal ->
withdraw()
- Transfer ->
transfer
- Account balance: ->
getBalanceOfAccount()
- Data is stored in memory in the
BankAccountRepository class via class variables.
- This is a singleton class initialized in
init.ts.
- I've also created the
user-accounts domain to mimic real life business flow where:
- Ony valid users within your application should be able to create bank accounts
- Users can create multiple bank accounts
# Install dependencies
npm install
# Run all tests
npm run test