Files
healthy-fit/backend/app/schemas/user.py
Carlos Escalante bd91eb4171 Migrate frontend to TypeScript and extend user profile
Converted frontend codebase from JavaScript to TypeScript, including pages, components, and context. Added new layout and UI kit components. Updated backend user model and schemas to support profile fields (firstname, lastname, age, gender, height, weight, unit_preference) and added endpoints for reading/updating current user. Introduced food log listing endpoint and migration script for user table. Updated dependencies and build configs for TypeScript and Tailwind v4.
2026-01-18 19:01:00 -06:00

37 lines
826 B
Python

from typing import Optional
from sqlmodel import SQLModel
class UserBase(SQLModel):
email: str
username: str
class UserCreate(UserBase):
password: str
class UserRead(UserBase):
id: int
firstname: Optional[str] = None
lastname: Optional[str] = None
age: Optional[int] = None
gender: Optional[str] = None
height: Optional[float] = None
weight: Optional[float] = None
unit_preference: str = "metric"
class UserUpdate(SQLModel):
email: Optional[str] = None
username: Optional[str] = None
password: Optional[str] = None
firstname: Optional[str] = None
lastname: Optional[str] = None
age: Optional[int] = None
gender: Optional[str] = None
height: Optional[float] = None
weight: Optional[float] = None
unit_preference: Optional[str] = None