From 342e5baca2e551702021d67379d928afe8e86b9a Mon Sep 17 00:00:00 2001 From: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> Date: Thu, 20 Nov 2025 13:24:21 +0200 Subject: [PATCH] feat: add hashedLink to BOOKING_REQUESTED webhook payload (#25274) - Add hashedLink field to CalendarEvent type definition - Add withHashedLink method to CalendarEventBuilder - Pass hashedLink from booking request to CalendarEvent in RegularBookingService - hashedLink will now be included in webhook payloads when booking via private API links Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- packages/features/CalendarEventBuilder.ts | 8 ++++++++ .../bookings/lib/service/RegularBookingService.ts | 1 + packages/types/Calendar.d.ts | 1 + 3 files changed, 10 insertions(+) diff --git a/packages/features/CalendarEventBuilder.ts b/packages/features/CalendarEventBuilder.ts index 10ae0d6832..1efd779085 100644 --- a/packages/features/CalendarEventBuilder.ts +++ b/packages/features/CalendarEventBuilder.ts @@ -479,6 +479,14 @@ export class CalendarEventBuilder { return this; } + withHashedLink(hashedLink?: string | null) { + this.event = { + ...this.event, + hashedLink, + }; + return this; + } + build(): CalendarEvent | null { // Validate required fields if ( diff --git a/packages/features/bookings/lib/service/RegularBookingService.ts b/packages/features/bookings/lib/service/RegularBookingService.ts index 95cf13acdf..f7a8c2b86d 100644 --- a/packages/features/bookings/lib/service/RegularBookingService.ts +++ b/packages/features/bookings/lib/service/RegularBookingService.ts @@ -1387,6 +1387,7 @@ async function handler( platformCancelUrl, platformBookingUrl, }) + .withHashedLink(hasHashedBookingLink ? reqBody.hashedLink ?? null : null) .build(); if (!builtEvt) { diff --git a/packages/types/Calendar.d.ts b/packages/types/Calendar.d.ts index 22e67ce546..009ad2fe06 100644 --- a/packages/types/Calendar.d.ts +++ b/packages/types/Calendar.d.ts @@ -163,6 +163,7 @@ export interface CalendarEvent { // Instead of sending this per event. // TODO: Links sent in email should be validated and automatically redirected to org domain or regular app. It would be a much cleaner way. Maybe use existing /api/link endpoint bookerUrl?: string; + hashedLink?: string | null; type: string; title: string; startTime: string;