Skip to content

stendahls/be-lia-2024

Repository files navigation

ToDo List API

Implement an API to be able to manage a todo-list.

Items can be added, updated and removed from the list.
It should also be possible to mark an item as being completed.

For each the system should maintain a “created date” and a “last updated date”.

Request bodies are expected inJSON format.
The content of responses should be in JSON format.

Here is a suggested API, feel free to change/add/remove endpoints as you see fit.

GET /item/{id}

Response
{
    "id": 123,
    "body": "lalala",
    "done": false,
    "createdOn": "2028-05-02 12:00:00",
    "updatedOn": "2028-05-02 12:00:00"
}

###

POST /item
{
    "body" : "An import task"
}

###

PUT /item
{
    "body" : "New text !"
}

###

DELETE /item/{id}

###

POST /item/markAsDone
{
    "id": 123
}

HTTP status code should be used appropriately. For example, a 404 should be returned when trying to retrieve/update an item that does not exist.

You do not need to implement all Apis.
We recommend tacking the requirements in this order:

  • create an item
  • retrieve an item
  • mark an item as done
  • delete an item
  • update an item

If you identify additional requirements, feel free to proritize them or ask us for guidance.

This project

This projects provides a kickstart for the API.

It is an ASP.Net core app.
ToDoListItemRepository is an in-memory database you can use to persist and retrieve todo items. You do not need to change it or its implementation.
The Databse is seeded with items on startup, you can change those seed items in the SeedTodoListItems.cs.

The GET endpoint has been partially implemented.

You can run the project with dotnet run.
A debugging profile is provided for VSCode (run it from the UI or F5).

You can access the stub of the GET implementation via http://localhost:5007/items/1. You can also access the swagger autogenerated documentation via http://localhost:5007/swagger.

To make testing easier you can define http requests in the 'TodoListApi.http' file and run them with the 'REST Client' extension in VSCode. Or use any tool you are familiar with (Postman, curl, etc).

Instructions for delivery

  • When you are finished or the time is up, ZIP the project. Use the naming convention "yourname-StendahlsLIa" for your ZIP file.
  • Upload the ZIP at https://wkf.ms/3UgZU9G

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages