This test requires that you to implement a product price checker interface.
This widget should be a self-contained component that can placed within a larger
admin page - you can simply place it within a basic index.html
page.
We have provided you with this bare-bones Django project to get started. Simply
fork this repo and begin working, ensuring that you install and add to the
requirements contained in requirements.txt
.
The project contains:
- The basic infrastructure to start running, with an sqlite DB
- A
products
app containing two models -Product
andPricingBlock
- An initial data fixture to get going
- A price search routine in
products.utils.get_price
- A simple unit test for
get_price
The tasks you must carry out are as follows:
- Optimise the
products.utils.get_price
function which is very long running under certain circumstances and contains faults - Implement the form as specified in the wireframe above using a modern javascript framework such as React, Vue or Angular
- Please ensure the form is presentable - you may use a CSS framework like bootstrap or material-ui or roll your own
- Hook up the interface to the backend, such that the user can find the cheapest price by specifying a product, start date and nights
Please provide us with information on how to run the code you provide.