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:
@@ -72,6 +72,16 @@ class BasePlugin(ABC):
|
||||
"""
|
||||
return None
|
||||
|
||||
# ─── Notification Types ───
|
||||
|
||||
def get_notification_types(self) -> list[dict[str, Any]]:
|
||||
"""Return notification types this plugin registers.
|
||||
|
||||
Override in subclasses to register notification types.
|
||||
Each dict must have: type_key, category, label, description, is_enabled_by_default
|
||||
"""
|
||||
return []
|
||||
|
||||
# ─── Route Registration ───
|
||||
|
||||
def get_routes(self) -> list[APIRouter]:
|
||||
|
||||
Reference in New Issue
Block a user