Skip to Content
Living documentation — last reviewed 2026-05-28
FeaturesMetric SetsMetric Sets — QA Plan

Metric Sets — QA Plan

1. Sets

#ScenarioExpected
1.1Create org-owned set with 3 definitions201; junction has 3 rows
1.2Create with zero owner FKs400 — exactly one required
1.3Create with two owner FKs400
1.4Create org-owned for another org id403
1.5Create with an unknown definition id400
1.6Create as a member role403

2. Recording values

#ScenarioExpected
2.1Coach records 145kg back squat 1RM for member201
2.2Record without recordedAtDefaults to now
2.3Record value 0DTO @Min(0) allows; verify product intent
2.4Record for a user not in this orgAllowed today (values are user-scoped, not membership-scoped) — flag as security note

3. Resolution

#ScenarioExpected
3.1Resolve set for member with one value per defEach entry returns latest
3.2Resolve set for member with no valuesEach entry returns null value
3.3Member has stale value + a newer oneNewer one returned (index supports ORDER BY recorded_at DESC LIMIT 1)

4. Definition catalogue

#ScenarioExpected
4.1List definitions returns global catalogueAll seeded rows
4.2Try to delete a definition still referencedRestricted by FK

5. Smoke

  • Workout builder resolves a member’s 1RM correctly via the bound set.
  • CHECK constraint rejects manual 2-owner row inserts.