@Override public double calculateDiscount(User user, Event event, Ticket ticket) { double discountPercentage = 0.0; if (user.getDateOfBirth().getTime() == new Date().getTime()) { discountPercentage = 0.05; } return discountPercentage; }
public void bookTicketForUser(User user, Event event, int seatNumber) { Ticket ticket = bookingService.getTicketByEventAndSeat(event, seatNumber); userService.bookTicket(user, ticket); System.out.println( user.getName() + " has just bought a ticket for " + event.getName() + " seat number = " + seatNumber + " for $" + ticket.getPrice()); }