Skip to content

A platform for community discussion. Free, open, simple.

516 B
Raw Blame
# frozen_string_literal: true

module DiscourseWorkflows
  class Execution::Show
    include Service::Base

    params do
      attribute :execution_id, :integer

      validates :execution_id, presence: true
    end

    policy :can_manage_workflows, class_name: Policy::CanManageWorkflows
    model :execution

    private

    def fetch_execution(params:)
      DiscourseWorkflows::Execution.includes(:execution_data, workflow: :active_version).find_by(
        id: params.execution_id,
      )
    end
  end
end