- The system should allow users to view the list of movies playing in different theaters.
- Users should be able to select a movie, theater, and show timing to book tickets.
- The system should display the seating arrangement of the selected show and allow users to choose seats.
- Users should be able to make payments and confirm their booking.
- The system should handle concurrent bookings and ensure seat availability is updated in real-time.
- The system should support different types of seats (e.g., normal, premium) and pricing.
- The system should allow theater administrators to add, update, and remove movies, shows, and seating arrangements.
- The system should be scalable to handle a large number of concurrent users and bookings.
- The Movie class represents a movie with properties such as ID, title, description, and duration.
- The Theater class represents a theater with properties such as ID, name, location, and a list of shows.
- The Show class represents a movie show in a theater, with properties such as ID, movie, theater, start time, end time, and a map of seats.
- The Seat class represents a seat in a show, with properties such as ID, row, column, type, price, and status.
- The SeatType enum defines the different types of seats (normal or premium).
- The SeatStatus enum defines the different statuses of a seat (available or booked).
- The Booking class represents a booking made by a user, with properties such as ID, user, show, selected seats, total price, and status.
- The BookingStatus enum defines the different statuses of a booking (pending, confirmed, or cancelled).
- The User class represents a user of the booking system, with properties such as ID, name, and email.
- The MovieTicketBookingSystem class is the main class that manages the movie ticket booking system. It follows the Singleton pattern to ensure only one instance of the system exists.
- The MovieTicketBookingSystem class provides methods for adding movies, theaters, and shows, as well as booking tickets, confirming bookings, and cancelling bookings.
- Multi-threading is achieved using concurrent data structures such as ConcurrentHashMap to handle concurrent access to shared resources like shows and bookings.
- The MovieTicketBookingDemo class demonstrates the usage of the movie ticket booking system by adding movies, theaters, shows, booking tickets, and confirming or cancelling bookings.