Back to Organisations

Org Admin — Build Plan

Ownership transfer, Operations add-on & configuration control — approved PRD.

Intent & Goal

Give the platform admin a single admin screen to oversee every registered organisation — see each one’s owner and Wave+Pulse add-on status — and to (a) transfer an organisation’s day-to-day ownership to a new employer while keeping full co-control, (b) switch the combined Wave+Pulse Operations add-on on or off for any org at any time, and (c) own both the room-size configuration and the geofence per org, setting the GPS work location on-site at each property, so productivity targets and access gating stay accurate and consistent while the app scales. The Housekeeping Academy learning is the core every employer gets; Wave+Pulse is an optional add-on the admin grants on demand; room-size config and geofence are admin-only until a future release.

Core Flow 1 — Org overview

Admin opens the Organisations admin screen and sees every registered Company with its name, current owner email/name, invite code, employee count, and whether the Operations add-on (Wave+Pulse) is enabled — reviewing all registered employers from one place.

Core Flow 2 — Toggle Operations add-on

Tapping Enable adds Wave+Pulse access for that org (unlocks WaveAdmin, WaveTeam, WaveDashboard, Pulse, Pulse viewer invites, Wave viewers); tapping Disable hides those entry points and blocks those routes for that org’s users, while the core Academy stays fully available. Existing Wave/Pulse data is never deleted on disable — it’s gated — so re-enabling restores access instantly.

Core Flow 3 — Transfer ownership

Admin transfers an organisation to a new employer: selects the org, enters the new owner’s email (must be a registered user), confirms, and the system re-points Company.owner_email to the new owner AND re-links every denormalized owner_email field across WaveSession, WaveRoom, WaveRoomStage, WaveTeam, WaveReport, CporScore, RpsScore — so the new employer inherits the full employer dashboard and all history cleanly. The platform admin remains a co-owner with full edit rights.

Core Flow 4 — Room-size configuration

Admin edits an org’s room-size config from the Configuration tab: room-number lists per size (single/double/family) and per-size per-stage target minutes that drive all Wave productivity targets. Only the admin can view or save this config; the employer’s dashboard no longer shows the room-size config tab. Saving re-resolves and re-denormalizes targets onto existing WaveRooms so live and future rooms reflect the new targets immediately.

Core Flow 5 — On-site geofence

Admin sets an org’s geofence from the Configuration tab while physically on-site: a capture control reads the admin’s current GPS into Company.geofence (lat/lng + radius + address label), so the live Wave board gates that org’s employees to the correct location. Only the admin can change the geofence; the employer’s dashboard no longer shows the geofence config tab.

Core Flow 6 — New employer sign-in

New employer signs in and sees the Employer Dashboard for the org they now own — with invites, employee progress, The Wave, Pulse, and the core Academy, but NO room-size config tab and NO geofence config tab (Operations add-on only if enabled) — confirming the handover worked; the admin still sees the same org in the Organisations screen with full control including config and geofence.

Technical — Entity & transfer function

Added an operations_addon boolean field (default false) to the Company entity; existing orgs that already use Wave/Pulse (Mantra) are seeded to true. A backend function transferOrgOwnership (service-role, admin-only) updates Company.owner_email and bulk-updates owner_email on WaveSession, WaveRoom, WaveRoomStage, WaveTeam, WaveReport, CporScore, RpsScore for that company_id.

Technical — Gating

Route guards and nav links for /WaveAdmin, /WaveTeam, /WaveDashboard, /Pulse, /WaveReports, Wave viewer + Pulse viewer invite panels check the org’s operations_addon flag and hide/block when off. Core learning routes (/Lessons, /BathroomHome, /KitchenHome, assessments, FitHub, HKtionary, jobs, accommodation) are never gated.

Technical — Admin screen

New admin page src/pages/admin/Organisations.jsx + route in App.jsx, visible only to role=admin, with two tabs per org: an Overview tab (owner, add-on toggle, transfer-ownership action) and a Configuration tab combining WaveRoomSizeConfig and WaveGeofenceConfig. Admin sees all companies. Disable is a soft gate (no data deletion) with a confirmation modal.

Technical — Config relocation

Moved room-size config AND geofence config out of the Employer Dashboard and into the Organisations admin screen only. The saveRoomSizeConfig re-sync logic is reused from the admin context. The geofence capture control reuses the existing GPS-capture flow but runs from the admin screen, capturing the admin’s current on-site GPS.

Technical — Co-control preserved

New owner must already be a registered user; the transfer confirms the target email exists before re-pointing. Transfer keeps admin co-control via the existing admin-role RLS rules (admin can update/delete everything), so no access is lost.

Build status

Company entity updated + seeded. transferOrgOwnership created and tested (no-op + invalid-user paths verified). Organisations screen created with Overview + Configuration tabs. Route + Admin nav link added. Employer Dashboard Config tab removed; Wave/Reports/Viewers/Pulse gated on add-on. WaveTeam, WaveDashboard, Pulse pages gated (admin bypasses). Mobile Wave Access tab gated. Production build compiles cleanly.