Skip to content

F25/aashi/create recurrence task table#168

Merged
Akishai18 merged 4 commits intomainfrom
F25/aashi/create-recurrence-task-table
Feb 6, 2026
Merged

F25/aashi/create recurrence task table#168
Akishai18 merged 4 commits intomainfrom
F25/aashi/create-recurrence-task-table

Conversation

@aashichaubey
Copy link
Contributor

@aashichaubey aashichaubey commented Nov 25, 2025

Notion ticket link

Create Recurrence Task Table

Implementation description

Added a new migration to create the recurrence_tasks table to support Weekly, Biweekly, Monthly, and Annually recurring tasks.
Added RecurrenceTask model with fields: task_id, days, cadence, end_date, and exclusions.
Updated Task model to include a @hasone relationship to RecurrenceTask so recurrence details can be retrieved via include: ["recurrence"]

Steps to test

  1. Create a test task_template
INSERT INTO task_templates (task_name, category, instruction)
VALUES ('Test Template', 'Misc.', 'Test Instruction')
RETURNING id;

Copy the returned id (call it TEMPLATE_ID).

  1. Create a test task linked to that template
INSERT INTO tasks (pet_id, task_template_id, created_at)
VALUES (101, TEMPLATE_ID, NOW())
RETURNING id;

Replace TEMPLATE_ID with the value from Step 1.
Copy the returned id (call it TASK_ID).

  1. Add a recurrence rule for that task
INSERT INTO recurrence_tasks (task_id, days, cadence, end_date, exclusions)
VALUES (
  TASK_ID,
  ARRAY['Mon','Wed']::enum_recurrence_tasks_days[],
  'Weekly',
  '2025-03-01',
  ARRAY['2025-02-10','2025-02-24']::date[]
);

Replace TASK_ID with the value from Step 2.

  1. Verify the recurrence record exists
SELECT * FROM recurrence_tasks WHERE task_id = TASK_ID;

If this returns a row, the recurrence was created correctly and can be retrieved via task.recurrence.

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

Copy link
Collaborator

@sthuray sthuray left a comment

Choose a reason for hiding this comment

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

Overall, LGTM (haven't tested yet). Left a few minor nitpicks to change.

@Akishai18 Akishai18 self-requested a review February 5, 2026 03:48
Copy link
Collaborator

@Akishai18 Akishai18 left a comment

Choose a reason for hiding this comment

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

LGTM - Requirements and Fixes Fulfilled

@Akishai18 Akishai18 removed the request for review from matthewd-so February 5, 2026 03:54
@Akishai18 Akishai18 dismissed sthuray’s stale review February 5, 2026 03:57

Requested changes addressed in latest commit

@Akishai18 Akishai18 enabled auto-merge February 5, 2026 03:58
@Akishai18 Akishai18 disabled auto-merge February 6, 2026 02:20
@Akishai18 Akishai18 added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit 7ec34f6 Feb 6, 2026
1 check passed
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.

4 participants