-
Notifications
You must be signed in to change notification settings - Fork 11.3k
feat: add hostSubsetIds parameter for round robin host filtering #25627
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
Conversation
Add support for filtering round robin event type hosts via API v2. When hostSubsetIds is provided, only the specified hosts are considered for availability calculation and booking assignment. Changes: - Add hostSubsetIds to slots API input (GET /slots/available) - Add hostSubsetIds to booking API input (POST /bookings) - Update _findQualifiedHostsWithDelegationCredentials to filter by hostSubsetIds - Pass hostSubsetIds through all layers: API -> tRPC -> slots/booking services This allows API consumers to request availability and create bookings for a subset of hosts within a round robin event type. Co-Authored-By: [email protected] <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/two-factor-authentication |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 29 files
Prompt for AI agents (all 2 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/api/v2/src/modules/slots/slots-2024-09-04/controllers/e2e/team-event-type-slots.controller.e2e-spec.ts">
<violation number="1" location="apps/api/v2/src/modules/slots/slots-2024-09-04/controllers/e2e/team-event-type-slots.controller.e2e-spec.ts:119">
P2: Missing cleanup for `teammateThree` in `afterAll`. This user is created in `beforeAll` but not deleted during test cleanup, which will cause test data pollution. Add `await userRepositoryFixture.deleteByEmail(teammateThree.email);` to the `afterAll` block.</violation>
</file>
<file name="apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/team-bookings.e2e-spec.ts">
<violation number="1" location="apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/team-bookings.e2e-spec.ts:653">
P3: Test description has grammatical error: "for force" should be "to force".</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
.../modules/slots/slots-2024-09-04/controllers/e2e/team-event-type-slots.controller.e2e-spec.ts
Show resolved
Hide resolved
apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/team-bookings.e2e-spec.ts
Outdated
Show resolved
Hide resolved
emrysal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RoutedMemberIds for API, looks good 👍
What does this PR do?
Adds support for filtering round robin event type hosts via API v2. When
hostSubsetIdsis provided, only the specified hosts are considered for availability calculation and booking assignment.This allows API consumers to request availability and create bookings for a specific subset of hosts within a round robin event type. For example, if a round robin event has 10 hosts but the user only wants to be matched with 2 specific hosts, they can pass those host IDs via
hostSubsetIds.Changes:
hostSubsetIdsto slots API input (GET /slots/available)hostSubsetIdsto booking API input (POST /bookings)_findQualifiedHostsWithDelegationCredentialsto filter byhostSubsetIdshostSubsetIdsthrough all layers: API → tRPC → slots/booking servicesRequested by: [email protected] (@ThyMinimalDev)
Link to Devin run: https://app.devin.ai/sessions/c0fb075cea004bf58eb4cbec324781c5
Visual Demo (For contributors especially)
N/A - This is a backend API change with no UI components.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Testing slots endpoint:
GET /v2/slots/available?eventTypeId={id}&startTime=...&endTime=...&hostSubsetIds=1,2Testing booking endpoint:
POST /v2/bookingswithhostSubsetIds: [1, 2]Edge cases to verify:
hostSubsetIdswith IDs that don't exist in the event type → should return empty availabilityhostSubsetIdscombined withroutedTeamMemberIds→routedTeamMemberIdsshould filter within thehostSubsetIdssubsetChecklist
Human Review Checklist
hostSubsetIdsis applied as a hard filter BEFOREcontactOwnerEmailandroutedTeamMemberIdsfiltershostSubsetIdsresults in no matching hosts, empty availability is returned (no fallback to all hosts)findQualifiedHostsWithDelegationCredentials.ts