adding favorite feature

This commit is contained in:
DioCrafts
2025-04-02 03:43:44 +02:00
parent 705cb5b069
commit 7069a54d8d
21 changed files with 1395 additions and 8 deletions
+19
View File
@@ -0,0 +1,19 @@
use async_trait::async_trait;
use crate::common::errors::Result;
use crate::application::dtos::favorites_dto::FavoriteItemDto;
/// Defines operations for managing user favorites
#[async_trait]
pub trait FavoritesUseCase: Send + Sync {
/// Get all favorites for a user
async fn get_favorites(&self, user_id: &str) -> Result<Vec<FavoriteItemDto>>;
/// Add an item to user's favorites
async fn add_to_favorites(&self, user_id: &str, item_id: &str, item_type: &str) -> Result<()>;
/// Remove an item from user's favorites
async fn remove_from_favorites(&self, user_id: &str, item_id: &str, item_type: &str) -> Result<bool>;
/// Check if an item is in user's favorites
async fn is_favorite(&self, user_id: &str, item_id: &str, item_type: &str) -> Result<bool>;
}
+2 -1
View File
@@ -4,4 +4,5 @@ pub mod file_ports;
pub mod storage_ports;
pub mod auth_ports;
pub mod trash_ports;
pub mod share_ports;
pub mod share_ports;
pub mod favorites_ports;