Skip to content

Add Foreign Exchange Rates plugin - #176

Merged
TimWheeler-SQUP merged 3 commits into
mainfrom
work/tw/PLUG-4841
Nov 5, 2026
Merged

TimWheeler-SQUP merged 3 commits into
mainfrom
work/tw/PLUG-4841

Conversation

@TimWheeler-SQUP

@TimWheeler-SQUP TimWheeler-SQUP commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Plugin overview

  • Plugin name: Foreign Exchange Rates
  • Purpose / problem solved: Daily foreign exchange rates for cost conversion and other cross currency dashboarding
    • Latest rate from a base currency to a target currency, with the change since the previous working day
    • Daily rate history for the selected timeframe
  • Authentication method(s): None. The Frankfurter API (European Central Bank reference rates) is free and needs no key.

🖼️ Plugin screenshots

Default dashboards

  • Overview: GBP/USD (Cable), EUR/USD (Fiber) and EUR/GBP (Chunnel) with daily change arrows and trend charts, rates per US dollar as sparklines, and biggest movers against USD
image

🧪 Test plan

  • squaredup validate passes: 3 data streams, icon, config validation, 1 dashboard
  • Deployed to a tenant and added the data source; the connection check passes
  • squaredup test on every stream:
    • Currencies: 30 currencies
    • Latest Rates: GBP → USD returns one row with rate, previous rate and change; with no inputs returns all EUR pairs
    • Historical Rates: tested over last 7 days, last 30 days, last month and this year, with one and with all target currencies
  • Checked rates against the Frankfurter API directly
  • Checked the connection check and tiles with the currency fields left blank (the check runs with no field values)
  • Checked the Overview dashboard renders, including the up/down change colours

⚠️ Known limitations

  • Daily reference rates only: rates are published once per working day (ECB), so not for live trading; weekends and bank holidays have no rate of their own
  • Fixed to ECB rates: the plugin uses the Frankfurter v2 API and always requests providers=ECB, so only European Central Bank reference rates are returned and this cannot be changed in the plugin
  • Timeframe edge: when a timeframe starts on a non-working day, Historical Rates includes the previous working day's rate
  • Third-party service: Frankfurter is a long-running open-source project (since 2018, MIT) run by a single maintainer, with no SLA

📚 Checklist

  • This PR adds a single plugin only
  • Plugin, datastream and UI naming follow SquaredUp guidelines
  • Logo added
  • One or more dashboards added
  • README added including configuration guidance
  • No secrets or credentials included
  • I agree to the Code of Conduct

🤖 Generated with Claude Code

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added a foreign exchange dashboard showing current GBP/USD, EUR/USD, and EUR/GBP rates, historical trends, rates by currency, and currency movers against USD.
    • Added latest and historical exchange rate data with selectable base and target currencies.
    • Rates come from the Frankfurter API, require no credentials, and are published on working days.
  • Documentation
    • Added details about the available data and an example SQL query for retrieving a GBP/USD rate.

New community plugin for daily foreign exchange rates from the free
Frankfurter API (European Central Bank reference rates, no credentials).

- Latest Rates: latest rate plus the change since the previous working day
- Historical Rates: daily rates for the selected timeframe
- Currencies (hidden): feeds the base/target currency drop-downs and the
  connection check
- Overview dashboard: Cable, Fiber and Chunnel with daily change, trend
  charts, rates per US dollar as sparklines and biggest movers vs USD

Stays on Frankfurter v1 for now; v1 is deprecated in favour of v2 but
remains available.

PLUG-4841

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The change adds a ForeignExchangeRates plugin that retrieves currency and exchange-rate data from Frankfurter. It adds latest and historical rate streams, response-processing scripts, a default Overview dashboard, and plugin setup and usage documentation.

Changes: Foreign exchange rates plugin

Layer / File(s) Summary
Plugin setup and currency lookup
plugins/ForeignExchangeRates/v1/metadata.json, plugins/ForeignExchangeRates/v1/configValidation.json, plugins/ForeignExchangeRates/v1/dataStreams/currencies.json, plugins/ForeignExchangeRates/v1/dataStreams/scripts/currencies.js, .github/CODEOWNERS, plugins/ForeignExchangeRates/v1/cspell.json, plugins/ForeignExchangeRates/v1/ui.json
The plugin metadata defines the Frankfurter API base. The currencies stream and script provide sorted currency options. The validation configuration adds a connection check for that stream. Supporting changes add a CODEOWNERS assignment, custom spelling words, and an empty UI array.
Latest and historical rate streams
plugins/ForeignExchangeRates/v1/dataStreams/latestRates.json, plugins/ForeignExchangeRates/v1/dataStreams/scripts/latestRates.js, plugins/ForeignExchangeRates/v1/dataStreams/historicalRates.json, plugins/ForeignExchangeRates/v1/dataStreams/scripts/historicalRates.js
The streams request historical and latest rates with optional currency selections. Their scripts produce rate rows; latest-rate rows also include previous rates and percentage changes.
Default dashboard and usage
plugins/ForeignExchangeRates/v1/defaultContent/manifest.json, plugins/ForeignExchangeRates/v1/defaultContent/overview.dash.json, plugins/ForeignExchangeRates/v1/docs/README.md
The Overview dashboard shows latest rates, historical trends, per-currency rates, and currency movers. The README describes the streams and includes a SQL example.

