Skip to content

feat: implement Exchange Rate REST API with CNB provider#816

Open
maria-khmaruk wants to merge 2 commits intoMewsSystems:masterfrom
maria-khmaruk:master
Open

feat: implement Exchange Rate REST API with CNB provider#816
maria-khmaruk wants to merge 2 commits intoMewsSystems:masterfrom
maria-khmaruk:master

Conversation

@maria-khmaruk
Copy link

This PR introduces a fully functional Exchange Rate REST API that provides daily currency exchange rates against CZK using data from the Czech National Bank (CNB).

The solution follows clean architecture principles and includes domain modeling, application logic, infrastructure integration, and API presentation layer.

What’s Included
Clean architecture with 4 layers:

  • Domain – Entities and value objects (Currency, ExchangeRate)
  • Application – Business logic and caching decorator
  • Infrastructure – CNB provider, HTTP clients, resilience policies
  • Presentation – Controllers, validation, API responses

External Integration:

  • CNB exchange rate provider
  • HTTP resilience using Microsoft.Extensions.Http.Resilience

API:

  • REST endpoint for retrieving exchange rate
  • Filtering by currency and date

Consistent response:

  • Data for success
  • errorCode + errorMessage for failures

Validation:

  • Request validation via DataAnnotations & custom Date attribute

Documentation:

  • Interactive API docs via Scalar
  • OpenAPI specification exposed

Testing:

  • Unit tests using xUnit v3
  • Mocking via NSubstitute

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