Skip to content

Scheduling infrastructure for absolutely everyone.

feat: add hashedLink to BOOKING_REQUESTED webhook payload (#25274)

Morgan342e5baca2e5
diff --git a/packages/features/CalendarEventBuilder.ts b/packages/features/CalendarEventBuilder.ts
index 10ae0d6832d..1efd779085e 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 95cf13acdfc..f7a8c2b86d8 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 22e67ce5463..009ad2fe062 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;