refactor: update milestone/task status enums to new state machine values
Milestone: open/freeze/undergoing/completed/closed (was open/pending/deferred/progressing/closed) Task: open/pending/undergoing/completed/closed (was open/pending/progressing/closed) - Add MilestoneStatusEnum to schemas with typed validation - Add started_at field to Milestone model - Update all router/CLI references from progressing->undergoing - Add completed status handling in task transition logic
This commit is contained in:
@@ -111,8 +111,8 @@ def create_milestone_task(project_id: int, milestone_id: int, task_data: schemas
|
||||
if not milestone:
|
||||
raise HTTPException(status_code=404, detail="Milestone not found")
|
||||
|
||||
if milestone.status and hasattr(milestone.status, 'value') and milestone.status.value == "progressing":
|
||||
raise HTTPException(status_code=400, detail="Cannot add items to a milestone that is in_progress")
|
||||
if milestone.status and hasattr(milestone.status, 'value') and milestone.status.value == "undergoing":
|
||||
raise HTTPException(status_code=400, detail="Cannot add items to a milestone that is undergoing")
|
||||
|
||||
# Generate task_code
|
||||
milestone_code = milestone.milestone_code or f"m{milestone.id}"
|
||||
|
||||
Reference in New Issue
Block a user