mirror of
https://github.com/ash-project/ash_double_entry.git
synced 2024-09-19 13:03:19 +12:00
improvement: accept attributes on transfer create
ci: dependabot only weekly
This commit is contained in:
parent
1d732a0c6c
commit
2a961a486d
3 changed files with 17 additions and 5 deletions
14
.github/dependabot.yml
vendored
14
.github/dependabot.yml
vendored
|
@ -1,6 +1,12 @@
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: mix
|
- package-ecosystem: mix
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: weekly
|
||||||
|
day: thursday
|
||||||
|
groups:
|
||||||
|
production-dependencies:
|
||||||
|
dependency-type: production
|
||||||
|
dev-dependencies:
|
||||||
|
dependency-type: development
|
||||||
|
|
|
@ -18,6 +18,10 @@ defmodule AshDoubleEntry.Transfer do
|
||||||
balance_resource: [
|
balance_resource: [
|
||||||
type: {:spark, Ash.Resource},
|
type: {:spark, Ash.Resource},
|
||||||
doc: "The resource being used for balances"
|
doc: "The resource being used for balances"
|
||||||
|
],
|
||||||
|
create_accept: [
|
||||||
|
type: {:wrap_list, :atom},
|
||||||
|
doc: "Additional attributes to accept when creating a transfer"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,9 @@ defmodule AshDoubleEntry.Transfer.Transformers.AddStructure do
|
||||||
attribute_writable?: true
|
attribute_writable?: true
|
||||||
)
|
)
|
||||||
|> Ash.Resource.Builder.add_action(:create, :transfer,
|
|> Ash.Resource.Builder.add_action(:create, :transfer,
|
||||||
accept: [:amount, :timestamp, :from_account_id, :to_account_id]
|
accept:
|
||||||
|
[:amount, :timestamp, :from_account_id, :to_account_id] ++
|
||||||
|
AshDoubleEntry.Transfer.Info.transfer_create_accept!(dsl)
|
||||||
)
|
)
|
||||||
|> Ash.Resource.Builder.add_action(:read, :read_transfers,
|
|> Ash.Resource.Builder.add_action(:read, :read_transfers,
|
||||||
pagination: Ash.Resource.Builder.build_pagination(keyset?: true)
|
pagination: Ash.Resource.Builder.build_pagination(keyset?: true)
|
||||||
|
|
Loading…
Reference in a new issue