Function create_notification_acknowledgment

Source
pub async fn create_notification_acknowledgment(
    pool: &Pool<MySql>,
    user_id: i64,
    notification_id: Option<i64>,
    role_notification_id: Option<i64>,
) -> Result<NotificationAcknowledgment>
Expand description

Creates a notification acknowledgment for a user.

This function records that a user has acknowledged a notification, which is useful for role-based notifications that need individual tracking.

§Arguments

  • pool - Database connection pool for executing the query
  • user_id - ID of the user acknowledging the notification
  • notification_id - Optional ID of a user notification being acknowledged
  • role_notification_id - Optional ID of a role notification being acknowledged

§Returns

  • Ok(NotificationAcknowledgment) - Successfully created acknowledgment
  • Err(anyhow::Error) - Failed to create acknowledgment