// 动物类型
export type AnimalType = 'sheep' | 'cow' | 'pig' | 'chicken' | 'goat' | 'duck' | 'other'

// 动物状态类型
export type AnimalStatus = 'available' | 'adopted' | 'reserved' | 'inactive'

// 动物性别类型
export type AnimalGender = 'male' | 'female' | 'unknown'

// 健康状态类型
export type HealthStatus = 'excellent' | 'good' | 'fair' | 'poor' | 'critical'

// 动物基本信息接口
export interface Animal {
  id: number
  name: string
  animalType: AnimalType
  breed: string
  age: number
  gender: AnimalGender
  status: AnimalStatus
  farmId: number
  farmName: string
  price: number
  description: string
  images: string[]
  healthStatus: HealthStatus
  adoptionCount: number
  createTime: string
  // 扩展信息
  features?: string[]
  personality?: string
  favoriteFood?: string
  // 医疗记录
  vaccinationRecords?: VaccinationRecord[]
  medicalHistory?: MedicalRecord[]
  // 认养信息
  currentAdopter?: string
  adoptionStartTime?: string
  adoptionEndTime?: string
  // 位置信息
  location?: string
  gpsCoordinates?: string
}

// 动物查询参数接口
export interface AnimalQueryParams {
  page: number
  pageSize: number
  keyword?: string
  status?: AnimalStatus
  animalType?: AnimalType
  farmId?: number
  minAge?: number
  maxAge?: number
  gender?: AnimalGender
  minPrice?: number
  maxPrice?: number
  startDate?: string
  endDate?: string
  sortField?: string
  sortOrder?: 'asc' | 'desc'
}

// 疫苗接种记录接口
export interface VaccinationRecord {
  id: number
  animalId: number
  vaccineName: string
  vaccinationDate: string
  nextVaccinationDate: string
  veterinarian: string
  notes?: string
}

// 医疗记录接口
export interface MedicalRecord {
  id: number
  animalId: number
  diagnosis: string
  treatment: string
  treatmentDate: string
  veterinarian: string
  cost: number
  notes?: string
  followUpDate?: string
}

// 动物统计信息接口
export interface AnimalStatistics {
  totalAnimals: number
  availableAnimals: number
  adoptedAnimals: number
  totalAdoptions: number
  averageAdoptionPrice: number
  animalTypeDistribution: Record<AnimalType, number>
  statusDistribution: Record<AnimalStatus, number>
  healthStatusDistribution: Record<HealthStatus, number>
  monthlyAdoptions: number
  adoptionGrowthRate: number
  topAdoptedAnimals: Animal[]
}

// 动物类型统计接口
export interface AnimalTypeStats {
  animalType: AnimalType
  count: number
  adoptionCount: number
  averagePrice: number
  adoptionRate: number
}

// 农场动物统计接口
export interface FarmAnimalStats {
  farmId: number
  farmName: string
  totalAnimals: number
  availableAnimals: number
  adoptedAnimals: number
  totalAdoptions: number
  averageAdoptionPrice: number
}

// 动物健康统计接口
export interface AnimalHealthStats {
  date: string
  excellentCount: number
  goodCount: number
  fairCount: number
  poorCount: number
  criticalCount: number
  vaccinationRate: number
}

// 动物认养记录接口
export interface AnimalAdoptionRecord {
  id: number
  animalId: number
  animalName: string
  userId: number
  username: string
  startTime: string
  endTime: string
  duration: number
  totalCost: number
  status: 'active' | 'completed' | 'cancelled'
  paymentStatus: 'paid' | 'pending' | 'refunded'
  adoptionType: 'individual' | 'group'
  groupMembers?: number[]
}

// 动物成长记录接口
export interface AnimalGrowthRecord {
  id: number
  animalId: number
  recordDate: string
  weight: number
  height: number
  condition: string
  notes?: string
  photos?: string[]
}

// 动物行为记录接口
export interface AnimalBehaviorRecord {
  id: number
  animalId: number
  recordDate: string
  behaviorType: string
  duration: number
  notes?: string
  videoUrl?: string
}

// 动物喂养记录接口
export interface AnimalFeedingRecord {
  id: number
  animalId: number
  feedingTime: string
  foodType: string
  quantity: number
  feeder: string
  notes?: string
}

// 动物活动记录接口
export interface AnimalActivityRecord {
  id: number
  animalId: number
  activityType: string
  startTime: string
  endTime: string
  duration: number
  caloriesBurned?: number
  notes?: string
}

// 动物导出参数接口
export interface AnimalExportParams {
  format: 'csv' | 'excel'
  fields: string[]
  startDate?: string
  endDate?: string
  status?: AnimalStatus
  animalType?: AnimalType
  farmId?: number
}

// 动物认养统计接口
export interface AnimalAdoptionStats {
  date: string
  adoptionCount: number
  totalRevenue: number
  averageAdoptionDuration: number
  popularAnimalTypes: string[]
  peakAdoptionHours: number[]
}

// 动物健康预警接口
export interface AnimalHealthAlert {
  id: number
  animalId: number
  animalName: string
  alertType: 'vaccination' | 'medical' | 'nutrition' | 'behavior'
  alertLevel: 'low' | 'medium' | 'high' | 'critical'
  alertMessage: string
  triggerTime: string
  resolved: boolean
  resolveTime?: string
  resolveNotes?: string
}