import type { UserRole } from '@/shared/types/app';

/** What tenant context a new user of a given role needs the creator to provide. */
export type RoleTenantInput = 'none' | 'org' | 'school' | 'campus' | 'class' | 'guardian';

const ROLE_TENANT_INPUT: Record<UserRole, RoleTenantInput> = {
  super_admin: 'none',
  system_admin: 'none',
  owner: 'org',
  superintendent: 'org',
  principal: 'school',
  registrar: 'school',
  director: 'campus',
  office_manager: 'campus',
  teacher: 'class',
  support_staff: 'class',
  student: 'class',
  guardian: 'guardian',
  guest: 'none',
};

export function getRoleTenantInput(role: UserRole): RoleTenantInput {
  return ROLE_TENANT_INPUT[role];
}
