"""Telegram channel domain — model, schemas, and repository for channel entities."""

from repo_core.domains.telegram.channel.model import TelegramChannel
from repo_core.domains.telegram.channel.schema import (
    ChannelCreateRequest,
    ChannelUpdateRequest,
    ChannelResponse,
    ChannelListResponse,
    ChannelAssignRequest,
    ChannelUnassignRequest,
    ChannelAssignResponse,
    ChannelUnassignResponse,
    AssignedAccountInfo,
    ChannelWithAssignmentsResponse,
    ChannelWithAssignmentsListResponse,
    ChannelFilterParams,
    BulkAssignRowResult,
    BulkAssignUploadResponse,
)
from repo_core.domains.telegram.channel.repository import TelegramChannelRepository

__all__ = [
    "TelegramChannel",
    "ChannelCreateRequest",
    "ChannelUpdateRequest",
    "ChannelResponse",
    "ChannelListResponse",
    "ChannelAssignRequest",
    "ChannelUnassignRequest",
    "ChannelAssignResponse",
    "ChannelUnassignResponse",
    "AssignedAccountInfo",
    "ChannelWithAssignmentsResponse",
    "ChannelWithAssignmentsListResponse",
    "ChannelFilterParams",
    "BulkAssignRowResult",
    "BulkAssignUploadResponse",
    "TelegramChannelRepository",
]


def create_repository() -> TelegramChannelRepository:
    """Create a TelegramChannelRepository auto-wired from environment variables.

    Usage::

        repo = create_repository()
        async with repo:
            channels, total = await repo.list_channels(limit=50, offset=0)
    """
    return TelegramChannelRepository(model=TelegramChannel)
