@@ -1,8 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use domain::ports::{
|
||||
DiaryQuery, EventPublisher, MovieCommand, MovieProfileRepository, MovieQuery,
|
||||
ReviewRepository, SocialQueryPort,
|
||||
DiaryQuery, EventPublisher, MovieCommand, MovieProfileRepository, MovieQuery, ReviewRepository,
|
||||
SocialQueryPort,
|
||||
};
|
||||
|
||||
use crate::config::AppConfig;
|
||||
|
||||
@@ -13,7 +13,10 @@ pub async fn execute(
|
||||
) -> Result<GoalWithProgress, DomainError> {
|
||||
let user_id = UserId::from_uuid(cmd.user_id);
|
||||
|
||||
let existing = deps.goal_query.find_by_user_and_year(&user_id, cmd.year).await?;
|
||||
let existing = deps
|
||||
.goal_query
|
||||
.find_by_user_and_year(&user_id, cmd.year)
|
||||
.await?;
|
||||
if existing.is_some() {
|
||||
return Err(DomainError::ValidationError(
|
||||
"Goal already exists for this year".into(),
|
||||
|
||||
@@ -5,13 +5,13 @@ use domain::testing::{
|
||||
};
|
||||
use domain::{
|
||||
ports::{
|
||||
AuthService, DiaryExporter, DiaryQuery, DocumentParser, EventPublisher,
|
||||
GoalCommand, GoalQuery, ImportProfileRepository, ImportSessionRepository, MetadataClient,
|
||||
MovieCommand, MovieProfileRepository, MovieQuery, ObjectStorage, PasswordHasher,
|
||||
PersonCommand, PersonQuery, PosterFetcherClient, RefreshSessionRepository,
|
||||
ReviewRepository, SearchCommand, SearchPort, StatsRepository, UserProfileFieldsRepository,
|
||||
UserRepository, UserSettingsRepository, WatchEventCommand, WatchEventQuery,
|
||||
WatchlistRepository, WebhookTokenRepository, WrapUpRepository, WrapUpStatsQuery,
|
||||
AuthService, DiaryExporter, DiaryQuery, DocumentParser, EventPublisher, GoalCommand,
|
||||
GoalQuery, ImportProfileRepository, ImportSessionRepository, MetadataClient, MovieCommand,
|
||||
MovieProfileRepository, MovieQuery, ObjectStorage, PasswordHasher, PersonCommand,
|
||||
PersonQuery, PosterFetcherClient, RefreshSessionRepository, ReviewRepository,
|
||||
SearchCommand, SearchPort, StatsRepository, UserProfileFieldsRepository, UserRepository,
|
||||
UserSettingsRepository, WatchEventCommand, WatchEventQuery, WatchlistRepository,
|
||||
WebhookTokenRepository, WrapUpRepository, WrapUpStatsQuery,
|
||||
},
|
||||
testing::{
|
||||
FakeAuthService, FakeDiaryQuery, FakeDocumentParser, FakeMetadataClient,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use domain::ports::{
|
||||
DiaryQuery, EventPublisher, ObjectStorage, SocialQueryPort, StatsRepository,
|
||||
UserRepository,
|
||||
DiaryQuery, EventPublisher, ObjectStorage, SocialQueryPort, StatsRepository, UserRepository,
|
||||
};
|
||||
|
||||
pub struct GetProfileDeps {
|
||||
|
||||
Reference in New Issue
Block a user