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>
This commit is contained in:
23
backend/app/models/blocker.py
Normal file
23
backend/app/models/blocker.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import uuid
|
||||
from sqlalchemy import Column, String, Text, DateTime, ForeignKey
|
||||
from sqlalchemy.sql import func
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.core.database import Base
|
||||
|
||||
|
||||
class Blocker(Base):
|
||||
__tablename__ = "pjctrl_blockers"
|
||||
|
||||
id = Column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||
task_id = Column(String(36), ForeignKey("pjctrl_tasks.id", ondelete="CASCADE"), nullable=False)
|
||||
reported_by = Column(String(36), ForeignKey("pjctrl_users.id"), nullable=False)
|
||||
reason = Column(Text, nullable=False)
|
||||
resolved_by = Column(String(36), ForeignKey("pjctrl_users.id"), nullable=True)
|
||||
resolution_note = Column(Text, nullable=True)
|
||||
created_at = Column(DateTime, server_default=func.now(), nullable=False)
|
||||
resolved_at = Column(DateTime, nullable=True)
|
||||
|
||||
# Relationships
|
||||
task = relationship("Task", back_populates="blockers")
|
||||
reporter = relationship("User", foreign_keys=[reported_by], back_populates="reported_blockers")
|
||||
resolver = relationship("User", foreign_keys=[resolved_by], back_populates="resolved_blockers")
|
||||
Reference in New Issue
Block a user