from pydantic import BaseModel


class User(BaseModel):
    id: int
    login: str
    full_name: str = ""
    email: str = ""


class Repo(BaseModel):
    id: int
    name: str
    full_name: str
    description: str = ""
    url: str
    updated_at: str = ""


class Milestone(BaseModel):
    id: int
    title: str


class Issue(BaseModel):
    id: int
    number: int
    title: str
    state: str
    labels: list[str] = []
    assignees: list[str] = []
    work_reasons: list[str] = []
    repository: str = ""
    updated_at: str = ""
    due_date: str | None = None
    milestone: Milestone | None = None
    url: str


class PullRequest(BaseModel):
    id: int
    number: int
    title: str
    state: str
    user: str
    labels: list[str] = []
    assignees: list[str] = []
    work_reasons: list[str] = []
    repository: str = ""
    updated_at: str = ""
    url: str


class SuggestionDelta(BaseModel):
    panel: str
    action: str
    target: str = ""
    priority: str = "medium"


class ViewContext(BaseModel):
    user: User
    repos: list[Repo] = []
    issues: list[Issue] = []
    pull_requests: list[PullRequest] = []
    view: str = "dashboard"
    deltas: list[SuggestionDelta] = []
