feat(profile): add weight_kg field for VO₂max and W/kg calculations#202
Merged
Conversation
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>
This was referenced Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
V31__user_weight.sql— nullableFLOATcolumn withCHECK (> 0 AND ≤ 500)GET /api/profilereturnsweight_kg;PATCHaccepts it with server-side validation (30–300)settings.html— weight input withstep=0.1, between sex select and save buttonuser_export.py—weight_kgincluded in Art. 20 data exportsettings.test.js— weight value serialised to JSON; null sent when field is emptyTest plan
cd api && npm test— all JS tests passmake migrateto apply V31 migrationGET /api/profileresponse includesweight_kgweight_kg: nullin DB🤖 Generated with Claude Code