VV Stories
5 stories across 3 validation groups. Each story proves one moment of truth for multi-tenant routing.
Org Isolation
Can each tenant see only their data?
Solar365 admin signs in for the first time. They belong to one org. Current app dumps them on /dashboard showing Dreamineering's data.
Land on /org/solar365/dashboard automatically, seeing only Solar365 data.
Sign-in → redirect to /org/solar365/dashboard in <3s. CRM contacts count matches Solar365's data, not Dreamineering's. Zero Dreamineering records visible.
User lands on /org/solar365/dashboard but server actions still return Dreamineering data because ApplicationContext ignores the URL slug.
Dreamineering admin navigates to /org/solar365/crm by manually editing the URL. They are not a member of Solar365.
Be denied access and redirected to their own org.
Request to /org/solar365/* returns redirect to /organisations/select within 500ms. No Solar365 data exposed in response.
User gets a 403 error page but the initial server component render already fetched and exposed Solar365 data in the HTML before the redirect.
Single-org user signs in. They belong to exactly one org. Current flow works — they should not see org picker or experience delays.
Auto-redirect to /org/[their-slug]/dashboard with no visible org picker.
Sign-in → redirect to /org/[slug]/dashboard. No intermediate org picker screen. Login time increase <200ms vs current.
Single-org user briefly sees the org picker flash before redirect — poor UX that suggests complexity they don't have.
Org Switching
Can users move between orgs?
Platform operator belongs to both Dreamineering and Solar365 orgs. Currently they must sign out and sign back in to switch context.
Switch org context via nav component without re-authentication.
Click org name in nav → dropdown shows both orgs → click Solar365 → navigate to /org/solar365/dashboard. Total switch time <2s. No re-authentication required.
Org switcher navigates to /org/solar365/ but session still holds Dreamineering's organisationId — data mismatch between URL and queries.
Backwards Compatibility
Do existing URLs still work?
Existing user has bookmarked /dashboard, /crm, /plans. Routes now live under /org/[slug]/*.
Old URLs redirect to the correct org-scoped path without breaking.
/dashboard → /org/[user-primary-org-slug]/dashboard via 302 redirect. Bookmark still works. Zero 404s for existing routes.
Redirect works for /dashboard but breaks for nested routes like /crm/contacts/[id] — partial redirect coverage.