from __future__ import annotations

from typing import TYPE_CHECKING

from sqlalchemy import Boolean, Column, Integer, String
from sqlalchemy.orm import relationship

from ultron8.api.db.u_sqlite.base_class import Base

if TYPE_CHECKING:
    from ultron8.api.db_models.item import Item  # noqa: F401


class User(Base):
    __tablename__ = "user"
    id = Column(Integer, primary_key=True, index=True)
    full_name = Column(String, index=True)
    email = Column(String, unique=True, index=True)
    hashed_password = Column(String)
    is_active = Column(Boolean(), default=True)
    is_superuser = Column(Boolean(), default=False)
    items = relationship("Item", back_populates="owner")


if "__main__" == __name__:
    user = User()

    print(user)
