Skip to content

Drop XDR exclusion from Provider model#334

Merged
hakanensari merged 1 commit intomainfrom
drop-xdr-exclusion
Apr 26, 2026
Merged

Drop XDR exclusion from Provider model#334
hakanensari merged 1 commit intomainfrom
drop-xdr-exclusion

Conversation

@lineoffligbot
Copy link
Copy Markdown
Collaborator

Closes #333.

Removes the hardcoded EXCLUDED_QUOTES = ["XDR"] filter from Provider#backfill. Several adapters (NB, SBI, BCRA, etc.) already produce XDR rates that were being silently dropped. XDR is a synthetic basket reserve unit but it's a valid ISO 4217 code, in the same category as ECU/XEU which we keep.

The money gem already knows XDR (numeric 960), so no historical_currencies.json entry is needed. The remaining filter !Money::Currency.find(c) continues to reject unknown codes.

Once merged, providers that emit XDR should be re-backfilled from coverage_start to ingest previously-dropped rows.

Test plan

  • APP_ENV=test bundle exec rake passes (lint + 587 specs)
  • Inverted provider_spec.rb "excludes XDR" → "ingests XDR" — confirmed it fails before the code change and passes after

Drop the hardcoded XDR exclusion from Provider#backfill so IMF Special
Drawing Rights rates from providers like NB, SBI, BCRA are no longer
silently filtered. Closes #333
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the hardcoded exclusion of ISO 4217 XDR (“Special Drawing Rights”) during provider backfills so that XDR rates emitted by multiple existing adapters are ingested instead of silently dropped.

Changes:

  • Removed the EXCLUDED_QUOTES = ["XDR"] constant and its use in Provider#backfill filtering.
  • Updated the provider backfill spec to assert that XDR records are imported.
  • Added a changelog entry documenting the behavior change and re-backfill guidance.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/provider.rb Stops filtering out XDR during backfill, leaving only “unknown currency code” rejection via Money::Currency.find.
spec/provider_spec.rb Updates the backfill behavior test from “excludes XDR” to “ingests XDR”.
CHANGELOG.md Documents that XDR is now ingested and notes the need to re-backfill to pick up previously dropped rows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hakanensari hakanensari merged commit eb6f598 into main Apr 26, 2026
11 checks passed
@hakanensari hakanensari deleted the drop-xdr-exclusion branch April 26, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop XDR exclusion from Provider model

3 participants