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 queryid
- ID of the alert to resolveuser_id
- ID of the user resolving the alertnotes
- Optional notes about the resolution
§Returns
Ok(Alert)
- Successfully resolved alertErr(anyhow::Error)
- Failed to resolve alert