/**
 * 用户角色
 */
export type UserRole = 'admin' | 'editor' | 'operator';

/**
 * 用户状态
 */
export type UserStatus = 'active' | 'disabled' | 'pending';

/**
 * 用户信息
 */
export interface User {
  id: number;
  username: string;
  email: string | null;
  nickname: string | null;
  avatarUrl: string | null;
  role: UserRole;
  status: UserStatus;
  lastLoginAt: string | null;
  lastLoginIp: string | null;
  createdAt: string;
  updatedAt: string;
}

/**
 * 登录请求
 */
export interface LoginRequest {
  username: string;
  password: string;
  rememberMe?: boolean;
}

/**
 * 登录响应
 */
export interface LoginResponse {
  accessToken: string;
  refreshToken: string;
  expiresIn: number;
  user: User;
}

/**
 * 注册请求
 */
export interface RegisterRequest {
  username: string;
  password: string;
  email?: string;
  nickname?: string;
}

/**
 * Token 刷新请求
 */
export interface RefreshTokenRequest {
  refreshToken: string;
}

/**
 * Token 刷新响应
 */
export interface RefreshTokenResponse {
  accessToken: string;
  expiresIn: number;
}

/**
 * 修改密码请求
 */
export interface ChangePasswordRequest {
  oldPassword: string;
  newPassword: string;
}

/**
 * 更新用户资料请求
 */
export interface UpdateProfileRequest {
  nickname?: string;
  email?: string;
  avatarUrl?: string;
}

/**
 * 创建用户请求（管理员）
 */
export interface CreateUserRequest {
  username: string;
  password: string;
  email?: string;
  nickname?: string;
  role?: UserRole;
}

/**
 * 更新用户请求（管理员）
 */
export interface UpdateUserRequest {
  username?: string;
  email?: string;
  nickname?: string;
  role?: UserRole;
  status?: UserStatus;
  password?: string;
}
