* add migration guide and dto * add factory * add notifier * add repo * add services * coderabbit review --1 * coderabbit review --2 * coderabbit review --3 * further improvement * -- * fix * bookingWebhookFactory consideration and type fixes * cleanup * fix types * DI part1 * DI --part 2 * remove migrationGuide as we're WIP * using evyweb for DI -- 1 * DI --final * separate func instead of private class * adds a todo migration file * adjust structure * address feedback * remove todo_migrate * --1 * fix type * address feedback * add TODO comment * address requested changes --1 * address feedback --2 * restructure as per feedback * rename camelcase
27 lines
706 B
TypeScript
27 lines
706 B
TypeScript
import { WebhookTriggerEvents } from "@calcom/prisma/enums";
|
|
|
|
import type { InstantMeetingDTO } from "../dto/types";
|
|
import type { WebhookPayload } from "./types";
|
|
|
|
export class InstantMeetingBuilder {
|
|
canHandle(triggerEvent: WebhookTriggerEvents): boolean {
|
|
return triggerEvent === WebhookTriggerEvents.INSTANT_MEETING;
|
|
}
|
|
|
|
build(dto: InstantMeetingDTO): WebhookPayload {
|
|
return {
|
|
triggerEvent: dto.triggerEvent,
|
|
createdAt: dto.createdAt,
|
|
payload: {
|
|
title: dto.title,
|
|
body: dto.body,
|
|
icon: dto.icon,
|
|
url: dto.url,
|
|
actions: dto.actions,
|
|
requireInteraction: dto.requireInteraction,
|
|
type: dto.type,
|
|
},
|
|
};
|
|
}
|
|
}
|