Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v2 slots new version #18758

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

supalarry
Copy link
Contributor

Linear CAL-5052

Copy link

linear bot commented Jan 20, 2025

@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Jan 20, 2025
@supalarry supalarry mentioned this pull request Jan 20, 2025
Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2025 8:58am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2025 8:58am

@supalarry
Copy link
Contributor Author

Converting to draft because have 1 more thing to do - slots endpoint should also return information in case of seated events of how many attendees are at that slot already.

So might need to change output format but thats easy.

@supalarry supalarry marked this pull request as ready for review January 24, 2025 10:52
@supalarry
Copy link
Contributor Author

Converting to draft because have 1 more thing to do - slots endpoint should also return information in case of seated events of how many attendees are at that slot already.

So might need to change output format but thats easy.

Resolved - slots for seated bookings now also return attendees count and booking uid

@liferays
Copy link

Hello,

I’d like to emphasize an important point. Alongside the default "reserve slot" behavior, which reserves a slot for 5 minutes, we need the flexibility to define how far into the future a slot can be reserved. For instance, instead of the default 5-minute duration, we should be able to reserve a slot for an extended period—up to 1000 years, if needed—effectively keeping the slot reserved indefinitely until we trigger a "Delete a selected slot" API or complete a booking.

This functionality would be particularly useful when building on top of Cal.com using its platform API, such as when creating predefined classes.

@liferays
Copy link

If possible, it would be great to include the ability to return reserved slots along with their slot ID and datetime. This would be especially beneficial for managing predefined timed classes or events across various platforms.

@supalarry
Copy link
Contributor Author

Hello,

I’d like to emphasize an important point. Alongside the default "reserve slot" behavior, which reserves a slot for 5 minutes, we need the flexibility to define how far into the future a slot can be reserved. For instance, instead of the default 5-minute duration, we should be able to reserve a slot for an extended period—up to 1000 years, if needed—effectively keeping the slot reserved indefinitely until we trigger a "Delete a selected slot" API or complete a booking.

This functionality would be particularly useful when building on top of Cal.com using its platform API, such as when creating predefined classes.

Thanks for the input and it's a great idea! Luckily, this is implemented in this PR. Here is an example POST request made to /v2/slots/reservations with the reservationDuration set to 60 minutes with following request body:

{
    eventTypeId: 10,
    slotStart: "2050-09-05T10:00:00.000Z",
    reservationDuration: 60,
}

@supalarry
Copy link
Contributor Author

If possible, it would be great to include the ability to return reserved slots along with their slot ID and datetime. This would be especially beneficial for managing predefined timed classes or events across various platforms.

The response of reserving a slot can be viewed here: reserve-slot.output.ts

Slots don't have IDs per se, but reservations do, so response contains UID of the reservation and the slotStart telling when slot starts and more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only ✨ feature New feature or request platform Anything related to our platform plan ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants