# frozen_string_literal: true class Core::Repositories::<%= @scope_class %>::<%= @repository_class %> < Core::Repositories::AbstractRepository def initialize(params:) @params = params @id = @params.id end def call(builder: true) <% if @resource_owner_id.present? -%> resource = <%= @model_class %>.find_by(id: @id, <%=@resource_owner_id%>: @params.<%=@resource_owner_id%>) <% else -%> resource = <%= @model_class %>.find_by(id: @id) <% end -%> return Failure '<%= @subject_class %> not found' unless resource.present? unless resource.destroy return Failure build_errors(resource) end Success '<%= @subject_class%> Destroyed.' end end