* Refactors related to enabling typescript 5.3.3 in @calcom/trpc
* Also skip respective tests (obviously logic is broken)
* This causes problems for some reason, revert
* Bring back QueryCell as it's used by atoms
* Partial push of new filters
* Let's always return the passed host array when a filter doesn't need to be applied
* fix: isFixed typing in same round robin host check
* Add main bulk of rewritten logic for routed fairness support
* Remove console.log
* Add getAttributeWithEnabledWeights to AttributeRepository
* Add OOO entry repository
* Use getOrderedListOfLuckyUsers in lead threshold filtering
* Shortfall already includes weight
* test against minShortfall
* first attempt to fix fallbacks
* Added testcase updates
* Partially fix filterHosts test
* Some test updates
* Removed email field from normalization
* fix no available users found error
* fix unit test
* remove fallback from same host reschedule return
* fixes and improvements for findQualifiedHosts
* include fallback logic in handleNewBooking
* use fallback in handleNewBooking
* fix for contact owner in handleNewBooking
* WIP - comment
* pass routingFormResponseId
* fix type error
* pass routingFormResponse
* fixes in treshold logic
* remove reason
* merge qualified and fallback availabilities
* fix type error
* add and fix tests
* clean up test file
* fix filterHostsBySameRoundRobinHost tests
* fix findQualifiedHosts.test.ts
* fix getRoutedUsers.test.ts
* fix tests
* fix isRerouting check
* fix start time for two weeks check
* fix fallback hosts
* fix test
* fallback hosts should also include qualified hosts
* fix type error
* fix typos
* add contact owner to fallbacks
* fix typo
* fix qualifiedRRUsers
* set fixed users when no hosts
* add tets + code clean up
* add test for reschedule with same host
* fix typo
* add more tests for findQualifiedHosts
* remove skip from test
* add comment
* remove unused code
* fix fallback users in loadAndValidateUsers
* improve naming for fallback
* rename missed fallback variable
* fix reschedule with same rr host in handleNewBooking
* fixes for fallback slots
* add more tests + small fixes for contact owner
* fix tests and type errors
* add logs for fallback
* add type:json to logger
* Fix small merge issue
* fix end time if two weeks are cut off
* add more tests for contact owner availability check
* add new logic for two weeks fallback
* fix reschedule same RR host test
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
* Reapply "fix: Multiple rr-hosts combine to create erroneous availability (#18772)"
This reverts commit 5dbc6d9ca6.
* Only thing left is a diff to show which slots are removed
* Add logging around time slot results
* Setup logging through axiom
* .... forgot
* fix: type errors
* Only log when there are differences
* Updated from old which had a failing test to new logic
* default people filter for admin
* chore
* type check
* added test case
* made test concise to reduce flakiness
* add timeout to wait for second get response before counting
* update timeout
---------
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* wip: Open draft PR with passing test (should fail)
* Fix aggregatedAvailability by not merging rr host availability
* Added test for validating fixed host behaviour
* Add test for combined rr and fixed hosts
* Check date-ranges arent returned multiple times when offered by multiple rr hosts
* Also sort date ranges
* Adding failing test that should result in 5 slots, but returns 7 as it returns the same slots twice.
* Slots returns duplicate slots for overlapping date ranges
* As mergeOverlappingDateRanges enabled the unified start time, we need to reproduce this
* Do not 'prettify' slots to the same degree if they fall on different days
* Added test to prove an end date before start also works
* Use a string instead of number as key
* chore: Deprecate organizerTimeZone, effectively unused
* Adjust all dateRanges similarly
* Bring back eventTimeZone
* Remove adjustDateRanges in favour of slot generation changes
* Convert to tz after all logic is finished.
* clearer code flow
* Remove console.log + add failing test due to inverse order
* Address issue with inversion when date ranges are given out of order
* feat: add option to disable sending transcription emails
* fix: types and tests
* fix: type error
* fix: type err
* fix: type err
---------
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
* migration and init to accept creationSource for new bookings
* V1 create booking
* V1 user creation
* webapp booking + V1 user
* user creation in V1, V2 and webapp
* booking source V2 and fix for v1 user
* fit type
* --fix type
* add test -- WIP
* fix type
* fix type
* ^
* Need more sleep zzz
* -_-
* bump libraries platform
* adds for v2 recurring booking
* fix lint
* instant meetings
* fix: api v2 creation source
* fixup! fix: api v2 creation source
* bump libraries
* add user
* fix test
* fixup! fix test
* add more source
* more source...
* fix type & test --1
* fix type & test --2
* typefix
* fixup test
---------
Co-authored-by: Morgan Vernay <morgan@cal.com>
* migration + migrate booking limit page to team settings
* new pages
* use settings toggle for displaying content
* get current team presets
* update mutation
* i18n for settings page
* remove redudant await
* cancelation UI for select
* handle other selection
* extract into a util
* inital cancelation reason flow
* fix i18n to be more readable
* add cancel reason logic
* nits
* improve copy
* ensure is teamMember and not isAdmin for getting internalNotes
* improvie spacing between elements
* fix types
* more type fixes
* correct types
* Update packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts
* use input component and remove mb-2 to allign with icon button
* Update packages/trpc/server/routers/viewer/teams/updateInternalNotesPresets.handler.ts
Co-authored-by: Eunjae Lee <hey@eunjae.dev>
* nits
* type fixs
* fix type
* fix type
* fix nullable option lost in merge
---------
Co-authored-by: Eunjae Lee <hey@eunjae.dev>
* Create `checkIfTeamHasActivePlan` method on `stripe-billing-service`
* Add `checkIfTeamPlanIsActive` to `InternalTeamBilling`
* Create `hasActiveTeamPlan` trpc endpoint
* Check for active team plan when updating workflows
* Create `useHasActiveTeamPlan` hook
* Use `useHasActiveTeamPlan` on workflow edit page
* Type fixes
* Type fix
* Add `accepted` to team query
* feat: Enhance SCIM user attribute handling and sync process
- Introduced a new PR_TODO.md file to track ongoing tasks and fixes.
- Updated `getAttributesFromScimPayload` to accept a directoryId and ignore core user attributes during syncing.
- Modified `handleUserEvents` to pass directoryId when syncing custom attributes.
- Improved attribute creation logic to handle unique options and added support for optional isGroup property in attribute options.
- Added utility function `getOptionsWithValidContains` to ensure valid sub-options in attribute options.
- Updated tests to reflect changes in attribute handling and ensure proper functionality.
This commit addresses issues with user attribute syncing and enhances the overall attribute management process.
* test: Add unit tests for getOptionsWithValidContains utility function
- Introduced a new test file for the getOptionsWithValidContains function.
- Added tests to verify the removal of duplicate options, initialization of empty contains arrays, filtering of non-existent sub-options, and handling of empty options arrays.
- Ensured comprehensive coverage of the utility's functionality to enhance reliability and maintainability.
* refactor: Update booking query to use userId and optimize availability check logic
- Changed the booking query to use userId instead of nested user object for filtering active bookings.
- Refactored availability check logic to improve readability and performance by using valueOf() for time comparisons and consolidating multiple checks into a single return statement.
* fix: update tests
* chore: use toDate()
* tests: add checkavailable unit tests