/**
 * 文件职责：到账查询页面本地状态类型定义。
 */
import type {
  FinanceSettlementChannelFilter,
  FinanceSettlementDetailItemDto,
  FinanceSettlementListItemDto,
} from '#/api/finance';

/** 到账查询筛选状态。 */
export interface FinanceSettlementFilterState {
  channel: FinanceSettlementChannelFilter;
  endDate: string;
  startDate: string;
}

/** 到账查询分页状态。 */
export interface FinanceSettlementPaginationState {
  page: number;
  pageSize: number;
  total: number;
}

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

/** 到账筛选请求负载。 */
export interface FinanceSettlementQueryPayload {
  channel?: Exclude<FinanceSettlementChannelFilter, 'all'>;
  endDate?: string;
  startDate?: string;
  storeId: string;
}

/** 到账列表请求负载。 */
export interface FinanceSettlementListQueryPayload extends FinanceSettlementQueryPayload {
  page: number;
  pageSize: number;
}

/** 展开行明细状态。 */
export interface FinanceSettlementDetailState {
  items: FinanceSettlementDetailItemDto[];
  loading: boolean;
}

/** 展开行明细缓存映射。 */
export type FinanceSettlementDetailStateMap = Record<
  string,
  FinanceSettlementDetailState
>;

/** 表格展开动作参数。 */
export interface FinanceSettlementExpandAction {
  expanded: boolean;
  row: FinanceSettlementListItemDto;
}
