Work Order - Task Management
pip install virtualenv
virtualenv .venv
pip install -r requirements.txt
To run django management commands & usage
source .venv/bin/activate
export DJANGO_SETTINGS_MODULE=workorders.settings
python manage.py migrate
python manage.py runserver 8000 # (Runs on 8000 port)
Functionality / User Stories
Create a worker (name, email, company_name)
Delete a worker
Create a work order
Assigning a worker to an order (an order can have max 5 workers)
Fetch all work orders:○For a specific worker○Sorted by deadline
curl -d ' {"name":"Deepak", "email":"kapeed2091@gmail.com", "company_name": "iB"}' -H " Content-Type: application/json" -X POST http://127.0.0.1:8000/task-management/create-worker/
curl -d ' {"worker_id":9}' -H " Content-Type: application/json" -X POST http://127.0.0.1:8000/task-management/delete-worker/
curl -d ' {"title": "Test Order", "description": "Test Description", "deadline": "2019-12-31"}' -H " Content-Type: application/json" -X POST http://127.0.0.1:8000/task-management/create-work-order/
curl -d ' {"order_id": 4, "worker_id":9}' -H " Content-Type: application/json" -X POST http://127.0.0.1:8000/task-management/assign-worker/
curl -d ' {"worker_id":6}' -H " Content-Type: application/json" -X POST http://127.0.0.1:8000/task-management/get-work-orders/
python manage.py test task_management.tests
# Tests are written for model functions
# Tests can be written at API level as well
# To check for coverage:
# pip install coverage
# coverage run manage.py test task_management.tests
# coverage report -m