Skip to content

alexgaspard/moneytransfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DepShield Badge

Money Transfer

Simple REST API to transfer money between accounts.

Run server with:

mvn clean install exec:java

Unit tests are available in src/test, integration tests are in it/test and should be executed with a server running on localhost:8080 without any previous data. To run unit tests:

mvn test

To run integration tests on API:

mvn test -Dtest=RestIT

Base URL is http://localhost:8080/api

Version: 1.0.0

License: MIT

/accounts


POST

Summary: Create a new account

Description:

Responses

Code Description
201 Created
GET

Summary: Get accounts

Description:

Responses

Code Description Schema
200 Success [ Account ]
404 Account not found

/accounts/{id}


GET

Summary: Get account by its identifier

Description:

Parameters

Name Located in Description Required Schema
id path Account unique identifier. Yes integer

Responses

Code Description Schema
200 Success Account
404 Account not found

/accounts/{id}/transactions


POST

Summary: Create a new transaction for this account

Description:

Parameters

Name Located in Description Required Schema
id path Account unique identifier. Yes integer
body body Transaction to create Yes Transaction

Responses

Code Description
201 Created
400 Bad request, e.g. if you exceed the overdraft limit
404 Account not found
GET

Summary: Get transactions for this account

Description:

Parameters

Name Located in Description Required Schema
id path Account unique identifier. Yes integer

Responses

Code Description Schema
200 Success [ Transaction ]
404 Account not found

/accounts/{id}/transactions/{id2}


GET

Summary: Get transaction by its identifier

Description:

Parameters

Name Located in Description Required Schema
id path Account unique identifier. Yes integer
id2 path Transaction unique identifier. Yes integer

Responses

Code Description Schema
200 Success Transaction
404 Account or transaction not found (transaction must be related to this account)

Models


Account

Name Type Description Required
id long Account unique identifier. Yes
balance number Account balance. No
transactions [ Transaction ] Transactions list related to this account. No

Transaction

Name Type Description Required
id long Transaction unique identifier. Yes
amount number Amount transfered by this transaction. Yes
type string Transaction type. Yes
related long Related account unique identifier. Yes
date dateTime Transaction date. No

API doc generated using swagger-markdown

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors