"""admin 广告配置 schemas(穿山甲 app_id/各位ID/验签密钥/各场景开关)。"""
from __future__ import annotations

from pydantic import BaseModel


class AdConfigOut(BaseModel):
    """admin 读到的完整广告配置(含 reward_mkey;admin 有权见,但绝不经 /platform 下发客户端)。"""

    app_id: str
    reward_code_id: str
    compare_draw_code_id: str
    coupon_draw_code_id: str
    reward_mkey: str
    reward_enabled: bool
    compare_ad_enabled: bool
    coupon_ad_enabled: bool
    withdrawal_ad_enabled: bool


class AdConfigUpdate(BaseModel):
    """部分更新:只改传入(非 None)字段。空串是合法值(如清空 mkey 回退 .env)。"""

    app_id: str | None = None
    reward_code_id: str | None = None
    compare_draw_code_id: str | None = None
    coupon_draw_code_id: str | None = None
    reward_mkey: str | None = None
    reward_enabled: bool | None = None
    compare_ad_enabled: bool | None = None
    coupon_ad_enabled: bool | None = None
    withdrawal_ad_enabled: bool | None = None
