An admin can now queue up an email address in advance (POST/GET/DELETE /system/pending-provisioning) with a source user and an optional admin flag. The moment that email actually verifies a real account - not raw registration, which proves nothing about ownership - it gets a deep copy of the source user's per-user API keys and every company they own (company profile, aliases, competitors, monitor config, sources, source documents, monitoring runs, reports, snapshots, detected changes, and enrichment - not just the company row), plus an email notification destination for its own address linked to the copied companies. The clone logic (_copy_row/_clone_company in provisioning_service.py) is generic over every table it touches via column introspection, so it doesn't need hand-maintained field lists per model. Co-Authored-By: Claude Sonnet 5 <[email protected]>
37 lines
1.8 KiB
Python
37 lines
1.8 KiB
Python
"""SQLAlchemy ORM models.
|
|
|
|
Every model module is imported here so that `Base.metadata` (used by Alembic
|
|
autogenerate) sees the full schema. Add new model modules to this list as
|
|
they're created.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.models.alert import Alert # noqa: F401
|
|
from app.models.company import Company, CompanyAlias, Competitor # noqa: F401
|
|
from app.models.company_enrichment import CompanyEnrichment # noqa: F401
|
|
from app.models.detected_change import DetectedChange # noqa: F401
|
|
from app.models.email_code import EmailCode # noqa: F401
|
|
from app.models.ip_ban import IpBan # noqa: F401
|
|
from app.models.ip_throttle_state import IpThrottleState # noqa: F401
|
|
from app.models.monitor_configuration import MonitorConfiguration # noqa: F401
|
|
from app.models.monitoring_run import MonitoringRun # noqa: F401
|
|
from app.models.notification_delivery import NotificationDelivery # noqa: F401
|
|
from app.models.notification_destination import ( # noqa: F401
|
|
NotificationDestination,
|
|
NotificationDestinationCompany,
|
|
)
|
|
from app.models.password_history import PasswordHistoryEntry # noqa: F401
|
|
from app.models.pending_provisioning import PendingProvisioning # noqa: F401
|
|
from app.models.refresh_token import RefreshToken # noqa: F401
|
|
from app.models.report import Report # noqa: F401
|
|
from app.models.snapshot import Snapshot # noqa: F401
|
|
from app.models.source import Source # noqa: F401
|
|
from app.models.source_document import SourceDocument # noqa: F401
|
|
from app.models.system_secret import SystemSecret # noqa: F401
|
|
from app.models.unban_request import UnbanRequest # noqa: F401
|
|
from app.models.user import User # noqa: F401
|
|
from app.models.user_api_key import UserApiKey # noqa: F401
|
|
from app.models.user_known_ip import UserKnownIp # noqa: F401
|
|
from app.models.user_security_event import UserSecurityEvent # noqa: F401
|