diff --git a/lib/towerops/accounts.ex b/lib/towerops/accounts.ex index 2e90e0e9..64bbb75a 100644 --- a/lib/towerops/accounts.ex +++ b/lib/towerops/accounts.ex @@ -103,12 +103,6 @@ defmodule Towerops.Accounts do @doc """ Returns an `%Ecto.Changeset{}` for tracking user registration changes. - - ## Examples - - iex> change_user_registration(user) - %Ecto.Changeset{data: %User{}} - """ @spec change_user_registration(User.t(), map()) :: Ecto.Changeset.t() def change_user_registration(%User{} = user, attrs \\ %{}) do @@ -117,15 +111,6 @@ defmodule Towerops.Accounts do @doc """ Registers a user with email and password. - - ## Examples - - iex> register_user(%{field: value}) - {:ok, %User{}} - - iex> register_user(%{field: bad_value}) - {:error, %Ecto.Changeset{}} - """ @spec register_user(map()) :: {:ok, User.t()} | {:error, Ecto.Changeset.t()} def register_user(attrs) do @@ -143,15 +128,6 @@ defmodule Towerops.Accounts do @doc """ Registers a user with email and password, and creates a default organization. - - ## Examples - - iex> register_user_with_organization(%{field: value}) - {:ok, %User{}} - - iex> register_user_with_organization(%{field: bad_value}) - {:error, %Ecto.Changeset{}} - """ @spec register_user_with_organization(map()) :: {:ok, User.t()} | {:error, Ecto.Changeset.t()} def register_user_with_organization(attrs) do @@ -199,12 +175,6 @@ defmodule Towerops.Accounts do @doc """ Returns an `%Ecto.Changeset{}` for changing the user profile. - - ## Examples - - iex> change_user_profile(user) - %Ecto.Changeset{data: %User{}} - """ def change_user_profile(user, attrs \\ %{}) do User.profile_changeset(user, attrs) @@ -212,15 +182,6 @@ defmodule Towerops.Accounts do @doc """ Updates the user profile. - - ## Examples - - iex> update_user_profile(user, %{name: ...}) - {:ok, %User{}} - - iex> update_user_profile(user, %{name: bad_value}) - {:error, %Ecto.Changeset{}} - """ def update_user_profile(user, attrs) do user @@ -246,11 +207,6 @@ defmodule Towerops.Accounts do Grants sudo mode to a user by updating their last_sudo_at timestamp. Returns `{:ok, user}` on success or `{:error, changeset}` on failure. - - ## Examples - - iex> grant_sudo_mode(user) - {:ok, %User{last_sudo_at: ~U[2026-02-01 12:00:00Z]}} """ def grant_sudo_mode(%User{} = user) do now = Towerops.Time.now() diff --git a/test/towerops/accounts_test.exs b/test/towerops/accounts_test.exs index 6eee5255..5f639825 100644 --- a/test/towerops/accounts_test.exs +++ b/test/towerops/accounts_test.exs @@ -1127,8 +1127,8 @@ defmodule Towerops.AccountsTest do test "returns active consent for user and type" do user = user_fixture() # user_fixture already grants consents during registration - assert %{consent_type: consent_type} = Accounts.get_active_consent(user.id, "privacy_policy") - assert consent_type == "privacy_policy" + active = Accounts.get_active_consent(user.id, "privacy_policy") + assert active.consent_type == "privacy_policy" assert is_nil(active.revoked_at) end