from pydantic import BaseModel, Field


class MenuAssetRead(BaseModel):
    id: str
    original_name: str
    display_name: str
    mime_type: str
    kind: str
    file_size_bytes: int
    status: str
    error_detail: str | None = None
    analysis_text: str = ""
    created_at: str
    updated_at: str


class MenuAssetRenamePayload(BaseModel):
    display_name: str = Field(min_length=1, max_length=180)


class MenuPromptSettingsPayload(BaseModel):
    sales_focus: str = Field(default="", max_length=4000)
    menu_text: str = Field(default="", max_length=30000)
    cocktail_list_text: str = Field(default="", max_length=30000)
    uploaded_assets_context_override: str = Field(default="", max_length=30000)


class MenuPromptSettingsResponse(MenuPromptSettingsPayload):
    tenant_name: str
    tenant_slug: str
    venue_name: str
    dashboard_url: str = ""
    documents_url: str = ""
    ordini_url: str = ""
    prenotazioni_url: str = ""
    menu_url: str = ""
    homemade_url: str = ""
    base_prompt: str
    prompt_preview: str
    uploaded_assets_context: str = ""
    uploaded_assets_context_generated: str = ""
    assistant_description: str
    assets: list[MenuAssetRead] = Field(default_factory=list)
    asset_total_count: int = 0
    asset_ready_count: int = 0
    updated_at: str | None = None
