Autogen registration UI.

This commit is contained in:
codevictory
2021-03-27 16:50:43 +02:00
parent 299b47ca56
commit da4ed0a6c1
13 changed files with 509 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
defmodule Runosaari.Registration.Performer do
use Ecto.Schema
import Ecto.Changeset
schema "performers" do
field :confirmed, :boolean, default: false
field :email, :string
field :fname, :string
field :lname, :string
field :notes, :string
field :performerId, :integer
field :tel, :string
timestamps()
end
@doc false
def changeset(performer, attrs) do
performer
|> cast(attrs, [:performerId, :fname, :lname, :email, :tel, :confirmed, :notes])
|> validate_required([:performerId, :fname, :lname, :email, :tel, :confirmed, :notes])
|> unique_constraint(:performerId)
|> unique_constraint(:email)
end
end