AP1.8a: Portfolio-Rang im Cockpit mit Reorder und Next-Action-Sortierung.
Deploy Development / deploy (push) Successful in 50s
Test Suite / pytest-backend (push) Successful in 2m21s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 21s
Deploy Development / deploy (push) Successful in 50s
Test Suite / pytest-backend (push) Successful in 2m21s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 21s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d7aefed0de
commit
a19c6abd26
16 files changed
+426
-34
No files matched your search
@@ -11,11 +11,17 @@ from data_layer import attention as dl_attention
|
||||
from data_layer import initiatives as dl_initiatives
|
||||
from data_layer import workspace as dl_workspace
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query
|
||||
from pydantic import BaseModel, Field
|
||||
from services import initiatives as initiative_service
|
||||
from tenant_context import TenantContext
|
||||
|
||||
router = APIRouter(prefix="/api/workspace", tags=["workspace"])
|
||||
|
||||
|
||||
class PortfolioReorderRequest(BaseModel):
|
||||
initiative_ids: list[str] = Field(min_length=1)
|
||||
|
||||
|
||||
def _require_actor_ctx(ctx: TenantContext) -> TenantContext:
|
||||
if not ctx.actor_id:
|
||||
raise HTTPException(status_code=400, detail="Kein Actor im TenantContext")
|
||||
@@ -88,3 +94,18 @@ def workspace_next_actions(
|
||||
ctx: TenantContext = Depends(require_capability("kairo.attention.read")),
|
||||
):
|
||||
return dl_attention.get_next_action_candidates(ctx, limit=limit or 10)
|
||||
|
||||
|
||||
@router.post("/portfolio/reorder")
|
||||
def workspace_portfolio_reorder(
|
||||
body: PortfolioReorderRequest,
|
||||
ctx: TenantContext = Depends(require_capability("kairo.initiative.manage")),
|
||||
):
|
||||
try:
|
||||
return initiative_service.reorder_portfolio(
|
||||
tenant_id=ctx.tenant_id,
|
||||
initiative_ids=body.initiative_ids,
|
||||
user_id=ctx.user_id,
|
||||
)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc)) from exc
|
||||
Reference in new issue
Block a user