feat: Add case closing and document viewing routes

Adds API endpoints for closing a case, which triggers an analysis job,
and for viewing the generated document.

This also includes:
- New `AppError` variants: `Conflict` and `ServiceUnavailable`.
- Helper functions for file handling, date parsing, and document
  searching.
- Unit tests for helper functions.
This commit is contained in:
2026-04-15 19:22:25 +02:00
parent aa6b8fd798
commit aed4cd59d3
4 changed files with 312 additions and 2 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ pub async fn handle_case_detail(
/// Locate a case directory under `<user_root>/{open|done}/<case_id>`.
/// Returns the path and the status bucket it was found in.
async fn locate_case(user_root: &Path, case_id: &str) -> Option<(std::path::PathBuf, String)> {
pub(crate) async fn locate_case(user_root: &Path, case_id: &str) -> Option<(std::path::PathBuf, String)> {
for status in ["open", "done"] {
let p = user_root.join(status).join(case_id);
if tokio::fs::try_exists(&p).await.unwrap_or(false) {