mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-08 18:35:00 +03:00
New notifications app: Notification (event, addressed to an audience: ALL/ OWNER/OPERATORS/USER) + per-user NotificationRead, so one event reaches many recipients but read-state is personal. Service notify() with a type registry (level + deep-link route) — adding a type is one entry. API: list (+unreadCount) and read (ids/all). Owner sees operator-addressed events too (oversight). First source wired: a new inbound dialog emits DIALOG_WAITING to operators (deduped per conversation). Frontend: real bell badge in the topbar opening a notification drawer (grouped today/earlier, level icons, unread dots, click → navigate + mark read, 'mark all read'); Shell polls every 15s. Verified: operator-audience event visible to operator and owner; marking read is per-user. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
16 lines
511 B
Python
16 lines
511 B
Python
from django.contrib import admin
|
|
|
|
from hub_platform.notifications.models import Notification, NotificationRead
|
|
|
|
|
|
@admin.register(Notification)
|
|
class NotificationAdmin(admin.ModelAdmin):
|
|
list_display = ("type", "audience", "level", "title", "organization", "created_at")
|
|
list_filter = ("type", "audience", "level")
|
|
search_fields = ("title", "body", "dedup_key")
|
|
|
|
|
|
@admin.register(NotificationRead)
|
|
class NotificationReadAdmin(admin.ModelAdmin):
|
|
list_display = ("notification", "user", "read_at")
|