defmodule Towerops.Workers.StaleViolationCleanupWorker do
  @moduledoc """
  Daily Oban cron worker that deletes old non-permanent violation records.

  Removes records older than 90 days with offense_count < 3.
  Permanent bans are retained indefinitely for audit purposes.
  """

  use Oban.Worker, queue: :maintenance

  alias Towerops.Security.BruteForce

  @impl Oban.Worker
  def perform(_job) do
    BruteForce.delete_stale_violations()
    :ok
  end
end
