feat: add POST /web/cases/purge-closed for bulk hard-delete

Iterates the user's data dir and removes every case directory that
carries a .closed marker. Requires form field confirm=yes as a server-
side guard against accidental browser-history re-POSTs. Emits CasePurged
per successfully removed case; per-case failures are logged but do not
abort the sweep.

UI button is deferred to the show-closed step so the endpoint is only
reachable after an explicit navigation. Three integration tests cover
the happy path, missing-confirm, and coexistence with open cases.
This commit is contained in:
2026-04-21 10:46:07 +02:00
parent 396565a571
commit 8173ff2f26
4 changed files with 173 additions and 1 deletions
+1
View File
@@ -32,6 +32,7 @@ pub enum CaseEventKind {
DocumentReady,
CaseClosed,
CaseReopened,
CasePurged,
CaseReset,
}