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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user