-
Notifications
You must be signed in to change notification settings - Fork 12.7k
refactor(bookings): delivers per-member round-robin limit overrides end-to-end #28715
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
Open
manurana26770
wants to merge
19
commits into
calcom:main
Choose a base branch
from
manurana26770:feat/individual-member-limits
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7e416b2
refactor(bookings): add round-robin host effective-limits foundation …
manurana26770 fd96d98
Merge branch 'main' of https://github.com/calcom/cal.com into feat/in…
manurana26770 a006556
feat(bookings): plumb host limit override fields into round-robin boo…
manurana26770 4bf1e79
refactor(users): dedupe normalized host projection for routing paths
manurana26770 9aa3339
Merge branch 'main' of https://github.com/manurana26770/cal.com into …
manurana26770 cd35eae
Merge branch 'calcom:main' into feat/individual-member-limits
manurana26770 28864fb
Merge branch 'main' of https://github.com/calcom/cal.com into feat/in…
manurana26770 5ca647c
feat(event-types): persist per-host round-robin limit overrides
manurana26770 a06f40a
feat(event-types-ui): add per-host limit controls in assignment flow
manurana26770 a8c06e9
feat(bookings): load host override limits in booking pipeline
manurana26770 7666def
feat(round-robin): enforce effective host limits in booking flows
manurana26770 f094cf4
feat(slots): bucket hosts by effective booking limits
manurana26770 af540ba
Merge branch 'feat/individual-member-limits' of https://github.com/ma…
manurana26770 c8d740a
fix(round-robin): address review findings for host overrides and slots
manurana26770 e0e90e8
Merge branch 'main' of https://github.com/calcom/cal.com into feat/in…
manurana26770 2cd0a29
fix(round-robin): resolve post-merge review findings
manurana26770 52840ed
fix(round-robin): retry host selection on limit conflicts
manurana26770 3b5b741
fix(eventtypes,slots): stabilize UTC date normalization and timezone …
manurana26770 192c88b
fix(round-robin): recheck recurring availability for retry candidates
manurana26770 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
packages/features/bookings/lib/handleNewBooking/eventTypeEffectiveLimits.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import type { getEventTypeResponse } from "./getEventTypesFromDB"; | ||
| import type { IsFixedAwareUser } from "./types"; | ||
|
|
||
| export type EventLimitFields = Pick< | ||
| getEventTypeResponse, | ||
| | "minimumBookingNotice" | ||
| | "beforeEventBuffer" | ||
| | "afterEventBuffer" | ||
| | "slotInterval" | ||
| | "bookingLimits" | ||
| | "durationLimits" | ||
| | "periodType" | ||
| | "periodDays" | ||
| | "periodCountCalendarDays" | ||
| | "periodStartDate" | ||
| | "periodEndDate" | ||
| >; | ||
|
|
||
| export type EventTypeResponseWithIsFixedAwareUsers = Omit<getEventTypeResponse, "users"> & { | ||
| users: IsFixedAwareUser[]; | ||
| }; | ||
|
|
||
| export const getEventLevelLimits = <T extends EventLimitFields>(eventType: T): EventLimitFields => ({ | ||
| minimumBookingNotice: eventType.minimumBookingNotice, | ||
| beforeEventBuffer: eventType.beforeEventBuffer, | ||
| afterEventBuffer: eventType.afterEventBuffer, | ||
| slotInterval: eventType.slotInterval, | ||
| bookingLimits: eventType.bookingLimits, | ||
| durationLimits: eventType.durationLimits, | ||
| periodType: eventType.periodType, | ||
| periodDays: eventType.periodDays, | ||
| periodCountCalendarDays: eventType.periodCountCalendarDays, | ||
| periodStartDate: eventType.periodStartDate, | ||
| periodEndDate: eventType.periodEndDate, | ||
| }); | ||
|
|
||
| export const buildEventTypeWithEffectiveLimits = <T extends EventLimitFields>(params: { | ||
| eventType: T; | ||
| effectiveLimits: EventLimitFields; | ||
| }): T => { | ||
| const { eventType, effectiveLimits } = params; | ||
|
|
||
| return { | ||
| ...eventType, | ||
| minimumBookingNotice: effectiveLimits.minimumBookingNotice, | ||
| beforeEventBuffer: effectiveLimits.beforeEventBuffer, | ||
| afterEventBuffer: effectiveLimits.afterEventBuffer, | ||
| slotInterval: effectiveLimits.slotInterval, | ||
| bookingLimits: effectiveLimits.bookingLimits, | ||
| durationLimits: effectiveLimits.durationLimits, | ||
| periodType: effectiveLimits.periodType, | ||
| periodDays: effectiveLimits.periodDays, | ||
| periodCountCalendarDays: effectiveLimits.periodCountCalendarDays, | ||
| periodStartDate: effectiveLimits.periodStartDate, | ||
| periodEndDate: effectiveLimits.periodEndDate, | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.