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.
Since i had to do "number of assumptions", i did following:
User is able to filter from Scottish and English countries.
Mapping of Rating values was done according to supplied tables in the assignment, even though they appear to be either partial or wrong.
Refactored majority of code to show how i practice clean code.
Tests implementation was not mandatory so i added no tests.
Regarding the API - its documentation is rather vague, and there are multiple discrepancies between information given in assignment and information stated in the API documentation (eg. possible values for different SchemeTypes).
For sorting i wanted to use sortOptionKey=desc_rating but for some reason, in case of england, ratings then started with value 0 (which to me seems more like an ascending, rather than descending sorting), so i resorted to using sortOptionKey=rating instead.
I hope you like the code.
Happy review:)