26 lines
521 B
Elixir
26 lines
521 B
Elixir
defmodule Mv.Accounts.User do
|
|
use Ash.Resource,
|
|
domain: Mv.Accounts,
|
|
data_layer: AshPostgres.DataLayer
|
|
|
|
postgres do
|
|
table("users")
|
|
repo(Mv.Repo)
|
|
end
|
|
|
|
attributes do
|
|
uuid_primary_key(:id)
|
|
|
|
attribute(:email, :string, allow_nil?: true, public?: true)
|
|
attribute(:password_hash, :string, sensitive?: true)
|
|
attribute(:oicd_id, :string)
|
|
end
|
|
|
|
actions do
|
|
defaults([:read, :destroy, :create, :update])
|
|
end
|
|
|
|
relationships do
|
|
belongs_to(:member, Mv.Membership.Member)
|
|
end
|
|
end
|