Skip to content

feat(profile): add weight_kg field for VO₂max and W/kg calculations#202

Merged
gerfru merged 1 commit into
mainfrom
wave-17-user-weight
Jun 13, 2026
Merged

feat(profile): add weight_kg field for VO₂max and W/kg calculations#202
gerfru merged 1 commit into
mainfrom
wave-17-user-weight

Conversation

@gerfru

@gerfru gerfru commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Optional body weight field (30–300 kg) in Settings, stored per user
  • Used downstream for W/kg power metrics and the Uth VO₂max formula (15 × HRmax / HRrest)
  • GDPR-compliant: nullable, deletable with account, included in data export

Changes

Layer Change
DB V31__user_weight.sql — nullable FLOAT column with CHECK (> 0 AND ≤ 500)
API GET /api/profile returns weight_kg; PATCH accepts it with server-side validation (30–300)
UI settings.html — weight input with step=0.1, between sex select and save button
GDPR user_export.pyweight_kg included in Art. 20 data export
Tests settings.test.js — weight value serialised to JSON; null sent when field is empty

Test plan

  • cd api && npm test — all JS tests pass
  • make migrate to apply V31 migration
  • Open Settings → enter weight → Save → refresh → value persists
  • GET /api/profile response includes weight_kg
  • Leave weight empty → Save → weight_kg: null in DB

🤖 Generated with Claude Code

Optional body weight (30–300 kg) stored per user, exposed in Settings UI
with step=0.1 input. Used downstream for W/kg power metrics and Uth VO₂max
formula (15 × HRmax / HRrest).

- V31 Flyway migration: nullable FLOAT column with CHECK (> 0 AND ≤ 500)
- GET /api/profile: weight_kg included in response
- PATCH /api/profile: accepts weight_kg with server-side range validation
- Settings page: weight input between sex select and save button
- GDPR export: weight_kg included in user data export (Art. 20)
- JS tests: weight value sent in fetch body; null when field empty

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gerfru gerfru merged commit 052a4f8 into main Jun 13, 2026
13 checks passed
@gerfru gerfru deleted the wave-17-user-weight branch June 13, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant