Zeige im Breadcrumb die Aktenstruktur und lass Kapitel samt Inhalt an ihren Ort ziehen.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
cafa4e8b92
commit
7ef73ad500
12 files changed
+627
-93
No files matched your search
@@ -42,7 +42,9 @@ from app.api.schemas import (
|
||||
CaseIn,
|
||||
CaseLinkIn,
|
||||
CasePatch,
|
||||
ChapterDateIn,
|
||||
ChapterIn,
|
||||
ChapterOrderIn,
|
||||
CrossLinkIn,
|
||||
DeadlineIn,
|
||||
DeadlinePatch,
|
||||
@@ -79,7 +81,7 @@ from app.auth.security import (
|
||||
verify_password,
|
||||
)
|
||||
from app.core.errors import Problem, forbidden, not_found, too_many, unprocessable
|
||||
from app.core.timeutil import dump_dt, utcnow
|
||||
from app.core.timeutil import dump_date, dump_dt, utcnow
|
||||
from app.media.storage import content_disposition, read_bytes
|
||||
from app.media.storage import asset_path
|
||||
from app.ops import (
|
||||
@@ -109,6 +111,8 @@ from app.ops import (
|
||||
revoke_grant,
|
||||
move_binding_chapter,
|
||||
reorder_bindings,
|
||||
reorder_chapters,
|
||||
set_chapter_date,
|
||||
set_content_order,
|
||||
set_exception,
|
||||
unlink_matter_case,
|
||||
@@ -565,8 +569,22 @@ def post_case_chapter(
|
||||
principal: Principal = Depends(get_principal),
|
||||
conn: Connection = Depends(get_conn),
|
||||
):
|
||||
row = create_chapter(conn, principal.account_id, "case", case_id, body.title, body.position, None)
|
||||
return _created(f"/api/v1/cases/{case_id}/chapters/{row['id']}", {"id": str(row["id"]), "title": row["title"], "position": row["position"]})
|
||||
row = create_chapter(conn, principal.account_id, "case", case_id, body.title, body.position, None, body.document_on)
|
||||
return _created(
|
||||
f"/api/v1/cases/{case_id}/chapters/{row['id']}",
|
||||
{"id": str(row["id"]), "title": row["title"], "position": row["position"], "document_on": dump_date(row["document_on"])},
|
||||
)
|
||||
|
||||
|
||||
@router.post("/api/v1/cases/{case_id}/chapters/order")
|
||||
def post_case_chapter_order(
|
||||
case_id: UUID,
|
||||
body: ChapterOrderIn,
|
||||
principal: Principal = Depends(get_principal),
|
||||
conn: Connection = Depends(get_conn),
|
||||
):
|
||||
version = reorder_chapters(conn, principal.account_id, "case", case_id, body.expected_version, body.chapter_ids, None)
|
||||
return {"version": version}
|
||||
|
||||
|
||||
@router.post("/api/v1/cases/{case_id}/grants")
|
||||
@@ -640,13 +658,41 @@ def post_matter_chapter(
|
||||
conn: Connection = Depends(get_conn),
|
||||
):
|
||||
context = parse_query_context(context_kind, context_id)
|
||||
row = create_chapter(conn, principal.account_id, "matter", matter_id, body.title, body.position, context)
|
||||
row = create_chapter(
|
||||
conn, principal.account_id, "matter", matter_id, body.title, body.position, context, body.document_on
|
||||
)
|
||||
return _created(
|
||||
f"/api/v1/matters/{matter_id}/chapters/{row['id']}",
|
||||
{"id": str(row["id"]), "title": row["title"], "position": row["position"]},
|
||||
{"id": str(row["id"]), "title": row["title"], "position": row["position"], "document_on": dump_date(row["document_on"])},
|
||||
)
|
||||
|
||||
|
||||
@router.post("/api/v1/matters/{matter_id}/chapters/order")
|
||||
def post_matter_chapter_order(
|
||||
matter_id: UUID,
|
||||
body: ChapterOrderIn,
|
||||
principal: Principal = Depends(get_principal),
|
||||
conn: Connection = Depends(get_conn),
|
||||
):
|
||||
version = reorder_chapters(
|
||||
conn, principal.account_id, "matter", matter_id, body.expected_version, body.chapter_ids, _ctx_model(body.context)
|
||||
)
|
||||
return {"version": version}
|
||||
|
||||
|
||||
@router.patch("/api/v1/chapters/{chapter_id}")
|
||||
def patch_chapter_date(
|
||||
chapter_id: UUID,
|
||||
body: ChapterDateIn,
|
||||
principal: Principal = Depends(get_principal),
|
||||
conn: Connection = Depends(get_conn),
|
||||
):
|
||||
version = set_chapter_date(
|
||||
conn, principal.account_id, chapter_id, body.expected_version, body.document_on, _ctx_model(body.context)
|
||||
)
|
||||
return {"version": version, "document_on": dump_date(body.document_on)}
|
||||
|
||||
|
||||
@router.post("/api/v1/matters/{matter_id}/case-links")
|
||||
def post_case_link(
|
||||
matter_id: UUID,
|
||||
|
||||
Reference in new issue
Block a user