42 lines
980 B
Python
42 lines
980 B
Python
from datetime import date
|
|
from typing import List, Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from app.core.dto.training import ApproachDTO
|
|
|
|
|
|
class SessionMetricsResponse(BaseModel):
|
|
max_weight: float
|
|
e1rm: Optional[float]
|
|
volume: float
|
|
total_reps: int
|
|
best_reps: int
|
|
|
|
|
|
class SessionRowResponse(BaseModel):
|
|
training_id: Optional[int]
|
|
trainee_id: Optional[int]
|
|
date: date
|
|
trainer: Optional[str]
|
|
splitted_weight: bool
|
|
approaches: List[ApproachDTO]
|
|
metrics: SessionMetricsResponse
|
|
|
|
|
|
class RecordResponse(BaseModel):
|
|
value: float
|
|
date: date
|
|
|
|
|
|
class ExerciseProgressResponse(BaseModel):
|
|
name: str
|
|
weighted: bool
|
|
max_weight: float
|
|
best_primary: Optional[RecordResponse]
|
|
best_secondary: Optional[RecordResponse]
|
|
first_primary: Optional[float]
|
|
last_primary: Optional[float]
|
|
primary_change: Optional[float]
|
|
primary_change_percent: Optional[float]
|
|
rows: List[SessionRowResponse] # newest first
|