from typing import Any, Dict, List, Optional, Union
from pydantic.networks import EmailStr
from app.crud.base_sqlmodel import CRUDBase
from sqlmodel.ext.asyncio.session import AsyncSession
from sqlmodel import select
from app.schemas.user import IUserCreate, IUserUpdate
from app.models.user import User
from app.core.security import verify_password, get_password_hash
from datetime import datetime


class CRUDUser(CRUDBase[User, IUserCreate, IUserUpdate]):
    async def get_by_email(
        self, db_session: AsyncSession, *, email: str
    ) -> Optional[User]:
        users = await db_session.exec(