7a5a48fb4c
- Plugin registry with discover/install/activate/deactivate/uninstall lifecycle - PluginManifest Pydantic v2 schema (name, version, dependencies, routes, events, migrations) - BasePlugin abstract class with lifecycle hooks (on_install/activate/deactivate/uninstall) - Migration runner with tenant_id validator (rejects tables without tenant_id) - Event bus integration: register/unregister listeners on activate/deactivate - Service container DI: plugins receive db, cache, event_bus, storage, notifications - Idempotent operations (activate active=200, deactivate inactive=200) - UI registry for frontend component registration - 47 new tests (14 ACs + 33 unit tests), 103 total tests pass - Migration 0003: plugins + plugin_migrations tables - Coverage: 85.92% for plugin modules
21 lines
728 B
Python
21 lines
728 B
Python
"""SQLAlchemy models for LeoCRM."""
|
|
|
|
from app.models.tenant import Tenant
|
|
from app.models.user import User, UserTenant
|
|
from app.models.role import Role
|
|
from app.models.session import Session
|
|
from app.models.audit import AuditLog, DeletionLog
|
|
from app.models.notification import Notification
|
|
from app.models.auth import PasswordResetToken, ApiToken
|
|
from app.models.company import Company
|
|
from app.models.contact import Contact, CompanyContact
|
|
from app.models.plugin import Plugin, PluginMigration
|
|
|
|
__all__ = [
|
|
"Tenant", "User", "UserTenant", "Role", "Session",
|
|
"AuditLog", "DeletionLog", "Notification",
|
|
"PasswordResetToken", "ApiToken", "Company",
|
|
"Contact", "CompanyContact",
|
|
"Plugin", "PluginMigration",
|
|
]
|