adding triggers and functions for booking tickets and calculating average rating