b0e987f790
- 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)
52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
"""SQLAlchemy models for LeoCRM."""
|
|
|
|
from app.models.address import Address
|
|
from app.models.ai_conversation import AIConversation, AIMessage
|
|
from app.models.attachment import Attachment
|
|
from app.models.audit import AuditLog, DeletionLog
|
|
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, NotificationPreference, NotificationType
|
|
from app.models.plugin import Plugin, PluginMigration
|
|
from app.models.role import Role
|
|
from app.models.sequence import Sequence
|
|
from app.models.session import Session
|
|
from app.models.system_settings import SystemSettings
|
|
from app.models.tax import TaxRate
|
|
from app.models.tenant import Tenant
|
|
from app.models.user import User, UserTenant
|
|
from app.models.workflow import Workflow, WorkflowInstance, WorkflowStepHistory
|
|
|
|
__all__ = [
|
|
"Tenant",
|
|
"User",
|
|
"UserTenant",
|
|
"Role",
|
|
"Session",
|
|
"AuditLog",
|
|
"DeletionLog",
|
|
"Notification",
|
|
"NotificationType",
|
|
"NotificationPreference",
|
|
"PasswordResetToken",
|
|
"ApiToken",
|
|
"Company",
|
|
"Contact",
|
|
"CompanyContact",
|
|
"Currency",
|
|
"TaxRate",
|
|
"Sequence",
|
|
"SystemSettings",
|
|
"Attachment",
|
|
"Address",
|
|
"Plugin",
|
|
"PluginMigration",
|
|
"AIConversation",
|
|
"AIMessage",
|
|
"Workflow",
|
|
"WorkflowInstance",
|
|
"WorkflowStepHistory",
|
|
]
|