export type AdminSettlementBatchRow = {
  id: number;
  draw_id: number;
  draw_no: string | null;
  currency_code: string | null;
  result_batch_id: number;
  settle_version: number;
  status: string;
  review_status: string | null;
  reviewed_at: string | null;
  paid_at: string | null;
  total_ticket_count: number;
  total_win_count: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 total_bet_amount_minor */
  total_bet_amount: number;
  total_bet_amount_minor: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 total_actual_deduct_minor */
  total_actual_deduct: number;
  total_actual_deduct_minor: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 total_payout_amount_minor */
  total_payout_amount: number;
  total_payout_amount_minor: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 total_jackpot_payout_amount_minor */
  total_jackpot_payout_amount: number;
  total_jackpot_payout_amount_minor: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 platform_profit_minor */
  platform_profit: number;
  platform_profit_minor: number;
  started_at: string | null;
  finished_at: string | null;
  created_at: string | null;
};

export type AdminSettlementBatchListData = {
  items: AdminSettlementBatchRow[];
  meta: {
    current_page: number;
    per_page: number;
    total: number;
    last_page: number;
  };
};

export type AdminSettlementBatchShowData = {
  id: number;
  draw_id: number;
  draw_no: string | null;
  currency_code: string | null;
  draw_status: string | null;
  result_batch_id: number;
  result_batch_version: number | null;
  result_batch_status: string | null;
  settle_version: number;
  status: string;
  review_status: string | null;
  reviewed_by: number | null;
  reviewed_at: string | null;
  review_remark: string | null;
  paid_at: string | null;
  total_ticket_count: number;
  total_win_count: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 total_bet_amount_minor */
  total_bet_amount: number;
  total_bet_amount_minor: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 total_actual_deduct_minor */
  total_actual_deduct: number;
  total_actual_deduct_minor: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 total_payout_amount_minor */
  total_payout_amount: number;
  total_payout_amount_minor: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 total_jackpot_payout_amount_minor */
  total_jackpot_payout_amount: number;
  total_jackpot_payout_amount_minor: number;
  /** @deprecated 历史字段，单位为 minor；优先使用 platform_profit_minor */
  platform_profit: number;
  platform_profit_minor: number;
  started_at: string | null;
  finished_at: string | null;
  created_at: string | null;
};

export type AdminSettlementDetailRow = {
  id: number;
  ticket_item_id: number;
  agent_node_id?: number | null;
  agent_code?: string | null;
  agent_name?: string | null;
  ticket_no: string | null;
  play_code: string | null;
  currency_code: string | null;
  player_id: number | null;
  site_code: string | null;
  site_player_id: string | null;
  username: string | null;
  /** @deprecated 使用 username */
  player_username?: string | null;
  matched_prize_tier: string | null;
  win_amount: number;
  jackpot_allocation_amount: number;
  match_detail_json: unknown;
  created_at: string | null;
};

export type AdminSettlementBatchDetailsData = {
  batch_id: number;
  items: AdminSettlementDetailRow[];
  meta: {
    current_page: number;
    per_page: number;
    total: number;
    last_page: number;
  };
};

export type AdminSettlementRunResponse = {
  ran: boolean;
  draw_no: string;
  status: string;
  settle_version: number;
};

export type AdminSettlementWorkflowResponse = {
  id: number;
  status: string;
  review_status?: string | null;
  paid_at?: string | null;
};
