feat(v2): 实现SQLite对公租赁经验加工与卡片预审轨迹闭环
This commit is contained in:
@@ -163,6 +163,7 @@ class ReviewPlanInput(Input):
|
||||
name: str = Field(min_length=1, max_length=200)
|
||||
skills: list[str] = Field(min_length=1, max_length=100)
|
||||
rules: list[str] = Field(default_factory=list, max_length=100)
|
||||
cards: list[str] = Field(default_factory=list, max_length=100)
|
||||
template: str = Field(min_length=1, max_length=ID_MAX)
|
||||
budget: dict | None = None
|
||||
audience: list[str] = Field(default_factory=list, max_length=10)
|
||||
@@ -877,7 +878,7 @@ def transition_knowledge_candidate(card_id: str, payload: TransitionInput, reque
|
||||
with _db() as db:
|
||||
return evaluate(db, draft["id"], _actor(request))
|
||||
if payload.action == "publish":
|
||||
role(request, ("reviewer",))
|
||||
role(request, ("admin", "reviewer"))
|
||||
with _db() as db:
|
||||
return knowledge_cards.publish(db, draft["id"], _actor(request),
|
||||
request.state.identity.get("preview", False))
|
||||
@@ -942,10 +943,22 @@ def transition_review_plan(plan_ref: str, payload: TransitionInput, request: Req
|
||||
with _db() as db:
|
||||
return evaluate(db, draft["id"], _actor(request))
|
||||
if payload.action == "publish":
|
||||
role(request, ("reviewer",))
|
||||
role(request, ("admin", "reviewer"))
|
||||
with _db() as db:
|
||||
return registry.release(db, draft["id"], _actor(request),
|
||||
request.state.identity.get("preview", False))
|
||||
raise ValueError(f"不支持的方案动作:{payload.action};本版支持 evaluate 与 publish")
|
||||
|
||||
return run(request, action)
|
||||
|
||||
|
||||
@router.get('/projects/{project_id}/run-comparison')
|
||||
def compare_runs(project_id: str, left: str, right: str, request: Request):
|
||||
blocked=scope(request, project_id)
|
||||
if blocked is not None:
|
||||
return blocked
|
||||
def action():
|
||||
from services.trajectory_details import compare
|
||||
with _db() as db:
|
||||
return compare(db, project_id, left, right)
|
||||
return run(request, action)
|
||||
|
||||
Reference in New Issue
Block a user