A service that have ledger that keeps track of a user's tokens and the current USD value.
npm install
npm run dev
Request Type: POST
Route: http://localhost:3000/api/user/create
Request Body: {"name": "test_user", "userName": "test_user", "password": "changeMe123_"}
Request Type: POST
Route: http://localhost:3000/api/user/authenticate
Request Body: {"userName": "test_user", "password": "changeMe123_"}
Request Type: POST
Route: http://localhost:3000/api/ledger/create
Request Body: {"user": "test_user", "token": 2.9}
Request Type: GET
Route: http://localhost:3000/api/ledger/token/history/:userId
Request Type: GET
Route: http://localhost:3000/api/ledger/usd/history/:userId
To returns the stats: sum of tokens won on the current day so far and the total value of USD a user has in his account
Request Type: GET
Route: http://localhost:3000/api/ledger/user/stats/userId
Request Type: GET
Route: http://localhost:3000/api/ledger/history?user=userId&date=requestedDate
npm run test