Details
-
Story
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Won't Do
-
None
-
None
-
-
Thunderjet
Description
Overview:
Implement the exchange-rate endpoint: find the exchange rate for: from -> to (both currency codes) and cache it.
Approach:
- Call the following API: https://api.exchangeratesapi.io/latest?base=<to>&symbols=<from>
- Pull out the exchange rate
- Cache the value
- Invalidate the cache every day at 1600 CET
- If the service is unavailable or errors occur during retrieval, use the last known value.
- If there is no last known value, use 1.0
Example Request/Response to Public API:
$ curl "https://api.exchangeratesapi.io/latest?base=USD&symbols=EUR" -w '\n' | jq . { "base": "USD", "rates": { "EUR": 0.8929368694 }, "date": "2019-05-06" }
Example Response to Client:
{ "to": "USD", "from": "EUR", "rate": 0.8929368694, "date": "2019-05-06" }
Acceptance Criteria:
- The latest daily exchange rate is obtained and cached as described above
- Unit tests have been updated
- API tests have been updated
TestRail: Results
Attachments
Issue Links
- has to be done after
-
MODINVOICE-45 Define GET /exchange-rates
-
- Closed
-
- relates to
-
MODINVOICE-34 Create voucher on transition to "Approved"
-
- Closed
-
-
UXPROD-703 Ability to "process" invoice
-
- Closed
-