feat(client-portal) : phase 3 — ticket notifications
LST-69 (3.2) phase 3. Wires the existing notification system to client-ticket events (the bell/useNotifications/endpoints already existed). - Notification.relatedTicket (ManyToOne ClientTicketInterface, SET NULL) + additive migration + notification:read group. - NotifierInterface::notify() gains a backward-compatible optional relatedTicket param (existing callers unchanged). - ClientTicketNumberProcessor (POST): notifies all ROLE_ADMIN users (ticket_created), tolerant try/catch after flush. ClientTicketStatusProcessor (PATCH): notifies submittedBy on status change (ticket_status_changed). - Front: notification DTO relatedTicket; NotificationBell navigates to /admin (admin) or /portal (client) on ticket notifications. 180 tests green (178 + 2), nuxt build passes, cs-fixer clean.
This commit is contained in:
@@ -102,11 +102,22 @@ function toggleDropdown() {
|
||||
}
|
||||
}
|
||||
|
||||
const auth = useAuthStore()
|
||||
|
||||
const isAdmin = computed(() => (auth.user?.roles ?? []).includes('ROLE_ADMIN'))
|
||||
|
||||
function handleClick(notif: Notification) {
|
||||
if (!notif.isRead) {
|
||||
markAsRead(notif.id)
|
||||
}
|
||||
isOpen.value = false
|
||||
|
||||
// Deep-link to the related ticket when present. The notification payload does
|
||||
// not carry the ticket's project, so we route to the relevant list view:
|
||||
// admins to the client-tickets admin tab, clients to their portal.
|
||||
if (notif.relatedTicket) {
|
||||
navigateTo(isAdmin.value ? '/admin' : '/portal')
|
||||
}
|
||||
}
|
||||
|
||||
async function handleMarkAllRead() {
|
||||
|
||||
Reference in New Issue
Block a user