You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.3 KiB
59 lines
2.3 KiB
defmodule DecentralisedBookIndex.Metadata do
|
|
use Ash.Domain,
|
|
otp_app: :decentralised_book_index
|
|
|
|
resources do
|
|
resource DecentralisedBookIndex.Metadata.Book do
|
|
define :create_book,
|
|
action: :create,
|
|
args: [:title, :isbn, :description, :author_roles, {:optional, :book_editions_registry_id}]
|
|
|
|
define :add_book_to_related_editions_registry,
|
|
action: :add_book_to_related_editions_registry,
|
|
args: [:title, :isbn, :description, :author_roles, :related_book_id]
|
|
|
|
define :list_books, action: :read
|
|
define :get_book_by_id, args: [:id], action: :by_id
|
|
define :get_book_alternative_editions, args: [:book], action: :get_alternative_editions
|
|
define :update_book, action: :update
|
|
define :destroy_book, action: :destroy
|
|
end
|
|
|
|
resource DecentralisedBookIndex.Metadata.Author do
|
|
define :create_author,
|
|
action: :create,
|
|
args: [:name, :description, {:optional, :author_alias_registry_id}]
|
|
|
|
define :add_author_to_related_alias_registry,
|
|
action: :add_author_to_related_alias_registry,
|
|
args: [:name, :description, :related_author_id]
|
|
|
|
define :list_authors, action: :read
|
|
define :get_author_by_id, args: [:id], action: :by_id
|
|
define :get_author_alternative_names, args: [:author], action: :get_alternative_names
|
|
define :update_author, action: :update
|
|
define :destroy_author, action: :destroy
|
|
end
|
|
|
|
resource DecentralisedBookIndex.Metadata.DBIServer
|
|
|
|
resource DecentralisedBookIndex.Metadata.AuthorAliasRegistry do
|
|
define :create_author_alias_registry, action: :create
|
|
define :list_author_alias_registries, action: :read
|
|
define :get_author_alias_registry_by_id, args: [:id], action: :by_id
|
|
define :update_author_alias_registry, action: :update
|
|
define :destroy_author_alias_registry, action: :destroy
|
|
end
|
|
|
|
resource DecentralisedBookIndex.Metadata.BookEditionsRegistry do
|
|
define :create_book_editions_registry, action: :create
|
|
define :list_book_editions_registries, action: :read
|
|
define :get_book_editions_registry_by_id, args: [:id], action: :by_id
|
|
define :update_book_editions_registry, action: :update
|
|
define :destroy_book_editions_registry, action: :destroy
|
|
end
|
|
|
|
resource DecentralisedBookIndex.Metadata.AuthorRole
|
|
end
|
|
end
|