pub trait NotificationPreferenceRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
preference: &'life1 NotificationPreference,
) -> Pin<Box<dyn Future<Output = Result<NotificationPreference, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<NotificationPreference>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_user_and_type<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
notification_type: NotificationType,
) -> Pin<Box<dyn Future<Output = Result<Option<NotificationPreference>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<NotificationPreference>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
preference: &'life1 NotificationPreference,
) -> Pin<Box<dyn Future<Output = Result<NotificationPreference, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_channel_enabled<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
notification_type: NotificationType,
channel: NotificationChannel,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_defaults_for_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<NotificationPreference>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
preference: &'life1 NotificationPreference,
) -> Pin<Box<dyn Future<Output = Result<NotificationPreference, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
preference: &'life1 NotificationPreference,
) -> Pin<Box<dyn Future<Output = Result<NotificationPreference, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new notification preference
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<NotificationPreference>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<NotificationPreference>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find preference by ID
Sourcefn find_by_user_and_type<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
notification_type: NotificationType,
) -> Pin<Box<dyn Future<Output = Result<Option<NotificationPreference>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_user_and_type<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
notification_type: NotificationType,
) -> Pin<Box<dyn Future<Output = Result<Option<NotificationPreference>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find preference by user and notification type
Sourcefn find_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<NotificationPreference>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<NotificationPreference>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all preferences for a user
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
preference: &'life1 NotificationPreference,
) -> Pin<Box<dyn Future<Output = Result<NotificationPreference, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
preference: &'life1 NotificationPreference,
) -> Pin<Box<dyn Future<Output = Result<NotificationPreference, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update preference
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete preference
Sourcefn is_channel_enabled<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
notification_type: NotificationType,
channel: NotificationChannel,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_channel_enabled<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
notification_type: NotificationType,
channel: NotificationChannel,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if user has enabled a specific channel for a notification type