refactor: move AppContext to presentation crate, structurally enforce boundary
All checks were successful
CI / Check / Test (push) Successful in 39m33s
All checks were successful
CI / Check / Test (push) Successful in 39m33s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use domain::{errors::DomainError, models::GoalWithProgress, ports::GoalRepository, value_objects::UserId};
|
||||
use domain::{
|
||||
errors::DomainError, models::GoalWithProgress, ports::GoalRepository, value_objects::UserId,
|
||||
};
|
||||
|
||||
use super::queries::GetGoalQuery;
|
||||
|
||||
@@ -10,15 +12,11 @@ pub async fn execute(
|
||||
) -> Result<Option<GoalWithProgress>, DomainError> {
|
||||
let user_id = UserId::from_uuid(query.user_id);
|
||||
|
||||
let found = goal
|
||||
.find_by_user_and_year(&user_id, query.year)
|
||||
.await?;
|
||||
let found = goal.find_by_user_and_year(&user_id, query.year).await?;
|
||||
|
||||
let Some(g) = found else { return Ok(None) };
|
||||
|
||||
let current_count = goal
|
||||
.count_reviews_in_year(&user_id, query.year)
|
||||
.await?;
|
||||
let current_count = goal.count_reviews_in_year(&user_id, query.year).await?;
|
||||
|
||||
Ok(Some(GoalWithProgress {
|
||||
goal: g,
|
||||
|
||||
Reference in New Issue
Block a user