Skip to content

samfrown/jjtransfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jjtransfer - RESTful API for money transfer

API can be invoked by multiple service and systems on behalf of end users.

Design

Implemented use cases Use cases

Class diagram and data model Class diagram

Build

mvn clean package

Running

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

API

Accounts

Create account
POST /accounts

Request:

{
  "accountId" : "Alice"
}

Response: AccountRm

{
  "accountId" : "userName",
  "balance" : "USD 1234.50000"
}
Get account info
GET /accounts/(id)

Response: AccountRm

Deposit to account
POST /accounts/(id)/deposit

Request:

{
  "depositAmount" : 1234.5
}

Transfers

Prepare transfer
POST /accounts/(id)/transfers

Request:

{ 
  "destinationAccountId" : "Bob",
  "transferAmount" : 100 
}

Response: TransferRm

{
  "transferId" : "<some uuid>",
  "sourceAccountId" : "Alice",
  "destinationAccountId" : "Bob",
  "transferAmount" : "USD 100.00000"
  "state" : "NEW"
}
Update prepared transfer
PUT /accounts/(id)/transfers/(tid)

Response: TransferRm

Review prepared transfers
GET /accounts/(id)/transfers

Response: list of TransferRm

Commit transfer
POST /accounts/(id)/transfers/(tid)

Response: TransferRm

Releases

No releases published

Packages

No packages published

Languages