BE-PR-007: refactor Proposal Accept to generate story tasks from all Essentials

- Removed old logic that created a single story/feature task on accept
- Accept now iterates all Essentials under the Proposal
- Each Essential.type maps to a story/* task (feature/improvement/refactor)
- All tasks created in a single transaction
- Added ProposalAcceptResponse and GeneratedTaskSummary schemas
- Proposal must have at least one Essential to be accepted
- No longer writes to deprecated feat_task_id field
This commit is contained in:
zhi
2026-03-30 07:46:20 +00:00
parent 431f4abe5a
commit cb0be05246
2 changed files with 101 additions and 28 deletions

View File

@@ -353,6 +353,27 @@ class ProposalDetailResponse(ProposalResponse):
from_attributes = True
class GeneratedTaskSummary(BaseModel):
"""Brief summary of a task generated from a Proposal Essential."""
task_id: int
task_code: str
task_type: str
task_subtype: str
title: str
essential_id: int
essential_code: str
class ProposalAcceptResponse(ProposalResponse):
"""Response for Proposal Accept — includes the generated story tasks."""
essentials: List[EssentialResponse] = []
generated_tasks: List[GeneratedTaskSummary] = []
class Config:
from_attributes = True
# Backward-compatible aliases
ProposeStatusEnum = ProposalStatusEnum
ProposeBase = ProposalBase