* Early return if date range is empty
* test: add tests for empty workingHours early return optimization
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Volnei Munhoz <volnei@cal.com>
2026-01-21 02:51:01 -03:00
Benny JooGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: remove @calcom/web imports from packages/features to eliminate circular dependency
- Migrate UserTableUser and MemberPermissions types to packages/features/users/types/user-table.ts
- Migrate useGeo hook to packages/features/geo/GeoContext.tsx
- Migrate buildLegacyRequest to packages/lib/buildLegacyCtx.ts
- Migrate Calendar component to packages/features/calendars/weeklyview/components/
- Move test utilities (bookingScenario, fixtures) to packages/features/test/
- Update all imports in packages/features to use new locations
- Add re-exports in apps/web for backward compatibility
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: delete original implementation files and fix type issues
- Delete original calendar component files in apps/web (keep only re-export stubs)
- Migrate OutOfOfficeInSlots to packages/features/bookings/components
- Convert apps/web OutOfOfficeInSlots to re-export stub
- Fix className vs class issue in Calendar.tsx
- Fix @calcom/trpc import violation in user-table.ts by using structural type
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: add missing isGroup and contains fields to UserTableUser attributes type
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: update customRole type to match actual Prisma Role model
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix build
* fix
* fix
* cleanup weeklyview
* fix
* refactor to mv MemberPermissions to types package
* add types dependency to features
* fix
* fix
* fix
* fix
* fix
* fix
* rename
* rename
* migrate
* migrate
* migrate
* fix
* fix
* fix
* refactor: move test utilities from packages/features/test to tests/libs
- Move bookingScenario utilities to tests/libs/bookingScenario
- Move fixtures to tests/libs/fixtures
- Update all imports in packages/features test files to use new location
- Update all imports in apps/web test files to use new location
- Eliminates duplication of test utilities between packages/features and apps/web
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: correct relative import paths for tests/libs in test files
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* refactor: replace test utility implementations with re-exports to tests/libs
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: fix test import paths and move signup handler tests to apps/web
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: move buildLegacyCtx to packages/lib and restore handlers to packages/features
- Move buildLegacyCtx from apps/web/lib to packages/lib to break circular dependency
- Update apps/web/lib/buildLegacyCtx.ts to re-export from @calcom/lib
- Restore signup handlers and tests to packages/features/auth/signup/handlers
- Update handler imports to use @calcom/lib/buildLegacyCtx instead of @calcom/web/lib/buildLegacyCtx
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: update recurring-event.test.ts imports to use tests/libs path
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* refactor: delete test re-export files and update imports to use tests/libs directly
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: update remaining test imports to use tests/libs directly
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: update handleRecurringEventBooking calls to match function signature (1 arg)
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* remove
* migrate tests
* migrate tests
* refactor: update test mock imports by removing and using async for mock creators.
* fix type errors
* fix: add type assertion for MockUser in p2002.test-suite.ts
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: restore locale import in compareReminderBodyToTemplate.test.ts using relative path
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* feat: create @calcom/testing package and migrate tests from /tests directory
- Created new @calcom/testing package in /packages/testing
- Moved all files from /tests to /packages/testing
- Updated all imports across the codebase to use @calcom/testing alias
- Removed /tests directory at root level
This allows other packages like @calcom/features and @calcom/web to import
testing utilities using the @calcom/testing alias instead of relative paths.
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix
* fix
* fix: add missing useBookings export to @calcom/atoms package
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: add missing useCalendarsBusyTimes and useConnectedCalendars exports to @calcom/atoms
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* chore: add @calcom/testing as explicit devDependency to packages that use it
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* refactor: move setupVitest.ts into @calcom/testing package
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix
* chore: add biome rules to restrict @calcom/testing imports
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix
* rename libs to lib
* rename libs to lib
* add rule
* add rule
* refactor: remove @calcom/features imports from @calcom/testing
- Move mockPaymentSuccessWebhookFromStripe to fresh-booking.test.ts
- Replace ProfileRepository.generateProfileUid() with uuidv4()
- Clone Tracking type into @calcom/testing/src/lib/types.ts
- Update imports in expects.ts and getMockRequestDataForBooking.ts
- Move source files into src/ folder
- Move CalendarManager mock to @calcom/features
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* fix: add explicit exports for nested paths in @calcom/testing
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* improve
* improve
* fix
* fix
* fix type checks
* fix type checks
* fix type checks
* fix tests
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-01-08 16:59:11 +09:00
Anik Dhabal BabuGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: align booking limit timezone between availability and validation
- Use eventType.schedule?.timeZone for booking limits in availability calculation
- Previously used user's timezone causing day boundary mismatch
- Add unit tests to verify timezone alignment
- Fixes issue where slots remain available after reaching booking limit
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* Rename variable limitsTz to eventTimeZone
* update
* fix: correct timezone fallback to include user timezone without forcing UTC
- Changed fallback chain to: schedule → event → user → undefined
- Treats empty strings as missing timezones
- Does not force UTC when all timezones are missing
- Aligns with validation behavior when timezone is undefined
- Fixes getSchedule.test.ts failures
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* Revert "fix: correct timezone fallback to include user timezone without forcing UTC"
This reverts commit 721e0bdfd7b08004e68df6bdf5b97b9bd6cf3d5c.
* test: remove complex unit tests with 'as any' casts
- Removed Booking Limits Timezone Alignment tests that required heavy mocking
- These tests relied on spying private methods and had many 'as any' casts
- Timezone alignment is already covered by integration tests in getSchedule.test.ts
- Kept BookingDateInPastError test which has no type issues
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* address review
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* 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>
* 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>
* Return a busy block placeholder if calendar throws an error
* Refactor `getCalendarsEvents` to return an object with a success prop
* Throw error in `getBusyTimes` if failed to fetch calendar availability
* Return empty available days if error getting busy times
* yeet.
* Type fix
* Fix type error in getLuckyUsers
* Type fixes
* Type fix
* Type fix
* Fix test
* Fix test mocks
* Refactor calendars.service to use new calendarBusyTimesQuery
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* chore: DI available slots service repositories
* remove configService from worker module
* register scheduleRepo in availableSlotsModule
* chore: bump platform libs
* remove useless comment from prisma module
* fix: availableSlotsModule to class deps
* fix: repositoriesModule deps
* chore: container pattern
* refactor: move modules in DI folder
* fixup! refactor: move modules in DI folder
* refactor: GetAvailableSlotsService
* chore: add todo comments where DI is needed
* chore: bump platform libs
* chore: fix unit tests
* fix: only instantiate AvailableSlotsService once per service
* Update packages/trpc/server/routers/viewer/slots/util.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* fix: bind this on all functions with reporting
---------
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Add tests for booking and duration limits in getSchedule.test.ts
Co-Authored-By: keith@cal.com <keith@cal.com>
* fix: use SchedulingType enum instead of string for schedulingType
Co-Authored-By: keith@cal.com <keith@cal.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: keith@cal.com <keith@cal.com>
* 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>
Found via `codespell -q 3 -S "*.svg,./apps/web/public/static/locales,./packages/app-store/stripepayment/lib/currencyOptions.ts,./packages/lib/freeEmailDomainCheck/freeEmailDomains.ts" -L afterall,atleast,datea,fo,incase,ist,nam,notin,optionel,perview,reccuring`
Closes#19193
* Add a case that crashes
* Add proper crash test case
---------
Co-authored-by: Hariom Balhara <hariombalhara@gmgmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* If contact owner first available slot is more than 2 weeks. Normal RR
* If contact owner first available slot is more than 2 weeks. Normal RR
* Type fix
* Add test
* 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>
* add booking booking to team settings
* add update mutation
* add missing export
* fix dirty state
* first version of global team limits in getUserAvailability
* add test setup
* create seperate test file for global limits
* add tests for all units
* move limitManager and booking limit functions outside of getUserAvailability
* add migration
* clean up code
* move yearly booking count to booking repository
* code clean up
* don't count rescheduling booking
* add test for getSchedule
* fix type error
* fix type error
* fix type error
* fix from and end date for fetching bookings
* reuse functions
* allow null for bookingLimits
* remove bookings from managed event type
* fix type error
* code clean up
* small fixes form clean up
* fix type issue
* same fixes in teams/_post
* fix existing tz issue
* tests for fix
* adds missingn await
* imrove description
* remove spreading
* fix reschedule issue with booking limits
* fix reschedule error with booking durations
* remove useeffect
* undo commit
* add bookingLimits to UpdateOrgTeamDto
* fix unit tests
* Prepare view for app router migration
* throw error if not in ascending order
* fix disabled update button
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
* feat: block pending meetings for requires confirmation
* add i18n
* fix:typecheck
* fix(requires-confirmation-block): Fixes type error
* fix(requires-confirmation-block): Fixes type error
* Tweak to set BookingWhereInput as the explicit type instead of as
* fix: type error
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* add org to create workflow button
* add save button for testing in dev mode
* add select all to multi select dropdown
* fix select all
* pass isOrg to WorkflowDetailsPage
* add checkbox to apply to all including future
* fix count text on select
* WIP schema
* shows teams in dropdown
* add team option to UI
* [WIP] refactor for update handler
* filter out "all" from activeOn
* fix type error
* create more helper functions
* create reusable function for scheduling all booking reminders
* finish update workflows for orgs (without testing)
* fix isAuthorized check for orgs
* fix getting newActiveOn
* move all helper functions to util file
* more code clean up
* fix deleting reminders for org workflows
* fix adding and editing steps
* update form data when workflow is saved
* code clean up
* fixing creating/deleting reminders when user is member of several teams
* fix setting activeOn for teams in useffect
* add on delete cascade
* make multiSelectSchenbox searchable
* set activeOn correctly when checkbox true
* WIP
* fix type errors in MultiSelectCheckboxes
* implemented scheduling org-wide workfow notifications (not yet tested)
* fix type errors
* type error
* add missing changes from merge conflict
* remote not needed include statement
* fix type errors
* code clean up + some todo comments
* support org workflows for cancelled workflows
* delete reminders from removed members
* remove reminders if isActiveOnAll is turned off
* fix unti test and type error
* code clean up
* create basis for testing to book org team event
* create org workflow with active team
* fix getting active org workflows on team + test setup
* fix creating workflow step for tests
* fix first org test
* add test for user event type with org workflow active
* use deleteAllWorkflowReminders everywhere
* add test for deleteRemindersFromRemovedActiveOn
* fix type errors
* make all tests pass
* fix type error
* fix getSchedule test
* code clean up
* add missing import
* fix type error
* fix tests
* code clean up
* fix imports
* update reminders when trigger was changed
* check for teamId before userId in reminderScheduler
* move getOrgIdFromMemberOrTeamId to different folder
* code clean up
* fix tests
* test setup for scheduleBookingReminders
* fix typo
* add tests for scheduleBookingReminders
* fix prisma default import
* fix workflowStep type
* add scheduleBookingReminders test for sms
* return dummy sid for scheduleSMS testMode
* clean up + fixes
* add lost changes from merge
* get teamId and userId from incoming evt object
* removing not needed select
* add org support for scheduleMandatory email reminder
* add other teams to dropdown
* move getAllWorkflows to seperate file and call it in parent function
* include org wide workflows in createNewSeat
* some fixes + code clean up
* add new team to select text count when including future teams is checked
* fix upsert and remove sms reminder field
* correctly update activeOn if 'including future ...' is enabled
* list active Org workflows in event workflows settings
* fix sms reminder field in all handlers
* add helper function to check if step was edited
* fix active on badge on workflow
* fix type error
* fix double reminders
* add teamId: null for userWorkflow query
* fix activeOnAll with managed event types
* add missing teamId in getAllWorkflows
* add a dafaut to prisma param
* fix managed event types on select all user workflows
* code clean up
* better variable name
* small fixes in update handler
* fix test name to match function name
* add info badge
* fix workflow count in event type settings
* fix getting bookings from children manged event types
* delete reminders when user is not part of any time no more
* implement feedback
* fix disbale workflow in event type settings
* fix remove member
* create new function getAllWorkflowsFromEventType
* add some removed code
* use promise.allSettled when deleting workflow reminders
* create new function deleteWorkflowRemindersOfRemovedMember.ts
* fix userId param
* delete org worklfows when team is disbanded
* don't trigger active on all workflow if not part of any team
* fix active on count badge
* add test for deleteWorkflowRemidnersOfRemovedMember
* trigger workflow also if not member of any subteam
* fix failing test
* remove unused code
* use testId for go back button
* fixes for managed event types & activateEventTypeHandler
* code clean up
* don't activate workflow on locked managed event type
* fix type error
* type error
* more type fixes
* feedback
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* fix timezone display on booking page to reflect event availability timezone
* migrate fetching event owner's schedule to server side
* migrate fetching event owner's schedule to server side
* fix e2e test errors
* Add WEBAPP_URL_FOR_OAUTH to salesforce auth
* In event manager constructor include "_crm" credentials as calendar creds
* Change crm apps to type to end with `_crm`
* Move sendgrid out of CRM
* Add zoho bigin to CRM apps
* When getting apps, use slug
* Add `crm` variants
* Hubspot Oauth use `WEBAPP_URL_FOR_OAUTH`
* Refactor creating credentials
* Fix empty CRM page
* Use credentials with `_crm`
* Abstract getAppCategoryTitle
* Add integration.handler changes
* Init crmManager
* Change salesforce to CrmService
* Create crmManager
* Create contact on new event
* Create event
* Create new CRM reference
* - Fix create new contact for salesforce
- Add reschedule to crmManager
* Create deleteAllCRMEvents
* When searching for credential, look for current credentials in class
* On cancel, delete 3rd party events
* Add delete method
* Type fix
* Type fix
* Convert Close.com to CrmService
* Convert Close.com to CrmService
* Move hubspot to CrmService
* Convert Pipedrive to CrmService
* Rename classes to CrmService
* Move ZohoCrm to CrmService
* Move Bigin to CrmService
* Type return for CrmServices
* Fix type errors
* Close.com create leads and contacts
* Fix tests
* Type fix
* Zoho bug fixes
* Clean up
* Type fixes
* Remove apiDeletes
* Type fixes
* Specific typing
* Type fix
* Type fix
* Type fix
* Type fix
* Type fix
* feat: Enable CRM apps on a per event type basis (#14450)
* Add Salesforce to be an event type app
* Handle new booking, only get enabled CRM credentials
* Abstract generating search params
* Add close.com to event type
* Clean up
* Move hubspot to event type
* Add pipedrive to event type
* Add zoho bigin to event type
* Add zoho crm to event type
* Remove console.log
* Add deleting CRM apps from event type
* Delete event type apps
* Fix deleting credentials
* Add CRM app data to event type metadata
* Backwards compatibility: add CRM credential if doesn't exist on event type
* Don't include user CRM credentials for backwards comp
* Backwards compatibility show CRM app is enabled and dirty field
* Clean up
* Type fixes
* Type fixes
* Type fix
* Type fix
* Remove console.log
* Test fix
* Upgrade embed-react vite version - dev
* Change build can't find error message
* Add back omni install prop
* Clean up
* Refactor `writeAppDataToEventType`
* Use eventType repository in writeAppDataToEventType
* Clean up old comments
* Add error logging
* createCRMEvents pass event uid as created event uid
* Use `getUid`
* Clean up props in create crm event
* Small changes to `crmManager`
* Fix zoho CRM
* refactor crmManager
* Undo vite config change
* Fix teamId query
* Fix bigin error
* Remove need for `writeAppDataToEventType`
* Add `getAllCredentials` test
* Add crmManager tests
* Type fixes
* Fix type errors
* Fix getAllCredentials test
* Fix tests
* Skip CRM manager tests for now
* feat: Skip RR Assignment if Contact Exists In Salesforce (#14556)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
* Update yarn.lock
* @zomars feedback - use new URL for state params
* fix: update hook to not produce enabled === undefined
* fix: update app card interfaces to use the new enabled from useIsAppEnabled
* fix: feedback for crm RR skip (#15160)
* code clean up
* fix type any
* test setup for RR lead skip
* code clean up
* simplify code
* type error
* finshed first test for RR lead skip
* add seconds test
* add test for handleNewBooking
* test if teamMember is set
* fix missing enabled key
* fix tests
* fix type error
* use setSystemTime instead of getDate
* remove nested if
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
* fix type error
* fix: remove app metadata from all eventTypes on deleting the app
* fix: update hook to not produce enabled === undefined (default to false)
---------
Co-authored-by: Shaik-Sirajuddin <sirajuddinshaik30gmail.com>
Co-authored-by: Shaik-Sirajuddin <sirajudddinshaik30@gmail.com>
Co-authored-by: Shaik-Sirajuddin <89742297+Shaik-Sirajuddin@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: sean-brydon <sean@cal.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: Somay Chauhan <somaychauhan98@gmail.com>
* wip
* wip
* wip
* Add tests
* Update getSchedule.test.ts
* Update types.ts
* Self review fixes
* Update text
* PR feedback from Carina
* Use utcoffset for range as well
* Remove logging from the function that runs on every timeslot
* Add one more test
* Show x days instead of x+1 days for both ROLLING and ROLLING_WINDOW
* refactor tests
* Move bookingScenario imports to the top as they import prismock mock that has to be imported very early
* More reordering of imports
* Fix accidental min update at wrong place
* Handle legacy value of zero for periodDays
* Range fix
* Fix isDateOutOfBound not being checked properly during booking. Also added a test for the case
* Fix duplicate element, how the hell it reached there
* Use today plus x days for ROLLING periodType
* Add disabled for Checkbox as well
* Revert logger.ts
* Formatting
Signed-off-by: zomars <zomars@me.com>
* Fix ordering of imports that is causing tests failure
---------
Signed-off-by: zomars <zomars@me.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* fix: invalid Cancelled / Rescheduled downstream calendar block
* Adjust test so no calendar is connected
* Remove the googleCalendar from multiple tests
* use same lucky user + check availability
* add tests for recurring round robin events
* only use luckyUsers for recurring bookings
* don't check availability for all recurring dates
* code clean up
* pass schedulingType
* fix type error
* add availability check for fixed hosts + test
* fix type error
* implement feedback
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* perf: pre-load booking data for all users
* Fixing property issues
* Fixes
* Removed unwanted console.log
* Made comment for intention of refactor more clear
* fix: types
* _count is optional
* Assign to const bookings
* Added mock for prisma booking
* Fixed unit tests
* Added lint ignore for prisma field
* Update bookingScenario.ts
* Fix linting
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* fix timezone zone issue for first slot
* fix failed test in getSchedule
* Update apps/web/test/lib/getSchedule.test.ts
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: alannnc <alannnc@gmail.com>
## What does this PR do?
Currently, we start the first slot always at the nearest 15 minutes. This is not ideal as for some duration other slot starting time make more sense. So with this PR the starting times are defined as follow:
- Frequency is exact hours (60, 120, 180, ...), slot start time is a full hour
- Frequency is half hours (30, 90, ...), slot start time is half or full hours (8:00, 8:30, ...)
- Same with 20-minute events (20, 40, ...) and 10-minute events
- Everything else will start at the nearest 15 min slot
It also fixes that slot times are shifted when there is a busy slot with a different duration. Here is a before and after of a 30-min event with a 5-minute busy slot at 1:00 pm
Before:

After

#### 30 Minute events, availability starting at 7:15
Before:

After:

## Type of change
- Bug fix (non-breaking change which fixes an issue)
## How should this be tested?
- Check if slot times are shown as described
- Test with different intervals/durations
- Test with busy times
- Test with different availabilities
## Mandatory Tasks
- [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.
* [CAL-1517] fix all Typescript warnings
* solve conflicts
* Update stripeCheckoutSession.handler.ts
Parse is a guard, so even though the variable is unused the parse itself is needed.
* Update ToolbarPlugin.tsx
Don't change dependency tree
---------
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* Moving to vitest
* Rearranging test
* Fixing prettier linting
* Reverting launch.json
* Adjustments
* Merged with main and regenerated lockfile
* Fixing tests for API
* Yarn updated, docs is gone
---------
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>