def generate
      return unless resource
      return unless event_class.types.include?(:notification)

      followers.each do |recipient|
        generate_notification_for(recipient, user_role: :follower) if ["all", "followed-only"].include?(recipient.notification_types)
      end

      affected_users.each do |recipient|
        generate_notification_for(recipient, user_role: :affected_user) if ["all", "own-only"].include?(recipient.notification_types)
      end
    end
def generate
      return unless resource
      return unless event_class.types.include?(:notification)

      followers.each do |recipient|
        generate_notification_for(recipient, user_role: :follower) if ["all", "followed-only"].include?(recipient.notification_types)
      end

      affected_users.each do |recipient|
        generate_notification_for(recipient, user_role: :affected_user) if ["all", "own-only"].include?(recipient.notification_types)
      end
    end
Initializes the class.

 event - A String with the name of the event.
 event_class - A class that wraps the event.
 resource - an instance of a class implementing the `Decidim::Resource` concern.
 followers - a collection of Users that receive the notification because
   they're following it
 affected_users - a collection of Users that receive the notification because
   they're affected by it
 extra - a Hash with extra information for the event.
 rubocop:disable Metrics/ParameterLists
 rubocop:enable Metrics/ParameterLists
 Schedules a job for each recipient to create the notification. Returns `nil`
 if the resource is not resource or if it is not present.

 Returns nothing.