Class: NotificationWorkers::Partner::BookingWorker

Inherits:
ApplicationWorker show all
Includes:
RollbarSynTokenSetterWorker
Defined in:
app/workers/notification_workers/partner/booking_worker.rb

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

Instance Method Details

#perform(reservation_id) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/workers/notification_workers/partner/booking_worker.rb', line 9

def perform(reservation_id)
  reservation = Reservation.find_by(id: reservation_id)
  return if reservation.blank?

  TransactionNotif.create(
    reservation: reservation,
    restaurant: reservation.restaurant,
    model: reservation,
    message_en: "Booking ##{reservation.id} is waiting for your approval",
    message_th: "การจอง ##{reservation.id} รอการยืนยันจากคุณอยู่",
    notif_type: :booking
  )
end