-
Notifications
You must be signed in to change notification settings - Fork 583
Implement Czech National Bank Exchange Rate Provider #804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pablocsilva
wants to merge
21
commits into
MewsSystems:master
Choose a base branch
from
pablocsilva:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a fully functional ExchangeRateProvider backed by the Czech National Bank (CNB) public exchange rate data source.
The solution fetches daily exchange rates from the official CNB endpoint, parses the pipe-separated response format, and exposes the data through a strongly typed domain model. The application is buildable, runnable, and outputs the retrieved exchange rates as required.
Exchange Rate Updater – Notes & Considerations
How to Run The Application
1. Problem Statement
See Challenge Instructions here: Mews Backend .NET Challenge Instructions
The goal of this challenge is to fetch daily foreign exchange rates published by the Czech National Bank (CNB), parse the returned data, and expose the rates in a clean, domain-driven model.
The CNB endpoint returns exchange rates as a plain-text, pipe-separated file containing:
The solution is expected to:
2. Assumptions
The following assumptions were made to keep the solution focused and explicit:
3. Approach
The solution is structured around a clear separation of concerns:
It uses IoC and DI to allow new implementations to be added without breaking existing ones
HTTP Client Layer
Parsing Layer
Domain Layer
Application Layer
The design favors clarity and correctness over premature optimization.
4. Design Decisions
Immutability
Separation of Concerns
Explicit Validation
Resilience
5. Immutability & Modeling
The following modeling strategy was applied:
Records
CurrencyandExchangeRateClasses
This distinction reflects the difference between data and behavior in the system.
6. Edge Cases & Error Handling
The solution explicitly handles:
When errors occur, the system:
7. Testing Strategy
The testing approach focuses on correctness and determinism:
Unit tests for higher-level application behavior and Integration tests were intentionally omitted due to scope.
8. Limitations
Known limitations include:
These were accepted trade-offs given the scope of the challenge.
9. Possible Improvements
With additional time, the following enhancements could be made: