additionInformation => additionalInformation
This commit is contained in:
parent
41c5ad45fd
commit
13f20dd7cf
|
@ -7,7 +7,7 @@ import { sendDeclinedEmails, sendScheduledEmails } from "@calcom/emails";
|
|||
import { isPrismaObjOrUndefined } from "@calcom/lib";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { AdditionInformation, CalendarEvent, RecurringEvent } from "@calcom/types/Calendar";
|
||||
import type { AdditionalInformation, CalendarEvent, RecurringEvent } from "@calcom/types/Calendar";
|
||||
import { refund } from "@ee/lib/stripe/server";
|
||||
|
||||
import { getSession } from "@lib/auth";
|
||||
|
@ -208,7 +208,7 @@ async function patchHandler(req: NextApiRequest) {
|
|||
|
||||
log.error(`Booking ${currentUser.username} failed`, error, results);
|
||||
} else {
|
||||
const metadata: AdditionInformation = {};
|
||||
const metadata: AdditionalInformation = {};
|
||||
|
||||
if (results.length) {
|
||||
// TODO: Handle created event metadata more elegantly
|
||||
|
@ -218,7 +218,7 @@ async function patchHandler(req: NextApiRequest) {
|
|||
}
|
||||
try {
|
||||
await sendScheduledEmails(
|
||||
{ ...evt, additionInformation: metadata },
|
||||
{ ...evt, additionalInformation: metadata },
|
||||
recurringEventId ? recurringEvent : {} // Send email with recurring event info only on recurring event context
|
||||
);
|
||||
} catch (error) {
|
||||
|
|
|
@ -22,7 +22,7 @@ import { getDefaultEvent, getGroupName, getUsernameList } from "@calcom/lib/defa
|
|||
import { getErrorFromUnknown } from "@calcom/lib/errors";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import type { BufferedBusyTime } from "@calcom/types/BufferedBusyTime";
|
||||
import type { AdditionInformation, CalendarEvent, RecurringEvent } from "@calcom/types/Calendar";
|
||||
import type { AdditionalInformation, CalendarEvent, RecurringEvent } from "@calcom/types/Calendar";
|
||||
import type { EventResult, PartialReference } from "@calcom/types/EventManager";
|
||||
import { handlePayment } from "@ee/lib/stripe/server";
|
||||
|
||||
|
@ -706,7 +706,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
|
||||
log.error(`Booking ${user.name} failed`, error, results);
|
||||
} else {
|
||||
const metadata: AdditionInformation = {};
|
||||
const metadata: AdditionalInformation = {};
|
||||
|
||||
if (results.length) {
|
||||
// TODO: Handle created event metadata more elegantly
|
||||
|
@ -724,7 +724,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
await sendRescheduledEmails(
|
||||
{
|
||||
...evt,
|
||||
additionInformation: metadata,
|
||||
additionalInformation: metadata,
|
||||
additionalNotes, // Resets back to the additionalNote input and not the override value
|
||||
cancellationReason: reqBody.rescheduleReason,
|
||||
},
|
||||
|
@ -752,7 +752,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
|
||||
log.error(`Booking ${user.username} failed`, error, results);
|
||||
} else {
|
||||
const metadata: AdditionInformation = {};
|
||||
const metadata: AdditionalInformation = {};
|
||||
|
||||
if (results.length) {
|
||||
// TODO: Handle created event metadata more elegantly
|
||||
|
@ -764,7 +764,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
await sendScheduledEmails(
|
||||
{
|
||||
...evt,
|
||||
additionInformation: metadata,
|
||||
additionalInformation: metadata,
|
||||
additionalNotes,
|
||||
customInputs,
|
||||
},
|
||||
|
|
|
@ -71,7 +71,7 @@ test.describe("Integrations", () => {
|
|||
body.payload.organizer.timeZone = dynamic;
|
||||
body.payload.organizer.language = dynamic;
|
||||
body.payload.uid = dynamic;
|
||||
body.payload.additionInformation = dynamic;
|
||||
body.payload.additionalInformation = dynamic;
|
||||
|
||||
// if we change the shape of our webhooks, we can simply update this by clicking `u`
|
||||
// console.log("BODY", body);
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between PRO and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"name":"PRO","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"test@example.com","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"uid":"[redacted/dynamic]","metadata":{},"additionInformation":"[redacted/dynamic]"}}
|
||||
{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between PRO and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"name":"PRO","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"test@example.com","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"uid":"[redacted/dynamic]","metadata":{},"additionalInformation":"[redacted/dynamic]"}}
|
|
@ -6,7 +6,7 @@ import EventManager from "@calcom/core/EventManager";
|
|||
import { sendLocationChangeEmails } from "@calcom/emails";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import type { AdditionInformation, CalendarEvent } from "@calcom/types/Calendar";
|
||||
import type { AdditionalInformation, CalendarEvent } from "@calcom/types/Calendar";
|
||||
|
||||
import { createProtectedRouter } from "@server/createRouter";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
|
@ -133,14 +133,14 @@ export const bookingsRouter = createProtectedRouter()
|
|||
};
|
||||
logger.error(`Booking ${ctx.user.username} failed`, error, results);
|
||||
} else {
|
||||
const metadata: AdditionInformation = {};
|
||||
const metadata: AdditionalInformation = {};
|
||||
if (results.length) {
|
||||
metadata.hangoutLink = results[0].createdEvent?.hangoutLink;
|
||||
metadata.conferenceData = results[0].createdEvent?.conferenceData;
|
||||
metadata.entryPoints = results[0].createdEvent?.entryPoints;
|
||||
}
|
||||
try {
|
||||
await sendLocationChangeEmails({ ...evt, additionInformation: metadata });
|
||||
await sendLocationChangeEmails({ ...evt, additionalInformation: metadata });
|
||||
} catch (error) {
|
||||
console.log("Error sending LocationChangeEmails");
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ export default class GoogleCalendarService implements Calendar {
|
|||
requestBody: {
|
||||
description: getRichDescription({
|
||||
...calEventRaw,
|
||||
additionInformation: { hangoutLink: event.data.hangoutLink || "" },
|
||||
additionalInformation: { hangoutLink: event.data.hangoutLink || "" },
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ import { v5 as uuidv5 } from "uuid";
|
|||
import { FAKE_DAILY_CREDENTIAL } from "@calcom/app-store/dailyvideo/lib/VideoApiAdapter";
|
||||
import getApps from "@calcom/app-store/utils";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { AdditionInformation, CalendarEvent } from "@calcom/types/Calendar";
|
||||
import type { AdditionalInformation, CalendarEvent } from "@calcom/types/Calendar";
|
||||
import type {
|
||||
CreateUpdateResult,
|
||||
EventResult,
|
||||
|
@ -19,7 +19,7 @@ import { createEvent, updateEvent } from "./CalendarManager";
|
|||
import { LocationType } from "./location";
|
||||
import { createMeeting, updateMeeting } from "./videoClient";
|
||||
|
||||
export type Event = AdditionInformation & VideoCallData;
|
||||
export type Event = AdditionalInformation & VideoCallData;
|
||||
|
||||
export const isZoom = (location: string): boolean => {
|
||||
return location === "integrations:zoom";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { DestinationCalendar } from "@prisma/client";
|
||||
|
||||
import { AdditionInformation, CalendarEvent, ConferenceData, Person } from "@calcom/types/Calendar";
|
||||
import { AdditionalInformation, CalendarEvent, ConferenceData, Person } from "@calcom/types/Calendar";
|
||||
|
||||
class CalendarEventClass implements CalendarEvent {
|
||||
type!: string;
|
||||
|
@ -13,7 +13,7 @@ class CalendarEventClass implements CalendarEvent {
|
|||
team?: { name: string; members: string[] };
|
||||
location?: string | null;
|
||||
conferenceData?: ConferenceData;
|
||||
additionInformation?: AdditionInformation;
|
||||
additionalInformation?: AdditionalInformation;
|
||||
uid?: string | null;
|
||||
videoCallData?: any;
|
||||
paymentInfo?: any;
|
||||
|
|
|
@ -74,8 +74,8 @@ export function LocationInfo(props: { calEvent: CalendarEvent }) {
|
|||
);
|
||||
}
|
||||
|
||||
if (props.calEvent.additionInformation?.hangoutLink) {
|
||||
const hangoutLink: string = props.calEvent.additionInformation.hangoutLink;
|
||||
if (props.calEvent.additionalInformation?.hangoutLink) {
|
||||
const hangoutLink: string = props.calEvent.additionalInformation.hangoutLink;
|
||||
|
||||
return (
|
||||
<Info
|
||||
|
|
|
@ -94,8 +94,8 @@ export const getLocation = (calEvent: CalendarEvent) => {
|
|||
return calEvent.videoCallData.url;
|
||||
}
|
||||
|
||||
if (calEvent.additionInformation?.hangoutLink) {
|
||||
return calEvent.additionInformation.hangoutLink;
|
||||
if (calEvent.additionalInformation?.hangoutLink) {
|
||||
return calEvent.additionalInformation.hangoutLink;
|
||||
}
|
||||
|
||||
return providerName || calEvent.location || "";
|
||||
|
|
|
@ -79,7 +79,7 @@ export interface ConferenceData {
|
|||
createRequest?: calendar_v3.Schema$CreateConferenceRequest;
|
||||
}
|
||||
|
||||
export interface AdditionInformation {
|
||||
export interface AdditionalInformation {
|
||||
conferenceData?: ConferenceData;
|
||||
entryPoints?: EntryPoint[];
|
||||
hangoutLink?: string;
|
||||
|
@ -111,7 +111,7 @@ export interface CalendarEvent {
|
|||
};
|
||||
location?: string | null;
|
||||
conferenceData?: ConferenceData;
|
||||
additionInformation?: AdditionInformation;
|
||||
additionalInformation?: AdditionalInformation;
|
||||
uid?: string | null;
|
||||
videoCallData?: VideoCallData;
|
||||
paymentInfo?: PaymentInfo | null;
|
||||
|
@ -133,7 +133,7 @@ export interface EntryPoint {
|
|||
password?: string;
|
||||
}
|
||||
|
||||
export interface AdditionInformation {
|
||||
export interface AdditionalInformation {
|
||||
conferenceData?: ConferenceData;
|
||||
entryPoints?: EntryPoint[];
|
||||
hangoutLink?: string;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PartialReference } from "./EventManager";
|
||||
import type { VideoCallData } from "./VideoApiAdapter";
|
||||
|
||||
export type Event = AdditionInformation & VideoCallData;
|
||||
export type Event = AdditionalInformation & VideoCallData;
|
||||
|
|
Loading…
Reference in New Issue
Block a user