24 lines
727 B
Python
24 lines
727 B
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from sqlalchemy import ForeignKey, Integer
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from fooder.domain.base import Base, CommonMixin
|
|
|
|
if TYPE_CHECKING:
|
|
from fooder.domain.user import User
|
|
|
|
|
|
class UserSettings(Base, CommonMixin):
|
|
"""UserSettings."""
|
|
|
|
user_id: Mapped[int] = mapped_column(Integer, ForeignKey("user.id"), unique=True)
|
|
user: Mapped[User] = relationship(back_populates="settings")
|
|
# meals_name_convention: Mapped[list[str]] # json column, format TBD
|
|
protein_goal: Mapped[float]
|
|
carb_goal: Mapped[float]
|
|
fat_goal: Mapped[float]
|
|
fiber_goal: Mapped[float]
|
|
calories_goal: Mapped[float]
|