Add admin-only case reset functionality

Introduce a new "reset" action for bulk operations and a dedicated
endpoint for individual case resets. These features allow administrators
to revert a case to its raw audio state by deleting derived artifacts
like transcripts, analysis input, and documents. The functionality also
includes renaming `.m4a.failed` files back to `.m4a` to re-trigger
transcription.

This commit also:
- Adds a `reset_case_artefacts` helper function to `case_actions.rs`.
- Implements the `handle_reset_case` endpoint.
- Adds the "Reset" button to the UI for administrators.
- Includes unit and integration tests to verify the new functionality
  and access control.
This commit is contained in:
2026-04-16 11:27:55 +02:00
parent bbc9b53609
commit b2b1368902
8 changed files with 261 additions and 2 deletions
+4
View File
@@ -29,6 +29,10 @@ pub fn api_router() -> Router<AppState> {
"/web/cases/{case_id}/delete",
post(case_actions::handle_delete_case),
)
.route(
"/web/cases/{case_id}/reset",
post(case_actions::handle_reset_case),
)
.route(
"/web/cases/undo-delete",
post(case_actions::handle_undo_delete),