// 活动类型
export type ActivityType = 'travel' | 'movie' | 'dinner' | 'game' | 'sports' | 'study' | 'other'

// 活动状态类型
export type ActivityStatus = 'pending' | 'active' | 'completed' | 'cancelled' | 'full'

// 活动审核状态类型
export type ActivityAuditStatus = 'pending' | 'approved' | 'rejected'

// 活动基本信息接口
export interface Activity {
  id: number
  title: string
  activityType: ActivityType
  description: string
  organizerId: number
  organizerName: string
  location: string
  startTime: string
  endTime: string
  maxParticipants: number
  currentParticipants: number
  status: ActivityStatus
  price: number
  createTime: string
  // 扩展信息
  images?: string[]
  tags?: string[]
  requirements?: string
  // 审核信息
  auditStatus?: ActivityAuditStatus
  auditRemark?: string
  auditTime?: string
  // 统计信息
  viewCount?: number
  likeCount?: number
  shareCount?: number
  // 地理位置
  latitude?: number
  longitude?: number
  // 费用说明
  feeIncludes?: string[]
  feeExcludes?: string[]
  // 取消政策
  cancellationPolicy?: string
  // 联系方式
  contactPhone?: string
  contactWechat?: string
}

// 活动查询参数接口
export interface ActivityQueryParams {
  page: number
  pageSize: number
  keyword?: string
  status?: ActivityStatus
  activityType?: ActivityType
  organizerId?: number
  minPrice?: number
  maxPrice?: number
  startDate?: string
  endDate?: string
  location?: string
  sortField?: string
  sortOrder?: 'asc' | 'desc'
}

// 活动统计信息接口
export interface ActivityStatistics {
  totalActivities: number
  activeActivities: number
  completedActivities: number
  cancelledActivities: number
  totalParticipants: number
  totalRevenue: number
  averageParticipation: number
  activityTypeDistribution: Record<ActivityType, number>
  statusDistribution: Record<ActivityStatus, number>
  monthlyGrowth: number
  popularActivities: Activity[]
  participantDemographics: {
    ageDistribution: Record<string, number>
    genderDistribution: Record<string, number>
    locationDistribution: Record<string, number>
  }
}

// 活动参与记录接口
export interface ActivityParticipation {
  id: number
  activityId: number
  activityTitle: string
  userId: number
  username: string
  joinTime: string
  status: 'confirmed' | 'waiting' | 'cancelled'
  paymentStatus: 'paid' | 'pending' | 'refunded'
  paymentAmount: number
  paymentTime?: string
  // 评价信息
  rating?: number
  review?: string
  reviewTime?: string
  // 取消信息
  cancelReason?: string
  cancelTime?: string
  // 参与信息
  participantsCount?: number
  groupMembers?: number[]
}

// 活动评价接口
export interface ActivityReview {
  id: number
  activityId: number
  activityTitle: string
  userId: number
  username: string
  organizerId: number
  organizerName: string
  rating: number
  review: string
  reviewTime: string
  isAnonymous: boolean
  // 回复信息
  reply?: string
  replyTime?: string
  // 有用性统计
  helpfulCount: number
  reportCount: number
  status: 'normal' | 'hidden' | 'deleted'
}

// 活动组织者接口
export interface ActivityOrganizer {
  id: number
  username: string
  nickname: string
  avatar: string
  organizerLevel: number
  totalActivities: number
  completedActivities: number
  cancellationRate: number
  averageRating: number
  totalParticipants: number
  joinTime: string
  // 认证信息
  isVerified: boolean
  verificationLevel: number
  // 联系方式
  contactPhone?: string
  contactEmail?: string
  // 组织者描述
  description?: string
  specialties?: string[]
}

// 活动类型统计接口
export interface ActivityTypeStats {
  activityType: ActivityType
  count: number
  totalParticipants: number
  totalRevenue: number
  averageRating: number
  completionRate: number
}

// 活动时间统计接口
export interface ActivityTimeStats {
  date: string
  activityCount: number
  participantCount: number
  revenue: number
  peakHours: number[]
}

// 活动地点统计接口
export interface ActivityLocationStats {
  location: string
  activityCount: number
  participantCount: number
  averageRating: number
  totalRevenue: number
}

// 活动审核记录接口
export interface ActivityAuditRecord {
  id: number
  activityId: number
  activityTitle: string
  auditStatus: ActivityAuditStatus
  auditRemark?: string
  auditor: string
  auditTime: string
  previousStatus?: ActivityStatus
  // 审核详情
  auditDetails?: {
    contentCheck: boolean
    safetyCheck: boolean
    complianceCheck: boolean
  }
}

// 活动取消记录接口
export interface ActivityCancellationRecord {
  id: number
  activityId: number
  activityTitle: string
  cancelReason: string
  cancelTime: string
  cancelledBy: 'organizer' | 'system' | 'participant'
  refundStatus: 'pending' | 'processed' | 'completed'
  refundAmount: number
  affectedParticipants: number
  // 取消详情
  weatherConditions?: string
  safetyConcerns?: string
  otherReasons?: string
}

// 活动推荐参数接口
export interface ActivityRecommendationParams {
  userId?: number
  location?: string
  preferredTypes?: ActivityType[]
  budgetRange?: [number, number]
  timeRange?: [string, string]
  participantCount?: number
  excludeAttended?: boolean
}

// 活动导出参数接口
export interface ActivityExportParams {
  format: 'csv' | 'excel'
  fields: string[]
  startDate?: string
  endDate?: string
  status?: ActivityStatus
  activityType?: ActivityType
  organizerId?: number
}

// 活动参与统计接口
export interface ActivityParticipationStats {
  date: string
  participationCount: number
  newParticipants: number
  repeatParticipants: number
  participationRate: number
  cancellationRate: number
  averageGroupSize: number
}

// 活动收入统计接口
export interface ActivityRevenueStats {
  date: string
  revenue: number
  activityCount: number
  averageRevenuePerActivity: number
  refundAmount: number
  netRevenue: number
}

// 活动运营指标接口
export interface ActivityOperationMetrics {
  date: string
  newActivities: number
  completedActivities: number
  participantSatisfaction: number
  organizerSatisfaction: number
  activityCompletionRate: number
  revenuePerParticipant: number
  marketingEffectiveness: number
}