_MAP: MGN-008 - Notifications
Modulo: MGN-008
Nombre: Notificaciones
Fase: 02 - Core Business
Story Points: 25 SP
Estado: Parcialmente Implementado
Sprint: 7
Ultima actualizacion: 2026-01-07
Resumen
Sistema de notificaciones multi-canal (email, push, in-app, WebSocket) con templates y preferencias de usuario. Sprint 7 implemento el WebSocket Gateway para notificaciones en tiempo real.
Metricas
| Metrica |
Valor |
| Story Points |
25 SP |
| Requerimientos (RF) |
4 |
| Especificaciones (ET) |
3 |
| User Stories (US) |
4 |
| Tablas DB |
6 (existentes en system) |
| Endpoints API |
WebSocket Gateway |
| Tests |
- |
Requerimientos Funcionales
Indice completo: INDICE-RF-NOTIF.md
Especificaciones Tecnicas
Historias de Usuario
| ID |
Titulo |
Estado |
| US-MGN008-001 |
Notificaciones In-App |
Pendiente |
| US-MGN008-002 |
Notificaciones Email |
Pendiente |
| US-MGN008-003 |
Notificaciones Push |
Pendiente |
| US-MGN008-004 |
WebSocket Gateway |
Implementado |
Implementacion
Database (Existente en system schema)
| Objeto |
Tipo |
Schema |
| notifications |
Tabla |
system |
| message_templates |
Tabla |
system |
| messages |
Tabla |
system |
| email_queue |
Tabla |
system |
Backend (src/modules/notifications/)
| Objeto |
Tipo |
Path |
| NotificationGateway |
Gateway |
src/modules/notifications/websocket/notification.gateway.ts |
| WebSocketTypes |
Types |
src/modules/notifications/websocket/websocket.types.ts |
WebSocket Gateway
| Evento |
Descripcion |
| connection |
Cliente conectado |
| notification |
Emite notificacion a usuario/tenant |
| tenant-notification |
Broadcast a todo el tenant |
| user-notification |
Notificacion individual |
Frontend (src/features/notifications/)
| Componente |
Path |
| NotificationBell |
src/features/notifications/components/NotificationBell.tsx |
| NotificationDropdown |
src/features/notifications/components/NotificationDropdown.tsx |
| useNotificationSocket |
src/features/notifications/hooks/useNotificationSocket.ts |
| notificationsStore |
src/features/notifications/stores/notifications.store.ts |
Caracteristicas Implementadas (Sprint 7)
- Socket.IO Gateway: Comunicacion bidireccional en tiempo real
- JWT Authentication: Validacion de token en conexion WebSocket
- Room-based: Rooms por tenant y usuario
- Event Emission: Metodos para emitir a usuario, tenant o broadcast
- Notification Bell UI: Icono con contador de no leidas
- Notification Dropdown: Lista de notificaciones con acciones
Dependencias
Depende de: MGN-001 (Auth), MGN-002 (Users), MGN-004 (Tenants), MGN-006 (Settings)
Requerido por: Modulos de negocio
Trazabilidad
Ver: TRACEABILITY.yml
Changelog
| Fecha |
Sprint |
Cambios |
| 2026-01-07 |
Sprint 7 |
WebSocket Gateway + Frontend Notification Center |
| 2025-12-05 |
- |
Documentacion RF inicial |
Generado por: Requirements-Analyst
Implementado por: Backend-Agent, Frontend-Agent (Sprint 7)
Fecha: 2026-01-07