unoplatform / uno.todo

Uno Platform "Uno To Do" reference app
https://platform.uno/
Other
48 stars 12 forks source link

Add Task Steps Support to Uno ToDo App #109

Open agaldanaw2 opened 2 years ago

agaldanaw2 commented 2 years ago

Task Steps Support

I'd like to add support for task steps from this way:

Add endpoints for ITaskEndpoint (because they are task properties) or Do you wanna I create ITaskStepEndpoint (only change the location)?:

ITaskEndpoint (ITaskStepEndpoint):

Add contracts to management of task steps:

  1. [Post("/me/tasks/lists/{baseTaskListId}/tasks/{baseTaskId}/checklistItems")] [Headers("Authorization: Bearer")] Task<CheckListItem> AddStepAsync(string baseTaskListId, string baseTaskId, CheckListItemData checkListItem, CancellationToken ct)

  2. [Get("/me/tasks/lists/{baseTaskListId}/tasks/{baseTaskId}/checklistItems")] [Headers("Authorization: Bearer")] Task<TaskReponseData<CheckListItem>> GetStepsAsync(string baseTaskListId, string baseTaskId, CancellationToken ct)

  3. [Delete("/me/tasks/lists/{baseTaskListId}/tasks/{baseTaskId}/checklistItems/{checklistItemId}")] [Headers("Authorization: Bearer")] Task DeleteStepAsync (string baseTaskListId, string baseTaskId, string checklistItemId, CancellationToken ct)

  4. [Patch("/me/tasks/lists/{baseTaskListId}/tasks/{baseTaskId}/checklistItems/{checklistItemId}")] [Headers("Authorization: Bearer")] Task<CheckListItem> UpdateStepAsync (string baseTaskListId, string baseTaskId, string checklistItemId, CheckListItemData checkListItem, CancellationToken ct)

Add methods for step management:

ITaskService (ITaskStepService)

  1. CheckListItem AddStepAsync(string baseTaskListId, string baseTaskId, CheckListItemData checkListItem, CancellationToken ct)

  2. IInmutableList<CheckListItem> GetStepsAsync(string baseTaskListId, string baseTaskId, CancellationToken ct)

  3. Task DeleteStepAsync (string baseTaskListId, string baseTaskId, string checklistItemId, CancellationToken ct)

  4. UpdateStepAsync (string baseTaskListId, string baseTaskId, string checklistItemId, CheckListItemData checkListItem, CancellationToken ct)

Entities:

CheckListItemData (use as DTO for communication between APP and API):

Property Data type Description
checkedDateTime DateTimeOffset The date and time when the checklistItem was finished.
createdDateTime DateTimeOffset The date and time when the checklistItem was created.
displayName String Field indicating the title of checklistItem.
id String Server generated ID for the checkListItem
isChecked Boolean State indicating whether the item is checked off or not.

CheckListItem:

Property Data type Description
checkedDateTime DateTimeOffset The date and time when the checklistItem was finished.
createdDateTime DateTimeOffset The date and time when the checklistItem was created.
displayName String Field indicating the title of checklistItem.
id String Server generated ID for the checkListItem
isChecked Boolean State indicating whether the item is checked off or not.
francoistanguay commented 2 years ago

Looks good!. Feel free to add to existing task endpoint/service. I think it's ok.