HarborForge.Backend: dev-2026-03-29 -> main #13

Merged
hzhang merged 43 commits from dev-2026-03-29 into main 2026-04-05 22:08:15 +00:00
Showing only changes of commit 8d2d467bd8 - Show all commits

View File

@@ -302,6 +302,57 @@ class ProposalResponse(ProposalBase):
from_attributes = True
# ---------------------------------------------------------------------------
# Essential schemas (under Proposal)
# ---------------------------------------------------------------------------
class EssentialTypeEnum(str, Enum):
FEATURE = "feature"
IMPROVEMENT = "improvement"
REFACTOR = "refactor"
class EssentialBase(BaseModel):
title: str
type: EssentialTypeEnum
description: Optional[str] = None
class EssentialCreate(EssentialBase):
"""Create a new Essential under a Proposal.
``proposal_id`` is inferred from the URL path, not the body.
"""
pass
class EssentialUpdate(BaseModel):
title: Optional[str] = None
type: Optional[EssentialTypeEnum] = None
description: Optional[str] = None
class EssentialResponse(EssentialBase):
id: int
essential_code: str
proposal_id: int
created_by_id: Optional[int] = None
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True
class ProposalDetailResponse(ProposalResponse):
"""Extended Proposal response that embeds its Essential list."""
essentials: List[EssentialResponse] = []
class Config:
from_attributes = True
# Backward-compatible aliases
ProposeStatusEnum = ProposalStatusEnum
ProposeBase = ProposalBase