File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -387,6 +387,23 @@ export type BookingHandlerInput = {
387387 forcedSlug ?: string ;
388388} & PlatformParams ;
389389
390+ function formatAvailabilitySnapshot ( data : {
391+ dateRanges : { start : dayjs . Dayjs ; end : dayjs . Dayjs } [ ] ;
392+ oooExcludedDateRanges : { start : dayjs . Dayjs ; end : dayjs . Dayjs } [ ] ;
393+ } ) {
394+ return {
395+ ...data ,
396+ dateRanges : data . dateRanges . map ( ( { start, end } ) => ( {
397+ start : start . toISOString ( ) ,
398+ end : end . toISOString ( ) ,
399+ } ) ) ,
400+ oooExcludedDateRanges : data . oooExcludedDateRanges . map ( ( { start, end } ) => ( {
401+ start : start . toISOString ( ) ,
402+ end : end . toISOString ( ) ,
403+ } ) ) ,
404+ } ;
405+ }
406+
390407async function handler (
391408 input : BookingHandlerInput ,
392409 bookingDataSchemaGetter : BookingDataSchemaGetter = getBookingDataSchema
@@ -1397,7 +1414,10 @@ async function handler(
13971414
13981415 logger . info ( `Booking created` , {
13991416 bookingUid : booking . uid ,
1400- availabilitySnapshot : organizerUserAvailability ?. availabilityData ,
1417+ selectedCalendarIds : organizerUser . allSelectedCalendars ?. map ( ( c ) => c . id ) ?? [ ] ,
1418+ availabilitySnapshot : organizerUserAvailability ?. availabilityData
1419+ ? formatAvailabilitySnapshot ( organizerUserAvailability . availabilityData )
1420+ : null ,
14011421 } ) ;
14021422 }
14031423
Original file line number Diff line number Diff line change @@ -252,6 +252,10 @@ const _getBusyTimes = async (params: {
252252 console.log("videoBusyTimes", videoBusyTimes);
253253 busyTimes.push(...videoBusyTimes);
254254 */
255+ } else {
256+ logger . warn ( `No credentials found for user ${ userId } ` , {
257+ selectedCalendarIds : selectedCalendars . map ( ( calendar ) => calendar . id ) ,
258+ } ) ;
255259 }
256260 logger . debug (
257261 "getBusyTimes:" ,
Original file line number Diff line number Diff line change @@ -9,11 +9,12 @@ const logger = new Logger({
99 prettyErrorStackTemplate : " • {{fileName}}\t{{method}}\n\t{{filePathWithLine}}" , // default
1010 prettyErrorTemplate : "\n{{errorName}} {{errorMessage}}\nerror stack:\n{{errorStack}}" , // default
1111 prettyLogTemplate : "{{hh}}:{{MM}}:{{ss}}:{{ms}} [{{logLevelName}}] " , // default with exclusion of `{{filePathWithLine}}`
12- stylePrettyLogs : true ,
12+ stylePrettyLogs : ! IS_PRODUCTION ,
1313 prettyLogStyles : {
1414 name : "yellow" ,
1515 dateIsoStr : "blue" ,
1616 } ,
17+ type : IS_PRODUCTION ? "json" : "pretty" ,
1718} ) ;
1819
1920export default logger ;
You can’t perform that action at this time.
0 commit comments