- Docker, npm, python and serverless must be installed locally
- Run
npm install
andpython install -r requirements.txt
to install python(via virtual environment) and node dependencies - Run
docker compose up
to start the database onlosthost:3306
- Run
make serverless-offline
to start the server locally on port8080
OR runserverless invoke local --function get_all_orders
- Create a new git repository named
example-co-orders-service
- Create a branch named
develop
and this must be yourdefault
branch - All changes made in this repo will be done via a new branch and a Pull Request to the
develop
branch. Please addmalachany
as the reviewer of all PRs for this test
- There is an issue with the database migrations using alembic. Fix the issue and document exactly how you fixed the issue
- Create an endpoint to grab a service by id
- Create an endpoint to grab a list of all services
- Use alembic to manage tables being added/updated in database
handler.py
has starter code for you to get started with
- Create an
orders
table using SQLAlchemy (to be used the for the next step). - Create an
order_items
table- Must have a relationship with the orders table to know what order the item belongs to
- Must have a relationship that states what service the order item is for
- Create endpoints to create, read, update, and delete orders from the database running on
localhost:3306
- The create and update endpoints must accept in the request which services to add to the order and a user cannot update a deleted order
- The read endpoints should be one that lists all the orders and one that describes a single order with all the order items
- The read endpoint must respond with a list of all order items for the order and cannot return a deleted order
- The delete endpoint must not delete the order, but set a
status
column to deleted on the row
- Create an endpoint that can be used by the frontend to display the number of created orders over time
- Update the function timeout time to 30 seconds [https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/]
- Create tests for your code using pytest
make test
and ensure your code passes the pylist checkmake test-style