feat: Improve handling of association name config
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2026-05-07 12:13:45 +02:00
parent 605a897045
commit 2443bc62ac
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
9 changed files with 179 additions and 4 deletions

View file

@ -143,6 +143,27 @@ defmodule Mv.Config do
|> parse_and_validate_integer(default)
end
# ---------------------------------------------------------------------------
# Association name
# ENV variable takes priority; fallback to Settings from database.
# ---------------------------------------------------------------------------
@doc """
Returns the association name.
Reads from `ASSOCIATION_NAME` env first, then from Settings.
"""
@spec association_name() :: String.t() | nil
def association_name do
env_or_setting("ASSOCIATION_NAME", :club_name)
end
@doc """
Returns true if ASSOCIATION_NAME is set (field is read-only in Settings).
"""
@spec association_name_env_set?() :: boolean()
def association_name_env_set?, do: env_set?("ASSOCIATION_NAME")
# ---------------------------------------------------------------------------
# Vereinfacht accounting software integration
# ENV variables take priority; fallback to Settings from database.