Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: zomars <zomars@me.com>
22 lines
648 B
TypeScript
22 lines
648 B
TypeScript
import { WebhookTriggerEvents } from "@calcom/prisma/enums";
|
|
|
|
import { calculateMaxStartTime, sendWebhookPayload, prepareNoShowTrigger } from "./common";
|
|
|
|
export async function triggerGuestNoShow(payload: string): Promise<void> {
|
|
const result = await prepareNoShowTrigger(payload);
|
|
if (!result) return;
|
|
|
|
const { webhook, booking, didGuestJoinTheCall } = result;
|
|
|
|
const maxStartTime = calculateMaxStartTime(booking.startTime, webhook.time, webhook.timeUnit);
|
|
|
|
if (!didGuestJoinTheCall) {
|
|
await sendWebhookPayload(
|
|
webhook,
|
|
WebhookTriggerEvents.AFTER_GUESTS_CAL_VIDEO_NO_SHOW,
|
|
booking,
|
|
maxStartTime
|
|
);
|
|
}
|
|
}
|