Implement task closure functionality for task authors

Description

Currently, there is no way for task authors to close tasks that are no longer active or needed. This feature will allow task authors to change the status of a task to "Closed" while preventing non-authors from performing this action.

This task implements the user story:

As a task author, I want to change the status of a task to "closed" so that I can indicate when a task is no longer active or needed.

Acceptance Criteria

  • Task authors can change the status of their tasks to "Closed"
  • The task's modification date is updated when the status is changed
  • Non-authors (including assigned users) are prevented from changing a task's status to "Closed"
  • Appropriate error messages are displayed when unauthorized users attempt to close a task
  • The UI reflects the updated status immediately after a successful status change

BDD Scenario Titles

  1. Author closes the task
  2. Non-author attempts to close the task
  3. Assigned user who is not the author attempts to close the task

Technical Implementation Details

  • Add permission check in the TaskController to verify if the current user is the author before allowing status changes
  • Update the Task model to include a "Closed" status option
  • Modify the task update endpoint to handle status changes and permission validation
  • Ensure the modification date is automatically updated when the status changes
  • Add appropriate error handling and user feedback mechanisms

Definition of Done

  • All acceptance criteria are met
  • All BDD scenarios pass
  • Unit tests are written and passing
  • Code follows project coding standards
  • Code has been reviewed and approved
  • Documentation is updated to reflect the new functionality
  • The feature has been tested in the development environment
Assignee Loading
Time tracking Loading