Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endpoint for search panel #54

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

endpoint for search panel #54

wants to merge 2 commits into from

Conversation

JustKong13
Copy link
Collaborator

@JustKong13 JustKong13 commented Jun 18, 2022

Creates the endpoint for time certification, and stores valid user-provided inputs into database

Logic flow: in the /reservation route, the "From" and "To" time buttons will trigger a dropdown modal so that the user can provide times for any selected date. This data will be sent and then the backend will perform certification tests:

  • Make sure that the time is an actual time (24:67 is not a valid time)
  • Make sure that the date exists (Feburary 30th is not a real date) -> this will be taken care of in the react-calendar module
  • Check to make sure that the two times provided happen one after another (a reservation from 14:30 to 12:30 makes no sense)
  • Check to see if it interfere with any other reservations

After these tests are ran, they will update the Users, Rooms, and Buildings Database

NOTE: you may notice that I did not append new reservations to the end of reservations lists (good for you for noticing 🥳). it was designed this way so that if there is some sort of bug that may arise, we did not mutate the original list of reservations (i.e. this is an insurance policy)

ANOTHER NOTE: ReservationType now has a r_id field, date and times are no longer string types, rather they are Date and Time types. it made it a lot easier for me 😄

  • perform checks to make sure of valid times and dates
  • create useful Time and Date data types, as well as add the r_id to ReservationType so that when the user looks at their reservation, they will know what room its for
  • update rooms, buildings, and users database
  • check to make sure there is no overlap with any other reservation
  • create modal to take in the user input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants