API can be invoked by multiple service and systems on behalf of end users.
mvn clean package
Start server on 8080 port:
java -jar target/jjtransfer-<version>.jar
Start server on another port:
java -Dhttp.port=8888 -jar target/jjtransfer-<version>.jar
... or start server by maven:
mvn exec:java
POST /accounts
Request:
{
"accountId" : "Alice"
}
Response: AccountRm
{
"accountId" : "userName",
"balance" : "USD 1234.50000"
}
GET /accounts/(id)
Response: AccountRm
POST /accounts/(id)/deposit
Request:
{
"depositAmount" : 1234.5
}
POST /accounts/(id)/transfers
Request:
{
"destinationAccountId" : "Bob",
"transferAmount" : 100
}
Response: TransferRm
{
"transferId" : "<some uuid>",
"sourceAccountId" : "Alice",
"destinationAccountId" : "Bob",
"transferAmount" : "USD 100.00000"
"state" : "NEW"
}
PUT /accounts/(id)/transfers/(tid)
Response: TransferRm
GET /accounts/(id)/transfers
Response: list of TransferRm
POST /accounts/(id)/transfers/(tid)
Response: TransferRm