Class: SpreeCmCommissioner::CustomerNotificationCronExecutor

Inherits:
BaseInteractor
  • Object
show all
Defined in:
app/interactors/spree_cm_commissioner/customer_notification_cron_executor.rb

Instance Method Summary collapse

Instance Method Details

#callObject



3
4
5
6
7
# File 'app/interactors/spree_cm_commissioner/customer_notification_cron_executor.rb', line 3

def call
  customer_notifications.find_each do |customer_notification|
    enqueue_customer_notification_alert(customer_notification)
  end
end

#customer_notificationsObject



9
10
11
# File 'app/interactors/spree_cm_commissioner/customer_notification_cron_executor.rb', line 9

def customer_notifications
  SpreeCmCommissioner::CustomerNotification.scheduled_items
end

#enqueue_customer_notification_alert(customer_notification) ⇒ Object



13
14
15
# File 'app/interactors/spree_cm_commissioner/customer_notification_cron_executor.rb', line 13

def enqueue_customer_notification_alert(customer_notification)
  SpreeCmCommissioner::CustomerNotificationSenderJob.perform_later(customer_notification.id)
end