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:
Matthieu
2026-06-21 01:15:05 +02:00
parent 144a8a4685
commit 0cce586a1f
9 changed files with 230 additions and 4 deletions
@@ -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() {