import { lotteryRequest } from "@/lib/lottery-http";
import type {
  TicketPlaceData,
  TicketPlacePayload,
  TicketPreviewData,
  TicketPreviewPayload,
} from "@/types/api/ticket";

/** `POST /api/v1/ticket/preview` — 不落库，用于确认弹窗（产品文档 §10.1.2） */
export function postTicketPreview(
  body: TicketPreviewPayload,
): Promise<TicketPreviewData> {
  return lotteryRequest.post<TicketPreviewData>(
    `/ticket/preview`,
    body,
  );
}

/** `POST /api/v1/ticket/place` — 真实下注 */
export function postTicketPlace(body: TicketPlacePayload): Promise<TicketPlaceData> {
  return lotteryRequest.post<TicketPlaceData>(
    `/ticket/place`,
    body,
  );
}
