Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillaumefalourd/poc-bank-api-java
POC of a bank api in JAVA ☕️
https://github.com/guillaumefalourd/poc-bank-api-java
2017 api java poc proof-of-concept
Last synced: 3 months ago
JSON representation
POC of a bank api in JAVA ☕️
- Host: GitHub
- URL: https://github.com/guillaumefalourd/poc-bank-api-java
- Owner: GuillaumeFalourd
- License: apache-2.0
- Created: 2020-12-02T19:34:33.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-21T11:11:44.000Z (11 months ago)
- Last Synced: 2024-04-19T21:25:16.330Z (9 months ago)
- Topics: 2017, api, java, poc, proof-of-concept
- Language: Java
- Homepage:
- Size: 132 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# poc-bank-api-java
`Project creation date: 2017`
Application that simulates a bank api, allowing the registration of customers, and the operations of deposits, withdrawals, transfers, balance inquiries and account statements.
## Business rules
- The account balance can't be negative;
- It is not possible to make a withdrawal or transfer when the account balance is insufficient;
- Accounts involved in any operation must be valid;
- The customer can only have one account (validate by CPF for example);
- The account Id for future transactions must be included in the creation request response;
- An extract should return all account movements (transfers, deposits and withdrawals);
- It is not possible to make a transfer to yourself (the source account cannot be the same as the destination account);## Run the API locally
### Premisses
- Java JDK
- Maven
- Docker
- Docker-Compose
- PostgreSQLAfter installing the dependencies through the terminal in the project's root folder, execute the following command:
```bash
mvn clean install
```Then type the instruction below to allocate the container with the database:
```bash
docker-compose up
```You should now be able to start the application in the IDE. It will be possible to test the application at: ```localhost:8080/```
## UML Diagram
![UML](docs/UML-bank-api.png)
### Services
#### "/client"
Service | Http Method | Address | Parameters
------------ | ------------ | ------------- | -------------
New Client Account | POST |localhost:8080/client/create | {"name": "Guillaume Falourd", "cpf": "111.111.111-11"}
Get Client Account | GET |localhost:8080/client/{accountId} |
Update Cliente Account | PUT | localhost:8080/client/update/{accountId} | {"name": "Guillaume Falourd", "cpf": "111.111.111-11"}#### "/operation"
Service | Http Method | Address | Parameters
------------ | ------------ | ------------- | -------------
Balance | GET | localhost:8080/operation/balance/{accountId} |
Deposit | POST | localhost:8080/operation/deposit | {"accountId": 1,"value": 500}
Cashout | POST | localhost:8080/operation/cashout | {"accountId": 2,"value": 140}
Transfer | POST | localhost:8080/operation/transfer | {"depositAccountid": 1, "recipientAccountid": 2, "value": 50.00}
Extract | GET | localhost:8080/operation/accountStatement/{accountId} |