feat: platform toggle calendar event creation (#21788)

* feat: add areCalendarEventsEnabled to PlatformOAuthClient table

* feat: areCalendarEvents enabled in handleNewBooking and v2

* feat: v2 handle areCalendarEventsEnabled

* feat: toggle areCalendarEventsEnabled on frontend

* feat: enable areCalendarEventsEnabled for recurring,confirm,paid

* refactor: use placeholder calendar event

* remove merge conflicts

* chore: bump libraries

* chore: bump libraries
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2025-06-13 14:15:47 +00:00
1 parent d7fd055171
commit 4a53ec0b74
33 files changed
+525 -22

No files matched your search

+3 -1
View File
@@ -1,3 +1,5 @@
import EventManager from "@calcom/lib/EventManager";
export { getPublicEvent, type PublicEventType } from "@calcom/features/eventtypes/lib/getPublicEvent";
export { getBulkUserEventTypes, getBulkTeamEventTypes } from "@calcom/lib/event-types/getBulkEventTypes";
@@ -17,7 +19,7 @@ export {
} from "@calcom/prisma/zod-utils";
export { validateCustomEventName } from "@calcom/lib/event";
export { EventManager };
export { getEventTypeById } from "@calcom/lib/event-types/getEventTypeById";
export { getEventTypesByViewer } from "@calcom/lib/event-types/getEventTypesByViewer";
export type { EventType } from "@calcom/lib/event-types/getEventTypeById";
@@ -6,6 +6,10 @@ import { PERMISSION_MAP } from "@calcom/platform-constants";
export const ARE_DEFAULT_EVENT_TYPES_ENABLED_DOCS =
"If true, when creating a managed user the managed user will have 4 default event types: 30 and 60 minutes without Cal video, 30 and 60 minutes with Cal video. Set this as false if you want to create a managed user and then manually create event types for the user.";
export const ARE_CALENDAR_EVENTS_ENABLED_DOCS =
"If true and if managed user has calendar connected, calendar events will be created. Disable it if you manually create calendar events. Default to true.";
export class CreateOAuthClientInput {
@IsOptional()
@IsString()
@@ -60,4 +64,14 @@ export class CreateOAuthClientInput {
description: ARE_DEFAULT_EVENT_TYPES_ENABLED_DOCS,
})
areDefaultEventTypesEnabled? = false;
@IsOptional()
@IsBoolean()
@Transform(({ value }) => value ?? true)
@ApiPropertyOptional({
type: Boolean,
default: true,
description: ARE_CALENDAR_EVENTS_ENABLED_DOCS,
})
areCalendarEventsEnabled? = true;
}
@@ -1,7 +1,10 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsArray, IsBoolean, IsOptional, IsString } from "class-validator";
import { ARE_DEFAULT_EVENT_TYPES_ENABLED_DOCS } from "./create-oauth-client.input";
import {
ARE_CALENDAR_EVENTS_ENABLED_DOCS,
ARE_DEFAULT_EVENT_TYPES_ENABLED_DOCS,
} from "./create-oauth-client.input";
export class UpdateOAuthClientInput {
@IsOptional()
@@ -47,4 +50,12 @@ export class UpdateOAuthClientInput {
description: ARE_DEFAULT_EVENT_TYPES_ENABLED_DOCS,
})
areDefaultEventTypesEnabled?: boolean;
@IsOptional()
@IsBoolean()
@ApiPropertyOptional({
type: Boolean,
description: ARE_CALENDAR_EVENTS_ENABLED_DOCS,
})
areCalendarEventsEnabled?: boolean;
}
@@ -3,6 +3,8 @@ import { IsArray, IsEnum, IsString, IsNumber, IsOptional, IsDate, IsBoolean, IsU
import { PERMISSION_MAP } from "@calcom/platform-constants";
import { ARE_CALENDAR_EVENTS_ENABLED_DOCS } from "../inputs";
export class PlatformOAuthClientDto {
@ApiProperty({ example: "clsx38nbl0001vkhlwin9fmt0" })
@IsString()
@@ -56,6 +58,10 @@ export class PlatformOAuthClientDto {
})
areDefaultEventTypesEnabled!: boolean;
@IsBoolean()
@ApiProperty({ example: true, description: ARE_CALENDAR_EVENTS_ENABLED_DOCS })
areCalendarEventsEnabled!: boolean;
@ApiPropertyOptional({ example: "https://example.com/booking-redirect" })
@IsOptional()
@IsUrl()