feat: account deletion request and active-user check

This commit is contained in:
2026-10-26 02:11:44 +01:00
parent 83bb5d9847
commit 0b5d18c4ee
27 changed files with 577 additions and 151 deletions

View File

@@ -7,7 +7,7 @@ use bootstrap::Repositories;
use domain::{
errors::DomainError,
models::GeneratedToken,
ports::{AuthService, FollowGraphQuery, PersonQuery, SearchPort, UserRepository},
ports::{AuthService, PersonQuery, SearchPort, UserRepository},
testing::{
PanicAuthService, PanicDiaryExporter, PanicDiaryQuery, PanicDocumentParser,
PanicEventPublisher, PanicGoalCommand, PanicGoalQuery, PanicImportProfileRepository,
@@ -168,15 +168,15 @@ pub fn test_app_state_with_search_port(
build_test_state_from(repos, Arc::new(PanicAuthService))
}
/// Test state with `follow_graph` overridden BEFORE `build_deps` runs, so the
/// stub is visible from both `app_ctx.repos.follow_graph` and the prebuilt
/// `deps.social.query` that the social handlers actually read from.
pub fn test_app_state_with_follow_graph(
follow_graph: Arc<dyn FollowGraphQuery>,
/// Test state whose repositories are adjusted by `adjust` BEFORE `build_deps`
/// runs, for tests that need more than one stub swapped in (e.g. a follow graph
/// plus the live user that authenticated routes now look up).
pub fn test_app_state_with_repos(
adjust: impl FnOnce(&mut Repositories),
auth_service: Arc<dyn AuthService>,
) -> http_axum::state::AppState {
let mut repos = test_repositories();
repos.follow_graph = follow_graph;
adjust(&mut repos);
build_test_state_from(repos, auth_service)
}