cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

feat: Implement global booking limits for users

Open asadath1395 opened this issue 1 year ago • 33 comments

What does this PR do?

Fixes #8985

https://www.loom.com/share/c99fb2713137476fb987dcd76236704a?sid=101bbea4-6f4b-4a83-82f7-5fc2bd308a1b

Type of change

  • New feature (non-breaking change which adds functionality)

Mandatory Tasks

  • [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

asadath1395 avatar Mar 28 '24 07:03 asadath1395

@asadath1395 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Mar 28 '24 07:03 vercel[bot]

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

github-actions[bot] avatar Mar 28 '24 07:03 github-actions[bot]

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (03/28/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (03/28/24)

1 label was added to this PR based on Keith Williams's automation.

"Add foundation team as reviewer" took an action on this PR • (04/16/24)

1 reviewer was added to this PR based on Keith Williams's automation.

graphite-app[bot] avatar Mar 28 '24 07:03 graphite-app[bot]

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

New Page Added

The following page was added to the bundle from the code in this PR:

Page Size (compressed) First Load % of Budget (350 KB)
/settings/my-account/bookings 311.71 KB 540.14 KB 154.33%

github-actions[bot] avatar Mar 28 '24 07:03 github-actions[bot]

@ciaranha Shouldn't global booking limits limit the number of bookings of your whole cal.com account considering all event types?

For example:

  • Global booking limit: 1 per day
  • Event type 1 gets booked for tomorrow
  • Now tomorrow is blocked for all event types

If that's the case then I think we also don't need the Review part here: Screenshot 2024-04-17 at 10 18 04 AM You could still want an event type specific booking limit. For example:

  • Global limit: 10 bookings per week
  • Event type limit: Only allow 1 booking of this event type per day

CarinaWolli avatar Apr 17 '24 14:04 CarinaWolli

@ciaranha Shouldn't global booking limits limit the number of bookings of your whole cal.com account considering all event types?

👆 Yes.

For example:

Global booking limit: 1 per day Event type 1 gets booked for tomorrow Now tomorrow is blocked for all event types

👆 Exactly

You could still want an event type-specific booking limit. For example:

  • Global limit: 10 bookings per week
  • Event type limit: Only allow 1 booking of this event type per day

👆 Exactly

If that's the case then I think we also don't need the Review part here:

👆 Yes

Copy suggestions for clarification: CleanShot 2024-04-17 at 15 33 04@2x

ciaranha avatar Apr 17 '24 14:04 ciaranha

@asadath1395 I am putting this in draft as this needs some adjustments 🙏

CarinaWolli avatar Apr 17 '24 14:04 CarinaWolli

The syncing thing threw me offguard. @ciaranha How should the global future booking limit work?

asadath1395 avatar Apr 17 '24 15:04 asadath1395

The syncing thing threw me offguard. @ciaranha How should the global future booking limit work?

I think the above comment explains it pretty well but let me know if you still have questions 🙏

CarinaWolli avatar Apr 17 '24 16:04 CarinaWolli

@asadath1395 are you referring to the Global settings for "Limit future booking" & "Buffers" from here?

If so, you can ignore those and just implement the "Limit booking frequency" here. I don't think there's anything else to cover from a design perspective. Let me know if this clears things up for you.

ciaranha avatar Apr 18 '24 08:04 ciaranha

@asadath1395 are you referring to the Global settings for "Limit future booking" & "Buffers" from here?

If so, you can ignore those and just implement the "Limit booking frequency" here. I don't think there's anything else to cover from a design perspective. Let me know if this clears things up for you.

Yup i was referring to that, cool will go ahead and tweak the existing "Limit booking frequency" to match as discussed above. On a side note, if and when Global settings for "Limit future booking" & "Buffers" are ready, i would love to work on it, please feel free to assign it to me. Thanks

asadath1395 avatar Apr 18 '24 09:04 asadath1395

@asadath1395 great thank you 🙏 from a design point of view, the others are ready. I will however just create separate issues for them and get a review from other team members to ensure we want to add these to the product and there are no unforeseen downsides or anything overlooked.

ciaranha avatar Apr 18 '24 10:04 ciaranha

@asadath1395 make sure to mark PR as 'ready for review' when you are done 🙏

CarinaWolli avatar Apr 23 '24 21:04 CarinaWolli

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Jun 13 '24 00:06 github-actions[bot]

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Jul 04 '24 00:07 github-actions[bot]

This PR is being closed due to a lack of activity. Please reopen if work is to continue.

keithwillcode avatar Jul 29 '24 03:07 keithwillcode

@CarinaWolli Since you are working on global booking limits for teams https://github.com/calcom/cal.com/issues/16557, 2nd point here https://github.com/calcom/cal.com/pull/14243#pullrequestreview-2025439062 is not applicable for this PR, right?

asadath1395 avatar Sep 13 '24 09:09 asadath1395

@keithwillcode Could you please re-open this PR? I would like to continue the work here

asadath1395 avatar Sep 13 '24 12:09 asadath1395

@CarinaWolli Since you are working on global booking limits for teams #16557, 2nd point here #14243 (review) is not applicable for this PR, right?

Yes you are right, we changed that. We only want to count the user's bookings including bookings from managed event types, but not bookings from other team event types (collective, round-robin)

CarinaWolli avatar Sep 17 '24 20:09 CarinaWolli