mirror of
https://github.com/ash-project/ash_double_entry.git
synced 2024-09-21 05:53:21 +12:00
17 lines
385 B
Elixir
17 lines
385 B
Elixir
defmodule AshDoubleEntry.Account.Transformers.AddStructure do
|
|
use Spark.Dsl.Transformer
|
|
|
|
def transform(dsl) do
|
|
dsl
|
|
|> Ash.Resource.Builder.add_attribute(:balance, :decimal,
|
|
allow_nil?: false,
|
|
default: Decimal.new(0),
|
|
writable?: false
|
|
)
|
|
|> Ash.Resource.Builder.add_attribute(
|
|
:currency,
|
|
:string,
|
|
allow_nil?: false
|
|
)
|
|
end
|
|
end
|