Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calvinlfer/wallet-api
An implementation of an API for wallet built using Akka (HTTP, Cluster Sharding, Event Sourcing) and ZIO
https://github.com/calvinlfer/wallet-api
akka scala zio
Last synced: 9 days ago
JSON representation
An implementation of an API for wallet built using Akka (HTTP, Cluster Sharding, Event Sourcing) and ZIO
- Host: GitHub
- URL: https://github.com/calvinlfer/wallet-api
- Owner: calvinlfer
- Created: 2020-03-30T13:38:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-03T15:13:08.000Z (almost 5 years ago)
- Last Synced: 2025-01-05T08:47:55.118Z (13 days ago)
- Topics: akka, scala, zio
- Language: Scala
- Homepage:
- Size: 61.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Wallet API
An implementation of a Wallet API built on Akka Typed making using of event sourcing (using the JDBC plugin) and
distributed by Akka Cluster Sharding.Deposits and Withdrawals follow a fee structure (the more money in your account, the cheaper it becomes to transact).
The amount of money generated by fees is calculated via a Persistence Query but is not currently exposed but can be
accessed by querying the `processor` table.### Running the application
1. Make sure to spin up Postgres via `docker-compose up -d`
2. Run the application using IntelliJ, Visual Studio Code + Metals or just `sbt run`### Postman
A Postman collection is included for easy testing in the `postman` folder### Operations
#### Create
`POST /wallets`
```json
{
"id": "abc"
}
```#### Deposit
`POST /wallets//deposit`
```json
{
"amount": 2000
}
```#### Withdraw
`POST /wallets//withdraw`
```json
{
"amount": 2000
}
```#### Query Deposit Fee
`POST /wallets//depositFee`
```json
{
"amount": 2000
}
```#### Query Withdraw Fee
`POST /wallets//withdrawFee`
```json
{
"amount": 2000
}
```#### Immediate history
`GET /wallets/abc/history/immediate`#### All history
`GET /wallets/abc/history/all`