File tree Expand file tree Collapse file tree
packages/features/bookings/lib/handleNewBooking Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { ErrorCode } from "@calcom/lib/errorCodes" ;
22import { ErrorWithCode } from "@calcom/lib/errors" ;
3+ import logger from "@calcom/lib/logger" ;
34import prisma from "@calcom/prisma" ;
45import { BookingStatus } from "@calcom/prisma/enums" ;
56
7+ const log = logger . getSubLogger ( { prefix : [ "[checkActiveBookingsLimitForBooker]" ] } ) ;
8+
69export const checkActiveBookingsLimitForBooker = async ( {
710 eventTypeId,
811 maxActiveBookingsPerBooker,
@@ -57,6 +60,7 @@ const checkActiveBookingsLimit = async ({
5760 } ) ;
5861
5962 if ( bookingsCount >= maxActiveBookingsPerBooker ) {
63+ log . warn ( `Maximum booking limit reached for ${ bookerEmail } for event type ${ eventTypeId } ` ) ;
6064 throw new ErrorWithCode ( ErrorCode . BookerLimitExceeded , ErrorCode . BookerLimitExceeded ) ;
6165 }
6266} ;
@@ -104,6 +108,7 @@ const checkActiveBookingsLimitAndOfferReschedule = async ({
104108 const lastBooking = bookingsCount [ bookingsCount . length - 1 ] ;
105109
106110 if ( bookingsCount . length >= maxActiveBookingsPerBooker ) {
111+ log . warn ( `Maximum booking limit reached for ${ bookerEmail } for event type ${ eventTypeId } ` ) ;
107112 throw new ErrorWithCode (
108113 ErrorCode . BookerLimitExceededReschedule ,
109114 ErrorCode . BookerLimitExceededReschedule ,
You can’t perform that action at this time.
0 commit comments