Mache die Inhaltsliste zur einen Arbeitsflaeche mit Vorschauzeilen, damit Pfad, Herkunft und eigene Reihenfolge im Alltag erhalten bleiben.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
52bda91aad
commit
3465ed57f6
16 files changed
+1375
-314
No files matched your search
@@ -58,12 +58,14 @@ from app.api.schemas import (
|
||||
MemberIn,
|
||||
BindingOrderIn,
|
||||
ContentOrderIn,
|
||||
ChapterMoveIn,
|
||||
DatesPatch,
|
||||
NoteIn,
|
||||
NotePatch,
|
||||
RoomIn,
|
||||
ScopeIn,
|
||||
TaskDeadlineIn,
|
||||
SummaryPatch,
|
||||
TaskIn,
|
||||
TaskPatch,
|
||||
)
|
||||
@@ -105,12 +107,14 @@ from app.ops import (
|
||||
patch_matter,
|
||||
patch_task,
|
||||
revoke_grant,
|
||||
move_binding_chapter,
|
||||
reorder_bindings,
|
||||
set_content_order,
|
||||
set_exception,
|
||||
unlink_matter_case,
|
||||
update_dates,
|
||||
update_note,
|
||||
update_summary,
|
||||
)
|
||||
from app.present import (
|
||||
LABELS,
|
||||
@@ -512,6 +516,12 @@ def cases(principal: Principal = Depends(get_principal), conn: Connection = Depe
|
||||
for case, rights in list_cases(conn, principal.account_id):
|
||||
summary = case_summary(case, rights)
|
||||
summary["home_scope_name"] = room_name(conn, case["home_scope_id"])
|
||||
summary["kind_label"] = "Unterakte" if case["parent_case_id"] else "Akte"
|
||||
summary["parent_title"] = None
|
||||
if case["parent_case_id"]:
|
||||
parent = get_case(conn, case["parent_case_id"])
|
||||
if parent is not None and case_rights(conn, principal.account_id, parent).read:
|
||||
summary["parent_title"] = parent["title"]
|
||||
items.append(summary)
|
||||
return {"items": items, "next_cursor": None}
|
||||
|
||||
@@ -1236,6 +1246,42 @@ def patch_element_dates(
|
||||
return {"id": str(element["id"]), "version": element["version"]}
|
||||
|
||||
|
||||
@router.patch("/api/v1/elements/{element_id}/summary")
|
||||
def patch_element_summary(
|
||||
element_id: UUID,
|
||||
body: SummaryPatch,
|
||||
principal: Principal = Depends(get_principal),
|
||||
conn: Connection = Depends(get_conn),
|
||||
):
|
||||
element = update_summary(
|
||||
conn,
|
||||
principal.account_id,
|
||||
element_id,
|
||||
body.expected_version,
|
||||
body.summary,
|
||||
_ctx_model(body.context),
|
||||
)
|
||||
return {"id": str(element["id"]), "version": element["version"], "summary": element["summary"]}
|
||||
|
||||
|
||||
@router.patch("/api/v1/bindings/{binding_id}/chapter")
|
||||
def patch_binding_chapter(
|
||||
binding_id: UUID,
|
||||
body: ChapterMoveIn,
|
||||
principal: Principal = Depends(get_principal),
|
||||
conn: Connection = Depends(get_conn),
|
||||
):
|
||||
version = move_binding_chapter(
|
||||
conn,
|
||||
principal.account_id,
|
||||
binding_id,
|
||||
body.expected_version,
|
||||
body.chapter_id,
|
||||
_ctx_model(body.context),
|
||||
)
|
||||
return {"version": version}
|
||||
|
||||
|
||||
@router.get("/api/v1/cases/{case_id}/course")
|
||||
def case_course(case_id: UUID, principal: Principal = Depends(get_principal), conn: Connection = Depends(get_conn)):
|
||||
case, rights = require_case(conn, principal.account_id, case_id, "read")
|
||||
|
||||
@@ -156,6 +156,18 @@ class DatesPatch(APIModel):
|
||||
context: ContextIn | None = None
|
||||
|
||||
|
||||
class SummaryPatch(APIModel):
|
||||
expected_version: int = Field(ge=1)
|
||||
summary: str | None = Field(default=None, max_length=400)
|
||||
context: ContextIn | None = None
|
||||
|
||||
|
||||
class ChapterMoveIn(APIModel):
|
||||
expected_version: int = Field(ge=1)
|
||||
chapter_id: UUID | None = None
|
||||
context: ContextIn | None = None
|
||||
|
||||
|
||||
class NotePatch(APIModel):
|
||||
expected_version: int = Field(ge=1)
|
||||
document: DocumentIn
|
||||
|
||||
Reference in new issue
Block a user