- Backend: GET /api/reminders/due endpoint, PATCH snooze endpoint, snoozed_until column + migration - Frontend: useAlerts hook polls every 30s, fires Sonner toasts on non-dashboard pages (max 3 + summary), renders AlertBanner on dashboard below stats row - Dashboard Active Reminders card filters out items shown in banner Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
989 B
Python
21 lines
989 B
Python
from sqlalchemy import String, Text, Boolean, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from app.database import Base
|
|
|
|
|
|
class Reminder(Base):
|
|
__tablename__ = "reminders"
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True, index=True)
|
|
title: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
description: Mapped[Optional[str]] = mapped_column(Text, nullable=True)
|
|
remind_at: Mapped[Optional[datetime]] = mapped_column(nullable=True)
|
|
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
|
is_dismissed: Mapped[bool] = mapped_column(Boolean, default=False)
|
|
snoozed_until: Mapped[Optional[datetime]] = mapped_column(nullable=True)
|
|
recurrence_rule: Mapped[Optional[str]] = mapped_column(String(255), nullable=True)
|
|
created_at: Mapped[datetime] = mapped_column(default=func.now())
|
|
updated_at: Mapped[datetime] = mapped_column(default=func.now(), onupdate=func.now())
|