def notify_restaurant_owners_about_positive_booked_customer_task(customer_id): reservations = ReservationManager.retrieve_by_customer_id_in_future( customer_id) for reservation in reservations: restaurant = reservation.restaurant owner = restaurant.owner notification = Notification(owner.id, customer_id, restaurant.id, reservation.start_time) NotificationManager.create_notification(notification=notification)
def __retrieve_by_customer_id_in_future(message): from gooutsafe.dao.reservation_manager import ReservationManager reservations = ReservationManager.retrieve_by_customer_id_in_future( message['customer_id']) reservations = [ reservation.serialize() for reservation in reservations ] return reservations