Coder Social home page Coder Social logo

sharadashehan / airline_reservation_system Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 4.0 117.11 MB

Real-time Tickets Reservation System, developed for B Airways Company.

Python 41.74% HTML 0.33% CSS 12.44% JavaScript 45.49%
encryption flask flask-restful js-cookie jwt-authentication mysql reactjs server-side-caching sql stored-procedures throttling

airline_reservation_system's Introduction

Hey there! I'm Sharada

👨🏻‍💻  About Me

🎓  I'm currently studying at Computer Science Engineering department, University of Moratuwa.
🌱  I'm actively pursuing skills development in the domains of DevOps, Machine Learning, Cybersecurity, and Cloud Architecture.
✍️  In my free time, I pursue watching TV Series, Movies and Writing codes as hobbies.
✉️  You can contact me through Gmail. I'll try to respond as soon as I can.
📜  You can find my achievements on Credly and Coursera

⚙️  GitHub Analytics

🛠  Tech Stack

Languages

Python JavaScript TypeScript Java C++ C GraphQL HTML5 CSS3 Markdown

Development Frameworks

Django DjangoREST Spring Apollo-GraphQL Express.js Flask React Next JS React Native Flutter jQuery OpenCV

Development Environments

Visual Studio Code Sublime Text Jupyter Notebook PyCharm CLion IntelliJ IDEA WebStorm DataGrip Anaconda NodeJS

DevOps Tools

Nginx Jenkins Docker Kubernetes Azure Google Cloud AWS Cloudflare Vercel Terraform Puppet Postman Insomnia Git GitHub

Databases

MySQL Postgres MongoDB SQLite AmazonDynamoDB

Machine Learning

Keras TensorFlow scikit-learn NumPy SciPy Pandas

Operating Systems

Linux Ubuntu Debian Windows

Other Tools

Figma Arduino CMake Babel Webpack Expo JWT

🌐 Connect With Me

LinkedIn Facebook

airline_reservation_system's People

Contributors

dependabot[bot] avatar niroshan2001 avatar rusira-de-silva avatar sharadashehan avatar tharushadinujaya avatar wimukthimadushan avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

rusira-de-silva

airline_reservation_system's Issues

Backend : Admin Get Passengers By Next Flight API

GET /api/admin/next-flight/passengers?fromAirport=VCBI&toAirport=VOMM

Requires Authentication Header of Admin : {
'Authorization' : 'Bearer <access_token>'
}

Response data : [
{
"bookingRefID": "UYTRL94UI453",
"flightID": 76,
"isAdult": 1,
"isPaymentDone": 1,
"name": "Sophia Smith",
"seatNumber": "11E",
"passportID": "UV345678",
"travelClass": "Economy",
"userType": "Guest"
},
{
"bookingRefID": "UYTRL94UI453",
"flightID": 76,
"isAdult": 1,
"isPaymentDone": 1,
"name": "Oliver Johnson",
"seatNumber": "12E",
"passportID": "UV345678",
"travelClass": "Economy",
"userType": "Guest"
},
...
]

success status code : 200

parameters required : fromAirport, toAirport.
*parameters should not be closed within apostrophes.

Backend : User Pending Payments API

GET /api/user/pending-payments

Requires Authentication Header of Registered User : {
'Authorization' : 'Bearer <access_token>'
}

Response data : [
{
"bookingRefID": "G2MPFNPA3C5H",
"flightID": 45,
"passengers": [
{
"firstName": "John",
"isAdult": 1,
"lastName": "Doe",
"passportID": "JK9535IO",
"seatNumber": 31
},
{
"firstName": "Jane",
"isAdult": 1,
"lastName": "Doe",
"passportID": "JK9530IO",
"seatNumber": 32
},
{
"firstName": "Baby",
"isAdult": 0,
"lastName": "Doe",
"passportID": "JK9535PB",
"seatNumber": 33
}
],
"price": "1173.90",
"travelClass": "Economy"
},
{
"bookingRefID": "LYVPGMTFCKY5",
"flightID": 130,
"passengers": [
{
"firstName": "Sam",
"isAdult": 1,
"lastName": "Convoy",
"passportID": "II789012",
"seatNumber": 1
}
],
"price": "200.00",
"travelClass": "Economy"
},
{
"bookingRefID": "SKH4LGUUIUBR",
"flightID": 8,
"passengers": [
{
"firstName": "Sam",
"isAdult": 1,
"lastName": "Convoy",
"passportID": "II789012",
"seatNumber": 1
},
{
"firstName": "Olivia",
"isAdult": 1,
"lastName": "Smith",
"passportID": "ST901234",
"seatNumber": 2
},
{
"firstName": "Liam",
"isAdult": 0,
"lastName": "Brown",
"passportID": "UV567890",
"seatNumber": 3
}
],
"price": "570.00",
"travelClass": "Economy"
}
]

