* first version of ooo calibration
* decrease precision when checking for full day event
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* improve variable naming
* don't include hosts created after OOO
* fix failing tests
* fix all tests
* add test for ooo calibration
* first implementation to fix full day busy event reaching the current month
* allow mutiple day events
* make getAvailabilityWithTimeZones optional
* fix type error
* fix type errors
* fix tests
* fix type error
* fix test
* code clean up
* remove time adjustment from map
* code clean up
* fix tests
* getAllCalendars -> this.getAllCalendars
* fix typo
* extract mergeOverlappingRanges
* code improvements from feedback
* fix getCalIdsWithTimeZone
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Benny Joo <sldisek783@gmail.com>
* Add email domain array
* Create numbered email domain object
* Check email domain
* Rename function
* Add tests
* Frontend enable skip ownership check if free email domain
* Backend ignore adding ownership to return records if free email domain check is enabled
* feat: Only require confirmation for free email domains (#17917)
* Add requiresConfirmationForFreeEmail to db
* Add option to event type settings
* Get requiresConfirmationForFreeEmail for event type page
* Include requiresConfirmationForFreeEmail in fetching event type
* Pass bookerEmail to `getRequiresConfirmationFlags`
* Add free email domain check to `determineRequiresConfirmation`
* Add `requiresConfirmationForFreeEmail` to types
* Add severity to Watchlist table
* Add migration for watchlist severity
* Add `getEmailDomainInWatchlist` method to watchlist repository
* Use watchlist repository to check for free email domain
* Mock watchlist repository in test
* Update test
* Rename method
* Add severity to blocked list
* Move check free email domain to async
* Type checks
* Adjust for promise returned
* Fix tests
* Fix
* Fix tests
* revert: "fix: Request permissions to allow events to be created on shared Office365/Outlook calendars (#17760)"
This reverts commit 1680cba5a5.
* plain.com card
* detiled error handling for get customer
* working email and id
* hmac
* Revert "fix: correct line-breaks in calendar event description (#18077)"
This reverts commit 06494a6999.
* pr changes requet
* remove pan for now
* add-new-implementation-for-early-review
* Pushing fix for createHmac stringify
* added validation and user repository for email check
* add apiRouteMiddleware which handles the error handling
* HMAC_SECRET_KEY -> PLAIN_HMAC_SECRET_KEY
* Use the right error
* Convey right error to consumer
* Fixup apiRouteMiddleware to handle handler
* Don't export handler, only export POST
* changed to app directory
* working unkown user card
---------
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* feat: AI description - DB model + frontend + backend (fetch only)
* fix types and add validation to backend
* improve log
* improve
* import type
* add EventTypeTranslationRepository
* fix replexica error
* fix replexica error
* fix
* fix test
* wip
* wip
* add createManyDescriptionTranslations method
* improve logic
* refactor
* update replexica type
* improve typing
* Renamed descriptionTranslations to fieldTranslations
* log errors in replexica service
* handle translations in background
* don't create, upsert instead
* make sure that description is updated
* simplify
* fix
* Update packages/trpc/server/routers/viewer/eventTypes/update.handler.ts
* improve filter logic in frontend
* implement background job using Tasker
* update schema
* update schema again
* rename
* rename id to uid
* add migration
* fix type
* update
* update schema and migration sql
* fix migration
* fix type check
* fix type check 2
* improve find logic in EventMeta
* add more validation
* add logger
* rename
* upgrade replexica/sdk to 0.7.0
* upgrade replexica to 0.7.0
* use batchLocalizeText
* add comments
* override browser locale if user is a signed in calcom user
* fix type in replexica
* fix migration sql
* fix type
* use dynamic import
* do not use batchLocalizeText
* chore: drop sourceLang, targetLang and id columns
* fix
* wip
* add more validations
* fix type error
* address comment
* refactor
* update booking page to use translated title
* fix type error
* fix
* revert yarn.lock changes
* remove unused import
* remove duplication migrate.sql file
* fix test
* remove test tags
* fix function name
* refactor
* fix type check
* use Promise.all
* remove unneeded code
---------
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
* change order of eventtypes and routingforms
* for workflows
* for filtered workflows
* update slug of first expected event-type
* updated due to latest merges
* test to ensure new eventtype added is first in the list
* test for workflows
---------
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* feat: AI description - DB model + frontend + backend (fetch only)
* fix types and add validation to backend
* improve log
* improve
* import type
* fix replexica error
* fix
* fix test
* update replexica type
* Renamed descriptionTranslations to fieldTranslations
* Moved the eventTypeId column to 2nd
---------
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
## What does this PR do?
Optimizes team and organization admin checks by:
- Removing unnecessary member data fetching in profile repository
- Simplifying team admin verification query to directly check membership
- Refactoring organization admin check to use the optimized team verification method
## Mandatory Tasks
- [x] I have self-reviewed the code
- [x] I have updated the developer docs in /docs
- [ ] I confirm automated tests are in place
## How should this be tested?
1. Log in as a team admin/owner
2. Verify team admin privileges still work correctly
3. Log in as an organization admin
4. Confirm organization admin permissions are maintained
5. Check that admin-only features remain accessible
Expected behavior:
- Team admins/owners should retain all their existing permissions
- Organization admins should maintain their administrative capabilities
- No degradation in admin functionality while improving query performance
## Checklist
- I haven't read the [contributing guide](https://github.com/calcom/cal.com/blob/main/CONTRIBUTING.md)
- My code doesn't follow the style guidelines of this project
- I haven't commented my code, particularly in hard-to-understand areas
- I haven't checked if my changes generate no new warnings
* wip
* Add preview mode in router
* only fetch bookings of this month for weighted rr
* test set up
* only get bookings of current month
* reverts test setup
* first changes for weight adjustments
* reset booking count + adjust calibration
* depreciate weightAdjustment
* get only bookings created this month
* fix typo
* make sure createdAt for hosts is correct
* use earliest possibel date as fallback
* add missing createdAt date to tests
* fix typo
* clean up changes in tests
* fix typo
* change end date to current date
* fix: Fall back to empty host array when no hosts are found
* fix: Restructure code a little
* fixed test, incorrectly used now outdated var
* perf: remove Dayjs from getLuckyUser
* Refactor getHostsWithCalibration for optimised performance, intentionally break test as findMany is always an array
* Better mock for host.findMany
* Remove team-event-types.test.ts, move to appropriate package
* TypeScript cannot auto-infer that an array is non-empty when assigning to a var
* fix: Type Fixes and DistributionMethod enum add
* Optimise tests
* Added test to show that bookings made before a newHost was added affect the lucky user result
* Throw error when the usersWithHighestPriority is empty, which should never happen
* WIP
* remove comment
* update migrations
* get attributes weights and virtual queue data
* use attribute weights and use bookings of virtual queue only
* clean up migrations
* Add shortfall column and add tests
* code clean up from feedback
* wrapper function for getLuckyUser
* code clean up
* fetch routingFormResponse in handleNewBooking
* fix type errors
* fix type errors in tests
* fix getAttributesQueryValue import for tests
* fix totalWeight
* add test for attributes weights and virtual queues
* clean up code
* add test for prepareQueuesAndAttributesData
* remove console.log
* use lazy import
* Add more tests and more columns to matching members queue
* fix issue from merge
* always send usersAndTheirBookingShortfalls
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* only fetch bookings of this month for weighted rr
* test set up
* only get bookings of current month
* reverts test setup
* first changes for weight adjustments
* reset booking count + adjust calibration
* depreciate weightAdjustment
* get only bookings created this month
* fix typo
* make sure createdAt for hosts is correct
* use earliest possibel date as fallback
* add missing createdAt date to tests
* fix typo
* clean up changes in tests
* fix typo
* change end date to current date
* fix: Fall back to empty host array when no hosts are found
* fix: Restructure code a little
* fixed test, incorrectly used now outdated var
* perf: remove Dayjs from getLuckyUser
* Refactor getHostsWithCalibration for optimised performance, intentionally break test as findMany is always an array
* Better mock for host.findMany
* Remove team-event-types.test.ts, move to appropriate package
* TypeScript cannot auto-infer that an array is non-empty when assigning to a var
* fix: Type Fixes and DistributionMethod enum add
* Optimise tests
* Added test to show that bookings made before a newHost was added affect the lucky user result
* Throw error when the usersWithHighestPriority is empty, which should never happen
* WIP
* remove comment
* update migrations
* get attributes weights and virtual queue data
* use attribute weights and use bookings of virtual queue only
* clean up migrations
* code clean up from feedback
* wrapper function for getLuckyUser
* code clean up
* fetch routingFormResponse in handleNewBooking
* fix type errors
* fix type errors in tests
* fix getAttributesQueryValue import for tests
* fix totalWeight
* add test for attributes weights and virtual queues
* clean up code
* add test for prepareQueuesAndAttributesData
* remove console.log
* use lazy import
* use findUnique
* add fallback weight
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* feat: Implements maxLeadThreshold which puts a maximum to the amount of lead a given host is allowed to be ahead
* Refactor getLuckyUser + implement in handleNewBooking + move logic to repo
* Decoupled @prisma from findQualifiedHosts
* Fix deep type error
* Add maxLeadThreshold to builder.ts
* Removed a console.log :O + fix handleChildrenEventTypes input
* Add distribution UI to enable balanced distribution/maximize availability
* 0-1-2 instead of 0-1-2-3 (3 bookings instead of 4)
* move types to types file
* Create salesforce routing form components
* Save salesforce data to routing form
* Fixes
* Add event type service
* Change commenting
* Pass data from routing form to CRM
* Init Salesforce routing form booking form handler
* Salesforce find user associated with lookup field
* Add looking up the contact owner
* If salesforce is disabled then don't change the Salesforce option
* Small refactor
* Refactor getting event type app metadata
* Refactor eventType service
* Type fix
* Clean up
* Add translations
Co-authored-by: Alex van Andel <emrysal@users.noreply.github.com>
---------
Co-authored-by: Alex van Andel <emrysal@users.noreply.github.com>
* fix due to error in zod.parse while adding new member
* updated zod parsing
* fix the linking with parent
* update fixture to accomodate assignAllTeamMembers for team and org scenarios
* added e2e test
* nit
* only fetch bookings of this month for weighted rr
* test set up
* only get bookings of current month
* reverts test setup
* first changes for weight adjustments
* reset booking count + adjust calibration
* depreciate weightAdjustment
* get only bookings created this month
* fix typo
* make sure createdAt for hosts is correct
* use earliest possibel date as fallback
* add missing createdAt date to tests
* fix typo
* clean up changes in tests
* fix typo
* change end date to current date
* fix: Fall back to empty host array when no hosts are found
* fix: Restructure code a little
* fixed test, incorrectly used now outdated var
* perf: remove Dayjs from getLuckyUser
* Refactor getHostsWithCalibration for optimised performance, intentionally break test as findMany is always an array
* Better mock for host.findMany
* Remove team-event-types.test.ts, move to appropriate package
* TypeScript cannot auto-infer that an array is non-empty when assigning to a var
* fix: Type Fixes and DistributionMethod enum add
* Optimise tests
* Added test to show that bookings made before a newHost was added affect the lucky user result
* Throw error when the usersWithHighestPriority is empty, which should never happen
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* add feature to change host schedule
* update for type-check:ci
* Update SingleForm.tsx for linterr
* update as per design review
* update for rerendering
* migration files
* On Delete set null for schedule
if schedule is deleted, no need to delete the host
* updated schema
* added testcases
* checking permissions before
* updated for comments
* update for initial value
* updated and cleanup
* set initial value
* update after merge
* updated nit style
* update for console warning and added comments
* nit/chore
* chore
* update for typechecks
* update for scheduleId param after merge
* update after merge or new changes in metadata.config
* update after weights functionality
* updated description text and column name as per review suggestion
* resolved merge conflicts
* fix typecheck due to changes in getScheduleSchema
* update after merge having refactor
* update refactored EventTypeWebWrapper after merge
* updated props
* updated trpc err code and added log
* update due to refactor in EventAvailabilityTab
* perf: Optimise TS type + select only the data that's needed for a specific function
---------
Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* init members page for platform
* add missing icon
* add members tab to sidebar
* use data from useMe query instead of useSession
* return user profiles since platform users are stored there
* small refactor
* fixup
* remove unused logs from console
* fixup
* resolve merge conflicts
* add missing tabs for members and billing
* update schema
* fixup
* memoise selection options for org and platform
* update onSubmit handler
* resolve merge conflicts
* add members tab
* improve team billing view when user not subscribed
* update members tab
* add function to find if user is admin of team
* update invite members handler to handle platform user as well
---------
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>