The admin Notifications page at /dashboard/notifications loads rows from admin_notifications via the Nest API (GET /api/v1/auth/admin/notifications). Admins can mark items read, mark all read, delete a single row, or delete selected rows in one call. Delivery preferences live under profile Settings → Notifications.
| Goals | Non-goals |
|---|
| Inbox for Laravel-style admin database notifications | Full push/email delivery from this screen |
| Scoped reads/deletes to the signed-in admin | Cross-admin notification management |
- List, mark read, mark all read, and delete call the backend; the UI invalidates the query cache after success.
- All and Unread use server pagination: query
page, limit (1–100, default 15), and unread=true for the unread list. The response includes data, total, page, pageSize, totalPages, and unreadTotal (badge count, independent of the unread filter).
- Category filters (Orders, Customers, System, Payments) load the first 100 rows without
unread, then filter and paginate in the browser.
- Delete (single) asks for confirmation, then
DELETE /api/v1/auth/admin/notifications/{id}; a missing or other-admin row returns 404.
- Delete selected asks for confirmation, then
POST /api/v1/auth/admin/notifications/delete with body { "ids": ["…"] } (1–200 ids). The response includes deleted and skipped (ids that did not match a row for this admin).
- User opens Notifications → list loads from the API.
- Mark as read →
PATCH …/{id}/read → row shows as read.
- Delete → confirm →
DELETE …/{id} → row disappears from the list.
- Delete selected → confirm →
POST …/delete with selected ids → matching rows are removed; list refreshes.
- Deletes are scoped to the current admin (
notifiable_id + known notifiable_type); do not use notification IDs as opaque capabilities across tenants.
- For operational alerting, still use monitoring, email, and on-call—not this inbox alone.
| ID | Scenario | Expected |
|---|
| N1 | Open notifications | List loads or error message |
| N2 | Mark one read | Row shows read; persists after refresh |
| N3 | Mark all read | Unread count clears |
| N4 | Delete with confirm | Row removed; persists after refresh |
| N5 | Delete cancel | No API call; row unchanged |