success status code : 200

Backend : Flight Search API

GET /api/flight/search?fromAirport=WIII&toAirport=WSSS&date=2023-11-15

Response data : [
{
"flightID": 1,
"airplaneModel": "Boeing 737",
"durationMinutes": 90,
"origin": {
"IATA": "CGK",
"address": "Tangerang,Banten,Indonesia",
"dateAndTime": "Wed, 15 Nov 2023 00:00:00 GMT"
},
"destination": {
"IATA": "SIN",
"address": "Changi,Singapore",
"dateAndTime": "Wed, 15 Nov 2023 01:30:00 GMT"
}
},
{
...
},
...
]

success status code : 200

parameters required : fromAirport, toAirport, date .
*parameters should not be closed within apostrophes.

Frontend : Seat Reserve Component

Component must support following functionalities.

Entering/selecting the first name last name, PassportID, is adult and seat number for each of passenger

Create form to get inputs from user or guest

Will receive already available seat numbers data of Flight from : #55 ( For selecting only available seat numbers )
Data required to be taken from user : #31 or #32

Frontend : Booking Success Component

Component must support following functionalities.

Showing a message to indicate booking is successful.
Showing the Booking Reference number of Booking Set.

Backend : Get All Models API

GET /api/get/models

GET response data : [
{
'modelID' : 1,
'name' : 'Boeing 737'
},
{
...
},
...
]

success status code : 200

Create this API in file with name 'get_all_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Frontend : Booked Tickets Page

When Entering the page check if user is logged in, If so display users' booked tickets and pending payments in separate sections
Data to be shown in booked tickets section : #29
Data to be shown in pending payments section : #34

If user is not logged in and there is a cookie with name "guest-id" and it has a value, then display guest's booked tickets and pending payments in separate sections
Data to be shown in booked tickets section : #103
Data to be shown in pending payments section : #93

Otherwise show a Search Bar that takes Booking Ref ID and displays corresponsing tickets using #33

Backend : Get All Airports API

GET /api/get/airports

GET response data : [
{
"city": "Mumbai",
"iataCode": "BOM",
"icaoCode": "VABB"
},
{
"city": "Katunayake",
"iataCode": "BIA",
"icaoCode": "VCBI"
},
...
]

success status code : 200

city is the level 0 location of airport.

Create this API in file with name 'get_all_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : Guest Books Flight API

POST /api/booking/create/guest

Request data :

Either

{
"flightID": 45,
"travelClass": "Economy",
"passengers": [
{
"seatNumber": 31,
"firstName": "John",
"lastName": "Doe",
"isAdult": 1,
"passportID": "JK9535IO"
},
{
"seatNumber": 32,
"firstName": "Jane",
"lastName": "Doe",
"isAdult": 1,
"passportID": "JP9535IO"
},
{
"seatNumber": 33,
"firstName": "Baby",
"lastName": "Doe",
"isAdult": 0,
"passportID": "JL9535IO"
}
]
}

OR

{
"flightID": 49,
"travelClass": "Economy",
"passengers": [
{
"seatNumber": 31,
"firstName": "John",
"lastName": "Doe",
"isAdult": 1,
"passportID": "JK9535IO"
},
{
"seatNumber": 32,
"firstName": "Jane",
"lastName": "Doe",
"isAdult": 1,
"passportID": "JK9530IO"
}
],
"guestID": "661EKEZFW036",
"email": "[email protected]",
"contactNumber": "42342342"
}

Response data : {
"bookingRefID": "GZDJDW6XRSD8",
"guestID": "661EKEZFW036",
"price": "1290.00"
}

success status code : 201

guestID, email, contactNumber are optional. If same user is booking multiple number of times guestID must be included every time that guest books. ( excluding the first booking. when guest books for first time, guestID should not be included )

Backend : Available Seats of Flight API

POST /api/flight/<flight_id>/seats
eg : /api/flight/1/seats?className=Business

Response data : {
"availableSeats": [ 3, 4 ],
"availableSeatsCount": 2,
"className": "Business",
"totalSeatsCount": 4
}

success status code : 201

required search parameter : className
Returns Available Seat numbers of Scheduled Flight ( that has given 'flight_id' ) under given class type.

Backend : DEO Add Route API

POST /api/deo/create/route

Requires Authentication Header of DEO : {
'Authorization' : 'Bearer <access_token>'
}

Request data : {
"origin" : "VCRI",
"destination" : "VOMM",
"durationMinutes" : 140,
"basePrice" : {
"Economy" : 200,
"Business" : 400,
"Platinum" : 600.50
}
}

success status code : 201

First check if user is a data entry operator by checking is_DEO == 1. If so, then create a record for new route in route table. ID of the record will be automatically added when adding it to table ( no need to add it manually ). Refer populate_route_table() function in populate_data.py file in scripts folder for more help.
If user is not a data entry operator send a response using abort() function with status code 403.

Create this API in file with name 'deo_create_route_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : User Update Profile API

PATCH /api/user/update/account

Requires Authentication Header of Registered User : {
'Authorization' : 'Bearer <access_token>'
}

Request data :
Either : {
"firstname":"Sam",
"lastname":"Convoy",
"passportID":"AH7645PO",
"address":"46, New St, Colombo, Sri Lanka",
"birthDate":"1994-05-23",
"gender":"Male",
"email":"[email protected]",
"contactNumber":"+94748758651"
}
Or : {
"firstname":"Sam",
"lastname":"Convoy",
"currentPassword":"k8p3rW",
"newPassword":"r434r3r4",
"passportID":"AH7645PO",
"address":"46, New St, Colombo, Sri Lanka",
"birthDate":"1994-05-23",
"gender":"Male",
"email":"[email protected]",
"contactNumber":"+94748758651"
}

success status code : 200

Backend : DEO Schedule Flight API

POST /api/deo/schedule-flight

Requires Authentication Header of DEO : {
'Authorization' : 'Bearer <access_token>'
}

Request data : {
"route" : 18,
"airplane" : "N98765",
"departureDate" : "2023-09-21",
"departureTime" : "14:30"
}

success status code : 201

First check if user is a data entry operator by checking is_DEO == 1. If so, then create a record for new scheduled flight in ScheduledFlight table.
Departure_Time field's value must be formatted in '2023-09-21 14:30:00' format.
Refer populate_scheduled_flight_table() function in populate_data.py file in scripts folder for more help.
If user is not a data entry operator send a response using abort() function with status code 403.

Create this API in file with name 'deo_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : Constraints and Triggers

  • Origin, Destination must be an unique pair in route table.
    Constraint added to create table query.
  • Same Airplane Cannot be in two scheduled flights during same time period.
    This will be checked when scheduling a new flight ( within Schedule Flights procedure ). Violation will generate an SQL Exception.
  • There should be only one booking for a any Seat_Number + Class + Scheduled_flight combination.
    This wil be checked before adding a booking to table ( within CreateBookingSet Procedure ). Violation will generate an SQL Exception.
  • Delete bookings if booked by guest and payments not made within specified time
    An Event runs every 5 minutes to delete booking records older than 10 minutes

Frontend : Login Ask Component

Component must support following functionalities.

Asking viewer to login or continue as a guest.
If viewer choeses to login allow him to enter credentials and login.

Backend : DEO Add Model API

POST /api/deo/create/model

Requires Authentication Header of DEO : {
'Authorization' : 'Bearer <access_token>'
}

Request data : {
"name" : "Airbus A860",
"seatsCount" : {
"Economy" : 150,
"Business" : 10,
"Platinum" : 0
}
}

success status code : 201

First check if user is a data entry operator by checking is_DEO == 1. If so, then create a record for new model in model table. ID of the record will be automatically added when adding it to table ( no need to add it manually ). Refer populate_model_table() function in populate_data.py file in scripts folder for more help. Autoincremented ID of the record can be returned by using a code like model_id = cursor.fetchone(0) after executing the insert query. Use this value when inserting records into capacity table, as the 'model' value.
Then, create 3 records in capacity table related to each class in seatsCount dictionary. ID of each record will be automatically added when adding it to table ( no need to add it manually ). Refer populate_category_table() function in populate_data.py file in scripts folder for more help.
If user is not a data entry operator send a response using abort() function with status code 403.

Create this API in file with name 'deo_create_model_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : Register New User API

POST /api/user/register

Request data = {
"username":"TimL",
"password":"k8p3rW",
"firstname":"Tim",
"lastname":"Lee",
"passportID":"AH7645IO",
"address":"46, New St, Colombo, Sri Lanka",
"birthDate":"1994-05-23",
"gender":"Male",
"email":"[email protected]",
"contactNumber":"+94740055651"
}

success status code : 201

If registration is successful, then redirect to #12 and get an access token.

Frontend : Data Entry Operator Profile View

Get Auth Token for DEO from : #88

Profile details section ~
Will receive DEO's profile details from : #84

Create forms for following sections to get inputs from Data Entry Operator

Add Model section ~
Data required to be taken from user : #50

Add Airplane section ~
Will receive all Models' data from : #97 ( To be shown in a dropdown menu )
Data required to be taken from user : #49

Add Airport section ~
Data required to be taken from user : #40

Add Route section ~
Will receive all Airports' data from : #99 ( To be shown in a dropdown menu )
Data required to be taken from user : #39

Schedule Flight section ~
Will receive all Routes' data from : #98 ( To be shown in a dropdown menu )
Will receive all Airplanes' data from : #100 ( To be shown in a dropdown menu )
Data required to be taken from user : #38

Update Delay section ~
Using same filters used in #17 get Flights' data from : #30
Data required to be taken from user : #52

Backend : DEO Add Airplane API

POST /api/deo/create/airplane

Requires Authentication Header of DEO : {
'Authorization' : 'Bearer <access_token>'
}

Request data : {
"tailNumber" : "HL7611",
"modelID" : 3
}

success status code : 201

First check if user is a data entry operator by checking is_DEO == 1. If so, then create a record for new airplane in airplane table. Refer populate_airplane_table() function in populate_data.py file in scripts folder for more help.
If user is not a data entry operator send a response using abort() function with status code 403.

Create this API in file with name 'deo_create_airplane_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : User Booked Tickets API

GET /api/tickets/user/search

Requires Authentication Header of Registered User : {
'Authorization' : 'Bearer <access_token>'
}

GET response data : [
{
"class": "Platinum",
"departureDate": "2023-11-15",
"departureTime": "11:00",
"flight": "BA0002",
"from": {
"IATA": "CGK",
"city": "Tangerang"
},
"passenger": "Liam Smith",
"seat": "1P",
"ticketNumber": 243,
"passportID": "II789012",
"to": {
"IATA": "BIA",
"city": "Katunayake"
}
},
{
"class": "Platinum",
"departureDate": "2023-11-15",
"departureTime": "11:00",
"flight": "BA0002",
"from": {
"IATA": "CGK",
"city": "Tangerang"
},
"passenger": "Olivia Johnson",
"seat": "2P",
"ticketNumber": 244,
"passportID": "II7899YU",
"to": {
"IATA": "BIA",
"city": "Katunayake"
}
},
...
]

success status code : 200

Return All Tickets of the the current user. ( Identify current user with jwt identity )
When writing relevant SQL query select records from 'ticket' view.
Details of each Ticket have to be inserted to a dictionary and append that each dictionary to list, which will be returned as the response.

Frontend : User Profile View

In bookedTickets section show set of tickets, booked by user, using data received from #29
In PendingPayments section show each set of booking details ( show details of all tickets related to a single booking within one selectable component ) separately, so that user can select one booking at a time and navigate to the make payment page. Data will be received from #34 for displaying to user

Backend : User Books Flight API

POST /api/booking/create/user

Requires Authentication Header of Registered User : {
'Authorization' : 'Bearer <access_token>'
}

Request data : {
"flightID": 45,
"travelClass": "Economy",
"passengers": [
{
"seatNumber": 31,
"firstName": "John",
"lastName": "Doe",
"isAdult": 1,
"passportID": "JK9535IO"
},
{
"seatNumber": 32,
"firstName": "Jane",
"lastName": "Doe",
"isAdult": 1,
"passportID": "JK9530IO"
},
{
"seatNumber": 33,
"firstName": "Baby",
"lastName": "Doe",
"isAdult": 0,
"passportID": "JK9535PB"
}
]
}

Response data : {
'bookingRefID': 'GY64HU8JUR4P',
'price': 1200.00
}

success status code : 201

Create this API in file with name 'create_booking_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Frontend : Ticket Component

Must show details of a ticket, in a similar structure. May use any design you prefer.
Refer #29 for data received from backend for a set of Tickets.

Ticket1

Frontend : Flight Search Component

Component must support following functionalities.

Searching for available flights and displaying flights.
Selecting a specific flight.
Clicking “Book Now” Button.

Create form to get inputs from user or guest

parameter values to be taken from user and response flight results data from backend : #30

Backend : DEO Add Airport API

POST /api/deo/create/airport

Requires Authentication Header of DEO : {
'Authorization' : 'Bearer <access_token>'
}

Request data : {
"ICAO" : "KJFK",
"IATA" : "JFK",
"location" : [ "New York", "United Status" ]
}

success status code : 201

First check if user is a data entry operator by checking is_DEO == 1. If so, then create a record for new airport in airport table. Refer populate_airport_table() function in populate_data.py file in scripts folder for more help.
Then, create separate records in location table related to each text value in 'location' list ( in the request data ). Use ICAO code in request data as the value of Airport field in location table. Refer populate_location_table() function in populate_data.py file in scripts folder for more help. For the value of 'level' field use integers 0,1,.. for each text value in 'location' list in request data.
For example in above case, ( 'KJFK', 0, 'New York' ), ( 'KJFK', 1, 'United Status' ) records will be added to location table.
If user is not a data entry operator send a response using abort() function with status code 403.

Create this API in file with name 'deo_create_airport_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : Admin Get Revenue By Model

GET /api/admin/revenue-by-model

Requires Authentication Header of Admin: {
'Authorization' : 'Bearer <access_token>'
}

Response data = [
{
"bookingSetsCount": 30,
"model": "Boeing 737",
"revenue": "18400.00"
},
{
"bookingSetsCount": 24,
"model": "Boeing 757",
"revenue": "22380.00"
},
{
"bookingSetsCount": 9,
"model": "Airbus A380",
"revenue": "11110.00"
}
]

success status code : 200

Backend : Search Booked Tickets By Ref ID API

GET /api/tickets/guest/search-by-ref-id?bookingRefID=WWWWLUUYY5PE

Response data : [
{
"class": "Economy",
"departureDate": "Sun, 19 Nov 2023 00:00:00 GMT",
"departureTime": "17:30",
"flight": "BA0039",
"from": {
"IATA": "BKK",
"city": "Bangkok"
},
"passenger": "John Doe",
"passportID": "JK9535IO",
"seat": "31E",
"status": "Active",
"ticketNumber": 362,
"to": {
"IATA": "SIN",
"city": "Changi"
}
},
{
"class": "Economy",
"departureDate": "Sun, 19 Nov 2023 00:00:00 GMT",
"departureTime": "17:30",
"flight": "BA0039",
"from": {
"IATA": "BKK",
"city": "Bangkok"
},
"passenger": "Jane Doe",
"passportID": "JP9535IO",
"seat": "32E",
"status": "Active",
"ticketNumber": 363,
"to": {
"IATA": "SIN",
"city": "Changi"
}
},
...
]

success status code : 200

parameters required : bookingRefID
*parameters should not be closed within apostrophes.

Backend : Get User Details API

GET /api/user/details/account

Requires Authentication Header of Registered User : {
'Authorization' : 'Bearer <access_token>'
}

GET response data : {
"address": "123, Main St, Yishun, Singapore",
"birthDate": "Wed, 15 Mar 1995 00:00:00 GMT",
"bookingsCount": 30,
"category": "Gold",
"contactNumber": "+6590123456",
"email": "[email protected]",
"firstName": "Sam",
"gender": "Male",
"lastName": "Convoy",
"passportId": "II789012",
"username": "SamC"
}

success status code : 200

Backend : Complete Booking API

POST /api/booking/complete/<bkset_id>

Request data : {
"transactionID" : "N8J5FG7UNJIO8TFB"
}

success status code : 200

Update the value of 'Completed' field in Booking_Set record ( which has same booking ref ID as 'bookingRefID' in request data ) to 1. If Booking_Set is associated with an user ( User field is not null ) then update user's category.

Create this API in file with name 'complete_booking_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : Get All Routes API

GET /api/get/routes

GET response data : [
{
"durationMinutes": 110,
"fromCity": "New Delhi",
"fromIATA": "DEL",
"fromICAO": "VIDP",
"routeID": 23,
"toCity": "Mumbai",
"toIATA": "BOM",
"toICAO": "VABB"
},
{
...
},
...
]

success status code : 200

