You'll have an hour to work on your own feel free to ask questions or look things up.
The goal is to provide an API to manage tasks.
The api should be able to return the following
- overdue tasks
- completed tasks
- incomplete tasks
- change the dueDate of tasks
- return tasks grouped by assignee.
We will pretend that we have a database (stored as a local file CSV for simplicity) and that we want to provide a JSON / command line API that let's us do the above.
Bonus points:
- unit tests
- this is an actual web API
- extensions
Please provide an API, queryable on localhost, testcases in your program is also fine, or via commandline (if you want to do this as a script) that supports the following:
GET /tasks?status="overdue"
returns {
taskAId: {
name
assignee
createdAt
dueDate
completed
},
taskBId: {
...
},
taskCId: {
...
}
# etc.
}
GET /tasks?completed={true/false} returns all tasks completed or not completed
POST /tasks/:id?<field>=<new_value> updates the specified task field with the new value
GET /employees/:id/tasks returns all tasks assigned to the employee with overdue property
returns {
taskAId: {
...
overdue
}
...
}
POST /tasks?id=<int>,dueDate="+1d" increments the dueDate
You can run this as a webserver if that is easy for you, or as a command line app. Keep this as simple as possible.