export interface RoleItem {
  id: string;
  name: string;
  code: string;
  userCount: number;
  enabled: boolean;
  description: string;
  updatedAt: string;
  menuKeys: string[];
  buttonKeys: string[];
}

export interface MenuPermissionNode {
  key: string;
  title: string;
  children?: MenuPermissionNode[];
}

export const menuPermissionTree: MenuPermissionNode[] = [
  { key: 'dashboard', title: '总览' },
  {
    key: 'llm',
    title: '大模型管理',
    children: [
      { key: 'llm-models', title: '模型列表' },
      { key: 'llm-providers', title: '供应商管理' },
      { key: 'llm-usage', title: '用量统计' },
      { key: 'llm-usage-details', title: '用量明细' },
      { key: 'llm-quota', title: '限流配额' },
    ],
  },
  {
    key: 'system',
    title: '系统管理',
    children: [
      { key: 'system-user', title: '用户管理' },
      { key: 'system-role', title: '角色管理' },
      { key: 'system-permission', title: '权限配置' },
    ],
  },
];

export const buttonPermissionOptions = [
  { label: 'user:create', value: 'user:create' },
  { label: 'user:edit', value: 'user:edit' },
  { label: 'user:delete', value: 'user:delete' },
  { label: 'llm:create', value: 'llm:create' },
];

export const initialRoles: RoleItem[] = [
  {
    id: 'role-1',
    name: '超级管理员',
    code: 'ROLE_ADMIN',
    userCount: 3,
    enabled: true,
    description: '拥有系统全部权限',
    updatedAt: '2026-07-20 10:00',
    menuKeys: [
      'dashboard',
      'llm',
      'llm-models',
      'llm-providers',
      'llm-usage',
      'llm-usage-details',
      'llm-quota',
      'system',
      'system-user',
      'system-role',
      'system-permission',
    ],
    buttonKeys: ['user:create', 'user:edit', 'user:delete', 'llm:create'],
  },
  {
    id: 'role-2',
    name: '运营',
    code: 'ROLE_OPERATOR',
    userCount: 5,
    enabled: true,
    description: '负责模型与用户日常运营',
    updatedAt: '2026-07-22 15:30',
    menuKeys: [
      'dashboard',
      'llm',
      'llm-models',
      'llm-providers',
      'llm-usage',
      'llm-quota',
      'system',
      'system-user',
      'system-role',
    ],
    buttonKeys: ['user:create', 'user:edit', 'llm:create'],
  },
  {
    id: 'role-3',
    name: '只读',
    code: 'ROLE_VIEWER',
    userCount: 4,
    enabled: true,
    description: '仅可查看数据，不可修改',
    updatedAt: '2026-07-18 09:12',
    menuKeys: ['dashboard', 'llm', 'llm-models', 'llm-usage'],
    buttonKeys: [],
  },
];
