# frozen_string_literal: true class Core::UseCases::<%= [@route_scope_class, @scope_class, @use_case_class].reject { |c| c.empty? }.join("::") %> < RiderKick::UseCases::AbstractUseCase contract do params(Core::UseCases::Contract::Default.new.call) do <% @contract_create.each do |field| -%> <%if field.include?(":#{@resource_owner_id}") -%> <% if @resource_owner_id.present? -%> required(:<%= @resource_owner_id %>).filled(:string) <% else -%> <%= field %> <% end -%> <% end -%> <% end -%> end end # Set specific return monads at method 'result' include Dry::Monads::Do.for(:result) def result params = yield build_parameter! Core::Repositories::<%= @scope_class%>::<%= @repository_class%>.new(params: params).call(builder: true) end end