"""
节目期次 Schema — 请求 / 响应模型
"""

from datetime import date

from pydantic import BaseModel, ConfigDict

from app.models.user import UserRole


class EpisodeBase(BaseModel):
    episode_number: int
    program_name: str
    air_date: date
    editor_id: int | None = None
    editor_name_snapshot: str
    audience_share: float | None = None
    audience_rating: float | None = None
    is_rerun: bool = False
    original_episode_id: int | None = None
    is_time_sensitive: bool = False
    is_outdoor_shoot: bool = False
    outdoor_contact_person: str | None = None
    outdoor_contact_info: str | None = None
    lead_source: str | None = None
    notes: str | None = None


class EpisodeCreate(EpisodeBase):
    pass


class EpisodeUpdate(EpisodeBase):
    pass


class EpisodeResponse(EpisodeBase):
    id: int

    model_config = ConfigDict(from_attributes=True)