from dataclasses import dataclass
from datetime import date, datetime
from typing import Optional


@dataclass
class User:
    user_id: int
    user_name: str
    user_mail: str
    user_password: str
    user_fallback_password: Optional[str]
    user_first_name: Optional[str]
    user_last_name: Optional[str]
    user_birth_day: Optional[date]
    is_active: bool
    is_team_member: bool
    is_admin: bool
    created_at: datetime
    last_updated_at: datetime

    def __hash__(self) -> int:
        return hash(self.user_id)

    def __eq__(self, other):
        if not isinstance(other, User):
            return NotImplemented
        return self.user_id == other.user_id
