defmodule Towerops.IntegrationsFixtures do
  @moduledoc """
  Test helpers for creating integration entities.
  """

  alias Towerops.Integrations

  def integration_fixture(organization_id, attrs \\ %{}) do
    attrs =
      Enum.into(attrs, %{
        provider: "preseem",
        enabled: true,
        credentials: %{"api_key" => "test-key-#{System.unique_integer()}"}
      })

    {:ok, integration} = Integrations.create_integration(organization_id, attrs)
    integration
  end
end
