* refactor: convert findQualifiedHostsWithDelegationCredentials to service class with DI
- Create QualifiedHostsService class following UserAvailabilityService pattern
- Add IQualifiedHostsService interface with prisma and bookingRepo dependencies
- Create DI module and container for qualified hosts service
- Update filterHostsBySameRoundRobinHost to accept prisma as parameter
- Update all usage sites to use the new service:
- loadAndValidateUsers.ts
- slots/util.ts
- test mocks in _post.test.ts
- Maintain backward compatibility with original function export
- Fix type issues in team properties (rrResetInterval, rrTimestampBasis)
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* fix: update filterHostsBySameRoundRobinHost test to include prisma parameter
- Add missing prisma parameter to all test function calls
- Resolves unit test failure caused by function signature change
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* fix: resolve type issues in FilterHostsService
- Import PrismaClient type instead of using unknown
- Fix type compatibility for BookingRepository constructor
- Update test mocks to use proper BookingRepository type
- Ensure all DI dependencies are properly typed
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* refactor: rename DI files to CamelCase and update imports
- Rename all files in packages/lib/di from kebab-case to CamelCase
- Update 22 external files with import statements to use new file names
- Update internal DI module files with corrected imports
- Maintain consistency with TypeScript naming conventions
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* chore: bump platform libs
* chore: bump platform libs
* fix: remove obsolete vitest mock after service class refactoring
- Remove obsolete mock for old function module
- Keep correct mock for new DI container
- Resolves CI unit test failures
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* fix: correct import path for calAIPhone zod-utils module
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* fix: Booker active booking limit can't be switched off (#23005)
* refactor: Get rid of `getServerSideProps` for /getting-started pages (#23003)
* refactor
* fix type check
* fix: Remove Reporting page within Routing Forms (#22990)
* fix error in handleNewBooking (#23011)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
* Documentation edits made through Mintlify web editor (#23007)
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* fix: Contact support button position changed from absolute to fixed (#23002)
* feat: Add private links to API (#22943)
* --init
* address change requests
* adding further changes
* address feedback
* further changes
* further clean-up
* clean up
* fix module import and others
* add guards
* remove unnecessary comments
* remove unnecessary comments
* cleanup
* sort coderabbig suggestions
* improve check
* chore: bump platform libraries
---------
Co-authored-by: Lauris Skraucis <lauris.skraucis@gmail.com>
Co-authored-by: supalarry <laurisskraucis@gmail.com>
* chore: release v5.5.15
* chore: bump platform libs
* chore: bump platform libs
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: morgan@cal.com <morgan@cal.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
Co-authored-by: Benny Joo <sldisek783@gmail.com>
Co-authored-by: Sahitya Chandra <sahityajb@gmail.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: Ayush Kumar <kumarayushkumar@protonmail.com>
Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
Co-authored-by: Lauris Skraucis <lauris.skraucis@gmail.com>
Co-authored-by: supalarry <laurisskraucis@gmail.com>
Co-authored-by: emrysal <me@alexvanandel.com>
* fix MSTeams formatting and duplicate events
* update without changing scopes, create onlineMeetings through CalendarService instead of VideoApiAdapter
* get url after online meeting is created required for downstream
* fallback to callvideo if only MSteams and update evt.videoCallData with url
* for backward compatibility set explicitly 'Microsoft Teams Meeting' for old meetings if rescheduled
* add dependency to msTeams App
* nit
* use interpolation
* update to create MSTeams event if only MSTeams installed and not Outlook Calendar
* make function MSTeams specific
---------
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
* feat: cal ai self serve architecture
* chore: add package
* chore: update evnet controller
* refactor: improvements
* chore: rename
* chore: type error and naming
* chore: just set it to nul
* chore: just set it to nul
* chore: some more improvements
* chore: packate version
* fix: API v2
* chore: change name of files
* chore: add select
* chore: add missing teamId
* chore: save progress
* refactor: split into multiple services
* refactor: make schema provider agonistic
* chore: improvements
* chore:
* chore: remove duplicate files
* chore: semicolon
* chore: formatting
* refactor: logging and error handling
* chore: rename variable
* refactor: use trpc error
* chore: replace with HttpError
* chore: remove from option
* We need the enum and not just the type
---------
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
* fix: apply PBAC to routing form CRUD
* apply permission checks to the UI
* moving prisma call to repository [WIP]
* rename repository and fix type error
* update implementation
* fix formMutation handler
* remove unused import
* revert some rename
* add RolePermission for 'routingForm'
* Revert "revert some rename"
This reverts commit 0ef3114c0d27b821271b36296de531654b37749f.
* clean up PrismaRoutingFormRepository
* fix unit test
* remove no longer necessary code
* fix type definition
* explicit permission handling
* do not disable un-editable routing form
* fix: correct property name from readonly to readOnly in ListLinkItem
- Fix TypeScript error in routing forms component
- Change readonly={readOnly} to readOnly={readOnly} to match component interface
- Resolves type check failure in CI
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
---------
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* chore: Add relation between a host and a membership for future cascades
* Apply suggestion
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* add Add Group button
* add host groups to schema
* UI for host groups
* raname groups to hostGroups
* schema update
* show groups in assignment tab
* add no group hosts to Group 1
* add dummy group for non group hosts
* fix type errors
* use two dimensional array for luckyUserPools
* fix empty array
* group RR hosts in handleNewBooking
* improve logic for grouping lucky users
* find all lucky users of all groups
* allow several RR hosts on booking
* clean up migrations
* create helper function
* group hosts for slots logic
* add group logic to loading available slots
* adding hosts to groups
* add groupId to hostSchema
* disable hosts from other groups
* handle groups in checkedTeamSelect
* fix adding hosts to groups
* remove and add groups
* show hosts if there are no groups
* fixing adding first group with existing hosts
* show groups empty groups correctly
* UI upddate fixes
* fix adding hosts to existing first host group
* small fixes + code clean up
* add availability fix with test
* create new round-robin test file
* disable reassignment
* fix losing fixed hosts
* fix updating weights and priorities
* disable load balancing with Round Robin Groups
* automatically disable load balancing in update handler
* allRRHosts should only include hosts from same group
* fix type errors
* fix type error
* fix tests
* fix type error
* remove undefined from groupId type
* type changes
* add tests for hostGroups
* add tests for host groups
* fixes
* fix type errors with undefined groupId
* remove seperate host groups prop
* fix editing weights
* remove console.log
* code clean up
* improve getAggregatedAvailability tests
* throw error when no available hosts in a group
* add fixme comment
* create constant for DEFAULT_GROUP_ID
* clean up code
* mock default_group_id for unit tests
* don't show fixed hosts in edit weights side bar
* add DEFAULT_GROUP_ID to mock test-setup
* remove unused index variable
* code clean up
* fix updating host groups
* fix imports
* add default_group_id to mocks
* add uuid() to zod schema
* remove unused code
* fix singular translation key
* remove unnessary !!
* Revert formatting changes
* add additional tests for bookingActions
* use createMany
* import DEFAULT_GROUP_ID for mocks
* fix mocks
* clean up EventTeamAssignmentTab
* fix type errors in tests
* fix mocks
* remove constants.example.test.ts
* fix type error
* add missing groupId
* fix margin
* clean up empty host groups
* fix constants mock
* useCalback
* use reduce
* extract handlers into seperate functions
* fix handler functions
* fix border radius
* fix type error in CheckForEmptyAssignment
* fix type error
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2025-08-08 12:56:13 +01:00
Anik Dhabal BabuGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: prevent makeBodyVisible timeout from running after test teardown
- Add timeout tracking to makeBodyVisible function to enable cleanup
- Add vi.clearAllTimers() to test teardown to clear recursive timeouts
- Prevents 'ReferenceError: document is not defined' in CI tests
Fixes intermittent test failures where makeBodyVisible recursive timeout
continues running after test environment is torn down.
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* simplify: use only vi.clearAllTimers() to fix timeout issue
Based on code review feedback, test if vi.clearAllTimers() alone
is sufficient without modifying makeBodyVisible function.
- Reverted makeBodyVisible function changes
- Kept only vi.clearAllTimers() in test teardown
- Verified with multiple test runs and type checking
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor: convert getBusyTimes to service class with dependency injection
- Create BusyTimesService following UserAvailabilityService pattern
- Add DI tokens, module, and container setup for BusyTimesService
- Update all usage locations to use service instead of direct function calls
- Maintain existing function signatures for backward compatibility
- Add legacy exports to ensure smooth transition
- Update type references in trpc util to use service prototype
- Fix linting issues by making legacy exports async with proper imports
- All tests pass and type checking succeeds
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* refactor: busy time service
* fix: api v2 eslint plugins version mismatch
* chore: bump platform libs
* chore: bump platform libs
* fix: missing di busyTimesModule in slots service
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: morgan@cal.com <morgan@cal.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
* chore: Move date range validation to zod, removing TRPCError
* This is not a BAD_REQUEST but an internal error, should not happen
* Add a check to ensure the given start time is before end time
* fix: make organizationId optional number type in BookerEmbed
* feat: dont call useMe for embeds
* useOAuthClient hook should re-run when url is set
* feat: Remove `?orgId=0` from /public event query params
---------
Co-authored-by: Rajiv Sahal <sahalrajiv-extc@atharvacoe.ac.in>
* refactor: move getTotalBookingDuration to BookingRepository
- Move getTotalBookingDuration function from standalone file to BookingRepository class
- Update all usage sites to call method through repository instance
- Remove standalone function file packages/lib/server/queries/booking/index.ts
- Add prisma import to util.ts for BookingRepository instantiation
- Maintain exact same method signature and functionality
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* fix: remove eslint-config-next to resolve TypeScript ESLint conflicts
- Remove eslint-config-next dependency that was causing version conflicts
- Resolves 'Class extends value undefined is not a constructor or null' errors
- ESLint 'next' config issue appears to be pre-existing in main branch
Co-Authored-By: morgan@cal.com <morgan@cal.com>
* fixup! Merge branch 'main' into devin/move-getTotalBookingDuration-1754460208
* chore: bump platform libs
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: morgan@cal.com <morgan@cal.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>