docs: v2 event-types (#16854)
* docs: optional get event-types query params * docs: create event type input * docs: update event type input * docs: child inputs of create and update event type inputs * docs: updated swagger * refactor: add disabled option to booking window * refactor: seats description * swagger
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+10
-2
@@ -1,5 +1,6 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
|
||||
import { ValidatorConstraint, registerDecorator } from "class-validator";
|
||||
import { IsEnum, ValidatorConstraint, registerDecorator } from "class-validator";
|
||||
|
||||
import {
|
||||
BookerLayoutsInputEnum_2024_06_14,
|
||||
@@ -44,9 +45,16 @@ function IsValidLayout(validationOptions?: ValidationOptions) {
|
||||
}
|
||||
|
||||
export class BookerLayouts_2024_06_14 {
|
||||
@IsValidLayout({ message: "defaultLayout must be one of the valid layouts." })
|
||||
@IsValidLayout({ message: "defaultLayout must be one of the valid layouts - month, week or column" })
|
||||
@ApiProperty({ type: String, enum: BookerLayoutsInputEnum_2024_06_14 })
|
||||
@IsEnum(BookerLayoutsInputEnum_2024_06_14)
|
||||
defaultLayout!: BookerLayoutsInputEnum_2024_06_14;
|
||||
|
||||
@IsValidLayout({ message: "enabledLayouts must be one of the valid layouts." })
|
||||
@ApiProperty({ type: [String], enum: BookerLayoutsInputEnum_2024_06_14 })
|
||||
@IsEnum(BookerLayoutsInputEnum_2024_06_14, {
|
||||
each: true,
|
||||
message: "enabledLayouts must contain only valid layouts - month, week or column",
|
||||
})
|
||||
enabledLayouts!: BookerLayoutsInputEnum_2024_06_14[];
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
|
||||
import { IsBoolean, IsInt, IsOptional, Min, ValidatorConstraint, registerDecorator } from "class-validator";
|
||||
|
||||
@@ -14,7 +14,7 @@ export class BaseBookingLimitsCount_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "The number of bookings per day",
|
||||
example: 1,
|
||||
})
|
||||
@@ -23,7 +23,7 @@ export class BaseBookingLimitsCount_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "The number of bookings per week",
|
||||
example: 2,
|
||||
})
|
||||
@@ -32,7 +32,7 @@ export class BaseBookingLimitsCount_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "The number of bookings per month",
|
||||
example: 3,
|
||||
})
|
||||
@@ -41,7 +41,7 @@ export class BaseBookingLimitsCount_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "The number of bookings per year",
|
||||
example: 4,
|
||||
})
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
|
||||
import { IsBoolean, IsInt, IsOptional, Min, ValidatorConstraint, registerDecorator } from "class-validator";
|
||||
|
||||
@@ -8,7 +8,7 @@ export class BaseBookingLimitsDuration_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(15)
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "The duration of bookings per day (must be a multiple of 15)",
|
||||
example: 60,
|
||||
})
|
||||
@@ -17,7 +17,7 @@ export class BaseBookingLimitsDuration_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(15)
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "The duration of bookings per week (must be a multiple of 15)",
|
||||
example: 120,
|
||||
})
|
||||
@@ -26,7 +26,7 @@ export class BaseBookingLimitsDuration_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(15)
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "The duration of bookings per month (must be a multiple of 15)",
|
||||
example: 180,
|
||||
})
|
||||
@@ -35,7 +35,7 @@ export class BaseBookingLimitsDuration_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(15)
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "The duration of bookings per year (must be a multiple of 15)",
|
||||
example: 240,
|
||||
})
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
|
||||
import {
|
||||
IsEnum,
|
||||
@@ -47,7 +47,7 @@ export class BusinessDaysWindow_2024_06_14 extends BookingWindowBase {
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
example: true,
|
||||
description:
|
||||
"If true, the window will be rolling aka from the moment that someone is trying to book this event. Otherwise it will be specified amount of days from the current date.",
|
||||
@@ -67,7 +67,7 @@ export class CalendarDaysWindow_2024_06_14 extends BookingWindowBase {
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
example: true,
|
||||
description:
|
||||
"If true, the window will be rolling aka from the moment that someone is trying to book this event. Otherwise it will be specified amount of days from the current date.",
|
||||
|
||||
+88
-25
@@ -1,4 +1,9 @@
|
||||
import { ApiProperty as DocsProperty, getSchemaPath, ApiExtraModels } from "@nestjs/swagger";
|
||||
import {
|
||||
ApiProperty as DocsProperty,
|
||||
ApiPropertyOptional as DocsPropertyOptional,
|
||||
getSchemaPath,
|
||||
ApiExtraModels,
|
||||
} from "@nestjs/swagger";
|
||||
import { Type, Transform, Expose } from "class-transformer";
|
||||
import {
|
||||
IsString,
|
||||
@@ -30,9 +35,12 @@ import {
|
||||
import type { InputBookingField_2024_06_14 } from "./booking-fields.input";
|
||||
import { ValidateInputBookingFields_2024_06_14 } from "./booking-fields.input";
|
||||
import type { BookingLimitsCount_2024_06_14 } from "./booking-limits-count.input";
|
||||
import { ValidateBookingLimistsCount } from "./booking-limits-count.input";
|
||||
import { BaseBookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input";
|
||||
import type { BookingLimitsDuration_2024_06_14 } from "./booking-limits-duration.input";
|
||||
import { ValidateBookingLimistsDuration } from "./booking-limits-duration.input";
|
||||
import {
|
||||
BaseBookingLimitsDuration_2024_06_14,
|
||||
ValidateBookingLimistsDuration,
|
||||
} from "./booking-limits-duration.input";
|
||||
import type { BookingWindow_2024_06_14 } from "./booking-window.input";
|
||||
import {
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
@@ -41,7 +49,7 @@ import {
|
||||
ValidateBookingWindow,
|
||||
} from "./booking-window.input";
|
||||
import type { ConfirmationPolicy_2024_06_14 } from "./confirmation-policy.input";
|
||||
import { ValidateConfirmationPolicy } from "./confirmation-policy.input";
|
||||
import { BaseConfirmationPolicy_2024_06_14, ValidateConfirmationPolicy } from "./confirmation-policy.input";
|
||||
import { DestinationCalendar_2024_06_14 } from "./destination-calendar.input";
|
||||
import { Disabled_2024_06_14 } from "./disabled.input";
|
||||
import { EventTypeColor_2024_06_14 } from "./event-type-color.input";
|
||||
@@ -80,7 +88,13 @@ export const CREATE_EVENT_SLUG_EXAMPLE = "learn-the-secrets-of-masterchief";
|
||||
BooleanFieldInput_2024_06_14,
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
CalendarDaysWindow_2024_06_14,
|
||||
RangeWindow_2024_06_14
|
||||
RangeWindow_2024_06_14,
|
||||
BaseBookingLimitsCount_2024_06_14,
|
||||
Disabled_2024_06_14,
|
||||
BaseBookingLimitsDuration_2024_06_14,
|
||||
Recurrence_2024_06_14,
|
||||
BaseConfirmationPolicy_2024_06_14,
|
||||
Seats_2024_06_14
|
||||
)
|
||||
export class CreateEventTypeInput_2024_06_14 {
|
||||
@IsInt()
|
||||
@@ -98,12 +112,12 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE })
|
||||
@DocsPropertyOptional({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE })
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateLocations_2024_06_14()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Locations where the event will take place. If not provided, cal video link will be used as the location.",
|
||||
oneOf: [
|
||||
@@ -119,7 +133,7 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@ValidateInputBookingFields_2024_06_14()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Custom fields that can be added to the booking form when the event is booked by someone. By default booking form has name and email field.",
|
||||
oneOf: [
|
||||
@@ -142,12 +156,14 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty({ description: "If true, person booking this event't cant add guests via their emails." })
|
||||
@DocsPropertyOptional({
|
||||
description: "If true, person booking this event't cant add guests via their emails.",
|
||||
})
|
||||
disableGuests?: boolean;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: `Number representing length of each slot when event is booked. By default it equal length of the event type.
|
||||
If event length is 60 minutes then we would have slots 9AM, 10AM, 11AM etc. but if it was changed to 30 minutes then
|
||||
we would have slots 9AM, 9:30AM, 10AM, 10:30AM etc. as the available times to book the 60 minute event.`,
|
||||
@@ -157,26 +173,28 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@IsOptional()
|
||||
@DocsProperty({ description: "Minimum number of minutes before the event that a booking can be made." })
|
||||
@DocsPropertyOptional({
|
||||
description: "Minimum number of minutes before the event that a booking can be made.",
|
||||
})
|
||||
minimumBookingNotice?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: "Time spaces that can be pre-pended before an event to give more time before it.",
|
||||
})
|
||||
beforeEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: "Time spaces that can be appended after an event to give more time after it.",
|
||||
})
|
||||
afterEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"If you want that this event has different schedule than user's default one you can specify it here.",
|
||||
})
|
||||
@@ -184,12 +202,19 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingLimistsCount()
|
||||
@DocsProperty({ description: "Limit how many times this event can be booked" })
|
||||
@DocsPropertyOptional({
|
||||
description: "Limit how many times this event can be booked",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(BaseBookingLimitsCount_2024_06_14) },
|
||||
{ $ref: getSchemaPath(Disabled_2024_06_14) },
|
||||
],
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingLimitsCount?: BookingLimitsCount_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"This will limit your availability for this event type to one slot per day, scheduled at the earliest available time.",
|
||||
})
|
||||
@@ -197,19 +222,26 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingLimistsDuration()
|
||||
@DocsProperty({ description: "Limit total amount of time that this event can be booked" })
|
||||
@DocsPropertyOptional({
|
||||
description: "Limit total amount of time that this event can be booked",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(BaseBookingLimitsDuration_2024_06_14) },
|
||||
{ $ref: getSchemaPath(Disabled_2024_06_14) },
|
||||
],
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingLimitsDuration?: BookingLimitsDuration_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingWindow()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: "Limit how far in the future this event can be booked",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(BusinessDaysWindow_2024_06_14) },
|
||||
{ $ref: getSchemaPath(CalendarDaysWindow_2024_06_14) },
|
||||
{ $ref: getSchemaPath(RangeWindow_2024_06_14) },
|
||||
{ $ref: getSchemaPath(Disabled_2024_06_14) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingWindow?: BookingWindow_2024_06_14;
|
||||
@@ -217,18 +249,32 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty({ description: "Offset timeslots shown to bookers by a specified number of minutes" })
|
||||
@DocsPropertyOptional({ description: "Offset timeslots shown to bookers by a specified number of minutes" })
|
||||
offsetStart?: number;
|
||||
|
||||
@IsOptional()
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.",
|
||||
})
|
||||
@Type(() => BookerLayouts_2024_06_14)
|
||||
bookerLayouts?: BookerLayouts_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateConfirmationPolicy()
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(BaseConfirmationPolicy_2024_06_14) },
|
||||
{ $ref: getSchemaPath(Disabled_2024_06_14) },
|
||||
],
|
||||
})
|
||||
@Type(() => Object)
|
||||
confirmationPolicy?: ConfirmationPolicy_2024_06_14;
|
||||
|
||||
@ValidateNested()
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => {
|
||||
if (value && typeof value === "object") {
|
||||
if ("interval" in value) {
|
||||
@@ -240,21 +286,30 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
return value;
|
||||
})
|
||||
@ValidateNested()
|
||||
@DocsPropertyOptional({
|
||||
description: "Create a recurring event type.",
|
||||
oneOf: [{ $ref: getSchemaPath(Recurrence_2024_06_14) }, { $ref: getSchemaPath(Disabled_2024_06_14) }],
|
||||
})
|
||||
@Type(() => Object)
|
||||
recurrence?: Recurrence_2024_06_14 | Disabled_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
requiresBookerEmailVerification?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
hideCalendarNotes?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
lockTimeZoneToggleOnBookingPage?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@DocsPropertyOptional()
|
||||
@Type(() => EventTypeColor_2024_06_14)
|
||||
color?: EventTypeColor_2024_06_14;
|
||||
|
||||
@@ -270,11 +325,16 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
return value;
|
||||
})
|
||||
@ValidateNested()
|
||||
@DocsPropertyOptional({
|
||||
description: "Create an event type with multiple seats.",
|
||||
oneOf: [{ $ref: getSchemaPath(Seats_2024_06_14) }, { $ref: getSchemaPath(Disabled_2024_06_14) }],
|
||||
})
|
||||
@Type(() => Object)
|
||||
seats?: Seats_2024_06_14 | Disabled_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: `Customizable event name with valid variables:
|
||||
{Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name},
|
||||
{Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION},
|
||||
@@ -284,15 +344,18 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
customName?: string;
|
||||
|
||||
@IsOptional()
|
||||
@DocsPropertyOptional()
|
||||
@Type(() => DestinationCalendar_2024_06_14)
|
||||
destinationCalendar?: DestinationCalendar_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
useDestinationCalendarEmail?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
hideCalendarEventDetails?: boolean;
|
||||
}
|
||||
|
||||
@@ -312,7 +375,7 @@ export class Host {
|
||||
@IsOptional()
|
||||
@Expose()
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Only relevant for round robin event types. If true then the user must attend round robin event always.",
|
||||
})
|
||||
@@ -321,7 +384,7 @@ export class Host {
|
||||
@IsEnum(HostPriority)
|
||||
@Expose()
|
||||
@IsOptional()
|
||||
@DocsProperty({ enum: HostPriority })
|
||||
@DocsPropertyOptional({ enum: HostPriority })
|
||||
priority?: keyof typeof HostPriority = "medium";
|
||||
}
|
||||
|
||||
@@ -345,12 +408,12 @@ export class CreateTeamEventTypeInput_2024_06_14 extends CreateEventTypeInput_20
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => Host)
|
||||
@IsArray()
|
||||
@DocsProperty()
|
||||
@DocsProperty({ type: [Host] })
|
||||
hosts!: Host[];
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: "If true, all current and future team members will be assigned to this event type",
|
||||
})
|
||||
assignAllTeamMembers?: boolean;
|
||||
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { Transform } from "class-transformer";
|
||||
import { IsOptional, IsString } from "class-validator";
|
||||
|
||||
export class GetEventTypesQuery_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
"The username of the user to get event types for. If only username provided will get all event types.",
|
||||
})
|
||||
@@ -13,7 +13,7 @@ export class GetEventTypesQuery_2024_06_14 {
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
"Slug of event type to return. Notably, if eventSlug is provided then username must be provided too, because multiple users can have event with same slug.",
|
||||
})
|
||||
@@ -21,7 +21,7 @@ export class GetEventTypesQuery_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@TransformUsernames()
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
"Get dynamic event type for multiple usernames separated by comma. e.g `usernames=alice,bob`",
|
||||
type: String,
|
||||
@@ -32,7 +32,7 @@ export class GetEventTypesQuery_2024_06_14 {
|
||||
export class GetTeamEventTypesQuery_2024_06_14 {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
@ApiPropertyOptional({
|
||||
description: "Slug of team event type to return.",
|
||||
})
|
||||
eventSlug?: string;
|
||||
|
||||
+90
-46
@@ -1,4 +1,9 @@
|
||||
import { ApiProperty as DocsProperty, getSchemaPath, ApiExtraModels } from "@nestjs/swagger";
|
||||
import {
|
||||
ApiProperty as DocsProperty,
|
||||
ApiPropertyOptional as DocsPropertyOptional,
|
||||
getSchemaPath,
|
||||
ApiExtraModels,
|
||||
} from "@nestjs/swagger";
|
||||
import { Type, Transform } from "class-transformer";
|
||||
import { IsString, IsInt, IsBoolean, IsOptional, Min, ValidateNested, IsArray } from "class-validator";
|
||||
|
||||
@@ -19,9 +24,12 @@ import {
|
||||
ValidateInputBookingFields_2024_06_14,
|
||||
} from "./booking-fields.input";
|
||||
import type { BookingLimitsCount_2024_06_14 } from "./booking-limits-count.input";
|
||||
import { ValidateBookingLimistsCount } from "./booking-limits-count.input";
|
||||
import { BaseBookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input";
|
||||
import type { BookingLimitsDuration_2024_06_14 } from "./booking-limits-duration.input";
|
||||
import { ValidateBookingLimistsDuration } from "./booking-limits-duration.input";
|
||||
import {
|
||||
BaseBookingLimitsDuration_2024_06_14,
|
||||
ValidateBookingLimistsDuration,
|
||||
} from "./booking-limits-duration.input";
|
||||
import {
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
CalendarDaysWindow_2024_06_14,
|
||||
@@ -30,7 +38,7 @@ import {
|
||||
type BookingWindow_2024_06_14,
|
||||
} from "./booking-window.input";
|
||||
import type { ConfirmationPolicy_2024_06_14 } from "./confirmation-policy.input";
|
||||
import { ValidateConfirmationPolicy } from "./confirmation-policy.input";
|
||||
import { BaseConfirmationPolicy_2024_06_14, ValidateConfirmationPolicy } from "./confirmation-policy.input";
|
||||
import {
|
||||
CREATE_EVENT_DESCRIPTION_EXAMPLE,
|
||||
CREATE_EVENT_LENGTH_EXAMPLE,
|
||||
@@ -70,33 +78,39 @@ import { Seats_2024_06_14 } from "./seats.input";
|
||||
BooleanFieldInput_2024_06_14,
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
CalendarDaysWindow_2024_06_14,
|
||||
RangeWindow_2024_06_14
|
||||
RangeWindow_2024_06_14,
|
||||
BaseBookingLimitsCount_2024_06_14,
|
||||
Disabled_2024_06_14,
|
||||
BaseBookingLimitsDuration_2024_06_14,
|
||||
Recurrence_2024_06_14,
|
||||
BaseConfirmationPolicy_2024_06_14,
|
||||
Seats_2024_06_14
|
||||
)
|
||||
export class UpdateEventTypeInput_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty({ example: CREATE_EVENT_LENGTH_EXAMPLE })
|
||||
@DocsPropertyOptional({ example: CREATE_EVENT_LENGTH_EXAMPLE })
|
||||
lengthInMinutes?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_TITLE_EXAMPLE })
|
||||
@DocsPropertyOptional({ example: CREATE_EVENT_TITLE_EXAMPLE })
|
||||
title?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_SLUG_EXAMPLE })
|
||||
@DocsPropertyOptional({ example: CREATE_EVENT_SLUG_EXAMPLE })
|
||||
slug?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE })
|
||||
@DocsPropertyOptional({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE })
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateLocations_2024_06_14()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Locations where the event will take place. If not provided, cal video link will be used as the location.",
|
||||
oneOf: [
|
||||
@@ -112,7 +126,7 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@ValidateInputBookingFields_2024_06_14()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Custom fields that can be added to the booking form when the event is booked by someone. By default booking form has name and email field.",
|
||||
oneOf: [
|
||||
@@ -135,12 +149,14 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty({ description: "If true, person booking this event't cant add guests via their emails." })
|
||||
@DocsPropertyOptional({
|
||||
description: "If true, person booking this event't cant add guests via their emails.",
|
||||
})
|
||||
disableGuests?: boolean;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: `Number representing length of each slot when event is booked. By default it equal length of the event type.
|
||||
If event length is 60 minutes then we would have slots 9AM, 10AM, 11AM etc. but if it was changed to 30 minutes then
|
||||
we would have slots 9AM, 9:30AM, 10AM, 10:30AM etc. as the available times to book the 60 minute event.`,
|
||||
@@ -150,26 +166,28 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@IsOptional()
|
||||
@DocsProperty({ description: "Minimum number of minutes before the event that a booking can be made." })
|
||||
@DocsPropertyOptional({
|
||||
description: "Minimum number of minutes before the event that a booking can be made.",
|
||||
})
|
||||
minimumBookingNotice?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: "Time spaces that can be pre-pended before an event to give more time before it.",
|
||||
})
|
||||
beforeEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: "Time spaces that can be appended after an event to give more time after it.",
|
||||
})
|
||||
afterEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"If you want that this event has different schedule than user's default one you can specify it here.",
|
||||
})
|
||||
@@ -177,12 +195,19 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingLimistsCount()
|
||||
@DocsProperty({ description: "Limit how many times this event can be booked" })
|
||||
@DocsPropertyOptional({
|
||||
description: "Limit how many times this event can be booked",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(BaseBookingLimitsCount_2024_06_14) },
|
||||
{ $ref: getSchemaPath(Disabled_2024_06_14) },
|
||||
],
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingLimitsCount?: BookingLimitsCount_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"This will limit your availability for this event type to one slot per day, scheduled at the earliest available time.",
|
||||
})
|
||||
@@ -190,19 +215,26 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingLimistsDuration()
|
||||
@DocsProperty({ description: "Limit total amount of time that this event can be booked" })
|
||||
@DocsPropertyOptional({
|
||||
description: "Limit total amount of time that this event can be booked",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(BaseBookingLimitsDuration_2024_06_14) },
|
||||
{ $ref: getSchemaPath(Disabled_2024_06_14) },
|
||||
],
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingLimitsDuration?: BookingLimitsDuration_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingWindow()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: "Limit how far in the future this event can be booked",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(BusinessDaysWindow_2024_06_14) },
|
||||
{ $ref: getSchemaPath(CalendarDaysWindow_2024_06_14) },
|
||||
{ $ref: getSchemaPath(RangeWindow_2024_06_14) },
|
||||
{ $ref: getSchemaPath(Disabled_2024_06_14) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingWindow?: BookingWindow_2024_06_14;
|
||||
@@ -210,17 +242,32 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty({ description: "Offset timeslots shown to bookers by a specified number of minutes" })
|
||||
@DocsPropertyOptional({ description: "Offset timeslots shown to bookers by a specified number of minutes" })
|
||||
offsetStart?: number;
|
||||
|
||||
@IsOptional()
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.",
|
||||
})
|
||||
@Type(() => BookerLayouts_2024_06_14)
|
||||
bookerLayouts?: BookerLayouts_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateConfirmationPolicy()
|
||||
@DocsPropertyOptional({
|
||||
description:
|
||||
"Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(BaseConfirmationPolicy_2024_06_14) },
|
||||
{ $ref: getSchemaPath(Disabled_2024_06_14) },
|
||||
],
|
||||
})
|
||||
@Type(() => Object)
|
||||
confirmationPolicy?: ConfirmationPolicy_2024_06_14;
|
||||
|
||||
@ValidateNested()
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => {
|
||||
if (value && typeof value === "object") {
|
||||
if ("interval" in value) {
|
||||
@@ -232,21 +279,30 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
return value;
|
||||
})
|
||||
@ValidateNested()
|
||||
@DocsPropertyOptional({
|
||||
description: "Create a recurring event type.",
|
||||
oneOf: [{ $ref: getSchemaPath(Recurrence_2024_06_14) }, { $ref: getSchemaPath(Disabled_2024_06_14) }],
|
||||
})
|
||||
@Type(() => Object)
|
||||
recurrence?: Recurrence_2024_06_14 | Disabled_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
requiresBookerEmailVerification?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
hideCalendarNotes?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
lockTimeZoneToggleOnBookingPage?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@DocsPropertyOptional()
|
||||
@Type(() => EventTypeColor_2024_06_14)
|
||||
color?: EventTypeColor_2024_06_14;
|
||||
|
||||
@@ -262,11 +318,16 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
return value;
|
||||
})
|
||||
@ValidateNested()
|
||||
@DocsPropertyOptional({
|
||||
description: "Create an event type with multiple seats.",
|
||||
oneOf: [{ $ref: getSchemaPath(Seats_2024_06_14) }, { $ref: getSchemaPath(Disabled_2024_06_14) }],
|
||||
})
|
||||
@Type(() => Object)
|
||||
seats?: Seats_2024_06_14 | Disabled_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: `Customizable event name with valid variables:
|
||||
{Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name},
|
||||
{Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION},
|
||||
@@ -276,50 +337,33 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
customName?: string;
|
||||
|
||||
@IsOptional()
|
||||
@DocsPropertyOptional()
|
||||
@Type(() => DestinationCalendar_2024_06_14)
|
||||
destinationCalendar?: DestinationCalendar_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
useDestinationCalendarEmail?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsPropertyOptional()
|
||||
hideCalendarEventDetails?: boolean;
|
||||
}
|
||||
|
||||
@ApiExtraModels(
|
||||
AddressLocation_2024_06_14,
|
||||
LinkLocation_2024_06_14,
|
||||
IntegrationLocation_2024_06_14,
|
||||
PhoneLocation_2024_06_14,
|
||||
PhoneFieldInput_2024_06_14,
|
||||
AddressFieldInput_2024_06_14,
|
||||
TextFieldInput_2024_06_14,
|
||||
NumberFieldInput_2024_06_14,
|
||||
TextAreaFieldInput_2024_06_14,
|
||||
SelectFieldInput_2024_06_14,
|
||||
MultiSelectFieldInput_2024_06_14,
|
||||
MultiEmailFieldInput_2024_06_14,
|
||||
CheckboxGroupFieldInput_2024_06_14,
|
||||
RadioGroupFieldInput_2024_06_14,
|
||||
BooleanFieldInput_2024_06_14,
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
CalendarDaysWindow_2024_06_14,
|
||||
RangeWindow_2024_06_14
|
||||
)
|
||||
export class UpdateTeamEventTypeInput_2024_06_14 extends UpdateEventTypeInput_2024_06_14 {
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => Host)
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
@DocsPropertyOptional({ type: [Host] })
|
||||
hosts?: Host[];
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
@DocsPropertyOptional({
|
||||
description: "If true, all current and future team members will be assigned to this event type",
|
||||
})
|
||||
assignAllTeamMembers?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user