Example service with in-memory users accounts with PLN balance. API endpoint returns account by user's id with USD balance converted by external exchange rate service. Authentication and authorization is handle on another layer.
./gradlew bootRunThe service then listens on http://localhost:8080, for example:
http://localhost:8080/api/v1/accounts/1
Service uses NBP API to get exchange rate. To ensure more stability and efficiency, following features are implemented:
- Retries when NBP return 5xx status code.
- Cache on getting exchange rate, because NBP refresh data every new day.
API docs are served by the running application at http://localhost:8080/swagger.
Account response fields are described there in the schema section of account-controller/getAccount.
Things to implement in the future:
- Circuit-breaker pattern (instead of retries)
- Better requests debug logs format