Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

design-an-airline-management-system.md

Latest commit

History

320 lines (223 loc) · 11.4 KB

design-an-airline-management-system.md

File metadata and controls

320 lines (223 loc) · 11.4 KB

Design an Airline Management System

Let's make an Airline Management System

We'll cover the following:

An Airline Management System is a managerial software which targets to control all operations of an airline. Airlines provide transport services for their passengers. They carry or hire aircraft for this purpose. All operations of an airline company are controlled by their airline management system.

This system involves the scheduling of flights, air ticket reservations, flight cancellations, customer support, and staff management. Daily flights updates can also be retrieved by using the system.

<a href=Airline Management System" width="" />


Airline Management System

System Requirements

We will focus on the following set of requirements while designing the Airline Management System:

  1. Customers should be able to search for flights for a given date and source/destination airport.
  2. Customers should be able to reserve a ticket for any scheduled flight. Customers can also build a multi-flight itinerary.
  3. Users of the system can check flight schedules, their departure time, available seats, arrival time, and other flight details.
  4. Customers can make reservations for multiple passengers under one itinerary.
  5. Only the admin of the system can add new aircrafts, flights, and flight schedules. Admin can cancel any pre-scheduled flight (all stakeholders will be notified).
  6. Customers can cancel their reservation and itinerary.
  7. The system should be able to handle the assignment of pilots and crew members to flights.
  8. The system should be able to handle payments for reservations.
  9. The system should be able to send notifications to customers whenever a reservation is made/modified or there is an update for their flights.

Use Case Diagram

We have five main Actors in our system:

Here are the top use cases of the Airline Management System:

Here is the use case diagram of our Airline Management System:


Use Case Diagram for Airline Management System

Class Diagram

Here are the main classes of our Airline Management System:

<a href=Airline Management System Class Diagram" width="" />


Class Diagram for Airline Management System


UML for Airline Management System

Activity Diagrams

Reserve a ticket: Any customer can perform this activity. Here are the steps to reserve a ticket:


Activity Diagram for Airline Management System Reserve Ticket


Activity Diagram for Airline Management System Cancel Reservation

Code

Here is the code for major classes.

Enums and Constants: Here are the required enums, data types, and constants:

from enum import Enum class FlightStatus(Enum): ACTIVE, SCHEDULED, DELAYED, DEPARTED, LANDED, IN_AIR, ARRIVED, CANCELLED, DIVERTED, UNKNOWN = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 class PaymentStatus(Enum): UNPAID, PENDING, COMPLETED, FILLED, DECLINED, CANCELLED, ABANDONED, SETTLING, SETTLED, REFUNDED = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 class ReservationStatus(Enum): REQUESTED, PENDING, CONFIRMED, CHECKED_IN, CANCELLED, ABANDONED = 1, 2, 3, 4, 5, 6 class SeatClass(Enum): ECONOMY, ECONOMY_PLUS, PREFERRED_ECONOMY, BUSINESS, FIRST_CLASS = 1, 2, 3, 4, 5 class SeatType(Enum): REGULAR, ACCESSIBLE, EMERGENCY_EXIT, EXTRA_LEG_ROOM = 1, 2, 3, 4, 5 class AccountStatus(Enum): ACTIVE, CLOSED, CANCELED, BLACKLISTED, BLOCKED = 1, 2, 3, 4, 5, 6 class Address: def __init__(self, street, city, state, zip_code, country): self.__street_address = street self.__city = city self.__state = state self.__zip_code = zip_code self.__country = country 

Account, Person, Customer and Passenger: These classes represent the different people that interact with our system:

from abc import ABC from .constants import * # For simplicity, we are not defining getter and setter functions. The reader can # assume that all class attributes are private and accessed through their respective # public getter methods and modified only through their public methods function. class Account: def __init__(self, id, password, status=AccountStatus.Active): self.__id = id self.__password = password self.__status = status def reset_password(self): None class Person(ABC): def __init__(self, name, address, email, phone, account): self.__name = name self.__address = address self.__email = email self.__phone = phone self.__account = account class Customer(Person): def __init__(self, frequent_flyer_number): self.__frequent_flyer_number def get_itineraries(self): None class Passenger: def __init__(self, name, passport_number, date_of_birth): self.__name = name self.__passport_number = passport_number self.__date_of_birth = date_of_birth def get_passport_number(self): return self.__passport_number 

Airport, Aircraft, Seat and FlightSeat: These classes represent the top-level classes of the system:

class Airport: def __init__(self, name, address, code): self.__name = name self.__address = address self.__code = code def get_flights(self): None class Aircraft: def __init__(self, name, model, manufacturing_year): self.__name = name self.__model = model self.__manufacturing_year = manufacturing_year self.__seats = [] def get_flights(self): None class Seat: def __init__(self, seat_number, type, seat_class): self.__seat_number = seat_number self.__type = type self.__seat_class = seat_class class FlightSeat(Seat): def __init__(self, fare): self.__fare = fare def get_fare(self): return self.__fare 

Flight Schedule classes, Flight, FlightInstance, FlightReservation, Itinerary: Here are the classes related to flights and reservations:

class WeeklySchedule: def __init__(self, day_of_week, departure_time): self.__day_of_week = day_of_week self.__departure_time = departure_time class CustomSchedule: def __init__(self, custom_date, departure_time): self.__custom_date = custom_date self.__departure_time = departure_time class Flight: def __init__(self, flight_number, departure, arrival, duration_in_minutes): self.__flight_number = flight_number self.__departure = departure self.__arrival = arrival self.__duration_in_minutes = duration_in_minutes self.__weekly_schedules = [] self.__custom_schedules = [] self.__flight_instances = [] class FlightInstance: def __init__(self, departure_time, gate, status, aircraft): self.__departure_time = departure_time self.__gate = gate self.__status = status self.__aircraft = aircraft def cancel(self): None def update_status(self, status): None class FlightReservation: def __init__(self, reservation_number, flight, aircraft, creation_date, status): self.__reservation_number = reservation_number self.__flight = flight self.__seat_map = <> self.__creation_date = creation_date self.__status = status def fetch_reservation_details(self, reservation_number): None def get_passengers(self): None class Itinerary: def __init__(self, customer_id, starting_airport, final_airport, creation_date): self.__customer_id = customer_id self.__starting_airport = starting_airport self.__final_airport = final_airport self.__creation_date = creation_date self.__reservations = [] def get_reservations(self): None def make_reservation(self): None def make_payment(self): None