feat(notifications): TODO 7 — draft decision toast + email + bell badge
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user