Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/parths049/money-transfer
A Java RESTful API for money transfers between users accounts
https://github.com/parths049/money-transfer
apache-http-client h2-database jax-rs jetty-server
Last synced: 17 days ago
JSON representation
A Java RESTful API for money transfers between users accounts
- Host: GitHub
- URL: https://github.com/parths049/money-transfer
- Owner: parths049
- Created: 2017-10-19T10:32:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-07T21:54:01.000Z (over 1 year ago)
- Last Synced: 2023-10-20T22:16:24.398Z (about 1 year ago)
- Topics: apache-http-client, h2-database, jax-rs, jetty-server
- Language: Java
- Size: 35.2 KB
- Stars: 20
- Watchers: 2
- Forks: 23
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Money transfer Rest API
A Java RESTful API for money transfers between users accounts
### Technologies
- JAX-RS API
- H2 in memory database
- Log4j
- Jetty Container (for Test and Demo app)
- Apache HTTP Client### How to run
```sh
mvn exec:java
```Application starts a jetty server on localhost port 8080 An H2 in memory database initialized with some sample user and account data To view
- http://localhost:8080/user/test1
- http://localhost:8080/user/test2
- http://localhost:8080/account/1
- http://localhost:8080/account/2### Available Services
| HTTP METHOD | PATH | USAGE |
| -----------| ------ | ------ |
| GET | /user/{userName} | get user by user name |
| GET | /user/all | get all users |
| PUT | /user/create | create a new user |
| POST | /user/{userId} | update user |
| DELETE | /user/{userId} | remove user |
| GET | /account/{accountId} | get account by accountId |
| GET | /account/all | get all accounts |
| GET | /account/{accountId}/balance | get account balance by accountId |
| PUT | /account/create | create a new account
| DELETE | /account/{accountId} | remove account by accountId |
| PUT | /account/{accountId}/withdraw/{amount} | withdraw money from account |
| PUT | /account/{accountId}/deposit/{amount} | deposit money to account |
| POST | /transaction | perform transaction between 2 user accounts |### Http Status
- 200 OK: The request has succeeded
- 400 Bad Request: The request could not be understood by the server
- 404 Not Found: The requested resource cannot be found
- 500 Internal Server Error: The server encountered an unexpected condition### Sample JSON for User and Account
##### User :
```sh
{
"userName":"test1",
"emailAddress":"[email protected]"
}
```
##### User Account: :```sh
{
"userName":"test1",
"balance":10.0000,
"currencyCode":"GBP"
}
```#### User Transaction:
```sh
{
"currencyCode":"EUR",
"amount":100000.0000,
"fromAccountId":1,
"toAccountId":2
}
```## Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/parthsolanki49)