"""Recipe domain entities."""

from __future__ import annotations

from dataclasses import dataclass, field
from datetime import datetime, timezone
from typing import List


@dataclass
class RecipeItem:
    """配方中的单个素材/标题/配音项"""

    id: str
    recipe_id: str
    item_type: str  # asset / title / voice
    item_id: str
    position: int = 0
    metadata_: dict = field(default_factory=dict)


@dataclass
class Recipe:
    """配方 — 一次「一键生成」的完整参数组合"""

    id: str
    user_id: str
    name: str
    description: str = ""
    template_id: str = ""
    generation_params: dict = field(default_factory=dict)
    items: List[RecipeItem] = field(default_factory=list)
    is_active: bool = True
    metadata_: dict = field(default_factory=dict)
    created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
    updated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
