from typing import Optional, List
from pydantic import BaseModel


class ProfileUpdate(BaseModel):
    name: Optional[str] = None
    name_en: Optional[str] = None
    role: Optional[str] = None
    role_en: Optional[str] = None
    email: Optional[str] = None
    phone: Optional[str] = None
    github_url: Optional[str] = None
    blog_url: Optional[str] = None
    photo_url: Optional[str] = None
    bio: Optional[str] = None


class CareerCreate(BaseModel):
    category: str = "company"
    organization: str = ""
    role: str = ""
    description: str = ""
    start_date: str = ""
    end_date: str = ""
    sort_order: int = 0


class CareerUpdate(BaseModel):
    category: Optional[str] = None
    organization: Optional[str] = None
    role: Optional[str] = None
    description: Optional[str] = None
    start_date: Optional[str] = None
    end_date: Optional[str] = None
    sort_order: Optional[int] = None


class ProjectCreate(BaseModel):
    category: str = "personal"
    title: str = ""
    description: str = ""
    tech_stack: List[str] = []
    role: str = ""
    start_date: str = ""
    end_date: str = ""
    url: str = ""
    image_url: str = ""
    sort_order: int = 0


class ProjectUpdate(BaseModel):
    category: Optional[str] = None
    title: Optional[str] = None
    description: Optional[str] = None
    tech_stack: Optional[List[str]] = None
    role: Optional[str] = None
    start_date: Optional[str] = None
    end_date: Optional[str] = None
    url: Optional[str] = None
    image_url: Optional[str] = None
    sort_order: Optional[int] = None


class SkillCreate(BaseModel):
    category: str = "language"
    name: str = ""
    level: int = 3
    sort_order: int = 0


class SkillUpdate(BaseModel):
    category: Optional[str] = None
    name: Optional[str] = None
    level: Optional[int] = None
    sort_order: Optional[int] = None


class IntroCreate(BaseModel):
    title: str = ""
    content: str = ""
    is_main: int = 0


class IntroUpdate(BaseModel):
    title: Optional[str] = None
    content: Optional[str] = None


class AuthRequest(BaseModel):
    password: str


class TodoCreate(BaseModel):
    title: str
    description: Optional[str] = None
    status: str = "todo"


class TodoUpdate(BaseModel):
    title: Optional[str] = None
    description: Optional[str] = None
    status: Optional[str] = None


class BlogPostCreate(BaseModel):
    title: str
    body: str = ""
    excerpt: str = ""
    tags: List[str] = []
    date: str = ""


class BlogPostUpdate(BaseModel):
    title: Optional[str] = None
    body: Optional[str] = None
    excerpt: Optional[str] = None
    tags: Optional[List[str]] = None
    date: Optional[str] = None
