2021-03-05 19:23:32 -05:00
|
|
|
defmodule Shift73k do
|
2020-09-12 18:43:17 -04:00
|
|
|
@moduledoc """
|
2021-03-05 19:23:32 -05:00
|
|
|
Shift73k keeps the contexts that define your domain
|
2020-09-12 18:43:17 -04:00
|
|
|
and business logic.
|
|
|
|
|
|
|
|
Contexts are also responsible for managing your data, regardless
|
|
|
|
if it comes from the database, an external API or others.
|
|
|
|
"""
|
2021-03-26 19:13:57 -04:00
|
|
|
|
|
|
|
@weekdays [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday]
|
|
|
|
|
2023-01-28 08:14:32 -05:00
|
|
|
defp get_app_config_env do
|
|
|
|
Application.get_env(:shift73k, :app_global_vars,
|
|
|
|
time_zone: "America/New_York",
|
|
|
|
allow_registration: :true,
|
|
|
|
mailer_reply_to: "admin@example.com",
|
|
|
|
mailer_from: {"Shift73k", "shift73k@example.com"}
|
|
|
|
)
|
|
|
|
end
|
2021-03-26 19:13:57 -04:00
|
|
|
|
|
|
|
def weekdays, do: @weekdays
|
2023-01-28 08:14:32 -05:00
|
|
|
|
|
|
|
def get_app_time_zone, do:
|
|
|
|
get_app_config_env() |> Keyword.fetch!(:time_zone) |> IO.inspect(label: "time_zone", pretty: :true)
|
|
|
|
|
|
|
|
def get_app_mailer_from, do:
|
|
|
|
get_app_config_env() |> Keyword.fetch!(:mailer_from) |> IO.inspect(label: "mailer_from", pretty: :true)
|
|
|
|
|
|
|
|
def get_app_mailer_reply_to, do:
|
|
|
|
get_app_config_env() |> Keyword.fetch!(:mailer_reply_to) |> IO.inspect(label: "mailer_reply_to", pretty: :true)
|
|
|
|
|
|
|
|
def get_app_allow_reg, do:
|
|
|
|
get_app_config_env() |> Keyword.fetch!(:allow_registration) |> get_app_allow_reg()
|
|
|
|
|> IO.inspect(label: "allow_registration", pretty: :true)
|
|
|
|
def get_app_allow_reg("false"), do: :false
|
|
|
|
def get_app_allow_reg(:false), do: :false
|
|
|
|
def get_app_allow_reg(_not_false), do: :true
|
2020-09-12 18:43:17 -04:00
|
|
|
end
|