Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
make updateRoom query and remove useless console.log() ,
make available rooms query and test it and convert all callback queries to promises .
and utilities functions helps in getting final available rooms and test them .
updateRoom
the input should be object contain the data about the Room and the output should be the count of effected rows
the input
the output
availableRooms
the input should be object contain the reservation start date and the reservation end date and the type of room and the result is the available Rooms with it's prices .
the input
the output
Utilities Functions
removeDuplicated
that accepts array contain duplicated rows and remove them by using room_num and the elements of the array is object contain the room number and the room price .
the input
the output
filterResult
that takes the order from date and the order to date and array of all reservations in database and check all reservations if the reservations fail in between the from date and to date it's removed from array .
the input
the output