This tries to achieve the same thing as #901 but with a different data model as it seems the tests are failing because there are too much data triggers running in the background (interfering with the results). The changes of the data model:
creates a new collection slotBookingsCounts, modelled after slotsByDay - each doc is keyed by month string, containing a lookup of slot id => number of bookings for the slot
the data trigger updates the slotBookingsCounts on each write to a booked slot document
the bonus is that: bookings counts are not expected to be defined (by design), so tests don't need unnecessary additional setup
This tries to achieve the same thing as #901 but with a different data model as it seems the tests are failing because there are too much data triggers running in the background (interfering with the results). The changes of the data model:
slotBookingsCounts
, modelled afterslotsByDay
- each doc is keyed by month string, containing a lookup of slot id => number of bookings for the slotslotBookingsCounts
on each write to a booked slot document