Sequence Diagram(s)

sequenceDiagram
  participant OverviewDashboard
  participant historicalRates
  participant FrankfurterAPI
  participant historicalRatesJs
  OverviewDashboard->>historicalRates: Request rates for a timeframe
  historicalRates->>FrankfurterAPI: GET date range with currency selections
  FrankfurterAPI-->>historicalRates: Return rate data
  historicalRates->>historicalRatesJs: Process response data
  historicalRatesJs-->>OverviewDashboard: Return historical rate rows
Loading
Merge Risk: Low · previous review 17b7d

Same-currency selections return no rate instead of the identity rate. Other currency pairs remain available.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "Add Foreign Exchange Rates plugin" matches the main change. The PR adds the ForeignExchangeRates plugin, with its data streams, scripts, dashboard, and docs. The title is short, specific, a…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the structure of the Adding a new plugin template. It covers the plugin overview, screenshots, a test plan, known limitations, and a checklist. It states the purpose, the Frank…
Full details: Title check

Explanation

The title "Add Foreign Exchange Rates plugin" matches the main change. The PR adds the ForeignExchangeRates plugin, with its data streams, scripts, dashboard, and docs. The title is short, specific, and states the primary change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files. (4 skipped: 4 unsupported.)

Full details: Description check

Explanation

The description follows the structure of the Adding a new plugin template. It covers the plugin overview, screenshots, a test plan, known limitations, and a checklist. It states the purpose, the Frankfurter API with no authentication, and the validation and stream tests performed. It also lists the known limitations: daily ECB rates only, fixed provider, timeframe edge case, and third-party service risk. The description does not reference the template choice line, so it does not confirm which template was selected. The checklist items are marked as complete, but the description does not show a cross-check of the template choice.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: f32f24f3-5782-42b7-8b06-b0cd328a5df7
Commits

Reviewing files that changed from the base of the PR and between 040a6de and 17b7d28.

Files selected for processing: 7

  • plugins/ForeignExchangeRates/v1/dataStreams/currencies.json
  • plugins/ForeignExchangeRates/v1/dataStreams/historicalRates.json
  • plugins/ForeignExchangeRates/v1/dataStreams/latestRates.json
  • plugins/ForeignExchangeRates/v1/dataStreams/scripts/currencies.js
  • plugins/ForeignExchangeRates/v1/dataStreams/scripts/historicalRates.js
  • plugins/ForeignExchangeRates/v1/dataStreams/scripts/latestRates.js
  • plugins/ForeignExchangeRates/v1/metadata.json

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

- Point base URL at the v2 API and use the /rates endpoint
- Send providers=ECB on all requests to keep ECB-only rates
- Rename symbols arg to quotes and pass from/to as query args
- Rewrite scripts for the flat v2 response and drop base/base rows
- Limit currencies to those the ECB still publishes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

@TimWheeler-SQUP
TimWheeler-SQUP marked this pull request as ready for review November 3, 2026 22:42
@TimWheeler-SQUP
TimWheeler-SQUP requested review from a team and clarkd November 3, 2026 22:42
@TimWheeler-SQUP

Copy link
Copy Markdown
Contributor Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor
Action performed

Comments resolved. Approval is disabled; enable reviews.auto_approvals.enabled to allow explicit top-level @coderabbitai resolve or @coderabbitai approve commands.

The per-plugin spellcheck word list is no longer needed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

🧩 Plugin PR Summary

📦 Modified Plugins

  • plugins/ForeignExchangeRates/v1

📋 Results

Step Status
Scope & version ✅ Passed
Validation ✅ Passed
Deployment 🚀 Deployed

🔍 Validation Details

✅ foreign-exchange-rates
{
  "valid": true,
  "pluginName": "foreign-exchange-rates",
  "pluginType": "hybrid",
  "summary": {
    "Data Streams": 3,
    "Import Definitions": 0,
    "Correlation Rules": 0,
    "UI Configuration": false,
    "Has Icon": true,
    "Has Default Content": true,
    "Config Validation": true,
    "Custom Types": false
  }
}

@TimWheeler-SQUP
TimWheeler-SQUP merged commit 9f597aa into main Nov 5, 2026
2 checks passed
@TimWheeler-SQUP
TimWheeler-SQUP deleted the work/tw/PLUG-4841 branch November 5, 2026 09:00
@clarkd clarkd mentioned this pull request Nov 5, 2026
2 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants