Backend: - Add reset_at (datetime) and next_due_date (date) columns to todos - Toggle endpoint calculates reset schedule when completing recurring todos: daily resets next day, weekly resets start of next week (respects first_day_of_week setting), monthly resets 1st of next month - GET /todos auto-reactivates recurring todos whose reset_at has passed, updating due_date to next_due_date and clearing completion state - Alembic migration 014 Frontend: - Add reset_at and next_due_date to Todo type - TodoItem shows recurrence badge (Daily/Weekly/Monthly) in purple - Completed recurring todos display reset info: "Resets Mon 02/03/26 · Next due 06/03/26" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
584 B
Python
27 lines
584 B
Python
"""Add reset_at and next_due_date to todos for recurrence
|
|
|
|
Revision ID: 014
|
|
Revises: 013
|
|
Create Date: 2026-02-23
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "014"
|
|
down_revision = "013"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column("todos", sa.Column("reset_at", sa.DateTime(), nullable=True))
|
|
op.add_column("todos", sa.Column("next_due_date", sa.Date(), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("todos", "next_due_date")
|
|
op.drop_column("todos", "reset_at")
|