feat: enrich member/comment/propose APIs with usernames

- ProjectMemberResponse now includes username and full_name
- Comment list endpoint returns author_username
- ProposeResponse now includes created_by_username
- All serializers resolve User objects to surface human-readable names
- Supports frontend code-first migration (TODO §3.1/3.2)
This commit is contained in:
zhi
2026-03-21 20:28:28 +00:00
parent f45f5957f4
commit 3ff9132596
4 changed files with 46 additions and 9 deletions

View File

@@ -208,6 +208,8 @@ class ProjectMemberCreate(ProjectMemberBase):
class ProjectMemberResponse(BaseModel):
id: int
user_id: int
username: Optional[str] = None
full_name: Optional[str] = None
project_id: int
role: str = "dev"
@@ -290,6 +292,7 @@ class ProposeResponse(ProposeBase):
status: ProposeStatusEnum
project_id: int
created_by_id: Optional[int] = None
created_by_username: Optional[str] = None
feat_task_id: Optional[str] = None
created_at: datetime
updated_at: Optional[datetime] = None