RESTful API for money transfer between two accounts
- Java 11
- JAX-RS API
- Jetty
- H2 in memory database
- Hibernate
- JUnit
- Mockito
- Lombok
- Mapstruct
- Maven
- Generate resources running:
mvn clean install
- Run the fat jar:
java -jar target/money-transfer-api-0.0.1-SNAPSHOT-jar-with-dependencies.jar
POST : http://localhost:8080/clients
Request Payload:
{
"name": "John",
"document": "DOC10231",
"initialDeposit" : "10.55"
}
Response:
{
"id": 1,
"name": "John",
"account": {
"balance": 10.55
}
}
GET : http://localhost:8080/clients/{clientId}
Response:
{
"id": 1,
"name": "John",
"document": "DOC10231",
"account": {
"id": 2,
"balance": 10.55
}
}
POST : http://localhost:8080/clients/{clientId}/accounts/transactions
Request Payload:
{
"amount" : 5,
"toClientId" : 3
}
Response:
{
"newBalance": "5.55"
}