export type AdminFinanceDailyItem = {
  date: string
  paidOrderCount: number
  paidAmount: number
  refundAmount: number
  workerRewardAmount: number
  withdrawAmount: number
  rechargeAmount: number
  afterSalesRefundAmount: number
  workerRecoveryAmount: number
  netCashFlow: number
}

export type AdminFinanceOverview = {
  paidOrderCount: number
  paidAmount: number
  refundAmount: number
  workerRewardAmount: number
  withdrawAmount: number
  rechargeAmount: number
  afterSalesRefundAmount: number
  workerRecoveryAmount: number
  netCashFlow: number
  availableAmount: number
  frozenDepositAmount: number
  pendingUnfreezeAmount: number
  frozenWithdrawAmount: number
  pendingWithdrawAmount: number
  pendingWithdrawCount: number
}

export type AdminFinanceTransaction = {
  category: string
  channel: string
  sourceId: number
  occurredAt: string
  amount: number
  direction: 'in' | 'out'
  label: string
  referenceNo: string
}

export type AdminFinanceChannelDailyItem = {
  date: string
  channel: string
  category: string
  count: number
  amount: number
}

export type AdminFinanceSummary = {
  range: { from: string; to: string }
  overview: AdminFinanceOverview
  daily: AdminFinanceDailyItem[]
  channelDaily: AdminFinanceChannelDailyItem[]
}

export type AdminFinanceTransactionResult = {
  items: AdminFinanceTransaction[]
  pagination: { page: number; pageSize: number; total: number }
  range: { from: string; to: string }
}
