Expand description
Per-operator notifications — a small rustio_notifications
table + a public send helper for project code.
Schema:
CREATE TABLE rustio_notifications (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES rustio_users(id) ON DELETE CASCADE,
message TEXT NOT NULL,
url TEXT NOT NULL DEFAULT '',
read_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);Projects emit notifications via
[rustio_admin::send_notification] — anywhere a Db is in
scope. Every authenticated admin page renders a bell in the
topbar with an unread-count badge; the operator clicks
through to /admin/notifications, scans the list, and hits
“Mark all read” to clear the badge.
v1 scope: per-row dismissal is not yet shipped — the page offers a single “mark every notification for this operator as read” action. Operators with high notification volume can filter by date in a future iteration.
Structs§
- Notification
- One stored notification. Surfaced by [
list_for_user] for the admin UI.
Functions§
- ensure_
table - Ensure the
rustio_notificationstable + its unread-lookup index exist. Idempotent. - send
- Persist one notification targeted at
user_id.urlmay be empty when the message stands on its own (no click-through). Returns the new row’s id on success.