feat: notification preferences system with plugin registry

- Add NotificationType and NotificationPreference models
- Add get_notification_types() to BasePlugin for plugin registration
- Add sync_notification_types() to PluginRegistry
- Update create_notification() to check user preferences (returns Notification|None)
- Add API endpoints: GET /types, GET /preferences, PATCH /preferences/{type_key}
- Add NotificationPreferenceUpdate schema
- Mail plugin registers 10 notification types with metadata
- Add Alembic migration 0017 for new tables + seed data
- Frontend: SettingsNotifications page with toggle switches
- Frontend: Settings tab, route, hooks for notification preferences
- i18n: notification settings keys (de/en)
This commit is contained in:
Agent Zero
2026-07-15 21:00:32 +02:00
parent c4d0ec6f7f
commit b0e987f790
15 changed files with 652 additions and 11 deletions
+3 -1
View File
@@ -8,7 +8,7 @@ from app.models.auth import ApiToken, PasswordResetToken
from app.models.company import Company
from app.models.contact import CompanyContact, Contact
from app.models.currency import Currency
from app.models.notification import Notification
from app.models.notification import Notification, NotificationPreference, NotificationType
from app.models.plugin import Plugin, PluginMigration
from app.models.role import Role
from app.models.sequence import Sequence
@@ -28,6 +28,8 @@ __all__ = [
"AuditLog",
"DeletionLog",
"Notification",
"NotificationType",
"NotificationPreference",
"PasswordResetToken",
"ApiToken",
"Company",