From 580d1d2d666a41daf526b6ed32a5fed72780ee51 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Thu, 6 Mar 2025 21:50:27 +0200 Subject: [PATCH] Add interfaces for Author and AuthorAliasRegistry. --- lib/decentralised_book_index/metadata.ex | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/decentralised_book_index/metadata.ex b/lib/decentralised_book_index/metadata.ex index 4ba3238..c64ef4b 100644 --- a/lib/decentralised_book_index/metadata.ex +++ b/lib/decentralised_book_index/metadata.ex @@ -4,7 +4,24 @@ defmodule DecentralisedBookIndex.Metadata do resources do resource DecentralisedBookIndex.Metadata.Book - resource DecentralisedBookIndex.Metadata.Author + + resource DecentralisedBookIndex.Metadata.Author do + define :create_author, action: :create, args: [:name, :description, :author_alias_registry_id] + define :add_author_to_alias_registry, action: :add_author_to_alias_registry, args: [:author_alias_registry_id] + define :list_authors, action: :read + define :get_author_by_id, args: [:id], action: :by_id + 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 end end