Documentation Index
Fetch the complete documentation index at: https://mintlify.com/EdgarJr30/proyecto-de-grado-cms/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Notification Center provides a comprehensive system for delivering real-time alerts to users about ticket updates, assignments, status changes, and system events. It supports both in-app notifications and web push notifications.The notification system consists of three layers: event generation, delivery management, and presentation (in-app and push).
Notification Categories
Notifications are organized into five categories:Assignments
New ticket assignments and unassignments. Alerts when you’re assigned to a work order.
Comments
New comments added to tickets you’re involved with.
Status Changes
Ticket status updates, priority changes, and finalizations.
Deadlines
Deadline reminders, due soon alerts, and overdue notices.
Admin/System
System announcements and administrative notifications.
Notification Center
Access the Notification Center at/notificaciones to view and manage all notifications:
Feed View
Features:- Chronological list of notifications
- Visual distinction between read/unread
- Search by title, message, or category
- Quick mark as read/unread
- Click to navigate to related entity
- Real-time updates
- All
- Unread
- Tickets
- Admin
Shows all notifications regardless of read status or category.
Settings Panel
Configuration Options:-
Push Notifications
- Enable/disable push on current device
- Platform-specific instructions
- Permission status indicator
- Test notification sender
-
Category Preferences
- Toggle each category on/off
- Affects both in-app and push
- Saved per user
-
Admin Tools (if permitted)
- Send test notifications to any user
- Search users by name/email
- View push subscription status
- Test both in-app and push delivery
Notification States
Each notification has three state timestamps:Delivered At
When: Notification created and delivered to recipient Meaning: Notification exists in user’s feed Database:notification_deliveries.delivered_at
Seen At
When: User views the notification in the feed Meaning: User has seen the notification (but not necessarily read it) Database:notification_deliveries.seen_at
Auto-marked: When notification appears in viewport
Read At
When: User explicitly marks as read or clicks the notification Meaning: User has acknowledged and read the notification Database:notification_deliveries.read_at
Affects: Unread count badge
Web Push Notifications
Enabling Push
Platform-Specific Instructions
iOS (iPhone/iPad):- Install app to home screen first
- Open installed PWA
- Allow notifications when prompted
- Check Settings > [App Name] > Notifications
- Browser or PWA supported
- Allow notifications when prompted
- Check Settings > Apps > [Browser/App] > Notifications
- Browser permission prompt
- Check Settings > System > Notifications
- Verify browser notifications enabled
- Browser permission prompt
- Check System Preferences > Notifications
- Verify browser notifications enabled
Push Architecture
Components:-
Subscription - Device registers with push service
- Table:
web_push_subscriptions - Stores endpoint, keys, user_agent
- One per device per user
- Table:
-
Outbox - Queue for pending push messages
- Table:
web_push_outbox - Created by triggers on notification events
- Processed by Edge Function
- Table:
-
Edge Function - Sends push messages
- Function:
send-push-from-outbox - Triggered by cron (every minute)
- Uses Web Push protocol
- Marks delivered or failed
- Function:
-
Client - Receives and displays push
- Service worker intercepts
- Shows browser notification
- Handles click to open app
Event System
Notification Events
Stored innotification_events table:
Common Event Types
Ticket Events:ticket.createdticket.assignedticket.unassignedticket.status_changedticket.acceptedticket.finalizedticket.comment_addedticket.priority_changedticket.urgent_changedticket.deadline_setticket.deadline_changedticket.due_soonticket.overdue
Delivery Records
Each event creates one or more deliveries:Service Integration
Listing Notifications
~/workspace/source/src/services/notificationCenterService.ts:290 for implementation.
Marking as Read
~/workspace/source/src/services/notificationCenterService.ts:365 and :395.
Unread Count
~/workspace/source/src/services/notificationCenterService.ts:349.
Preferences
~/workspace/source/src/services/notificationCenterService.ts:428 and :448.
Real-time Subscription
~/workspace/source/src/services/notificationCenterService.ts:565.
Data Model
NotificationItem
Frontend representation:NotificationPreferences
User configuration:NotificationCategory
Category enum:UI Components
NotificationCenterPage
Main page at~/workspace/source/src/pages/NotificationCenterPage.tsx:102
Features:
- Feed with filtering and search
- Settings panel with preferences
- Push onboarding guide
- Admin test tools
- Responsive mobile/desktop layout
SwipeableNotificationCard
Interactive card at~/workspace/source/src/components/notifications/SwipeableNotificationCard.tsx
Gestures:
- Tap to open
- Swipe right for quick actions
- Long press for context menu
Badge Components
Unread count badge in app header:Permissions
View Notifications
All authenticated users can:- View their own notifications
- Mark notifications as read/unread
- Configure preferences
- Enable/disable push
Send Test Notifications
Requires one of:users:full_accessrbac:manage_permissions
- Search all users
- Send test notifications to any user
- View push subscription status
Performance
Pagination
- Default page size: 20 notifications
- Client-side pagination controls
- Server-side filtering and counting
- Efficient
range(offset, limit)queries
Caching
- Unread count cached in memory
- Refreshed on notification events
- Invalidated on mark as read/unread
Real-time Efficiency
- Uses Supabase Realtime channels
- Filters by
recipient_user_id - Only subscribes to own notifications
- Automatic reconnection on disconnect
Troubleshooting
Push not working
- Permission Denied
- iOS PWA Issues
- Subscription Failed
Symptoms: “Permission blocked” messageSolution:
- Check browser notification settings
- Reset site permissions
- Re-enable push in app
- Test with self-test button
Notifications not appearing
- Check category preferences (might be disabled)
- Verify RLS policies allow access
- Confirm event was created
- Check delivery records in database
- Review browser console for errors
Unread count wrong
- Refresh the page
- Mark all as read and verify
- Check
read_atin database - Clear browser cache
Best Practices
For Users
- Enable Push - Stay informed of urgent updates
- Review Daily - Check notification center regularly
- Mark as Read - Keep unread count manageable
- Configure Categories - Disable categories you don’t need
- Test Regularly - Verify push works after device changes
For Developers
- Use Correct Event Types - Follow naming convention
- Populate Payload - Include useful context data
- Set Meaningful Titles - Make notifications actionable
- Test on All Platforms - iOS, Android, desktop
- Handle Errors Gracefully - Push may fail, show in-app
For Admins
- Monitor Outbox - Check for stuck messages
- Review Edge Function Logs - Identify delivery issues
- Validate VAPID Keys - Ensure configured correctly
- Test User Notifications - Use admin test tool
- Clean Old Notifications - Archive old deliveries
Related Documentation
- Work Orders - Notifications for status changes
- Work Requests - Notifications for new requests
- My Tickets - Notifications for your assignments
- Kanban Board - Real-time board updates