Skip to content

Commit

Permalink
Room reservation soft launch improvements (#324)
Browse files Browse the repository at this point in the history
* Add office hours for room reservation soft launch

* Hot fix for reservable rooms
  • Loading branch information
KrisJordan authored Mar 8, 2024
1 parent b13e6dd commit 4efba6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 40 deletions.
48 changes: 10 additions & 38 deletions backend/services/coworking/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,71 +74,43 @@ def office_hours(self, date: datetime):
day = date.weekday()
if day == MONDAY:
return {
'SN135' : [
(time(hour=16, minute=30), time(hour=17, minute=00)),
],
'SN137' : [
(time(hour=15, minute=00), time(hour=16, minute=30))
],
'SN135' : [],
'SN137' : [],
'SN139' : [],
'SN141' : [
(time(hour=16, minute=00), time(hour=17, minute=30))
]
}
elif day == TUESDAY:
return {
'SN135' : [
(time(hour=14, minute=30), time(hour=16, minute=00)),
(time(hour=11, minute=00), time(hour=12, minute=00))
],
'SN135' : [],
'SN137' : [],
'SN139' : [
(time(hour=10, minute=30), time(hour=11, minute=00)),
(time(hour=11, minute=30), time(hour=13, minute=00)),
],
'SN139' : [],
'SN141' : [
(time(hour=10, minute=00), time(hour=11, minute=00))
]
}
elif day == WEDNESDAY:
return {
'SN135' : [
(time(hour=11, minute=00), time(hour=12, minute=00))
],
'SN135' : [],
'SN137' : [],
'SN139' : [
(time(hour=10, minute=30), time(hour=11, minute=00)),
(time(hour=11, minute=30), time(hour=13, minute=00)),
(time(hour=14, minute=30), time(hour=15, minute=00))
],
'SN139' : [],
'SN141' : [
(time(hour=10, minute=00), time(hour=11, minute=00))
]
}
elif day == THURSDAY:
return {
'SN135' : [
(time(hour=14, minute=30), time(hour=16, minute=00)),
(time(hour=11, minute=00), time(hour=12, minute=00))
],
'SN135' : [],
'SN137' : [],
'SN139' : [
(time(hour=10, minute=30), time(hour=11, minute=00)),
(time(hour=11, minute=30), time(hour=13, minute=00)),
(time(hour=14, minute=30), time(hour=15, minute=00))
],
'SN139' : [],
'SN141' : []
}
elif day == FRIDAY:
return {
'SN135' : [
(time(hour=11, minute=00), time(hour=12, minute=00))
],
'SN135' : [],
'SN137' : [],
'SN139' : [
(time(hour=10, minute=30), time(hour=11, minute=00)),
(time(hour=14, minute=30), time(hour=15, minute=00))
],
'SN139' : [],
'SN141' : [
(time(hour=10, minute=00), time(hour=11, minute=00))
]
Expand Down
6 changes: 4 additions & 2 deletions backend/services/coworking/reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ def get_map_reserved_times_by_date(
reserved_date_map[room.id] = time_slots_for_room

self._transform_date_map_for_unavailable(reserved_date_map)
del reserved_date_map["SN156"]
if "SN156" in reserved_date_map:
del reserved_date_map["SN156"]
self._transform_date_map_for_officehours(
date, reserved_date_map, operating_hours_start, operating_hours_duration
)
Expand Down Expand Up @@ -521,7 +522,8 @@ def _get_reservable_rooms(self) -> Sequence[RoomDetails]:

rooms = (
self._session.query(RoomEntity)
.filter(RoomEntity.id.not_in(self._policy_svc.non_reservable_rooms()))
# .where(RoomEntity.id.not_in(self._policy_svc.non_reservable_rooms()))
.where(RoomEntity.reservable == True)
.order_by(RoomEntity.id)
.all()
)
Expand Down

0 comments on commit 4efba6d

Please sign in to comment.