from __future__ import annotations

from sqlmodel import Session, select

from src.models import User
from src.schemas.user import CreateUser
from src.services.auth import check_password_hash, generate_password_hash


def get_user_by_email(db: Session, email: str) -> User | None:
    """
    Finds a user with the given email in the database and returns it.
    Returns None if a user with the email does not exists.
    """
    stmt = 