Rest api to provide wallet withdrawals.
The api is expected to enable transfer of money from wallet account to bank account.
// UML Sequence Diagram
User -initiate request-> router Engine
router Engine -Check if the funds are available-> Wallet
Wallet -. funds available-> router Engine
router Engine -. verify user and funds -> User
router Engine - persist transaction -> router Engine
router Engine -deposit to recipient-> Bank Engine
Bank Engine -. successful deposit -> router Engine
router Engine - update transaction status -> router Engine
router Engine - update wallet balance -> Wallet
Wallet -. update successful -> router Engine
router Engine -. transaction successful -> User
High level Architectural diagram.
How to run the application
- Have docker on your machine.
- Run docker-compose build
- Run docker-compose up
- Import postman collection file under postman_collection folder
- Execute the post
Expectation
1.Check wallet balance to be done and compared with the amount to be transferred.
2.If balance is less than the amount return.
3.Conitune if balance higher. Calculate charges and do the bank transfer.
4.If transfer successful, update the wallet balance
5.Persist the transaction.
What I could have done better
1.I could have included security module with spring security
2.I could have have included cloud architecture in my design
3.I could have used k8s for orchestration
4.I could have improved my error handling