My submission for the CSIT 2023 Software Engineering Mini Challenge on Backend Development
- Provided is a a connection to a NoSQL database containing 2 tables: flights and hotels.
- The goal is to write an application that provides 2 WebAPI endpoints (GET /flights and GET /hotels) that return the cheapest options for the respective item.
- The request body will contain the relevant information such as:
- Start and End Dates for travel
- Origin and Destination City
- In database.py, write two functions that handle the respective requests. Functions will follow this general structure:
- Connect to the databse via a pymongo client
- Make the relevant query
- Convert the returned cursor to a dataframe for processing
- Format the relevant data and return it
- In server.py, write a simple FastAPI application that has the two required endpoints.
- Perform basic input validation (e.g. correct date formatting)
- Format the data in the given request body
- Call the respective database.py functions with the given arguments
- Return the results