class PrintOrderQueueJob < ApplicationJob
  queue_as :default

  def perform(shop_code, booking_id)
    current_shop = Shop.find_by(shop_code: shop_code)
    ActsAsTenant.with_tenant(current_shop) do
      booking = Booking.find(booking_id)
      booking.orders.each do |order|
        oqs = OrderQueueStation.new
        oqs.process_order(order, booking.dining_facility_id)
      end
    end
  end
end
