Function resolve_alert

Source
pub async fn resolve_alert(
    pool: &Pool<MySql>,
    id: i64,
    user_id: i64,
    notes: Option<&str>,
) -> Result<Alert>
Expand description

Resolves an alert by a specific user.

This function updates the alert status to ‘resolved’, sets the resolved_at timestamp and resolved_by user ID, and creates a history record for the resolution.

§Arguments

  • pool - Database connection pool for executing the query
  • id - ID of the alert to resolve
  • user_id - ID of the user resolving the alert
  • notes - Optional notes about the resolution

§Returns

  • Ok(Alert) - Successfully resolved alert
  • Err(anyhow::Error) - Failed to resolve alert