// 商家状态类型
export type MerchantStatus = 'active' | 'inactive' | 'banned'

// 商家审核状态类型
export type MerchantAuditStatus = 'pending' | 'approved' | 'rejected'

// 商家分类类型
export type MerchantCategory = 'flower' | 'farm' | 'activity' | 'travel' | 'other'

// 商家基本信息接口
export interface Merchant {
  id: number
  userId: number
  shopName: string
  businessLicense: string
  contactPerson: string
  contactPhone: string
  contactEmail: string
  address: string
  description: string
  status: MerchantStatus
  auditStatus: MerchantAuditStatus
  auditTime?: string
  auditRemark?: string
  registerTime: string
  category: MerchantCategory
  // 统计信息
  serviceScore: number
  orderCount: number
  totalRevenue: number
  // 扩展信息
  businessHours?: string
  deliveryRange?: string
  minimumOrder?: number
  // 资质文件
  licenseImage?: string
  idCardImage?: string
  // 银行信息
  bankAccount?: string
  bankName?: string
  accountHolder?: string
}

// 商家查询参数接口
export interface MerchantQueryParams {
  page: number
  pageSize: number
  keyword?: string
  status?: MerchantStatus
  auditStatus?: MerchantAuditStatus
  category?: MerchantCategory
  startDate?: string
  endDate?: string
  sortField?: string
  sortOrder?: 'asc' | 'desc'
}

// 商家审核参数接口
export interface MerchantAuditParams {
  merchantId: number
  auditStatus: MerchantAuditStatus
  auditRemark?: string
}

// 商家统计信息接口
export interface MerchantStatistics {
  totalMerchants: number
  activeMerchants: number
  pendingAudit: number
  rejected: number
  totalRevenue: number
  averageScore: number
  categoryDistribution: Record<MerchantCategory, number>
  monthlyGrowth: number
  dailyActiveMerchants: number
  topMerchants: Merchant[]
}

// 商家收入统计接口
export interface MerchantRevenueStats {
  date: string
  revenue: number
  orderCount: number
  averageOrderValue: number
}

// 商家服务评分统计接口
export interface MerchantScoreStats {
  date: string
  averageScore: number
  reviewCount: number
  fiveStarCount: number
  oneStarCount: number
}

// 商家分类统计接口
export interface MerchantCategoryStats {
  category: MerchantCategory
  count: number
  totalRevenue: number
  averageScore: number
}

// 商家审核记录接口
export interface MerchantAuditRecord {
  id: number
  merchantId: number
  shopName: string
  auditStatus: MerchantAuditStatus
  auditRemark?: string
  auditor: string
  auditTime: string
  previousStatus?: MerchantAuditStatus
}

// 商家操作日志接口
export interface MerchantOperationLog {
  id: number
  merchantId: number
  shopName: string
  operationType: string
  operationDetail: string
  operationTime: string
  operator: string
  result: 'success' | 'failure'
}

// 商家资质文件接口
export interface MerchantQualification {
  id: number
  merchantId: number
  fileType: 'license' | 'idCard' | 'bank' | 'other'
  fileName: string
  fileUrl: string
  uploadTime: string
  status: 'verified' | 'pending' | 'rejected'
  verifyRemark?: string
  verifyTime?: string
}

// 商家银行信息接口
export interface MerchantBankInfo {
  id: number
  merchantId: number
  bankName: string
  bankAccount: string
  accountHolder: string
  branchName?: string
  status: 'verified' | 'pending' | 'rejected'
  verifyRemark?: string
  verifyTime?: string
}

// 商家导出参数接口
export interface MerchantExportParams {
  format: 'csv' | 'excel'
  fields: string[]
  startDate?: string
  endDate?: string
  status?: MerchantStatus
  auditStatus?: MerchantAuditStatus
  category?: MerchantCategory
}