from datetime import datetime

from pydantic import BaseModel, Field


class RecentTaskItem(BaseModel):
    id: str
    task_type: str = "generation"
    status: str
    current_step: str = ""
    error_message: str = ""
    updated_at: datetime | None = None


class SubscriptionInfo(BaseModel):
    """用户订阅信息。"""

    plan: str = "free"
    is_active: bool = False


class DashboardOverviewResponse(BaseModel):
    """Dashboard 概览数据。"""

    total_assets: int = 0
    used_storage_bytes: int = 0
    total_titles: int = 0
    total_voices: int = 0
    total_tasks: int = 0
    total_products: int = 0
    subscription: SubscriptionInfo = Field(default_factory=SubscriptionInfo)
    recent_tasks: list[RecentTaskItem] = Field(default_factory=list)
