"""SQLAlchemy ORM models for NoteFlow.

All models are re-exported here for backward compatibility with existing imports.
Models are organized into subdomain packages:
- core/: Meeting, segments, summaries, annotations, diarization
- identity/: Workspaces, users, settings
- entities/: Persons, speakers (knowledge graph entities)
- organization/: Tags, tasks
- integrations/: External service integrations, calendar
"""

from noteflow.infrastructure.persistence.models._base import (
    DEFAULT_USER_ID,
    DEFAULT_WORKSPACE_ID,
    EMBEDDING_DIM,
    Base,
)

# Core domain models
from noteflow.infrastructure.persistence.models.core import (
    ActionItemModel,
    AnnotationModel,
    DiarizationJobModel,
    KeyPointModel,
    MeetingModel,
    SegmentModel,
    StreamingDiarizationTurnModel,
    SummaryModel,
    WordTimingModel,
)

# Entity models (knowledge graph)
from noteflow.infrastructure.persistence.models.entities import (
    MeetingSpeakerModel,
    NamedEntityModel,
    PersonModel,
)

# Identity and tenancy models
from noteflow.infrastructure.persistence.models.identity import (
    ProjectMembershipModel,
    ProjectModel,
    SettingsModel,
    UserModel,
    UserPreferencesModel,
    WorkspaceMembershipModel,
    WorkspaceModel,
)

# Integration models
from noteflow.infrastructure.persistence.models.integrations import (
    CalendarEventModel,
    ExternalRefModel,
    IntegrationModel,
    IntegrationSecretModel,
    IntegrationSyncRunModel,
    MeetingCalendarLinkModel,
    WebhookConfigModel,
    WebhookDeliveryModel,
)

# Organization models
from noteflow.infrastructure.persistence.models.organization import (
    MeetingTagModel,
    TagModel,
    TaskModel,
)

__all__ = [
    "DEFAULT_USER_ID",
    "DEFAULT_WORKSPACE_ID",
    "EMBEDDING_DIM",
    # Core domain
    "ActionItemModel",
    "AnnotationModel",
    # Base and constants
    "Base",
    # Integrations
    "CalendarEventModel",
    "DiarizationJobModel",
    "ExternalRefModel",
    "IntegrationModel",
    "IntegrationSecretModel",
    "IntegrationSyncRunModel",
    "KeyPointModel",
    "MeetingCalendarLinkModel",
    "MeetingModel",
    # Entities
    "MeetingSpeakerModel",
    # Organization
    "MeetingTagModel",
    "NamedEntityModel",
    "PersonModel",
    # Identity
    "ProjectMembershipModel",
    "ProjectModel",
    "SegmentModel",
    "SettingsModel",
    "StreamingDiarizationTurnModel",
    "SummaryModel",
    "TagModel",
    "TaskModel",
    "UserModel",
    "UserPreferencesModel",
    "WebhookConfigModel",
    "WebhookDeliveryModel",
    "WordTimingModel",
    "WorkspaceMembershipModel",
    "WorkspaceModel",
]
