Help centre Families Coaches Support

Littles Baby Tracker

Help for families and coaches

Site Tools


technical:features:24_coach_own_family_tracker

24 — Coach's own family tracker

Technical reference. For task-based help, see the corresponding user guide.
Documentation status: reviewed against implementation · Reviewed: 2026-07-21 · Primary users: coaches who also want a personal family tracker · Surfaces: mobile web and platform API

Purpose

This feature lets a coach use the family product for their own household while preserving their coach workspace. It adds family capability to the same user and supplies personal premium access without manufacturing a client relationship.

User outcomes

Persona Outcome
Coach without a family role Enables a personal family tracker from the coach menu.
Dual-role coach/family user Moves between /coach and their self-scoped /family experience.
Coach using timers Keeps personal active timers visible and can return to the coach dashboard.
Practice operator Does not lose a client seat or gain a fake family assignment.

Entry points

Surface Entry point Result
Mobile web Coach side menu → My family tracker Calls enablement when needed, then opens /family?from=coach.
Mobile web Family shell while entered from coach Back to coach dashboard returns to /coach.
Mobile web Coach dashboard Personal timer context remains available independently of client-family context.

Functional flow

1. Enable the family capability

  1. The coach chooses their own family tracker.
  2. If the session does not yet include family, the client calls POST /auth/enable-self-family.
  3. The platform requires the authenticated user to have the coach role, sets familyRole to true, initializes missing home and communication preferences, and preserves any existing family data.
  4. If no qualifying personal entitlement exists, the platform creates an active manualComp entitlement with no sponsoring organization or coach.
  5. The response contains the updated session. Calling the endpoint again is safe and does not duplicate the entitlement.

2. Enter self-family mode

  1. The app records that the dual-role user entered from the coach side and navigates to /family?from=coach.
  2. All family pages resolve the subject as the actor's own family account. A first-time user completes the normal family setup, including creating/selecting a baby, before baby-scoped features are available.
  3. The mode marker is kept locally so route changes and refreshes retain the return affordance.

3. Return to coaching

  1. The family shell shows Back to coach dashboard only for a genuine dual-role session entered in this mode.
  2. Returning clears the local mode marker and navigates to /coach; it does not remove the family role or personal data.
  3. Visiting a coach-side route also clears the temporary mode marker.

What enablement deliberately does not do

  • It does not create a family assignment, invitation or invite-code redemption.
  • It does not attach an organization sponsor or coach to the personal entitlement.
  • It does not increment active-family capacity or consume a client seat.
  • It does not include the coach's household in client-roster or client analytics.
  • It does not grant access to any other family's records.

Validation and user-visible states

State Behaviour
Coach only Enablement runs once, refreshes the session and enters the family route.
Already dual-role The app skips redundant setup and switches route/context.
First family visit Normal family onboarding asks for the household/baby information required by family features.
Enablement denied or failed The user stays in coach context and can retry; no partial client assignment exists.
Refresh in self-family mode The persisted entry marker preserves the coach-return control.
Return to coach Navigation changes context; family role, data and entitlement remain.

Platform contract

Method and route Purpose
POST /auth/enable-self-family Idempotently add family capability and personal manual-comp entitlement to an authenticated coach.
GET /auth/me Return the dual-role session used by route and shell decisions.
Family routes under /families/me Operate on the actor's own family subject after enablement.

Authorization and data boundaries

  • Enablement is denied unless the actor is a coach.
  • The new family role grants only the same self scope as any family actor. Coach assignment checks continue to govern client context.
  • The personal entitlement has organizationId = null and coachUserId = null; it cannot be mistaken for sponsored support.
  • Coach and family review-prompt state, navigation context and analytics subjects remain separate for a dual-role user.
There is no “disable self family” endpoint. Leaving family mode is a context switch, not a role deletion. Account/data deletion follows the normal account rules rather than this toggle.

Acceptance checklist

  1. [ ] A coach-only session becomes dual-role and receives one personal entitlement.
  2. [ ] Repeated enablement is idempotent.
  3. [ ] Entry opens the actor's /family subject and displays a coach-return affordance.
  4. [ ] Return restores /coach without deleting family state.
  5. [ ] Personal timers reconcile normally across the coach/family navigation change.
  6. [ ] No invitation, assignment, seat consumption or client analytics row is created.
  7. [ ] A non-coach cannot call the enablement endpoint.

Source evidence

  • Mobile web: mobile-web/src/components/CoachSideMenu.tsx, mobile-web/src/components/FamilySideMenu.tsx, mobile-web/src/components/AppShell.tsx, mobile-web/src/App.tsx
  • Platform: platform/apps/api/src/routes/auth-routes.ts, platform/apps/api/src/services/auth-service.ts, platform/apps/api/src/services/prisma-auth-service.ts