In this challenge, you will develop an API to perform CRUD operations on your tasks. The API must include the following functionalities:
- Creating a task
- Listing all tasks
- Updating a task by
id
- Removing a task by
id
- Marking a task as complete by
id
- And the real challenge: Importing tasks in bulk via a CSV file
A task must have the following properties:
id
- Unique identifier for each tasktitle
- Title of the taskdescription
- Detailed description of the taskcompleted_at
- Date when the task was completed. The initial value should benull
created_at
- Date when the task was createdupdated_at
- Should always be updated to the date when the task was last updated
- Create a new task in the database.
- The
title
anddescription
fields must be sent in the body of the request. - The
id
,created_at
,updated_at
, andcompleted_at
fields should be automatically filled as per the property guidelines.
- List all tasks saved in the database.
- It should also be possible to search for tasks by filtering by
title
anddescription
.
- Update a task by
id
. - The body of the request should contain only
title
and/ordescription
. - Validate if the
id
belongs to a task saved in the database before updating.
- Remove a task by
id
. - Validate if the
id
belongs to a task saved in the database before deleting.
- Mark a task as complete or revert it to incomplete.
- Validate if the
id
belongs to a task saved in the database before updating.
- The API must be able to handle a large number of simultaneous requests.
- The bulk import of tasks via CSV should be efficient and able to process large volumes of data without significant performance degradation.
- Input validation should be rigorous to prevent SQL injection and other common vulnerabilities.
- Error responses should not expose internal system details.
- The code should be modular and follow good programming practices, facilitating maintenance and future expansion.
- Clear documentation should be provided on how to use the API, including request and response examples.
- The API should have high availability and be resilient to failures.
- Appropriate logging should be implemented to monitor and diagnose issues.
- The API should be simple and intuitive for developers to use.
- API responses should be clear and consistent.
- The API should be compatible with current versions of major browsers and HTTP client tools.
- It should be easy to integrate the API with other applications and services.
The Task Management API should provide an efficient and secure way to manage tasks, including CRUD operations and bulk import via CSV. By following the described functional and non-functional requirements, the API should offer a robust and reliable experience for users.