"""
Unified Inbox Mail Module

Multi-Account IMAP aggregation with KI-powered analysis.

Features:
- Multi-account IMAP aggregation
- Secure credential storage (Vault/encrypted)
- KI-powered email analysis (sender classification, deadline extraction)
- Arbeitsvorrat (task management) with deadline tracking
- Response suggestions

Usage:
    from mail.api import router as mail_router
    app.include_router(mail_router)

API Endpoints:
    POST /api/v1/mail/init - Initialize database tables
    POST /api/v1/mail/accounts - Create email account
    GET  /api/v1/mail/accounts - List accounts
    GET  /api/v1/mail/inbox - Get unified inbox
    POST /api/v1/mail/analyze/{id} - Analyze email with AI
    GET  /api/v1/mail/tasks - Get tasks (Arbeitsvorrat)
    GET  /api/v1/mail/tasks/dashboard - Dashboard statistics
"""

from .models import (
    # Enums
    AccountStatus,
    TaskStatus,
    TaskPriority,
    EmailCategory,
    SenderType,
    # Account models
    EmailAccountCreate,
    EmailAccountUpdate,
    EmailAccount,
    AccountTestResult,
    # Email models
    AggregatedEmail,
    EmailSearchParams,
    EmailComposeRequest,
    EmailSendResult,
    # Task models
    TaskCreate,
    TaskUpdate,
    InboxTask,
    TaskDashboardStats,
    # AI models
    SenderClassification,
    DeadlineExtraction,
    EmailAnalysisResult,
    ResponseSuggestion,
    # Stats
    MailStats,
    MailHealthCheck,
    # Templates
    EmailTemplate,
    EmailTemplateCreate,
)

from .api import router
from .aggregator import get_mail_aggregator
from .ai_service import get_ai_email_service
from .task_service import get_task_service
from .credentials import get_credentials_service
from .mail_db import init_mail_tables

__all__ = [
    # Router
    "router",
    # Services
    "get_mail_aggregator",
    "get_ai_email_service",
    "get_task_service",
    "get_credentials_service",
    # Database
    "init_mail_tables",
    # Enums
    "AccountStatus",
    "TaskStatus",
    "TaskPriority",
    "EmailCategory",
    "SenderType",
    # Models
    "EmailAccountCreate",
    "EmailAccountUpdate",
    "EmailAccount",
    "AccountTestResult",
    "AggregatedEmail",
    "EmailSearchParams",
    "EmailComposeRequest",
    "EmailSendResult",
    "TaskCreate",
    "TaskUpdate",
    "InboxTask",
    "TaskDashboardStats",
    "SenderClassification",
    "DeadlineExtraction",
    "EmailAnalysisResult",
    "ResponseSuggestion",
    "MailStats",
    "MailHealthCheck",
    "EmailTemplate",
    "EmailTemplateCreate",
]
