defmodule Scribble.EmailHandler.User do
use Ash.Resource
use Ash.Resource, data_layer: Ash.DataLayer.Ets
actions do
defaults [:create, :read]
end
attributes do
uuid_primary_key :id
attribute :email, :string, allow_nil?: false
attribute :name, :string, allow_nil?: false
attribute :reply_email, :string
create_timestamp :inserted_at
update_timestamp :updated_at
end
calculations do
calculate :response_email, :string, expr(reply_email || email)
end
end
defmodule Scribble.EmailHandler.User do
use Ash.Resource
use Ash.Resource, data_layer: Ash.DataLayer.Ets
actions do
defaults [:create, :read]
end
attributes do
uuid_primary_key :id
attribute :email, :string, allow_nil?: false
attribute :name, :string, allow_nil?: false
attribute :reply_email, :string
create_timestamp :inserted_at
update_timestamp :updated_at
end
calculations do
calculate :response_email, :string, expr(reply_email || email)
end
end