feat: Improve handling of association name config
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
605a897045
commit
2443bc62ac
9 changed files with 179 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue