fix: schedule no show webhooks for requires confirmation event (#17089)
This commit is contained in:
@@ -27,6 +27,8 @@ import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
|
||||
import { getAllWorkflowsFromEventType } from "@calcom/trpc/server/routers/viewer/workflows/util";
|
||||
import type { AdditionalInformation, CalendarEvent } from "@calcom/types/Calendar";
|
||||
|
||||
import { scheduleNoShowTriggers } from "./handleNewBooking/scheduleNoShowTriggers";
|
||||
|
||||
const log = logger.getSubLogger({ prefix: ["[handleConfirmation] book:user"] });
|
||||
|
||||
export async function handleConfirmation(args: {
|
||||
@@ -36,6 +38,8 @@ export async function handleConfirmation(args: {
|
||||
prisma: PrismaClient;
|
||||
bookingId: number;
|
||||
booking: {
|
||||
startTime: Date;
|
||||
id: number;
|
||||
eventType: {
|
||||
currency: string;
|
||||
description: string | null;
|
||||
@@ -393,6 +397,18 @@ export async function handleConfirmation(args: {
|
||||
|
||||
await Promise.all(scheduleTriggerPromises);
|
||||
|
||||
await scheduleNoShowTriggers({
|
||||
booking: {
|
||||
startTime: booking.startTime,
|
||||
id: booking.id,
|
||||
},
|
||||
triggerForUser,
|
||||
organizerUser: { id: booking.userId },
|
||||
eventTypeId: booking.eventTypeId,
|
||||
teamId,
|
||||
orgId,
|
||||
});
|
||||
|
||||
const eventTypeInfo: EventTypeInfo = {
|
||||
eventTitle: eventType?.title,
|
||||
eventDescription: eventType?.description,
|
||||
|
||||
@@ -8,15 +8,16 @@ type ScheduleNoShowTriggersArgs = {
|
||||
startTime: Date;
|
||||
id: number;
|
||||
};
|
||||
triggerForUser: number | true | null;
|
||||
organizerUser: { id: number };
|
||||
eventTypeId: number;
|
||||
triggerForUser?: number | true | null;
|
||||
organizerUser: { id: number | null };
|
||||
eventTypeId: number | null;
|
||||
teamId?: number | null;
|
||||
orgId?: number | null;
|
||||
};
|
||||
|
||||
export const scheduleNoShowTriggers = async (args: ScheduleNoShowTriggersArgs) => {
|
||||
const { booking, triggerForUser, organizerUser, eventTypeId, teamId, orgId } = args;
|
||||
|
||||
// Add task for automatic no show in cal video
|
||||
const noShowPromises: Promise<any>[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user