apps/recallassess/recallassess-api/src/config/navigation/types/navigation.types.ts
Navigation configuration with role-based items
Properties |
| items |
items:
|
Type : RoleBasedNavigationItem[]
|
| name |
name:
|
Type : string
|
import { NavigationItem } from "@bish-nest/core";
/**
* Participant roles that can access navigation items
* Maps to ParticipantRole enum in Prisma schema
*/
export enum ParticipantRole {
PARTICIPANT = "PARTICIPANT",
PARTICIPANT_ADMIN = "PARTICIPANT_ADMIN",
}
/**
* Extended navigation item with role-based access control
* Extends the base NavigationItem from @bish-nest/core
*/
export interface RoleBasedNavigationItem extends NavigationItem {
/**
* Roles that can access this navigation item
* If empty or undefined, accessible to all authenticated users
*/
allowedRoles?: ParticipantRole[];
/**
* Feature flags for conditional rendering
* Can be expanded for A/B testing, feature toggling, etc.
*/
featureFlags?: string[];
/**
* Custom permissions (for future expansion)
* Can be used for more granular access control
*/
permissions?: string[];
/**
* Additional metadata for extensibility
*/
metadata?: {
/**
* Badge configuration for notifications, counts, etc.
*/
badge?: {
title: string;
classes: string;
};
/**
* Analytics tracking ID
*/
trackingId?: string;
/**
* Help/tooltip text
*/
helpText?: string;
/**
* Is this a beta/new feature?
*/
isBeta?: boolean;
/**
* Any other custom metadata
*/
[key: string]: unknown;
};
/**
* Children items (for collapsable/group types)
*/
children?: RoleBasedNavigationItem[];
}
/**
* Navigation configuration with role-based items
*/
export interface RoleBasedNavigationConfig {
name: string;
items: RoleBasedNavigationItem[];
}