import { adminRequest } from "@/lib/admin-http";

import { API_V1_PREFIX } from "./paths";

import type { AdminTicketItemsData } from "@/types/api/admin-tickets";

const A = `${API_V1_PREFIX}/admin`;

export type TicketItemsListQuery = {
  page?: number;
  per_page?: number;
  player_id?: number;
  player_account?: string;
  draw_no?: string;
  status?: string[];
  number?: string;
  start_date?: string;
  end_date?: string;
};

export async function getAdminTicketItems(
  q: TicketItemsListQuery = {},
): Promise<AdminTicketItemsData> {
  return adminRequest.get<AdminTicketItemsData>(`${A}/tickets`, { params: q });
}
