summaryrefslogtreecommitdiff
path: root/app/services/bulk_push_event_payload_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/bulk_push_event_payload_service.rb')
-rw-r--r--app/services/bulk_push_event_payload_service.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/services/bulk_push_event_payload_service.rb b/app/services/bulk_push_event_payload_service.rb
new file mode 100644
index 00000000000..54157bc23f9
--- /dev/null
+++ b/app/services/bulk_push_event_payload_service.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class BulkPushEventPayloadService
+ def initialize(event, push_data)
+ @event = event
+ @push_data = push_data
+ end
+
+ def execute
+ @event.build_push_event_payload(
+ action: @push_data[:action],
+ commit_count: 0,
+ ref_count: @push_data[:ref_count],
+ ref_type: @push_data[:ref_type]
+ )
+
+ @event.push_event_payload.tap(&:save!)
+ end
+end