import uuid
from datetime import datetime

from pydantic import BaseModel, ConfigDict

from api.models.repo_goal import RepoGoalStatus


class RepoGoalCreate(BaseModel):
    repo_id: uuid.UUID
    domain_goal_id: uuid.UUID | None = None
    title: str
    description: str
    priority: int = 100
    status: str = RepoGoalStatus.active.value


class RepoGoalUpdate(BaseModel):
    title: str | None = None
    description: str | None = None
    priority: int | None = None
    status: str | None = None
    domain_goal_id: uuid.UUID | None = None


class RepoGoalRead(BaseModel):
    model_config = ConfigDict(from_attributes=True)
    id: uuid.UUID
    repo_id: uuid.UUID
    repo_slug: str
    domain_goal_id: uuid.UUID | None = None
    title: str
    description: str
    priority: int
    status: str
    created_at: datetime
    updated_at: datetime
