refactor(goals): scoped Arc deps instead of AppContext

This commit is contained in:
2026-06-11 21:36:11 +02:00
parent 2b295e10ba
commit f006ba00a8
12 changed files with 143 additions and 110 deletions

View File

@@ -5,9 +5,9 @@ use crate::test_helpers::TestContextBuilder;
#[tokio::test]
async fn returns_empty_when_no_goals() {
let ctx = TestContextBuilder::new().build();
let b = TestContextBuilder::new();
let result = list::execute(
&ctx,
b.goal_repo.clone(),
ListGoalsQuery {
user_id: Uuid::nil(),
},
@@ -20,10 +20,11 @@ async fn returns_empty_when_no_goals() {
#[tokio::test]
async fn returns_all_goals_for_user() {
let ctx = TestContextBuilder::new().build();
let b = TestContextBuilder::new();
for year in [2023, 2024, 2025] {
create::execute(
&ctx,
b.goal_repo.clone(),
b.event_publisher.clone(),
CreateGoalCommand {
user_id: Uuid::nil(),
year,
@@ -35,7 +36,7 @@ async fn returns_all_goals_for_user() {
}
let result = list::execute(
&ctx,
b.goal_repo.clone(),
ListGoalsQuery {
user_id: Uuid::nil(),
},