defmodule Towerops.BeaconsFixtures do @moduledoc """ This module defines test helpers for creating entities via the `Towerops.Beacons` context. """ @doc """ Creates a beacon monitor fixture. Accepts optional attrs to override defaults. Requires `organization_id` and `user_id` to be provided. """ def beacon_monitor_fixture(organization_id, user_id, attrs \\ %{}) do defaults = %{ name: "Test Beacon #{System.unique_integer()}", check_type: "http", target_url: "https://example.com", organization_id: organization_id, user_id: user_id, interval_seconds: 60, timeout_ms: 5000 } {:ok, beacon} = Towerops.Beacons.create_beacon(Map.merge(defaults, attrs)) beacon end end