This is for "today" usage only.
Eveyday @7AM, a CRON job will retrieve past day events from DB. Make sure these events' dates are for today only.
flowchart TD
A([Start]) --> B[Email Server: Received a new email from reserve\@something.miamioh.edu]
B --> C[Nodejs: fs. Read log and extract email for BookingID]
C --> |input BookingID| D[LibCalAPI: GET. NetID, Confirm or Cancel, Date&Time, Location&Room, Stud2&Stud3]
D --> E[Node: Split into individual records with full details. _Even for Stud2&Stud3_]
E --> F{Confirm or Cancel?}
F -->|Cancel| G[DB: DELETE. _Mind Date and Time_]
G --> H[If today --> PatronGroup: DELETE]
H --> Z([End])
F -->|Confirm| I{/patrons/ endpoint: GET. Validate NetID}
I -->|Invalid| K[LibCalAPI: DELETE. Send email notification]
I -->|Valid| M{DB: FINDMANY. Is NetID duplicated? Y/N _Mind Date_ }
M -->|Yes| W{Is the booking Today? Y/N}
W --> |Yes| K
W --> |No| O[DB: ADD. BookingID, NetID, Date, StartTime, EndTime, Location&Room]
O --> Z
M -->|No| J[DB: ADD. BookingID, NetID, Date, StartTime, EndTime, Location&Room]
J --> Q{Is the booking Today? Y/N}
Q -->|Yes| P[PatronGroup: ADD. NetID, Date, Start/End Time, Location, Room]
Q -->|No| Z
P --> Y[DB: DELETE. Remove today's expired reservations.]
K --> Z
Y --> Z
Note: in the above design, a group of students has to meet the following requirement: