from typing import Any, Dict, List, Optional

from pydantic import BaseModel, Field


class BugReportPayload(BaseModel):
    actual: str = Field(..., min_length=3, max_length=8000)
    expected: str = Field(..., min_length=3, max_length=8000)
    screenshot_base64: Optional[str] = Field(default=None, max_length=25_000_000)
    metadata: Dict[str, Any] = Field(default_factory=dict)
    logs: List[Dict[str, Any]] = Field(default_factory=list)
    extra_file_name: Optional[str] = Field(default=None, max_length=255)
    extra_file_base64: Optional[str] = Field(default=None, max_length=25_000_000)


class BugReportResult(BaseModel):
    success: bool
    sag_id: int
    case_url: str
    message: str
