/** `GET /api/v1/play/effective` → `data` */

export type PlayEffectiveVersionHead = {
  id: number;
  version_no: number;
  effective_at: string | null;
};

export type PlayEffectiveConfigSlice = {
  is_enabled: boolean;
  min_bet_amount: number;
  max_bet_amount: number;
  display_order: number;
  rule_text_zh: string | null;
  rule_text_en: string | null;
  rule_text_ne: string | null;
  extra_config_json: unknown;
};

export type PlayEffectiveOddsSlice = {
  prize_scope: string;
  odds_value: number;
  rebate_rate: string;
  commission_rate: string;
  currency_code: string;
  extra_config_json: unknown;
  /** 赔率乘数小数（与 odds_value/10000 一致） */
  odds_multiplier?: number;
};

export type PlayEffectivePlayRow = {
  play_code: string;
  category: string;
  dimension: number | null;
  bet_mode: string | null;
  display_name: string | null;
  sort_order: number;
  supports_multi_number: boolean;
  master_enabled: boolean;
  config: PlayEffectiveConfigSlice | null;
  odds: PlayEffectiveOddsSlice | null;
};

export type PlayEffectiveRiskCapRow = {
  draw_id: number | null;
  normalized_number: string;
  cap_amount: number;
  cap_type: string;
};

export type PlayEffectivePayload = {
  currency_code: string;
  effective_versions: {
    play_config: PlayEffectiveVersionHead;
    odds: PlayEffectiveVersionHead;
    risk_cap: PlayEffectiveVersionHead;
  };
  plays: PlayEffectivePlayRow[];
  risk_cap_items: PlayEffectiveRiskCapRow[];
};
