feat: define all 8 SQLModel tables
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
39
app/models/progress_log.py
Normal file
39
app/models/progress_log.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""ProgressLog model for tracking progression suggestions and outcomes.
|
||||
|
||||
Records what the progression engine suggested vs what the user actually did.
|
||||
"""
|
||||
|
||||
import datetime as dt
|
||||
from typing import Optional
|
||||
|
||||
from sqlmodel import Field, SQLModel
|
||||
|
||||
|
||||
class ProgressLog(SQLModel, table=True):
|
||||
"""A progression tracking entry for a specific exercise.
|
||||
|
||||
Attributes:
|
||||
id: Primary key, auto-incremented.
|
||||
user_id: FK to users table.
|
||||
exercise_id: FK to exercises table.
|
||||
date: The date this progression entry applies to.
|
||||
suggested_reps: What the engine recommended.
|
||||
suggested_weight: What the engine recommended.
|
||||
actual_reps: What the user actually did.
|
||||
actual_weight: What the user actually used.
|
||||
progression_applied: Type of progression (e.g., "reps_increase", "weight_increase", "deload").
|
||||
created_at: Timestamp when the record was created.
|
||||
"""
|
||||
|
||||
__tablename__ = "progress_log"
|
||||
|
||||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
user_id: int = Field(foreign_key="users.id", index=True)
|
||||
exercise_id: int = Field(foreign_key="exercises.id")
|
||||
date: dt.date = Field(default_factory=dt.date.today)
|
||||
suggested_reps: Optional[int] = Field(default=None)
|
||||
suggested_weight: Optional[str] = Field(default=None)
|
||||
actual_reps: Optional[int] = Field(default=None)
|
||||
actual_weight: Optional[str] = Field(default=None)
|
||||
progression_applied: Optional[str] = Field(default=None)
|
||||
created_at: dt.datetime = Field(default_factory=dt.datetime.utcnow)
|
||||
Reference in New Issue
Block a user