fix: formatting
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Rafael Epplée 2025-07-02 15:56:00 +02:00
parent 35a8885267
commit db3485af66
No known key found for this signature in database
GPG key ID: B4EFE6DC59FAE118

View file

@ -77,25 +77,21 @@ defmodule Mv.Membership.Member do
where: [present(:join_date)],
message: "cannot be in the future"
# Exit date not before join date
validate compare(:exit_date, greater_than: :join_date),
where: [present([:join_date, :exit_date])],
message: "cannot be before join date"
# Phone number format (only if set)
validate match(:phone_number, ~r/^\+?[0-9\- ]{6,20}$/),
where: [present(:phone_number)],
message: "is not a valid phone number"
# Postal code format (only if set)
validate match(:postal_code, ~r/^\d{5}$/),
where: [present(:postal_code)],
message: "must consist of 5 digits"
# Email validation with EctoCommons.EmailValidator
validate fn changeset, _ ->
email = Ash.Changeset.get_attribute(changeset, :email)