import { RoleType } from '@/constants/enumerate';

export interface LoginData {
  account: string;
  password: string;
}

export interface UserItem {
  id: number;
  loginName: string; // 登录名
  name: string; // 名称
  employeeId?: string; // 工号 (可选)
  source: string; // 来源 (例如：内部用户)
  role: RoleType; // 角色 (例如：学校管理员, 扫描员)
  enable: boolean; // 状态 (启用/禁用)
  wechatLinked?: boolean; // 关联微信 (可选, 可能为显示字段)
}
export type UserListPageRes = PageResult<UserItem>;

export interface UserListFilter {
  name?: string; // 按名称搜索
  loginName?: string; // 按登录名搜索
  enable: boolean; // 按状态筛选
  role?: RoleType; // 按角色筛选
}
export type UserListPageParam = PageParams<UserListFilter>;

export interface UserUpdateParam {
  id?: number;
  loginName: string;
  name: string;
  employeeId: string;
  enable: boolean;
  role: RoleType;
  password: string;
}

export interface ResetPasswordParam {
  ids: number[];
  password?: string; // 如果不传，后端可能会生成随机密码
}
export interface EnableUserParam {
  ids: number[];
  enabled: boolean;
}

export interface UpdatePwdData {
  // id: number;
  // oldPassword: string;
  password: string;
}

export interface BatchCreateUserParam {
  examId: number;
  role: RoleType;
  namingRule: string;
  accountsPerGroup: number;
  randomPassword: boolean;
  password?: string;
  subjectIds: number[];
}
