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.
NOTE: This pull request is part of Oddbox's technical test. This pull request is a mock pull request for candidates. None of this code is for real world production use.
Purpose
This change provides the ability to easily see a list of recipes between a date range and grouped by category (e.g. main, dessert, side).
The marketing team asked for this as they want customers to have a place where they can easily filter recipes between two dates, and customers generally want this grouped by category. In the future, the marketing team said they will likely be adding new categories of recipes.
The marketing team told us customers regularly access this data on the go from their mobile devices, so the page should also be responsive.
I was not provided any wireframes for how this should look, and so I have gone with a grid system using flexbox so that it is responsive.
Approach
I have created some backend and frontend code. The backend code loads the recipe data between two dates and groups by category (currently loaded from a JSON of recipes, this will be a database of recipes at some point).
The backend has an API endpoint
recipes/
which returns recipes provided between two dates. For example:recipes/?start_date=2022-07-25&end_date=2024-08-25
The frontend allows a user to enter the dates they want to filter by, and then shows the recipes in a grid format. I've attached a screenshot of how this looks with some recipes: