Refactor: Simplify case directory structure
The distinction between `open/` and `done/` directories for cases has been removed. All cases for a user now reside directly under the user's directory (e.g., `<data_path>/<slug>/<case_id>/`). This simplifies path management and eliminates redundant directory traversals. Key changes include: - Removed `open/` and `done/` subdirectories in path resolution. - Introduced a `paths::case_dir` function as a single source of truth for case directory layout. - Updated various modules (`recovery`, `auth`, `routes`, `transcribe`, `tests`) to use the new path structure. - Adjusted templates to reflect the simplified case status representation.
This commit is contained in:
@@ -124,8 +124,8 @@ async fn cases_with_valid_cookie_shows_only_own_cases() {
|
||||
make_user("dr_b", "s"),
|
||||
]);
|
||||
// Seed fixtures: dr_a has an open case, dr_b has one too.
|
||||
let case_a = config.data_path.join("dr_a/open/11111111-1111-1111-1111-111111111111");
|
||||
let case_b = config.data_path.join("dr_b/open/22222222-2222-2222-2222-222222222222");
|
||||
let case_a = config.data_path.join("dr_a/11111111-1111-1111-1111-111111111111");
|
||||
let case_b = config.data_path.join("dr_b/22222222-2222-2222-2222-222222222222");
|
||||
std::fs::create_dir_all(&case_a).unwrap();
|
||||
std::fs::create_dir_all(&case_b).unwrap();
|
||||
std::fs::write(case_a.join("2026-04-14T10-00-00Z.m4a"), b"x").unwrap();
|
||||
@@ -159,7 +159,7 @@ async fn case_detail_of_foreign_case_returns_404() {
|
||||
make_user("dr_a", "s"),
|
||||
make_user("dr_b", "s"),
|
||||
]);
|
||||
let case_b = config.data_path.join("dr_b/open/22222222-2222-2222-2222-222222222222");
|
||||
let case_b = config.data_path.join("dr_b/22222222-2222-2222-2222-222222222222");
|
||||
std::fs::create_dir_all(&case_b).unwrap();
|
||||
std::fs::write(case_b.join("2026-04-14T11-00-00Z.m4a"), b"x").unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user