from datetime import datetime from typing import Optional, List from pydantic import BaseModel, Field class CommentCreate(BaseModel): content: str = Field(..., min_length=1, max_length=10000) parent_comment_id: Optional[str] = None class CommentUpdate(BaseModel): content: str = Field(..., min_length=1, max_length=10000) class CommentAuthor(BaseModel): id: str name: str email: str class Config: from_attributes = True class MentionedUser(BaseModel): id: str name: str email: str class Config: from_attributes = True class CommentResponse(BaseModel): id: str task_id: str parent_comment_id: Optional[str] content: str is_edited: bool is_deleted: bool created_at: datetime updated_at: datetime author: CommentAuthor mentions: List[MentionedUser] = [] reply_count: int = 0 class Config: from_attributes = True class CommentListResponse(BaseModel): comments: List[CommentResponse] total: int