from typing import Any, Dict, List

from uuid import UUID

from sqlalchemy.orm import selectinload
from sqlmodel import select
from sqlmodel.ext.asyncio.session import AsyncSession

from service.crud.base import CRUDBase, ModelType
from service.models.models import Topic, TopicBase, TopicCreate, TopicModel, Word


class CRUDTopic(CRUDBase[Topic, TopicCreate, TopicBase]):
    async def get_model_topics(
        self, db: AsyncSession, *, model_id: UUID, version: int, with_words: bool = False
    ) -> List[ModelType]:
        statement = (
            