from typing import List, Optional
from pydantic import BaseModel
from uuid import UUID
from datetime import datetime

from schema.organization_schema import PaginationSchema


class CommentAddSchema(BaseModel):
    content: str
    ticket_id: UUID
    is_edited: Optional[bool] = None


class CommentAddReponse(BaseModel):
    message: str


class AuthorResponse(BaseModel):
    id: UUID
    name: str
    email: str

    class Config:
        from_attributes = True


class CommentResponse(BaseModel):
    id: UUID
    content: str
    is_edited: bool
    created_at: datetime
    updated_at:datetime

    author: AuthorResponse

    class Config:
        from_attributes = True


class CommentsAllResponse(BaseModel):
    comments: List[CommentResponse]
    # pagination: PaginationSchema