mirror of
https://github.com/UofCBaja/Interview-Backend.git
synced 2025-06-15 13:24:19 -06:00
fix(SchedulePackager): changed comments
This commit is contained in:
parent
45f6cf83c8
commit
4fe15620d7
@ -5,7 +5,21 @@ with open("./MockDB/schedule.yaml", "r") as scheduleyml:
|
||||
ymlschedule = yaml.safe_load(scheduleyml)
|
||||
|
||||
def getSchedulePackager():
|
||||
res = {"isBase64ENcoded": "false",
|
||||
"""
|
||||
What function does
|
||||
|
||||
``REQUIRES``: None
|
||||
|
||||
``PROMISES``: What function returns if applicable
|
||||
|
||||
``Develop in part by``: Brock T
|
||||
|
||||
``Contact``: darkicewolf50@gmail.ocm
|
||||
|
||||
"""
|
||||
res = {
|
||||
"isBase64ENcoded": "false",
|
||||
"statusCode": 200,
|
||||
"body": ymlschedule}
|
||||
return res
|
||||
"body": ymlschedule
|
||||
}
|
||||
return json.dumps(res)
|
||||
|
26
ReadDB.py
26
ReadDB.py
@ -1,26 +0,0 @@
|
||||
import pandas as pd
|
||||
|
||||
def ReadDatabase():
|
||||
# Load the updated Excel file into a pandas DataFrame
|
||||
excel_file_path = "./interview_database.xlsx"
|
||||
df = pd.read_excel(excel_file_path)
|
||||
|
||||
# Initialize the dictionary to store the structured data
|
||||
interview_data = {}
|
||||
|
||||
# Group the DataFrame by Date, Start Time, and Slot for organization
|
||||
for _, row in df.iterrows():
|
||||
date = row['Date']
|
||||
start_time = row['Start Time']
|
||||
slot = int(row['Slot']) if not pd.isna(row['Slot']) else 0
|
||||
|
||||
# Initialize nested structure if not present
|
||||
if date not in interview_data:
|
||||
interview_data[date] = {}
|
||||
if start_time not in interview_data[date]:
|
||||
if len(str(row['Interviewee Name']).split()) != slot:
|
||||
interview_data[date][start_time] = {
|
||||
'Meeting Duration': row['Meeting Duration'],
|
||||
}
|
||||
# Print the structured dictionary in JSON format for readability
|
||||
return interview_data
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
5
main.py
5
main.py
@ -3,6 +3,5 @@ from postSelectAppointment import SelectAppointment
|
||||
import json
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("hello")
|
||||
print(json.dumps(getSchedulePackager(), indent=4))
|
||||
print(json.dumps(SelectAppointment("10:00 am"), indent=4))
|
||||
print(getSchedulePackager())
|
||||
print(SelectAppointment("10:00 am"))
|
@ -1,6 +1,21 @@
|
||||
import json
|
||||
import datetime
|
||||
|
||||
def SelectAppointment (appointmentTime:datetime):
|
||||
"""
|
||||
packages up a response for a http request
|
||||
|
||||
``appointmentTime``: ``timedate``
|
||||
The appointment date and time details
|
||||
|
||||
``returns``: ``json``
|
||||
Returns the status of the booking confirmation
|
||||
|
||||
``Develop in part by``: Brock T
|
||||
|
||||
``Contact``: darkicewolf50@gmail.com
|
||||
"""
|
||||
|
||||
def SelectAppointment (appointmentTime):
|
||||
status = mockWriteFunction(appointmentTime)
|
||||
res = {"isBase64ENcoded": "false",
|
||||
"statusCode": 200,
|
||||
@ -9,7 +24,7 @@ def SelectAppointment (appointmentTime):
|
||||
res["body"] = {"Success": True}
|
||||
else:
|
||||
res["body"] = {"Success": False}
|
||||
return res
|
||||
return json.dumps(res)
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user