The API consists of two endpoints, GET /balance, and POST /event. Using your favorite programming language, build a system that can handle those requests.
$ make build
$ make start-app
$ make setup
$ make stop-app
curl --location --request POST 'localhost:8080/reset' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "deposit",
"destination": 100,
"amount": 10
}'
curl --location --request POST 'localhost:8080/event' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "deposit",
"destination": "100",
"amount": 1000
}'
curl --location --request POST 'localhost:8080/event' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "withdraw",
"origin": "100",
"amount": 5
}'
curl --location --request POST 'localhost:8080/event' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "transfer",
"origin": "100",
"amount": 15,
"destination": "300"
}'
To execute the unit tests
$ make run-tests
This project has ~65% code coverage