From a3fbe3731ecb53f47a980bed498e5eeb72e3b285 Mon Sep 17 00:00:00 2001 From: chauhan_s Date: Wed, 1 Oct 2025 16:15:40 +0530 Subject: [PATCH] feat: add host validation for team event types (#24170) * feat: add host validation for team event types * refactor: remove hosts validator in favor of documentation-based validation approach * fix: remove HostsOrAssignAllValidator from event type update inputs * docs: improve clarity of hosts and assignAllTeamMembers field descriptions in event type inputs --- .../inputs/create-event-type.input.ts | 5 +++-- .../inputs/update-event-type.input.ts | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts index 860bb6920e..e81eb1c948 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts @@ -19,6 +19,7 @@ import { ArrayUnique, } from "class-validator"; + import { SchedulingType } from "@calcom/platform-enums"; import { BookerLayouts_2024_06_14 } from "./booker-layouts.input"; @@ -560,14 +561,14 @@ export class CreateTeamEventTypeInput_2024_06_14 extends BaseCreateEventTypeInpu @DocsPropertyOptional({ type: [Host], description: - "Hosts contain specific team members you want to assign to this event type, but if you want to assign all team members, use `assignAllTeamMembers: true` instead and omit this field. For platform customers the hosts can include userIds only of managed users.", + "Hosts contain specific team members you want to assign to this event type, but if you want to assign all team members, use `assignAllTeamMembers: true` instead and omit this field. For platform customers the hosts can include userIds only of managed users. Provide either hosts or assignAllTeamMembers but not both", }) hosts?: Host[]; @IsBoolean() @IsOptional() @DocsPropertyOptional({ - description: "If true, all current and future team members will be assigned to this event type", + description: "If true, all current and future team members will be assigned to this event type. Provide either assignAllTeamMembers or hosts but not both", }) assignAllTeamMembers?: boolean; diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts index 62c0cb4a8b..8f69ea1717 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts @@ -455,14 +455,16 @@ export class UpdateTeamEventTypeInput_2024_06_14 extends BaseUpdateEventTypeInpu @Type(() => Host) @IsArray() @IsOptional() - @DocsPropertyOptional({ type: [Host] }) + @DocsPropertyOptional({ type: [Host], + description: + "Hosts contain specific team members you want to assign to this event type, but if you want to assign all team members, use `assignAllTeamMembers: true` instead and omit this field. For platform customers the hosts can include userIds only of managed users. Provide either hosts or assignAllTeamMembers but not both", + }) hosts?: Host[]; @IsOptional() @IsBoolean() - @DocsProperty() @DocsPropertyOptional({ - description: "If true, all current and future team members will be assigned to this event type", + description: "If true, all current and future team members will be assigned to this event type. Provide either assignAllTeamMembers or hosts but not both", }) assignAllTeamMembers?: boolean;