/** `GET /api/v1/draw/current` 的 `data`（可能为 `null`） */
export type DrawCurrentResultItem = {
  prize_type: string;
  prize_index: number;
  number_4d: string;
  suffix_3d: string | null;
  suffix_2d: string | null;
  head_digit: number | null;
  tail_digit: number | null;
};

export type DrawCurrentRiskPoolAlert = {
  normalized_number: string;
  status: "warning" | "sold_out";
};

export type DrawCurrentPayload = {
  /** 期号计划时区，PRD 固定为 UTC（GMT） */
  schedule_timezone?: string;
  /** 服务端当前时刻（UTC 下的 YYYY-MM-DD HH:mm:ss） */
  schedule_now?: string;
  draw_no: string;
  business_date: string;
  sequence_no: number;
  status: string;
  start_time: string | null;
  close_time: string | null;
  draw_time: string | null;
  seconds_to_close: number;
  /** 距开始下注（pending 且 start_time 在未来） */
  seconds_to_start?: number;
  seconds_to_draw: number;
  cooling_end_time: string | null;
  seconds_remaining_in_cooldown: number | null;
  /** 与 `jackpot.currency_code` 一致，便于 WS 快照与玩家币种对齐 */
  jackpot_currency_code?: string;
  jackpot?: {
    currency_code: string;
    enabled: boolean;
    current_amount_minor: number;
    current_amount_formatted?: string;
    draws_since_last_burst: number | null;
    last_trigger_draw_id?: number | null;
  };
  risk_pool_alerts?: DrawCurrentRiskPoolAlert[];
  result_items?: DrawCurrentResultItem[];
  result_version?: number;
  result_source?: string | null;
};

/** `GET /api/v1/draw/current` 的完整响应 */
export type DrawCurrentResponse = {
  server_now_ms: number;
  data: DrawCurrentPayload | null;
};
