Unclassified

03 — Role-Based Workspace and View Resolution

Objective

Resolve the Work section from the user's onboarding assignment and expose every applicable existing department view.

Resolution inputs

Organization
× Workspace
× Department
× Department role
× Industry
× Permissions
× Tenant configuration

Assignment model

export interface DemoUserAssignment {
  userId: string;
  name: string;
  organizationRole: string;
  workspaceId: string;
  department: DepartmentKey;
  departmentRole: string;
  industry: IndustryKey;
  permissions: string[];
  defaultView: string;
}

View registry

export interface DepartmentViewDefinition {
  id: string;
  label: string;
  route: string;
  component: React.ComponentType;
  icon?: React.ComponentType;
  requiredPermissions?: string[];
  industries?: string[];
}

export interface DepartmentWorkspaceDefinition {
  department: DepartmentKey;
  label: string;
  defaultView: string;
  views: DepartmentViewDefinition[];
}

Resolution algorithm

  1. Read the current user's assignment.
  2. Resolve the assigned department registry.
  3. Include every registered view matching industry and tenant configuration.
  4. Remove views blocked by permissions.
  5. Add authorized cross-functional views.
  6. Resolve the default view.
  7. Render the complete result under Work.

The frontend must not hard-code one generic department lens.

Account Success rule

All valid views found under:

apps/web/src/components/l1/domains/account-success/views

must be inventoried and registered. If ten valid views exist, the assigned Account Success user must receive ten Work entries unless a permission explicitly removes one.

Other departments

Apply the same rule to every domain folder under:

apps/web/src/components/l1/domains/*/views

Potential domains include Sales, Account Success, Support, Finance, Operations, Marketing, Product, Engineering, HR, Legal, Procurement, and Executive. The actual list must come from the repository.

Workspace and role switching

The sidebar switcher must show:

  • Organization
  • Workspace
  • Department
  • Department role
  • Available demo personas

Switching must update locally without a page reload:

  • Work navigation
  • Default route
  • Home content
  • Queue items
  • Approval items
  • Available Platform modules
  • Contextual Twin suggestions

Required demo personas

At minimum:

  • Aisha — Account Success Manager
  • Daniel — Finance Manager
  • Maya — Operations Lead
  • Arjun — Platform Administrator

Each persona must produce visibly different navigation and work content.

Route convention

/app/work/:department/:view

Examples:

/app/work/account-success/portfolio
/app/work/account-success/renewals
/app/work/finance/collections
/app/work/operations/queue

Acceptance criteria

  • Onboarding saves a local role and department assignment.
  • Work navigation is generated from the registry.
  • Every valid Account Success view is visible to the Account Success persona.
  • Other department views are resolved from existing component folders.
  • Permission filtering works before rendering.
  • Role switching updates routes, navigation, content, and Twin signals locally.