Function get_user_role_notifications

Source
pub async fn get_user_role_notifications(
    pool: &Pool<MySql>,
    user_id: i64,
    page: i64,
    per_page: i64,
) -> Result<Vec<UserNotificationWithRoleNotifications>>
Expand description

Retrieves all role notifications for a user with acknowledgment status.

This function fetches role notifications for all roles a user has, along with information about whether the user has acknowledged each notification.

§Arguments

  • pool - Database connection pool for executing the query
  • user_id - ID of the user
  • page - Zero-based page number
  • per_page - Number of records to fetch per page

§Returns

  • Ok(Vec<RoleNotificationWithAcknowledgment>) - Successfully retrieved notifications with acknowledgment status
  • Err(anyhow::Error) - Failed to fetch notifications