feat: add email notification system (Brevo SMTP + N8N daily digest)
- Add core notification service: types, email-service (nodemailer/Brevo SMTP), notification-service (digest builder, preference CRUD, HTML renderer) - Add API routes: POST /api/notifications/digest (N8N cron, Bearer auth), GET/PUT /api/notifications/preferences (session auth) - Add NotificationPreferences UI component (Bell button + dialog with per-type toggles) in Registratura toolbar - Add 7 Brevo SMTP env vars to docker-compose.yml - Update CLAUDE.md, ROADMAP.md, DATA-MODEL.md, SYSTEM-ARCHITECTURE.md, CONFIGURATION.md, DOCKER-DEPLOYMENT.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -443,6 +443,40 @@ interface WordTemplate extends BaseEntity {
|
||||
}
|
||||
```
|
||||
|
||||
### Email Notifications (platform service)
|
||||
|
||||
```typescript
|
||||
// src/core/notifications/types.ts
|
||||
|
||||
type NotificationType = "deadline-urgent" | "deadline-overdue" | "document-expiry";
|
||||
|
||||
interface NotificationPreference {
|
||||
userId: string;
|
||||
email: string;
|
||||
name: string;
|
||||
company: CompanyId;
|
||||
enabledTypes: NotificationType[];
|
||||
globalOptOut: boolean;
|
||||
}
|
||||
|
||||
interface DigestItem {
|
||||
entryNumber: string;
|
||||
subject: string;
|
||||
label: string;
|
||||
dueDate: string; // YYYY-MM-DD
|
||||
daysRemaining: number; // negative = overdue
|
||||
color: "red" | "yellow" | "blue";
|
||||
}
|
||||
|
||||
interface DigestSection {
|
||||
type: NotificationType;
|
||||
title: string;
|
||||
items: DigestItem[];
|
||||
}
|
||||
```
|
||||
|
||||
> **Storage:** Preferences stored in `KeyValueStore` (namespace `notifications`, key `pref:<userId>`). No separate Prisma model needed.
|
||||
|
||||
---
|
||||
|
||||
## Naming Conventions
|
||||
|
||||
Reference in New Issue
Block a user