Planned/structured workouts with interval targets and plan-vs-actual adherence. Designed in SYNTHESIS §10.1 based on TrainingPeaks, Garmin FIT, and OpenAthlete.
workout_plansathletesstructure JSONB: tree of steps with interval targetsStep types: warmup, cooldown, active, rest, steady, ramp, repeat, free
Duration types: time (seconds), distance (meters), calories, reps, hr_below, hr_above, lap_button, open
Target specification — three modes:
{ "metric": "power", "min": 200, "max": 250 }{ "metric": "power", "zone": 3 } — references athlete's training_zones{ "metric": "power", "pct_min": 0.75, "pct_max": 0.90, "anchor": "ftp" } — resolves via athlete_metricsMultiple targets per step (e.g., pace AND HR zone simultaneously). Per-step instructions for coaching notes.
activities.workout_plan_id FK links completed activity to the plan it executed. Adherence = compare plan structure against activity streams.
Polymorphic calendar = UNION of workout_plans (scheduled_date) + activities (start_date) + sleep_sessions + athlete_metrics.
structure JSONB validationSchema Migration
See docs/api-research/SYNTHESIS.md §10.1 (Planned/Structured Workouts), §10.5 (Polymorphic Calendar).