feat: add Propose model/schema + DB enum migration scripts
- New Propose model (app/models/propose.py) with status enum (open/accepted/rejected) - New Propose schemas (ProposeCreate/Update/Response) in schemas.py - MySQL enum migration in main.py for milestone/task status columns - milestone: pending→open, deferred→closed, progressing→undergoing - task: progressing→undergoing - Import propose model in startup for create_all - Add started_at column migration for milestones
This commit is contained in:
@@ -240,6 +240,42 @@ class MilestoneResponse(MilestoneBase):
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# Propose schemas
|
||||
|
||||
class ProposeStatusEnum(str, Enum):
|
||||
OPEN = "open"
|
||||
ACCEPTED = "accepted"
|
||||
REJECTED = "rejected"
|
||||
|
||||
|
||||
class ProposeBase(BaseModel):
|
||||
title: str
|
||||
description: Optional[str] = None
|
||||
|
||||
|
||||
class ProposeCreate(ProposeBase):
|
||||
project_id: Optional[int] = None
|
||||
|
||||
|
||||
class ProposeUpdate(BaseModel):
|
||||
title: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
|
||||
|
||||
class ProposeResponse(ProposeBase):
|
||||
id: int
|
||||
propose_code: Optional[str] = None
|
||||
status: ProposeStatusEnum
|
||||
project_id: int
|
||||
created_by_id: Optional[int] = None
|
||||
feat_task_id: Optional[str] = None
|
||||
created_at: datetime
|
||||
updated_at: Optional[datetime] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# Paginated response
|
||||
from typing import Generic, TypeVar
|
||||
T = TypeVar("T")
|
||||
|
||||
Reference in New Issue
Block a user