PR 1: user_gyms foundation (#136) [WIP]#137
Merged
Merged
Conversation
Foundation work for the multi-instruktør epic. Lands the user_gyms membership table in Supabase and the read helper plus auto-join helper that downstream PRs (joint-class history, opt-out toggle, multi-BU sportySync) will build on. Migration applied to remote Supabase project (kyolnraqudwrjjbtxhwx): - create table user_gyms (id, user_id, sporty_business_unit_id, role, created_at) with unique(user_id, sporty_business_unit_id) - RLS: self select/insert/delete; auth.uid() = user_id - Backfilled both existing users to BU 8 (Sporty Thon Senter Ski) db.js additions: - DEFAULT_SPORTY_BUSINESS_UNIT_ID = 8 - fetchMyGyms() — read; trusts RLS - ensureGymMembership(buId) — idempotent upsert; called on first login (wire-up in App.jsx is the next commit) Remaining for PR 1 (handover to local dev): - Wire ensureGymMembership() into App.jsx auth flow - Settings.jsx: read-only "Min gym" card (Sporty Thon Senter Ski) - i18n keys settings.my_gym_*, settings.my_gym_membership, settings.my_gym_future_hint in nb/en/fa - Comment on sportySync.js BU 8 hardcode pointing at PR 5 follow-up - CLAUDE.md architecture note for user_gyms - npm run build verification Plan: /root/.claude/plans/robust-exploring-sutton.md https://claude.ai/code/session_01PNmJDWGM4eWSDPFFHmJiyY
9 tasks
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-137.westeurope.7.azurestaticapps.net |
- App.jsx: call ensureGymMembership() on session resolve + auth state change - Settings.jsx: read-only "Min gym" card (Carbon Tag) between Utseende and Kontakt - nb/en/fa locales: myGym, myGymMembership, myGymFutureHint keys - sportySync.js: comment flagging BU 8 hardcode for future multi-gym removal - CLAUDE.md: architecture note for user_gyms, opt-out sharing model, role placeholder Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-137.westeurope.7.azurestaticapps.net |
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.
First PR in the multi-instruktør epic (#136). Lands the
user_gymsmembership table and read/upsert helpers; downstream PRs (joint-class history + opt-out toggle, profile display_name, roles FK, multi-BU sportySync) build on this.Already done
Supabase migration applied to remote project
<project-id>(irreversible — visible in the Supabase dashboard now):create table user_gyms (id, user_id, sporty_business_unit_id, role, created_at)withunique(user_id, sporty_business_unit_id)auth.uid() = user_idroleis a text placeholder; PR 4 will swap it forrole_idFK to a temporalrolestableCode (
app/src/lib/db.js):DEFAULT_SPORTY_BUSINESS_UNIT_ID = 8fetchMyGyms()— read; trusts RLSensureGymMembership(buId)— idempotent upsert; intended to be called on first loginApp wire-up + UI (commit d61bfd3):
App.jsx: callsensureGymMembership()aftergetSession()resolves and on each auth state changeSettings.jsx: read-only "Min gym" card with CarbonTag "Sporty Thon Senter Ski"+ future-hint subtitle; inserted between Utseende and Kontaktnb/en/falocales:settings.myGym,settings.myGymMembership,settings.myGymFutureHintsportySync.js: comment cross-referencing the multi-BU follow-upCLAUDE.md: architecture note foruser_gyms, opt-out-same-gym sharing model, role placeholder transitionTest plan
user_gymsrow exists for both existing users withsporty_business_unit_id = 8(verified post-migration)user_gymsrow with no UI stepnb,en,fa(RTL) — no missing-key fallbacksnpm run buildpasseshttps://claude.ai/code/session_01PNmJDWGM4eWSDPFFHmJiyY
Generated by Claude Code