refactor: adds schemales changeset and validation constant
This commit is contained in:
parent
14a8417fdf
commit
7da037d81d
6 changed files with 158 additions and 34 deletions
|
|
@ -19,6 +19,8 @@ defmodule Mv.Constants do
|
|||
|
||||
@custom_field_prefix "custom_field_"
|
||||
|
||||
@email_validator_checks [:html_input, :pow]
|
||||
|
||||
def member_fields, do: @member_fields
|
||||
|
||||
@doc """
|
||||
|
|
@ -30,4 +32,23 @@ defmodule Mv.Constants do
|
|||
"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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue