// 员工管理相关类型定义

export interface Employee {
  id: string;
  username: string;
  email: string;
  fullName: string | null;
  phone: string | null;
  isActive: boolean;
  isSuperuser: boolean;
  isVerified: boolean;
  createdAt: string;
  updatedAt: string;
  lastLoginAt: string | null;
  avatarUrl: string | null;
  bio: string | null;
  displayName: string | null;
  departmentId: string | null;
  departmentName: string | null;
  scope: string;
  companyName: string | null;
  tenantId: string;

  // 兼容现有表单和操作的字段
  enterpriseId?: string;
  enterpriseName?: string;
  name?: string;
  department?: string;
  position?: string;
  roleIds?: string[];
  roles?: string[];
  status?: UserStatus;
  auditStatus?: 'pending' | 'approved' | 'rejected';
  auditReason?: string;
  auditTime?: string;
  auditor?: string;
  lastLoginTime?: string;
}

export type UserStatus = 'active' | 'inactive' | 'frozen';

export interface Role {
  id: string;
  name: string;
  code: string;
  description?: string;
  type: RoleType;
  menuIds: string[];
  permissionIds: string[];
  defaultHomePage?: string;
  status: 'active' | 'inactive';
  createdAt: string;
  updatedAt: string;
}

export type RoleType = 'system' | 'custom';

// 统计数据
export interface EmployeeManagementStats {
  label: string;
  value: number;
  color: string;
  bg: string;
}

// 筛选条件
export interface EmployeeFilters {
  searchKeyword: string;
  statusFilter: string;
}

// 表单数据
export interface EmployeeFormData {
  username?: string;
  name?: string;
  phone?: string;
  email?: string;
  password?: string;
  department?: string;
  position?: string;
  enterpriseId?: string;
  enterpriseName?: string;
  status?: UserStatus;
  roleIds?: string[];
  auditStatus?: 'pending' | 'approved' | 'rejected';
}