// 用户状态类型
export type UserStatus = 'active' | 'inactive' | 'banned'

// 用户类型
export type UserType = 'normal' | 'merchant' | 'admin'

// 用户基本信息接口
export interface User {
  id: number
  username: string
  nickname: string
  avatar: string
  phone: string
  email: string
  status: UserStatus
  registerTime: string
  lastLoginTime: string
  userType: UserType
  // 扩展字段
  gender?: 'male' | 'female' | 'unknown'
  birthday?: string
  interests?: string[]
  location?: string
  // 商家特有字段
  shopName?: string
  businessLicense?: string
  // 统计信息
  travelCount?: number
  animalAdoptionCount?: number
  orderCount?: number
  // 安全相关
  isVerified?: boolean
  verificationLevel?: number
}

// 用户查询参数接口
export interface UserQueryParams {
  page: number
  pageSize: number
  keyword?: string
  status?: UserStatus
  userType?: UserType
  startDate?: string
  endDate?: string
  sortField?: string
  sortOrder?: 'asc' | 'desc'
}

// 用户统计信息接口
export interface UserStatistics {
  totalUsers: number
  activeUsers: number
  newUsersToday: number
  newUsersThisWeek: number
  newUsersThisMonth: number
  userGrowthRate: number
  userTypeDistribution: {
    normal: number
    merchant: number
    admin: number
  }
  statusDistribution: {
    active: number
    inactive: number
    banned: number
  }
  dailyActiveUsers: Array<{
    date: string
    count: number
  }>
}

// 用户操作记录接口
export interface UserOperationLog {
  id: number
  userId: number
  username: string
  operationType: string
  operationDetail: string
  operationTime: string
  ipAddress: string
  userAgent: string
  result: 'success' | 'failure'
}

// 用户注册统计接口
export interface UserRegistrationStats {
  date: string
  count: number
}

// 用户登录统计接口
export interface UserLoginStats {
  date: string
  count: number
}

// 用户行为统计接口
export interface UserBehaviorStats {
  date: string
  travelPublishCount: number
  animalAdoptionCount: number
  orderCount: number
  messageCount: number
  shareCount: number
}

// 用户导出参数接口
export interface UserExportParams {
  format: 'csv' | 'excel'
  fields: string[]
  startDate?: string
  endDate?: string
  status?: UserStatus
  userType?: UserType
}

// 管理员信息接口
export interface Admin {
  id: number
  username: string
  email: string
  nickname: string
  avatar: string
  role: string
  status: number
  lastLoginTime?: string
  createdAt: string
  updatedAt: string
}