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

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

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Labels:
      None
    • Template:
    • Development Team:
      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

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

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases