The Work Flow of this Flight Booking will look like this :
After the user signup their info is saved in DataBase and token is generated which get stored using browser Cookies
Same as signup the token will get stored in the form of cookie.
As soon as user hit the Booking route provided with Source, Destination and Date all the Information related to Airport and Flight fare will be shown like this:
The route is procted with isLoggedIn middleware
The Complete Info will Look like this
{
"bookingBy": "Admin",
"email": "admin@gmail.com",
"dateOfBooking": "2023/08/15",
"airportDetails": {
"source": {
"iata": "JAI",
"name": "Jaipur International Airport",
"city": "Jaipur"
},
"destination": {
"iata": "MAA",
"name": "Chennai International Airport",
"city": "Chennai"
}
},
"fareDetails": [
{
"name": "Indigo Airline",
"ICAO": "IGO",
"cost": 26866
},
{
"name": "AirAsia",
"ICAO": "IAD",
"cost": 30080
},
{
"name": "Akasa",
"ICAO": "AKJ",
"cost": 33135
}
]
}
The Price will get determined on the bases of Date of Booking If the user book within 48 hours from current time then the Price will be Extermely High If the user book within 1 Week form current time then the Price will be Moderate For rest of the condition the Price will be LOW
The Admin account creation is same as user but the role will be marked as admin
Routes of admin is procted with customeRole("admin") middleware
Here the admin setting up the Name, 3-word-letter-code of Airline and cost of airline based on per-kilometer