fromCity is the level 0 location of origin airport. toCity is the level 0 location of destination airport

Create this API in file with name 'get_all_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : Admin Get Passengers By Date and Destination API

GET /api/admin/passengers-to-destination?fromDate=2023-11-10&toDate=2023-11-18&toAirport=VOMM

Requires Authentication Header of Admin : {
'Authorization' : 'Bearer <access_token>'
}

Response data = {
"passengersCount": 45
}

success status code : 200

parameters required : fromDate, toDate, toAirport.
*parameters should not be closed within apostrophes.

Backend : Get All Airplanes API

GET /api/get/airplanes

GET response data : [
{
'tailNumber' : 'C-FGHIJ',
'modelName' : 'Boeing 737'
},
{
...
},
...
]

success status code : 200

Create this API in file with name 'get_all_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Frontend : Admin Profile View

Profile details section ~
Will receive Admin's profile details from : #13

Create forms for following tasks to get inputs from Admin for search queries and display retrieved data after that

Get Revenue By Model ~
Data required to be taken from admin and data retrieved from backend after that : #57

Get Passengers By Next Flight ~
Data required to be taken from admin and data retrieved from backend after that : #58

Get Passengers By Date and Destination ~
Data required to be taken from admin and data retrieved from backend after that : #59

Get Booking Count By Date and Passenger Type ~
Data required to be taken from admin and data retrieved from backend after that : #60

Get Past Flights Details ~
Data required to be taken from admin and data retrieved from backend after that : #61

Backend : Guest Cancel Booking API

DELETE /api/booking/cancel/guest/<bkset_id>/<guest_id>

success status code : 204

First check if User is a guest. Then check if value of 'Completed' field in booking_Set record is equal to 0. If so, then delete the booking_Set record from table.
If a booking_Set record with given bookingRefID is not found send a response using abort() function with status code 404.

Create this API in file with name 'cancel_booking_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : Get User Authentication Token API

POST /api/user/auth

Request data : {
"username": "SamC",
"password": "k8p3rW"
}

Response data : {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTY5NjU5OTQyOCwianRpIjoiNWE3ZTAxNTAtY2JlNS00MmVhLWJmNTctNjM5ZTc5MGEyYzEzIiwidHlwZSI6ImFjY2VzcyIsInN1YiI6IlNhbUMiLCJuYmYiOjE2OTY1OTk0MjgsImV4cCI6MTY5NjYwMDMyOH0.VsskdfjusYJtQ1an9hy_DtDsezy3-wF94be2mVUXzVQ",
"userData": {
"address": "123, Main St, Yishun, Singapore",
"birthDate": "Wed, 15 Mar 1995 00:00:00 GMT",
"bookingsCount": 30,
"category": "Gold",
"contactNumber": "+6590123456",
"email": "[email protected]",
"firstName": "Sam",
"gender": "Male",
"lastName": "Convoy",
"passportId": "II789012",
"username": "SamC"
}
}

success status code : 200

Backend : DEO Update Delay API

PATCH /api/deo/update/delay

Requires Authentication Header of DEO : {
'Authorization' : 'Bearer <access_token>'
}

Request data : {
"scheduledFlightID" : 24,
"delayMinutes" : 30
}

success status code : 200

First check if user is a data entry operator by checking value of IsDataEntryOperator field's value whether 0 or 1.
Update the scheduled flight's Delay_Minutes field by data in request only for scheduled_flight with given 'scheduledFlightID.
If user is not a data entry operator send a response using abort() function with status code 403.

Create this API in file with name 'deo_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : User Cancel Booking API

DELETE /api/booking/cancel/user/<bkset_id>

Requires Authentication Header of Registered User : {
'Authorization' : 'Bearer <access_token>'
}

success status code : 204

First check if 'User' field's value in booking_Set record with bookingRefID ( in request data ) match with the username of user who sent the request. Then check if value of 'Completed' field in booking_Set record is equal to 0. If so, then delete the booking_Set record from table.
If a booking_Set record with given bookingRefID is not found send a response using abort() function with status code 404.

Create this API in file with name 'cancel_booking_api.py'. If this file hasn't been created yet, create it in the same location where 'user_api.py' file is.

Backend : Database Views and Procedures

views

  • Flight View
  • Seat Reservation View
  • Ticket View
  • Passenger View

procedures

  • Complete Booking Set Procedure
  • Create Booking Set Procedure
  • Schedule Flight Procedure

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.