devsoc-unsw / freerooms

A web application designed to aid UNSW students in finding vacant rooms.
https://freerooms.devsoc.app/
Other
18 stars 1 forks source link

fix(status): account for bookings past midnight in status #423

Closed francojreyes closed 4 months ago

francojreyes commented 4 months ago

Similar issue to #419

Currently, room status is calculate by fetching all bookings that start and end between 00:00 and 23:59 of the queried day. Importantly, bookings that go until midnight or past midnight are not fetched. This means a room busy all day until midnight appears to have no bookings and is shown as free - a lot of law library rooms are like this and appear free.

This PR fixes that by fetching all bookings that overlap with the fetched day instead. So, we will also get bookings that:

This means the midnight bookings are accounted for. The query is also slightly slower now (100ms -> 200ms) but oh well.

richard-xue-vrx commented 4 months ago

LGTM