diff --git a/backend/models/user.py b/backend/models/user.py index a06df6f..3940e0c 100644 --- a/backend/models/user.py +++ b/backend/models/user.py @@ -21,11 +21,13 @@ class Kitchen(Base): ) -class User: - """Type stub for Depends(get_current_user) annotations — runtime is a SimpleNamespace.""" - id: int - email: str - name: str - is_admin: bool - kitchen_id: int - caps: list +class User(Base): + """Minimal SQLAlchemy model so FKs referencing users.id resolve at startup. + Route handlers receive a SimpleNamespace from auth.py at runtime, not instances + of this class — this definition exists only for SQLAlchemy FK resolution.""" + __tablename__ = "users" + + id: Mapped[int] = mapped_column(primary_key=True, index=True) + email: Mapped[str] = mapped_column(String(255), nullable=False) + name: Mapped[str | None] = mapped_column(String(255), nullable=True) + is_admin: Mapped[bool] = mapped_column(default=False)