Task Description: Implement a Simple Todo List Application
You are required to implement a simple Todo List application with the following functionality:
Todo Item Structure: Each todo item should have the following properties:
id: A unique identifier for the todo item (integer).
title: A string representing the title of the todo item.
completed: A boolean indicating whether the item is completed or not (default should be false).
Functionality:
Add Todo: Implement a function to add a new todo item. The function should take a title as an input and return the newly created todo object with a unique id.
Get All Todos: Implement a function that returns an array of all todos.
Complete Todo: Implement a function that marks a todo item as completed by its id. It should update the completed property of the corresponding todo item to true.
Delete Todo: Implement a function that deletes a todo item by its id.
Storage: Use an in-memory list to store the todo items. This means that the data will not persist between application runs.
Error Handling: Ensure the following:
Attempting to complete or delete a todo with a non-existing id should throw an error with an appropriate message.
The title for a new todo should not be empty; if it is, an error should be thrown.
Implementation Details:
Place all your implementation in the /app/ directory.
Ensure you write clear and concise code, including comments where necessary for better understanding.
Your code should adhere to best practices for readability and maintainability.
Once implemented, ensure that all provided tests pass successfully to verify the correctness of your implementation.