Your task is to refactor a callback-based program that simulates a cinema ticket booking system. The process includes the following steps.
- Search for a movie.
- Check seat availability.
- Reserve seats.
- Confirm booking by sending a confirmation message to the user.
To achieve this, you need to refactor the searchMovie
, checkSeatAvailability
, reserveSeats
and confirmBooking
functions to return promises instead of using callbacks. Then, use the refactored functions to handle the cinema booking tasks sequentially.