use domain::models::SortDirection; use uuid::Uuid; pub struct GetDiaryQuery { pub limit: Option, pub offset: Option, pub sort_by: Option, pub movie_id: Option, pub user_id: Option, } pub struct GetReviewHistoryQuery { pub movie_id: Uuid, } pub struct GetActivityFeedQuery { pub limit: u32, pub offset: u32, pub sort_by: domain::ports::FeedSortBy, pub search: Option, pub following: Option, } pub struct GetUsersQuery; #[derive(Debug, Clone, Copy, Default)] pub enum ProfileView { History, Trends, Ratings, #[default] Recent, } impl ProfileView { pub fn as_str(&self) -> &'static str { match self { Self::History => "history", Self::Trends => "trends", Self::Ratings => "ratings", Self::Recent => "recent", } } } impl std::str::FromStr for ProfileView { type Err = String; fn from_str(s: &str) -> Result { match s { "history" => Ok(Self::History), "trends" => Ok(Self::Trends), "ratings" => Ok(Self::Ratings), "recent" => Ok(Self::Recent), other => Err(format!("unknown profile view: {other}")), } } } pub struct GetUserProfileQuery { pub user_id: Uuid, pub view: ProfileView, pub limit: Option, pub offset: Option, pub sort_by: domain::ports::FeedSortBy, pub search: Option, } pub struct GetMovieSocialPageQuery { pub movie_id: uuid::Uuid, pub limit: u32, pub offset: u32, }