Skip to content

Task Splitting Specification

kayl424 edited this page Mar 13, 2022 · 3 revisions

Implementation due 18 March 2022

Authors

Jackson Chadfield
Fraser McCallum

Editor/Translator: Kayla Aylward

Specification

  • Users can create tasks and assign them to any user.
    • Tasks can be edited by anyone.
    • Can be assigned randomly or fixed.
    • Can be recurring.
      • Done state is reset on a given frequency.
      • If randomly assigned, pick a new user.
  • Users can mark tasks they are assigned to as done.
  • Users can delete tasks.

Back-End

  • Introduce new “tasks” table with the following structure:
    • name,
    • description,
    • last_completed (optional, time),
    • due_date,
    • interval (optional, in seconds),
    • assigned (user id),
    • pool (optional, user id array)
  • User Pool - random user from pool will be assigned to task.
  • Recurrence Rules:
    • Recurrence should be checked whenever a task is queried before it is returned.
    • If the current time is past due_date + interval:
      • Set to incomplete (delete last_completed column).
      • Set due date to (due_date + interval).
        • If this is in the past increase by interval until the future.
      • Reassign from user pool, if needed.
  • Endpoints
    • GET /house/tasks
      • Return all active tasks in the house.
    • GET /user/tasks
      • Return all active tasks assigned to user.
    • POST /house/tasks
      • Create a new task.
    • PUT /house/task/{id}
      • Ensure requestor is the owner.
      • Modify task name, description or pool.
      • If assigned user is no longer in pool choose a new assigned user.
    • PUT /house/task/{id}/completed
      • Mark a user as having completed (or not) a task.
      • User must be assigned.
    • DELETE /house/task/{id}
      • Delete a task.
      • User must be owner.

Front-End

  • Add a new PRIVATE page - /tasks
  • Tasks card on dashboard should navigate to this.
  • This page should list all the tasks in the flat:
    • Recommend using cards similar to those on dashboard page.
    • Card should list task name, description, completed checkbox.
    • Task ordering:
      • Incomplete assigned to user
      • Other incomplete tasks
      • Complete tasks assigned to user
      • Other complete tasks
  • Users can click on the card to open a details view
    • Can be on /tasks/{id}
    • React router to handle this - react hook to get path params to then fetch that id from the database.
    • Should have the ability to edit the task name, description, or pool of assigned people if you are the OWNER.
    • Should have the ability to delete the task if you are the OWNER.
  • Top part of the page with button to return to dashboard and button to add a new task. This can be done on a new page or modal.
    • New task should have the following:
      • Name,
      • Description,
      • Table of people who can be assigned to the task (i.e. pool of people). This table should list all people in the house with checkmarks to say whether they are assignable to this task.
Clone this wiki locally