/**
 * Role and Permission types
 * Re-exports types from the auto-generated OpenAPI schema
 */

import type { components } from './generated/api';

// Role DTOs
export type RoleDTO = components['schemas']['RoleDTO'];
export type RoleName = NonNullable<RoleDTO['name']>;
export type Permission = NonNullable<RoleDTO['permissions']>[number];

/**
 * Custom types for UI
 */

export interface RoleWithUsers {
  role: RoleDTO;
  userCount: number;
  users?: Array<{ id: string; username: string }>;
}
