type.ex (4000B)
1 # Zenflows is designed to implement the Valueflows vocabulary, 2 # written and maintained by srfsh <info@dyne.org>. 3 # Copyright (C) 2021-2023 Dyne.org foundation <foundation@dyne.org>. 4 # 5 # This program is free software: you can redistribute it and/or modify 6 # it under the terms of the GNU Affero General Public License as published by 7 # the Free Software Foundation, either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU Affero General Public License for more details. 14 # 15 # You should have received a copy of the GNU Affero General Public License 16 # along with this program. If not, see <https://www.gnu.org/licenses/>. 17 18 defmodule Zenflows.VF.RecipeProcess.Type do 19 @moduledoc false 20 21 use Absinthe.Schema.Notation 22 23 alias Zenflows.VF.RecipeProcess.Resolv 24 25 @name """ 26 An informal or formal textual identifier for a recipe process. Does not 27 imply uniqueness. 28 """ 29 @has_duration """ 30 The planned calendar duration of the process as defined for the recipe 31 batch. 32 """ 33 @process_classified_as """ 34 References a concept in a common taxonomy or other classification scheme 35 for purposes of categorization. 36 """ 37 @process_conforms_to """ 38 The standard specification or definition of a process. 39 """ 40 @process_conforms_to_id "(`ProcesssSpecification`) #{@process_conforms_to}" 41 @note "A textual description or comment." 42 43 @desc "Specifies a process in a recipe for use in planning from recipe." 44 object :recipe_process do 45 field :id, non_null(:id) 46 47 @desc @name 48 field :name, non_null(:string) 49 50 @desc @has_duration 51 field :has_duration, :duration, resolve: &Resolv.has_duration/3 52 53 @desc @process_classified_as 54 field :process_classified_as, list_of(non_null(:uri)) 55 56 @desc @process_conforms_to 57 field :process_conforms_to, non_null(:process_specification), 58 resolve: &Resolv.process_conforms_to/3 59 60 @desc @note 61 field :note, :string 62 end 63 64 input_object :recipe_process_create_params do 65 @desc @name 66 field :name, non_null(:string) 67 68 @desc @has_duration 69 field :has_duration, :iduration 70 71 @desc @process_classified_as 72 field :process_classified_as, list_of(non_null(:uri)) 73 74 @desc @process_conforms_to_id 75 field :process_conforms_to_id, non_null(:id), name: "process_conforms_to" 76 77 @desc @note 78 field :note, :string 79 end 80 81 input_object :recipe_process_update_params do 82 field :id, non_null(:id) 83 84 @desc @name 85 field :name, :string 86 87 @desc @has_duration 88 field :has_duration, :iduration 89 90 @desc @process_classified_as 91 field :process_classified_as, list_of(non_null(:uri)) 92 93 @desc @process_conforms_to_id 94 field :process_conforms_to_id, :id, name: "process_conforms_to" 95 96 @desc @note 97 field :note, :string 98 end 99 100 object :recipe_process_response do 101 field :recipe_process, non_null(:recipe_process) 102 end 103 104 object :recipe_process_edge do 105 field :cursor, non_null(:id) 106 field :node, non_null(:recipe_process) 107 end 108 109 object :recipe_process_connection do 110 field :page_info, non_null(:page_info) 111 field :edges, non_null(list_of(non_null(:recipe_process_edge))) 112 end 113 114 object :query_recipe_process do 115 field :recipe_process, :recipe_process do 116 arg :id, non_null(:id) 117 resolve &Resolv.recipe_process/2 118 end 119 120 field :recipe_processes, :recipe_process_connection do 121 arg :first, :integer 122 arg :after, :id 123 arg :last, :integer 124 arg :before, :id 125 resolve &Resolv.recipe_processes/2 126 end 127 end 128 129 object :mutation_recipe_process do 130 field :create_recipe_process, non_null(:recipe_process_response) do 131 arg :recipe_process, non_null(:recipe_process_create_params) 132 resolve &Resolv.create_recipe_process/2 133 end 134 135 field :update_recipe_process, non_null(:recipe_process_response) do 136 arg :recipe_process, non_null(:recipe_process_update_params) 137 resolve &Resolv.update_recipe_process/2 138 end 139 140 field :delete_recipe_process, non_null(:boolean) do 141 arg :id, non_null(:id) 142 resolve &Resolv.delete_recipe_process/2 143 end 144 end 145 end