BE-PR-002: Proposal model naming & field adjustments

- Add comprehensive docstring to Proposal model documenting all relationships
- Add column comments for all fields (title, description, status, project_id, etc.)
- Mark feat_task_id as DEPRECATED (will be replaced by Essential->task mapping in BE-PR-008)
- Add proposal_code hybrid property as preferred alias for DB column propose_code
- Update ProposalResponse schema to include proposal_code alongside propose_code
- Update serializer to emit both proposal_code and propose_code for backward compat
- No DB migration needed -- only Python-level changes
This commit is contained in:
zhi
2026-03-29 16:02:18 +00:00
parent cfacd432f5
commit 119a679e7f
3 changed files with 66 additions and 12 deletions

View File

@@ -288,12 +288,13 @@ class ProposalUpdate(BaseModel):
class ProposalResponse(ProposalBase):
id: int
propose_code: Optional[str] = None # DB column name kept for compat
proposal_code: Optional[str] = None # preferred name
propose_code: Optional[str] = None # backward compat alias (same value)
status: ProposalStatusEnum
project_id: int
created_by_id: Optional[int] = None
created_by_username: Optional[str] = None
feat_task_id: Optional[str] = None
feat_task_id: Optional[str] = None # DEPRECATED — will be removed after BE-PR-008
created_at: datetime
updated_at: Optional[datetime] = None