Table of Contents
A new intra-bank payment transfer system to allow real time payments between internal accounts.
System should be:
- Accessible by Restful Webservices
- Able to tell account balance in real time
- Able to get mini statement for last 20 transactions
- Able to transfer money in real time
- Able to fetch accounts details from accounts service (new / deleted)
- Given valid account details and positive funds available When account-id 111 sends £10 to account-id 222 Then account-111’s account should be debited with £10 And account-222’s account should be credited with £10
- Given invalid receiver account details and positive funds available When account-id 111 sends £10 to account-id 999 Then system should reject the transfer and report invalid account details
- Given valid account details and no funds available (£0) When account-id 111 sends £10 to account-id 222 Then system should reject the transfer with error Insufficient funds available
- Given valid account details When I call a service to check my account balance Then system should be able to report my current balance
- Given valid account details When I call mini-statement service Then system should be able to show me last 20 transactions
- Given invalid account details When I call a service to check my account balance Then system should return error saying invalid account number
- Given invalid account details When I call mini statement service Then system should return error saying invalid account number
- Java
- Spring Boot
- Spring Data JPA
- In-memory H2 database
- Flyway for database migrations
- JUnit 5
- Lombok
- Maven
- Swagger for API documentation
To get this project up and running simply clone this repository using your preferred IDE.
If you wish to build the project run the following command at the root of the project:
mvn clean install
To get the application up and running execute the main method found at the following path:
src/main/java/com/mastercard/paymenttransfersystem/PaymentTransferApplication.java
This project will pre-populate the database with the following accounts:
Account 1: id=786, balance=10000, currency=USD, state=ACTIVE
Account 2: id=555, balance=10000, currency=USD, state=ACTIVE)
All endpoints have been documented using swagger. Once the project is up and running the documentation can be accessed via this link:
http://localhost:8080/swagger-ui.html
Fahad Ali Sajad - @LinkedIn - Fahadalisajad@hotmail.com