Files
PROJECT-CONTORL/backend/app/schemas/comment.py
beabigegg 3470428411 feat: implement collaboration module
- Backend (FastAPI):
  - Task comments with nested replies and soft delete
  - @mention parsing with 10-mention limit per comment
  - Notification system with read/unread tracking
  - Blocker management with project owner notification
  - WebSocket endpoint with JWT auth and keepalive
  - User search API for @mention autocomplete
  - Alembic migration for 4 new tables

- Frontend (React + Vite):
  - Comments component with @mention autocomplete
  - NotificationBell with real-time WebSocket updates
  - BlockerDialog for task blocking workflow
  - NotificationContext for state management

- OpenSpec:
  - 4 requirements with scenarios defined
  - add-collaboration change archived

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 20:45:07 +08:00

53 lines
1.0 KiB
Python

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