54 lines
1.3 KiB
Elixir
54 lines
1.3 KiB
Elixir
defmodule Mv.Constants do
|
|
@moduledoc """
|
|
Module for defining constants and atoms.
|
|
"""
|
|
|
|
@member_fields [
|
|
:first_name,
|
|
:last_name,
|
|
:email,
|
|
:join_date,
|
|
:exit_date,
|
|
:notes,
|
|
:city,
|
|
:street,
|
|
:house_number,
|
|
:postal_code,
|
|
:membership_fee_start_date
|
|
]
|
|
|
|
@custom_field_prefix "custom_field_"
|
|
|
|
@email_validator_checks [:html_input, :pow]
|
|
|
|
def member_fields, do: @member_fields
|
|
|
|
@doc """
|
|
Returns the prefix used for custom field keys in field visibility maps.
|
|
|
|
## Examples
|
|
|
|
iex> Mv.Constants.custom_field_prefix()
|
|
"custom_field_"
|
|
"""
|
|
def custom_field_prefix, do: @custom_field_prefix
|
|
|
|
@doc """
|
|
Returns the email validator checks used for EctoCommons.EmailValidator.
|
|
|
|
We use both `:html_input` and `:pow` checks:
|
|
- `:html_input` - Pragmatic validation matching browser `<input type="email">` behavior
|
|
- `:pow` - Stricter validation following email spec, supports internationalization (Unicode)
|
|
|
|
Using both ensures:
|
|
- Compatibility with common email providers (html_input)
|
|
- Compliance with email standards (pow)
|
|
- Support for international email addresses (pow)
|
|
|
|
## Examples
|
|
|
|
iex> Mv.Constants.email_validator_checks()
|
|
[:html_input, :pow]
|
|
"""
|
|
def email_validator_checks, do: @email_validator_checks
|
|
end
|