// 分销员信息类型
interface Distributor {
  id: string;
  code: string;
  name: string;
  phone: string;
  status: number;
  statusLabel: string;
  qrcodeContent: string;
  totalReferrals: number;
  validReferrals: number;
  commissionBalance: number;
  frozenAmount: number;
  totalCommission: number;
  totalWithdrawn: number;
  remark: string;
  creatorName: string;
  createTime: string;
  updateTime?: string;
}

// 分销员查询参数
interface DistributorQuery {
  page?: number;
  pageSize?: number;
  code?: string;
  name?: string;
  phone?: string;
  status?: number;
}

// 推荐记录类型
interface Referral {
  id: string;
  distributorId: string;
  distributorName: string;
  userId: string;
  userName: string;
  status: number;
  statusLabel: string;
  firstOrderId: string;
  firstOrderAmount: number;
  firstOrderTime: string;
  effectiveTime: string;
  expireTime: string;
  createTime: string;
}

// 推荐记录查询参数
interface ReferralQuery {
  page?: number;
  pageSize?: number;
  distributorId?: string;
  userId?: string;
  status?: number;
  startDate?: string;
  endDate?: string;
}

// 佣金记录类型
interface Commission {
  id: string;
  distributorId: string;
  distributorName: string;
  userId: string;
  userName: string;
  commissionType: number;
  commissionTypeLabel: string;
  amount: number;
  orderAmount: number;
  rate: number;
  status: number;
  statusLabel: string;
  settleTime: string;
  createTime: string;
}

// 佣金记录查询参数
interface CommissionQuery {
  page?: number;
  pageSize?: number;
  distributorId?: string;
  userId?: string;
  commissionType?: number;
  status?: number;
  startDate?: string;
  endDate?: string;
}

// 提现记录类型
interface Withdrawal {
  id: string;
  distributorId: string;
  distributorName: string;
  amount: number;
  status: number;
  statusLabel: string;
  reviewerId: string;
  reviewerName: string;
  reviewTime: string;
  reviewRemark: string;
  transferTime: string;
  createTime: string;
}

// 提现记录查询参数
interface WithdrawalQuery {
  page?: number;
  pageSize?: number;
  distributorId?: string;
  status?: number;
  startDate?: string;
  endDate?: string;
}

// 月度报表类型
interface MonthlyReport {
  id: string;
  distributorId: string;
  distributorName: string;
  yearMonth: string;
  totalReferrals: number;
  validReferrals: number;
  pendingReferrals: number;
  expiredReferrals: number;
  totalCommission: number;
  settledCommission: number;
  pendingCommission: number;
  createTime: string;
}

// 月度报表查询参数
interface MonthlyReportQuery {
  page?: number;
  pageSize?: number;
  yearMonth?: string;
  distributorId?: string;
}

// 仪表盘数据类型
interface DashboardData {
  totalDistributors: number;
  activeDistributors: number;
  totalReferrals: number;
  validReferrals: number;
  totalCommission: number;
  monthlyCommission: number;
  trends: MonthlyTrend[];
}

// 月度趋势类型
interface MonthlyTrend {
  yearMonth: string;
  referralCount: number;
  validCount: number;
  commissionAmount: number;
}

// 分销配置类型
interface DistributorConfig {
  id: string;
  configKey: string;
  configValue: string;
  configDesc: string;
  updateTime: string;
}

export type {
  Distributor,
  DistributorQuery,
  Referral,
  ReferralQuery,
  Commission,
  CommissionQuery,
  Withdrawal,
  WithdrawalQuery,
  MonthlyReport,
  MonthlyReportQuery,
  DashboardData,
  MonthlyTrend,
  DistributorConfig
};
