# EPICA: EPIC-MGN-008 - Notificaciones ## Metadata | Campo | Valor | |-------|-------| | **ID** | EPIC-MGN-008 | | **Nombre** | Sistema de Notificaciones | | **Modulo** | notifications | | **Fase** | Fase 3 - Extended | | **Prioridad** | P2 | | **Estado** | Backlog | | **Story Points** | 21 | | **Sprint(s)** | Sprint 13-14 | --- ## Descripcion Sistema de notificaciones multicanal que incluye notificaciones in-app, email y push (mobile). Permite preferencias por usuario, templates de notificacion reutilizables con variables dinamicas, y soporte para eventos del sistema. --- ## Objetivo de Negocio Proveer notificaciones que: - Mantengan usuarios informados de eventos relevantes - Soporten multiples canales (in-app, email, push) - Permitan personalizacion de preferencias - Reduzcan tiempo de respuesta a eventos criticos - Mejoren engagement con la plataforma --- ## Stakeholders | Rol | Nombre/Equipo | Responsabilidad | |-----|---------------|-----------------| | Product Owner | Equipo Producto | Definicion de tipos de notificaciones | | Tech Lead | Equipo Backend | Arquitectura multicanal | | UX Designer | Equipo Frontend | DiseƱo de experiencia | | DevOps | Infraestructura | Configuracion servicios (FCM, SMTP) | --- ## Historias de Usuario | ID | Historia | Prioridad | SP | Estado | |----|----------|-----------|-----|--------| | US-MGN008-001 | Como usuario, quiero recibir notificaciones in-app para estar al tanto de eventos importantes | P0 | 5 | Backlog | | US-MGN008-002 | Como usuario, quiero recibir notificaciones por email para eventos que requieren accion | P0 | 5 | Backlog | | US-MGN008-003 | Como usuario, quiero configurar mis preferencias de notificacion para controlar que recibo | P0 | 3 | Backlog | | US-MGN008-004 | Como admin, quiero crear templates de notificacion para estandarizar comunicaciones | P1 | 5 | Backlog | | US-MGN008-005 | Como usuario, quiero marcar notificaciones como leidas para gestionar mi bandeja | P0 | 2 | Backlog | | US-MGN008-006 | Como usuario, quiero recibir push notifications en mobile para estar informado fuera del sistema | P2 | 3 | Backlog | **Total Story Points:** 23 SP (ajustado a 21) --- ## Criterios de Aceptacion de la Epica **Funcionales:** - [ ] Notificaciones in-app con badge de conteo no leido - [ ] Emails con templates HTML responsivos - [ ] Preferencias granulares por tipo de notificacion y canal - [ ] Push notifications (Firebase Cloud Messaging) - [ ] Templates con variables dinamicas ({{user.name}}, {{order.total}}) - [ ] Historial de notificaciones con filtros **No Funcionales:** - [ ] Performance: Notificacion entregada en < 2s (in-app) - [ ] Reliability: Email delivery rate > 95% - [ ] Escalabilidad: 1000+ notificaciones/minuto **Tecnicos:** - [ ] Cobertura de tests > 80% - [ ] Documentacion de templates disponibles - [ ] Integracion con proveedores externos configurada --- ## Dependencias **Esta epica depende de:** | Epica/Modulo | Estado | Bloqueante | |--------------|--------|------------| | EPIC-MGN-002 Users | Ready | Si | | EPIC-MGN-006 Settings (Email config) | Backlog | Si | **Esta epica bloquea:** | Epica/Modulo | Razon | |--------------|-------| | Todos los modulos | Usan notificaciones para eventos | --- ## Desglose Tecnico **Database:** - [ ] Schema: `core_notifications` - [ ] Tablas: 5 (notifications, notification_preferences, templates, push_tokens, email_queue) - [ ] Indices: Por user_id, read_at, created_at - [ ] RLS Policies: Si (usuario solo ve sus notificaciones) **Backend:** - [ ] Modulo: `notifications` - [ ] Services: NotificationService, EmailService, PushService, TemplateEngine - [ ] Entities: 5 (Notification, NotificationPreference, Template, PushToken, EmailQueue) - [ ] Endpoints: 8 (listar, marcar leido, preferencias, etc.) - [ ] Jobs: SendEmailJob, SendPushJob, CleanupOldNotificationsJob - [ ] Tests: 20+ **Frontend:** - [ ] Componentes: NotificationBell, NotificationDrawer, PreferencesForm, NotificationItem - [ ] Stores: 1 (notificationsStore con WebSocket para real-time) - [ ] WebSocket: Para notificaciones en tiempo real --- ## Riesgos | Riesgo | Probabilidad | Impacto | Mitigacion | |--------|--------------|---------|------------| | Email en spam | Media | Alto | Configurar SPF, DKIM, DMARC | | Push tokens invalidos | Media | Medio | Cleanup periodico de tokens | | Sobrecarga de notificaciones | Media | Medio | Throttling, preferencias | --- ## Definition of Ready (DoR) - [x] Historias de usuario definidas - [x] Criterios de aceptacion claros - [x] Dependencias identificadas - [x] Estimacion completada - [ ] Configuracion SMTP disponible - [ ] Proyecto Firebase configurado - [x] Sin bloqueadores activos ## Definition of Done (DoD) - [ ] Codigo implementado y revisado - [ ] Tests pasando (unit, integration) - [ ] Notificaciones in-app funcionando - [ ] Emails enviandose correctamente - [ ] Preferencias configurables - [ ] Documentacion actualizada - [ ] Inventarios actualizados - [ ] Demo realizada - [ ] Product Owner aprobo --- ## Documentacion Relacionada - Requerimientos: `docs/03-requerimientos/RF-notifications/` - User Stories: `docs/05-user-stories/mgn-008/` - DDL Spec: `docs/04-modelado/database-design/DDL-SPEC-core_notifications.md` --- ## Historial | Fecha | Cambio | Autor | |-------|--------|-------| | 2025-12-05 | Creacion de epica | Requirements-Analyst | | 2025-12-05 | Completado con Stakeholders, Riesgos, DoR/DoD | Requirements-Analyst | --- **Creada por:** Requirements-Analyst **Fecha:** 2025-12-05 **Ultima actualizacion:** 2025-12-05