Reactivating relationships, premium cascade, and what stays vs. what changes.
Switching coaches in the Hub is a pointer flip. The athlete keeps all their data (races, activities, wellness, notes, equipment, metrics). Only the active coach relationship changes.
Most switches happen when an athlete clicks a new coach's join link. The athlete sees a clear confirmation page that lists:
The athlete clicks Yes, switch to confirm, or No, stay to cancel.
The athlete's active CoachAthleteRelationship with the previous
coach is marked ended, with the current timestamp and a
"switched_coach" status. The record stays in the database for
auditing.
A relationship between the athlete and the new coach is either created fresh, or, if one already existed and was ended, it is reactivated instead of duplicated. The Hub uses a unique constraint to prevent duplicate active relationships.
If the previous coach was granting the athlete premium (source =
coach_grant), that grant ends with the relationship. The athlete
reverts to free unless:
Premium that was paid directly stays untouched.
The principle: data the athlete produced or owns travels with them; private workings of the previous coach stay private to that coach.
The athlete can switch back any time by clicking the previous coach's join link. The Hub handles reactivation gracefully.
Still stuck? Ask us a question and we'll write up an answer.
Ask a question