Skip to Content
Living documentation — last reviewed 2026-05-28
FeaturesGoalsGoals

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

PersonaSurfaceCapabilities
MemberMobile + /dashboard/goals/meCreate, view own, edit, archive
StaffMember detail pageView a member’s goals

Capabilities

  • Two goal types: body_metric (with metricType) or exercise_pr (with exerciseId). DB CHECK constraint enforces exactly one discriminator is set.
  • Direction-aware progress: FIT-119 added direction (increase / decrease) and startValueNumeric (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 latest bodyMetrics (for body_metric) or personalRecords value (for exercise_pr) at creation.
  • Status: active, achieved, cancelled. Soft-deleted via deleted_at (archive UX).
  • Achievement detection: progress crosses 100% → status flips to achieved, achieved_at set. 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.
  • ../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/