Uploaded image for project: 'mod-invoice'
  1. mod-invoice
  2. MODINVOICE-44

Implement GET /exchange-rate/<from>/<to>

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Won't Do
    • None
    • 1.0.0
    • 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

            Activity

              People

                Unassigned Unassigned
                cmcnally Craig McNally
                Craig McNally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases