structural refactor and codebase improvements
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use domain::{
|
||||
errors::DomainError,
|
||||
ports::WatchlistRepository,
|
||||
value_objects::{MovieId, UserId},
|
||||
};
|
||||
|
||||
use crate::watchlist::deps::IsOnWatchlistDeps;
|
||||
use crate::watchlist::queries::IsOnWatchlistQuery;
|
||||
|
||||
pub async fn execute(
|
||||
watchlist: Arc<dyn WatchlistRepository>,
|
||||
deps: &IsOnWatchlistDeps,
|
||||
query: IsOnWatchlistQuery,
|
||||
) -> Result<bool, DomainError> {
|
||||
let user_id = UserId::from_uuid(query.user_id);
|
||||
let movie_id = MovieId::from_uuid(query.movie_id);
|
||||
watchlist.contains(&user_id, &movie_id).await
|
||||
deps.watchlist.contains(&user_id, &movie_id).await
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user