diff options
Diffstat (limited to 'app/services/work_items')
-rw-r--r-- | app/services/work_items/build_service.rb | 11 | ||||
-rw-r--r-- | app/services/work_items/create_service.rb | 19 |
2 files changed, 30 insertions, 0 deletions
diff --git a/app/services/work_items/build_service.rb b/app/services/work_items/build_service.rb new file mode 100644 index 00000000000..15a26f81d7c --- /dev/null +++ b/app/services/work_items/build_service.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module WorkItems + class BuildService < ::Issues::BuildService + private + + def model_klass + ::WorkItem + end + end +end diff --git a/app/services/work_items/create_service.rb b/app/services/work_items/create_service.rb new file mode 100644 index 00000000000..49f7b89158b --- /dev/null +++ b/app/services/work_items/create_service.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module WorkItems + class CreateService + def initialize(project:, current_user: nil, params: {}, spam_params:) + @create_service = ::Issues::CreateService.new( + project: project, + current_user: current_user, + params: params, + spam_params: spam_params, + build_service: ::WorkItems::BuildService.new(project: project, current_user: current_user, params: params) + ) + end + + def execute + @create_service.execute + end + end +end |