/** 质押配置 */
export interface StakingConfigItem {
  id?: number;
  productName: string;
  coinUnit: string;
  minAmount: number | string;
  maxAmount: number | string;
  lockDays: number;
  releaseType: number;
  releasePeriod: number;
  releaseRate: number | string;
  description?: string;
  status: number;
  /** 是否自动发放空投：0否 1是 */
  autoAirdropEnabled?: number;
  /** 空投发放方式：0固定金额 1按质押比例 */
  airdropDistributeType?: number;
  airdropFixedAmount?: number | string;
  /** 比例小数，如 0.01 表示 1% */
  airdropRatio?: number | string;
  createTime?: string;
  updateTime?: string;
}

/** 质押订单 */
export interface StakingOrderItem {
  id: number;
  memberId: number;
  configId: number;
  coinUnit: string;
  amount: number | string;
  releasedAmount: number | string;
  status: number;
  stakingTime?: string;
  unlockTime?: string;
  lastReleaseTime?: string;
  createTime?: string;
  /** 今日是否已发放（仅质押中订单有值） */
  todayAirdropDistributed?: boolean | null;
  /** 今日是否可发放空投 */
  canDistributeAirdropToday?: boolean;
}

/** 质押流水 */
export interface StakingRecordItem {
  id: number;
  memberId: number;
  orderId?: number;
  coinUnit: string;
  amount: number | string;
  type: number;
  remark?: string;
  createTime?: string;
}

/** 空投分配（管理员向用户创建待领取记录） */
export interface AirdropDistributeForm {
  memberId: number | string;
  coinUnit: string;
  amount: number | string;
  stakingOrderId?: number | string;
}

/** 空投记录 */
export interface AirdropRecordItem {
  id: number;
  memberId: number;
  stakingOrderId?: number;
  coinUnit: string;
  amount: number | string;
  /** 0待领取 1已发放 2审核中 3已拒绝 */
  status: number;
  claimTime?: string;
  auditTime?: string;
  auditRemark?: string;
  createTime?: string;
}

export interface PageQueryParam {
  pageNo?: number;
  pageSize?: number;
}

export interface StakingOrderQueryParam extends PageQueryParam {
  status?: number | '';
  memberId?: number | string;
  coinUnit?: string;
  /** true=仅今日可发放但未发放的质押中订单 */
  pendingAirdropToday?: boolean;
}

export interface BatchAirdropDistributeRequest {
  stakingOrderIds: number[];
  amount: number | string;
}

export interface BatchAirdropDistributeResult {
  successCount: number;
  failCount: number;
  failMessages: string[];
}

export interface PageResult<T> {
  content: T[];
  totalElements: number;
  totalPages: number;
  number: number;
  size: number;
}
