* refactor: convert checkBookingLimits to class service with dependency injection - Create CheckBookingLimitsService class following AvailableSlotsService pattern - Add countBookingsByEventTypeAndDateRange method to BookingRepository - Move direct prisma calls from service to repository layer - Implement dependency injection with proper DI tokens and modules - Update all usage points to use the new service through DI - Maintain backward compatibility with error-throwing wrapper functions - Update tests to use the new service pattern - Resolve TODO comment in AvailableSlotsService for DI integration Co-Authored-By: [email protected] <[email protected]> * chore: DI CheckBookingLimitsService in v2 slots service * chore: bump libraries * chore: create getCheckBookingLimitsService * refactor: convert checkBookingAndDurationLimits to service class with DI - Create CheckBookingAndDurationLimitsService class following DI pattern - Add DI tokens and module for the new service - Update booking-limits container to provide the new service - Refactor handleNewBooking.ts to use service through DI - Maintain backward compatibility with deprecated function export - Preserve all existing functionality while improving code organization Co-Authored-By: [email protected] <[email protected]> * chore: CheckBookingAndDurationLimitsService * chore: bump platform libs --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Morgan <[email protected]>
10 lines
415 B
TypeScript
10 lines
415 B
TypeScript
import { createModule } from "@evyweb/ioctopus";
|
|
|
|
import { DI_TOKENS } from "@calcom/lib/di/tokens";
|
|
import { CheckBookingLimitsService } from "@calcom/lib/intervalLimits/server/checkBookingLimits";
|
|
|
|
export const checkBookingLimitsModule = createModule();
|
|
checkBookingLimitsModule
|
|
.bind(DI_TOKENS.CHECK_BOOKING_LIMITS_SERVICE)
|
|
.toClass(CheckBookingLimitsService, { bookingRepo: DI_TOKENS.BOOKING_REPOSITORY });
|