feat(notifications): TODO 7 — draft decision toast + email + bell badge

This commit is contained in:
Александр Зимин
2026-05-14 14:40:35 +00:00
parent 50d263745a
commit 9050e2427e
21 changed files with 1992 additions and 82 deletions
+32
View File
@@ -687,3 +687,35 @@ export type ChangelogDiff = {
after: unknown | null
summary: ChangelogDiffSummary
}
// === Notifications (TODO 7: draft decision toast + email) ===
/**
* Single notification row для current user. Backend serializes
* {@code notification_log} entry joined с {@code notification_read_state}
* (per-user unread tracking).
*
* <p>{@code payload} — JSON payload эвента (e.g. RecordDraftApproved).
* {@code payloadPreview} — server-pre-rendered summary string чтобы UI
* не парсил event payload (event_type → user-facing text mapping живёт
* backend'е).
*/
export type NotificationItem = {
id: string
eventType: string
channel: 'EMAIL' | 'EXPRESS' | 'TELEGRAM' | 'IN_APP'
sentAt: string
read: boolean
payloadPreview: string
/** Optional deep-link (e.g. /reviews/{draftId} для draft decision). */
href?: string | null
}
export type NotificationsResponse = {
items: NotificationItem[]
page: number
size: number
totalElements: number
/** Unread count for badge — pre-filtered server-side. */
totalUnread: number
}