Goals
Linear epic: FIT-119 (decrease goals + start values) Status: Shipped. Last reviewed: 2026-05-28
What
Member-set goals tied to either a body metric (e.g. “lose 5kg”) or an exercise PR (“hit 150kg back squat”). The goal carries a target, optional baseline (startValue), direction (increase/decrease), unit, optional deadline, and computed progress percentage.
Why
- Drives focus and engagement.
- Coaches consult goals during programming.
- Powers progress widgets and the “achievements” surface.
Personas
| Persona | Surface | Capabilities |
|---|---|---|
| Member | Mobile + /dashboard/goals/me | Create, view own, edit, archive |
| Staff | Member detail page | View a member’s goals |
Capabilities
- Two goal types:
body_metric(withmetricType) orexercise_pr(withexerciseId). DB CHECK constraint enforces exactly one discriminator is set. - Direction-aware progress: FIT-119 added
direction(increase / decrease) andstartValueNumeric(baseline). Without these, decrease goals like “lose weight” auto-completed at creation because current ≥ target was a stop condition that misfit “decreasing”. - Auto-resolved baseline: when the client omits
startValue, the service snapshots the latestbodyMetrics(for body_metric) orpersonalRecordsvalue (for exercise_pr) at creation. - Status:
active,achieved,cancelled. Soft-deleted viadeleted_at(archive UX). - Achievement detection: progress crosses 100% → status flips to
achieved,achieved_atset. Triggered on goal read / update flow (not via event today).
Capabilities (gaps)
- No coach-set goals (always member-created).
- No deadline-based reminders / push (could plug into FIT-170).
- No goal templates.
Related
../body-metrics/— baseline + progress for body goals.../workouts/(workout_results / personal_records) — baseline + progress for exercise PR goals.../insights/(planned) — analytics over goal completion rates.
Source code
- API:
apps/api/src/goals/{goals.service.ts, goals.controller.ts, goals.progress.ts} - DB:
libs/db/src/lib/schema/goals.ts - Web:
apps/web/src/components/member/goals/