/** GET /api/v1/admin/wallet/transfer-orders */
export type AdminTransferOrderItem = {
  id: number;
  transfer_no: string;
  agent_node_id?: number | null;
  agent_code?: string | null;
  agent_name?: string | null;
  player_id: number;
  site_code: string | null;
  site_player_id: string | null;
  username: string | null;
  nickname: string | null;
  direction: string;
  currency_code: string;
  amount: number;
  idempotent_key: string;
  status: string;
  can_reverse?: boolean;
  can_complete_credit?: boolean;
  can_manually_process?: boolean;
  external_ref_no: string | null;
  external_request_payload: Record<string, unknown> | null;
  external_response_payload: Record<string, unknown> | null;
  fail_reason: string | null;
  created_at: string | null;
  finished_at: string | null;
};

export type AdminTransferOrderListData = {
  items: AdminTransferOrderItem[];
  total: number;
  page: number;
  per_page: number;
};

/** GET /api/v1/admin/wallet/transactions */
export type AdminWalletTxnItem = {
  id: number;
  txn_no: string;
  agent_node_id?: number | null;
  agent_code?: string | null;
  agent_name?: string | null;
  player_id: number;
  site_code: string | null;
  site_player_id: string | null;
  username: string | null;
  nickname: string | null;
  wallet_id: number | null;
  biz_type: string;
  ledger_source?: "wallet_txn" | "credit_ledger";
  funding_mode?: string;
  auth_source?: string | null;
  biz_no: string;
  direction: number;
  amount: number;
  amount_formatted?: string;
  balance_before: number;
  balance_after: number;
  status: string;
  external_ref_no: string | null;
  idempotent_key: string | null;
  remark: string | null;
  created_at: string | null;
  /** 界面「完成时间」展示（表 `updated_at`） */
  updated_at: string | null;
};

export type AdminWalletTxnListData = {
  items: AdminWalletTxnItem[];
  total: number;
  page: number;
  per_page: number;
};

/** GET /api/v1/admin/players/{player}/wallets */
export type AdminPlayerWalletRow = {
  id: number;
  wallet_type: string;
  currency_code: string;
  balance: number;
  frozen_balance: number;
  available_balance: number;
  status: number;
  version: number;
};

export type AdminPlayerWalletsData = {
  player: {
    id: number;
    site_code: string;
    site_player_id: string;
    username: string | null;
    nickname: string | null;
    default_currency: string;
    status: number;
  };
  wallets: AdminPlayerWalletRow[];
};
