diff --git a/apps/api/src/services/notification-preferences.service.ts b/apps/api/src/services/notification-preferences.service.ts index 0b3fc54..9c9c4d6 100644 --- a/apps/api/src/services/notification-preferences.service.ts +++ b/apps/api/src/services/notification-preferences.service.ts @@ -6,9 +6,9 @@ import type { Pool } from 'pg'; * (welcome, password-reset, payment-*) — esos siempre se envían. * * Estado de implementación: - * - documento_subido: ✅ implementado (notify-upload.service.ts) - * - weekly_update: ⏳ pendiente (job es tenant-wide hoy) - * - subscription_expiring: ⏳ pendiente (no es per-contribuyente hoy) + * - documento_subido: ✅ implementado y configurable por contribuyente + * - weekly_update: ✅ implementado (job tenant-wide, no configurable) + * - subscription_expiring: ✅ implementado (aviso a owner, no configurable) * - recordatorio_fiscal: ⏳ placeholder para futuras alertas */ export const EMAIL_TYPES = [ diff --git a/apps/web/app/(dashboard)/configuracion/notificaciones/page.tsx b/apps/web/app/(dashboard)/configuracion/notificaciones/page.tsx index 1658eb7..b28a8c2 100644 --- a/apps/web/app/(dashboard)/configuracion/notificaciones/page.tsx +++ b/apps/web/app/(dashboard)/configuracion/notificaciones/page.tsx @@ -8,26 +8,30 @@ import { apiClient } from '@/lib/api/client'; import { useContribuyenteStore } from '@/stores/contribuyente-store'; import { Bell, Loader2 } from 'lucide-react'; -const EMAIL_LABELS: Record = { +const EMAIL_LABELS: Record = { documento_subido: { label: 'Documento subido', description: 'Notificación cuando se sube una declaración o documento extra del contribuyente.', status: 'active', + configurable: true, }, weekly_update: { label: 'Reporte semanal', description: 'Resumen de KPIs, alertas y discrepancias enviado los lunes 8:00 AM.', - status: 'pending', + status: 'active', + configurable: false, }, subscription_expiring: { label: 'Vencimiento de suscripción', description: 'Aviso cuando la suscripción del despacho está por vencer.', - status: 'pending', + status: 'active', + configurable: false, }, recordatorio_fiscal: { label: 'Recordatorios fiscales', description: 'Avisos de obligaciones próximas a vencer (declaraciones, pagos provisionales).', status: 'pending', + configurable: false, }, }; @@ -138,24 +142,30 @@ export default function NotificacionesPage() { if (!meta) return null; const checked = contrib.preferences[type] !== false; const isPending = meta.status === 'pending'; + const isConfigurable = meta.configurable; return (
{meta.label} - {isPending && ( + {isPending ? ( Próximamente - )} + ) : !isConfigurable ? ( + + A nivel despacho + + ) : null}

{meta.description}

-
); - })} + })}