* 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>
* feat: sync timezone with google/outlook for delegated credentials users
* chore: dynamic sync timezone in get availble slots
* redis cache for get delegated timezone
* Update packages/lib/getUserAvailability.ts
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* chore: Implement short-lived redis cache for slots
* chore: adapt apiv2 redis service to match with upstash redis
* chore: safer redis service and ms ttl
* fixup! chore: safer redis service and ms ttl
* Wrap with timeout, currently doesn't work yet
* Updated @upstash/redis for better signal support
* Fix type errors, remove ts value
* Inject NoopRedisService for NODE_ENV test
* chore: bump platform libs
* chore: bump platform libs
* Upstash Redis upgrade no longer resulted in expected hard crash on init, so updated factory and our Upstash Redis Adapter to mimick old behaviour
* Add SLOTS_CACHE_TTL variable for configurable ttl on slots cache
* Update parseInt to use right types
* chore: bump platform libs
* chore: bump platform libs
* chore: bump platform libs
* update e2e api v2 action
* set SLOTS_CACHE_TTL env var api v2 e2e
---------
Co-authored-by: cal.com <morgan@cal.com>
* feat: add cron job to cleanup old queued form responses
- Add cleanup cron job for App_RoutingForms_QueuedFormResponse table
- Delete records with null actualResponseId older than 1 hour
- Schedule to run twice daily (every 12 hours) via vercel.json
- Follow existing cron job patterns for authentication and structure
Co-Authored-By: hariom@cal.com <hariom@cal.com>
* fix: correct date comparison logic to delete older records
- Change from lte to gte in createdAt comparison
- Now properly deletes records older than 1 hour
Co-Authored-By: hariom@cal.com <hariom@cal.com>
* refactor: move cleanup logic to routing forms lib and import in API endpoint
- Create cleanupExpiredQueuedFormResponses function in routing forms lib
- Update API endpoint to import and use the new cleanup function
- Follow established patterns for code organization in Cal.com
- Maintain same functionality and authentication logic
Co-Authored-By: hariom@cal.com <hariom@cal.com>
* refactor: move entire cron logic to routing-forms cron folder
- Create routing-forms/cron/queuedFormResponseCleanup.ts with complete handler
- Move authentication, HTTP handling, and database operations to routing-forms
- Update API endpoint to simply import and call the cron handler
- Remove old lib cleanup function
- Follow user's preferred organizational pattern
Co-Authored-By: hariom@cal.com <hariom@cal.com>
* fix: correct date comparison logic to delete records older than 1 hour
- Change from gte (greater than or equal) to lt (less than) cutoffTime
- Now properly deletes records where createdAt < cutoffTime (older than 1 hour)
- Previous logic was deleting newer records instead of older ones
Co-Authored-By: hariom@cal.com <hariom@cal.com>
* fixes
* refactor: reorganize queuedFormResponse into domain-driven structure
- Move repository and service files to routingForm/queuedFormResponse subdirectory
- Clean up unused methods and tests for better maintainability
- Fix import paths and type definitions
- Ensure all tests pass and maintain backward compatibility
* fix: align QueuedFormResponse interface types with Prisma schema
- Update actualResponseId type from string to number to match Prisma Int type
- Make updatedAt nullable (Date | null) to match Prisma DateTime? type
- Fix import path for QueuedFormResponseRepository interface
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* refactor: reorganize queuedFormResponse into domain-driven structure
- Move repository and service files to routingForm/queuedFormResponse subdirectory
- Clean up unused methods and tests for better maintainability
- Fix import paths and type definitions
- Ensure all tests pass and maintain backward compatibility
* test: add comprehensive where clause validation tests and missing test coverage
* chore: update cron schedule to weekly for 7-day retention period
* revert: restore 12-hour cron schedule for better batch management
* Add integration tests
* refactor: apply test data builder pattern to queuedFormResponse integration tests
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: hariom@cal.com <hariom@cal.com>
Co-authored-by: Hariom <hariombalhara@gmail.com>
* refactor: getUserAvailability into service with DI
* chore: bump platform libs
* disable bull queue in e2e for bookings
* chore: bump platform libs
* chore: bump platform libs
* fix: should update event type bookingFields test
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
2025-08-05 13:13:42 +01:00
Eunjae LeeGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor: use dependency injection for InsightsBookingService
- Add DI tokens for InsightsBookingService and module
- Rename InsightsBookingService to InsightsBookingBaseService
- Create InsightsBookingService DI interface with create method
- Add DI module and container for InsightsBookingService
- Update tRPC router to use getInsightsBookingService DI container
- Update test file to use InsightsBookingBaseService
- Update documentation to reflect new DI pattern
Follows the same dependency injection pattern established for InsightsRoutingService in PR #22677
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: restore createInsightsBookingService helper using DI internally
- Keep createInsightsBookingService helper function for cleaner API
- Use getInsightsBookingService DI container internally
- Maintain same function signature and behavior
- All existing calls continue to work unchanged
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: rename service files with proper capitalization
- Rename insightsBookingBase.ts to InsightsBookingBaseService.ts
- Rename insightsBookingDI.ts to InsightsBookingDIService.ts
- Update all import statements to use new file names
- Maintain existing handler functionality using createInsightsBookingService(ctx, input)
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* revert some changes
* rename
* update doc
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: add backfill migration for routing response denormalized tables
* update script
* implement select type
* improve number handling
* clean up queries
* rename
* handle zero record case
* revert
* rename
* fix division problem
* log clean up
* force adding new rows after removing existing rows
* backfill only missing or wrong data
* remove sleep
* perf: use repository for webhooks list query & caching in /settings/developer/webhooks/... RSC
* fix type check
* invalidate cache on webhook list item actions
* fix review comment
* fix merge conflicts