/**
 * 文件职责：交易流水页面本地状态类型定义。
 */
import type {
  FinanceTransactionChannelFilter,
  FinanceTransactionPaymentFilter,
  FinanceTransactionTypeFilter,
} from '#/api/finance';

/** 快捷日期范围键。 */
export type QuickDateRangeKey =
  | '7d'
  | '30d'
  | ''
  | 'month'
  | 'today'
  | 'yesterday';

/** 交易流水筛选状态。 */
export interface FinanceTransactionFilterState {
  channel: FinanceTransactionChannelFilter;
  endDate: string;
  keyword: string;
  paymentMethod: FinanceTransactionPaymentFilter;
  quickRange: QuickDateRangeKey;
  startDate: string;
  type: FinanceTransactionTypeFilter;
}

/** 交易流水分页状态。 */
export interface FinanceTransactionPaginationState {
  page: number;
  pageSize: number;
  total: number;
}

/** 交易流水本页汇总状态。 */
export interface FinanceTransactionPageSummaryState {
  pageIncomeAmount: number;
  pageRefundAmount: number;
}

/** 通用选项项。 */
export interface OptionItem {
  label: string;
  value: string;
}

/** 快捷日期选项。 */
export interface QuickRangeOption {
  label: string;
  value: QuickDateRangeKey;
}

/** 交易流水筛选请求负载。 */
export interface FinanceTransactionQueryPayload {
  channel?: FinanceTransactionChannelFilter;
  endDate?: string;
  keyword?: string;
  paymentMethod?: FinanceTransactionPaymentFilter;
  startDate?: string;
  storeId: string;
  type?: FinanceTransactionTypeFilter;
}

/** 交易流水列表请求负载。 */
export interface FinanceTransactionListQueryPayload extends FinanceTransactionQueryPayload {
  page: number;
  pageSize: number;
}
