cal.com
cal.com copied to clipboard
Collective events are now considered from getBusyTimes booking query
What does this PR do?
Fixes #6374
This PR updates the getBusyTimes
query to consider a user busy within a given time period if:
- There is a booking owned by this user (previous functionality)
- There is a booking with an
eventType.id
in which this user is a host
Environment: Staging(main branch) / Production
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
How should this be tested?
- Clean your DB by running
yarn db-nuke
from withinpackages/prisma
- Boot the app from the root with
yarn dx
- Login as
[email protected]
/teampro
- Create a new Event Type for the
Team Pro
user - Edit
Collective Seeded Team Event
> Assignment > include the Team Pro user > Save - In an incognito browser, book a meeting under
Collective Seeded Team Event
- In an incognito browser, check the availability for the Event Type you created in Step 4
In Production you will see that the Team Pro user is considered available for the time slot booked in Step 6
In this PR you will see that the Team Pro user is considered unavailable for the time slot booked in Step 3
Checklist
- I have added tests that prove my fix is effective or that my feature works
- I have updated existing unit tests to pass locally with my changes
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
Name | Status | Preview | Comments | Updated |
---|---|---|---|---|
ui | ⬜️ Ignored (Inspect) | Feb 7, 2023 at 0:37AM (UTC) |
@AaronPresley is attempting to deploy a commit to the cal Team on Vercel.
A member of the Team first needs to authorize it.
@emrysal @PeerRich this one's ready for review 👍 It took a while to crawl through the schema to figure out the best way to gather this data, but I eventually figured out that the Host
table is the best source. I've left a lot of comments in the code itself to explain the flow.
Also, I noticed there's some performance testing around this function (named prismaBookingGetStart
and prismaBookingGetEnd
). I'm guessing there will be a bit of time added to this query, but hoping it's minimal.
@emrysal please let me know if you envisioned this lookup happening a different way. Thanks!