public class Airport {
String airportName; // for eg: SeaTac, Sky Harbor, Charles Douglas;
String address;
String uniqueAirportId; // for each airport
}
public class Airline {
String airlineName; //Alaska, American, Delta
String airlineCode; //1,2,3
}
public class Aircraft {
String manufacturer; //boeing, airbus
String model; //737, A300
String yearsInService;
String lastService;
String manufacturingDate;
}
public class Flight {
String flightNumber;
String source;
String destination;
String departureTime;
String expectedArrivalTime;
Aircraft assignedAircraft; //each flight will be an instance so a flight from seattle to london at a paricular time is 1 instance of flight
Airport airport;
boolean addFlightSchedule() {...} //information like source destination date time etc.
void updateStatus(FlightStatus flightStatus) {...} //update the status of the flight
boolean cancel() {...} // cancel the flight.
}
To pull out the reservation of the entire flight
/*To pull out the reservation of the entire flight*/
public class FlightReservation {
Flight flight;
String reservationNumber;
Map<Passenger, Seat> seatMap;
ReservationStatus reservationStatus;
public List<Passenger> getPassengers() {...}
public FlightReservation getFlightReservation(String reservationNumber) {...}
}
Class to assign seats to passengers for a particular flight instance.
/*Class to assign seats to passengers for a particular flight instance.*/
public class Seat {
String seatFare;
String seatType;
String seatNumber;
public float getFare() {...}
}
Both the customer and front-desk can use the itinerary class to book/ cancel/ update the reservation.
/*
Both the customer and front-desk can use the itinerary class to book/ cancel/ update the reservation.
*/
public class Itinerary {
String customerId;
Airport startingAirport;
Airport finalAirport;
Date creationDate;
List<FlightReservation> reservations;
public List<FlightReservation> getReservations();
public boolean makeReservation();
public boolean makePayment();
}
public class Payment {
String paymentId;
PaymentMode paymentMode;
PaymentStatus paymentStatus;
boolean makeTransaction() {...}
}
public class Notification {
String notificationId;
NotificationMode notificationMode;
NotificationStatus notificationStatus;
}
we will use enum class for all the Status like PaymentStatus
, NotificationStatus
, ReservationStatus
etc.