kin: KIN-BIZ-002 Исправить консистентность: approve через /tasks/{id}/approve не продвигает phase state machine
This commit is contained in:
parent
044bd15b2e
commit
39acc9cc4b
5 changed files with 288 additions and 4 deletions
|
|
@ -115,7 +115,7 @@ def list_projects(status: str | None = None):
|
|||
class NewProjectCreate(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
path: str
|
||||
path: str | None = None
|
||||
description: str
|
||||
roles: list[str]
|
||||
tech_stack: list[str] | None = None
|
||||
|
|
@ -170,7 +170,7 @@ VALID_PROJECT_TYPES = {"development", "operations", "research"}
|
|||
class ProjectCreate(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
path: str = ""
|
||||
path: str | None = None
|
||||
tech_stack: list[str] | None = None
|
||||
status: str = "active"
|
||||
priority: int = 5
|
||||
|
|
@ -181,9 +181,11 @@ class ProjectCreate(BaseModel):
|
|||
ssh_proxy_jump: str | None = None
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_operations_ssh_host(self) -> "ProjectCreate":
|
||||
def validate_fields(self) -> "ProjectCreate":
|
||||
if self.project_type == "operations" and not self.ssh_host:
|
||||
raise ValueError("ssh_host is required for operations projects")
|
||||
if self.project_type != "operations" and not self.path:
|
||||
raise ValueError("path is required for non-operations projects")
|
||||
return self
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue