mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-10-28 15:51:15 +00:00
feat(notifications): persistent read cursor + delivery history
notification_cursors table stores one read-cursor per user per tenant; GET /v1/activity returns unreadCount + readAt, POST /v1/activity/read persists the cursor. Reminder dispatches now append reminder.sent / reminder.failed system events so delivery history reaches the feed. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
76e45d4178
commit
2464aa45fa
14 files changed
+332
-8
No files matched your search
@@ -0,0 +1,15 @@
|
||||
-- +goose Up
|
||||
-- Persistent read state for the notification feed: one cursor per
|
||||
-- dashboard user per tenant. Events with created_at <= read_at count as
|
||||
-- read; everything newer is unread. Per-event flags were rejected — the
|
||||
-- feed is an audit list, not a per-item inbox.
|
||||
CREATE TABLE notification_cursors (
|
||||
tenant_id uuid NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
|
||||
user_subject text NOT NULL,
|
||||
read_at timestamptz NOT NULL,
|
||||
updated_at timestamptz NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (tenant_id, user_subject)
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE IF EXISTS notification_cursors;
|
||||
Reference in new issue
Block a user