Notifications (Admin)
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
Executive summary
Section titled “Executive summary”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 and non-goals
Section titled “Goals and non-goals”| 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 |
Current platform behavior
Section titled “Current platform behavior”- 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), andunread=truefor the unread list. The response includesdata,total,page,pageSize,totalPages, andunreadTotal(badge count, independent of theunreadfilter). - 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/deletewith body{ "ids": ["…"] }(1–200 ids). The response includesdeletedandskipped(ids that did not match a row for this admin).
Sequence: happy path
Section titled “Sequence: happy path”- 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 …/deletewith selected ids → matching rows are removed; list refreshes.
Security and operations
Section titled “Security and operations”- Deletes are scoped to the current admin (
notifiable_id+ knownnotifiable_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.
Test scenarios (UAT / QA)
Section titled “Test scenarios (UAT / QA)”| 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 |
/dashboard/notifications