Skip to content

Conversation

@Advaitgaur004
Copy link
Contributor

#91 Fix - Backend

Add Task Recurrence Support

Description

Adds support for recurring tasks based on Taskwarrior's recurrence functionality. Users can now create and modify tasks with daily, weekly, monthly, or yearly recurrence patterns. For more reference (docs)

Changes

  • Added recurrence fields to Task model (Recur, Until, Mask)
  • Updated request body models to support recurrence parameters
  • Modified task handlers to process recurrence fields
  • Added validation for recurrence patterns
  • Added comprehensive test coverage for recurring tasks

Testing

Added test cases for:

  • Creating tasks with recurrence
  • Creating tasks without recurrence
  • Modifying task recurrence
  • Removing recurrence from tasks
  • Invalid recurrence patterns

Inside Backend run the following command

go test -v ./controllers -run "Test_(ModifyRecurringTask|AddTaskWithRecurrence)"

Usage Example

// Create a daily recurring task
{
  "description": "Daily Standup",
  "due": "2024-03-20",
  "recur": "daily",
  "until": "2024-06-20"
}

// Modify task to weekly recurrence
{
  "taskid": "123",
  "description": "Weekly Report",
  "due": "2024-03-22",
  "recur": "weekly"
}

Important

  • Supported recurrence patterns: daily, weekly, monthly, yearly
  • The until field is optional
  • Recurring tasks require a due date

- Implemented recurrence pattern validation in AddTaskHandler and ModifyTaskHandler.
- Updated AddTaskRequestBody and ModifyTaskRequestBody to include recurrence and until fields.
- Enhanced AddTaskToTaskwarrior and ModifyTaskInTaskwarrior functions to handle recurrence parameters.
- Added unit tests for adding and modifying tasks with recurrence patterns.
@Advaitgaur004
Copy link
Contributor Author

@its-me-abhishek New Feature is Added

@its-me-abhishek
Copy link
Collaborator

are there any updates on the frontend

@Advaitgaur004
Copy link
Contributor Author

Advaitgaur004 commented Mar 15, 2025

are there any updates on the frontend

leave the issue there and remove the backend tag(label). I have some work to do, Either I'll do it later or someone else can manage this 😄

@Advaitgaur004
Copy link
Contributor Author

@its-me-abhishek Just a gentle reminder: you can test the various APIs created. Please leave the issue (#91) there and remove the backend tag after checking.

@its-me-abhishek
Copy link
Collaborator

hi, i am aware of this PR and i will test them out whenever some frontend gets developed for the same as the backend code looks okay to me (not tested).. the labels have to stay as (in this project) they are not about what has to be done, but what has been done in that closed (now open) issue for easy tracking in case some PR breaks anything unexpectedly

@its-me-abhishek
Copy link
Collaborator

also, do checkout the code-review above about some package.json

@Advaitgaur004
Copy link
Contributor Author

I didn't see any, can you provide the link if possible

Copy link
Collaborator

@its-me-abhishek its-me-abhishek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix this

@Advaitgaur004
Copy link
Contributor Author

please fix this

resolved

@Advaitgaur004
Copy link
Contributor Author

Currently busy with other work, I won't be able to create the frontend side.

@its-me-abhishek
Copy link
Collaborator

no issues, will close it for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants