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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user