The main aim of this project is to get a hands-on experience with Event Sourcing and CQRS
- Clone with
git clone https://github.com/pomkine/money-transfers
- Build a jar with
./gradlew shadowJar
- Run the jar with
java -jar build/libs/money-transfers.jar server config.yml
-
Open account - POST
/account
- Payload:
{ "initial_balance": {amount} }
- Example:
{ "initial_balance": 125.6 }
- Payload:
-
Get Account information - GET
/account/{account_id}
-
Transfer money - POST
/transfer
- Payload:
{ "from_account":"{from_account_id}", "to_account":"{to_account_id}", "amount":{amount} }
- Example:
{ "from_account":"32287c81-e925-466e-9753-1de9e2184a57", "to_account":"6a61adb1-d566-4f10-804f-95ed6e8fa152", "amount":6.55 }
- Payload:
-
Account aggregate
- Commands
- Open account
- Credit account
- Debit account
- Events
- Account opened
- Account credited
- Account debited
- Account debit failed due to insufficient funds
- Commands
-
Money transfer aggregate
- Commands
- Create money transfer
- Record not found account
- Events
- Money transfer created
- Account not found
- Credit recorded
- Debit recorded
- Failed debit recorded
- Commands
- Gradle config to run unit and acceptance tests separately
- Transfers read model
- Commands retry on version conflict