refactor: adds schemales changeset and validation constant

This commit is contained in:
carla 2026-01-19 11:43:51 +01:00
parent 14a8417fdf
commit 7da037d81d
6 changed files with 158 additions and 34 deletions

View file

@ -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