summaryrefslogtreecommitdiff
path: root/app/services/notification_recipients/builder/request_review.rb
blob: 911d89c6a8e902fca917d916b823eb4a9cd14018 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module NotificationRecipients
  module Builder
    class RequestReview < Base
      attr_reader :merge_request, :current_user, :reviewer

      def initialize(merge_request, current_user, reviewer)
        @merge_request, @current_user, @reviewer = merge_request, current_user, reviewer
      end

      def target
        merge_request
      end

      def build!
        add_recipients(reviewer, :mention, NotificationReason::REVIEW_REQUESTED)
      end
    end
  end
end