Skip to content

Implement ExchangeRateProvider for Czech National Bank#824

Open
NikBok wants to merge 1 commit into
MewsSystems:masterfrom
NikBok:feature/cnb-exchange-rate-provider
Open

Implement ExchangeRateProvider for Czech National Bank#824
NikBok wants to merge 1 commit into
MewsSystems:masterfrom
NikBok:feature/cnb-exchange-rate-provider

Conversation

@NikBok
Copy link
Copy Markdown

@NikBok NikBok commented May 9, 2026

Fetch exchange rates from two CNB public data sources:

  • Daily fixing (~30 major currencies: USD, EUR, JPY, etc.)
  • Other currencies (~160 additional currencies: KES, RUB, etc.) Rates are parsed from CNB's pipe-delimited text format and normalized to per-unit values (e.g. 100 JPY = 13.2 CZK becomes 1 JPY = 0.132 CZK). Only rates matching the requested currencies are returned; unknown currencies are silently ignored per the specification. Uses Polly for HTTP retry with exponential backoff to handle transient network failures.

Key decisions

  • Data source: Used CNB's plain text format over XML — simpler to parse, lightweight, and the format has been stable for years. Both daily fixing (~30
    currencies) and other currencies (~160) are fetched to maximize coverage.

  • Resilience: Added Polly for HTTP retry with exponential backoff rather than a manual retry loop. Polly is the industry standard in .NET and is
    composable — adding circuit breaker, timeout, or jitter later requires a single line, not a rewrite.

  • Constructor design: HttpClient and ResiliencePipeline are injected via constructor for testability. A parameterless constructor provides sensible
    defaults for direct usage.

  • AI Usage . Usage of Claude Code in order to research third party data and to analyze edge cases

Fetch exchange rates from two CNB public data sources:
  - Daily fixing (~30 major currencies: USD, EUR, JPY, etc.)
  - Other currencies (~160 additional currencies: KES, RUB, etc.)
  Rates are parsed from CNB's pipe-delimited text format and normalized
  to per-unit values (e.g. 100 JPY = 13.2 CZK becomes 1 JPY = 0.132 CZK).
  Only rates matching the requested currencies are returned; unknown
  currencies are silently ignored per the specification.
  Uses Polly for HTTP retry with exponential backoff to handle
  transient network failures.
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.

1 participant