docs: v2 schedules and event-types swagger (#16608)
* docs: schedules * docs: wip event-types * docs:event-types * docs:event-types * Delete yarn.lock * Revert "Delete yarn.lock" This reverts commit bb3eb23508c0fa2e216ba7bcb97756215f889daa. --------- Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
This commit is contained in:
co-authored by
Morgan
parent
c016241004
commit
44410c87f0
+2
-2
@@ -36,7 +36,7 @@ import {
|
||||
InternalServerErrorException,
|
||||
ParseIntPipe,
|
||||
} from "@nestjs/common";
|
||||
import { ApiTags as DocsTags } from "@nestjs/swagger";
|
||||
import { ApiExcludeController as DocsExcludeController } from "@nestjs/swagger";
|
||||
|
||||
import { EVENT_TYPE_READ, EVENT_TYPE_WRITE, SUCCESS_STATUS } from "@calcom/platform-constants";
|
||||
import { getPublicEvent, getEventTypesByViewer } from "@calcom/platform-libraries-0.0.2";
|
||||
@@ -47,7 +47,7 @@ import { PrismaClient } from "@calcom/prisma";
|
||||
version: [VERSION_2024_04_15, VERSION_2024_06_11],
|
||||
})
|
||||
@UseGuards(PermissionsGuard)
|
||||
@DocsTags("Event types")
|
||||
@DocsExcludeController(true)
|
||||
export class EventTypesController_2024_04_15 {
|
||||
constructor(
|
||||
private readonly eventTypesService: EventTypesService_2024_04_15,
|
||||
|
||||
+30
-1
@@ -24,7 +24,7 @@ import {
|
||||
Delete,
|
||||
Query,
|
||||
} from "@nestjs/common";
|
||||
import { ApiTags as DocsTags } from "@nestjs/swagger";
|
||||
import { ApiHeader, ApiTags as DocsTags } from "@nestjs/swagger";
|
||||
|
||||
import { EVENT_TYPE_READ, EVENT_TYPE_WRITE, SUCCESS_STATUS } from "@calcom/platform-constants";
|
||||
import {
|
||||
@@ -39,12 +39,23 @@ import {
|
||||
})
|
||||
@UseGuards(PermissionsGuard)
|
||||
@DocsTags("Event types")
|
||||
@ApiHeader({
|
||||
name: "cal-api-version",
|
||||
description: `Must be set to \`2024-06-14\``,
|
||||
required: true,
|
||||
})
|
||||
export class EventTypesController_2024_06_14 {
|
||||
constructor(private readonly eventTypesService: EventTypesService_2024_06_14) {}
|
||||
|
||||
@Post("/")
|
||||
@Permissions([EVENT_TYPE_WRITE])
|
||||
@UseGuards(ApiAuthGuard)
|
||||
@ApiHeader({
|
||||
name: "Authorization",
|
||||
description:
|
||||
"value must be `Bearer <token>` where `<token>` either managed user access token or api key prefixed with cal_",
|
||||
required: true,
|
||||
})
|
||||
async createEventType(
|
||||
@Body() body: CreateEventTypeInput_2024_06_14,
|
||||
@GetUser() user: UserWithProfile
|
||||
@@ -60,6 +71,12 @@ export class EventTypesController_2024_06_14 {
|
||||
@Get("/:eventTypeId")
|
||||
@Permissions([EVENT_TYPE_READ])
|
||||
@UseGuards(ApiAuthGuard)
|
||||
@ApiHeader({
|
||||
name: "Authorization",
|
||||
description:
|
||||
"value must be `Bearer <token>` where `<token>` either managed user access token or api key prefixed with cal_",
|
||||
required: true,
|
||||
})
|
||||
async getEventTypeById(
|
||||
@Param("eventTypeId") eventTypeId: string,
|
||||
@GetUser() user: UserWithProfile
|
||||
@@ -91,6 +108,12 @@ export class EventTypesController_2024_06_14 {
|
||||
@Patch("/:eventTypeId")
|
||||
@Permissions([EVENT_TYPE_WRITE])
|
||||
@UseGuards(ApiAuthGuard)
|
||||
@ApiHeader({
|
||||
name: "Authorization",
|
||||
description:
|
||||
"value must be `Bearer <token>` where `<token>` either managed user access token or api key prefixed with cal_",
|
||||
required: true,
|
||||
})
|
||||
@HttpCode(HttpStatus.OK)
|
||||
async updateEventType(
|
||||
@Param("eventTypeId") eventTypeId: number,
|
||||
@@ -108,6 +131,12 @@ export class EventTypesController_2024_06_14 {
|
||||
@Delete("/:eventTypeId")
|
||||
@Permissions([EVENT_TYPE_WRITE])
|
||||
@UseGuards(ApiAuthGuard)
|
||||
@ApiHeader({
|
||||
name: "Authorization",
|
||||
description:
|
||||
"value must be `Bearer <token>` where `<token>` either managed user access token or api key prefixed with cal_",
|
||||
required: true,
|
||||
})
|
||||
async deleteEventType(
|
||||
@Param("eventTypeId") eventTypeId: number,
|
||||
@GetUser("id") userId: number
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ import {
|
||||
Patch,
|
||||
UseGuards,
|
||||
} from "@nestjs/common";
|
||||
import { ApiResponse, ApiTags as DocsTags } from "@nestjs/swagger";
|
||||
import { ApiResponse, ApiExcludeController as DocsExcludeController } from "@nestjs/swagger";
|
||||
import { Throttle } from "@nestjs/throttler";
|
||||
|
||||
import { SCHEDULE_READ, SCHEDULE_WRITE, SUCCESS_STATUS } from "@calcom/platform-constants";
|
||||
@@ -36,7 +36,7 @@ import { CreateScheduleInput_2024_04_15 } from "../inputs/create-schedule.input"
|
||||
version: VERSION_2024_04_15_VALUE,
|
||||
})
|
||||
@UseGuards(ApiAuthGuard, PermissionsGuard)
|
||||
@DocsTags("Schedules")
|
||||
@DocsExcludeController(true)
|
||||
export class SchedulesController_2024_04_15 {
|
||||
constructor(private readonly schedulesService: SchedulesService_2024_04_15) {}
|
||||
|
||||
|
||||
+32
-2
@@ -17,7 +17,7 @@ import {
|
||||
Patch,
|
||||
UseGuards,
|
||||
} from "@nestjs/common";
|
||||
import { ApiResponse, ApiTags as DocsTags } from "@nestjs/swagger";
|
||||
import { ApiHeader, ApiOperation, ApiResponse, ApiTags as DocsTags } from "@nestjs/swagger";
|
||||
import { Throttle } from "@nestjs/throttler";
|
||||
|
||||
import { SCHEDULE_READ, SCHEDULE_WRITE, SUCCESS_STATUS } from "@calcom/platform-constants";
|
||||
@@ -38,11 +38,38 @@ import {
|
||||
})
|
||||
@UseGuards(ApiAuthGuard, PermissionsGuard)
|
||||
@DocsTags("Schedules")
|
||||
@ApiHeader({
|
||||
name: "cal-api-version",
|
||||
description: `Must be set to \`2024-06-11\``,
|
||||
required: true,
|
||||
})
|
||||
@ApiHeader({
|
||||
name: "Authorization",
|
||||
description:
|
||||
"value must be `Bearer <token>` where `<token>` either managed user access token or api key prefixed with cal_",
|
||||
required: true,
|
||||
})
|
||||
export class SchedulesController_2024_06_11 {
|
||||
constructor(private readonly schedulesService: SchedulesService_2024_06_11) {}
|
||||
|
||||
@Post("/")
|
||||
@Permissions([SCHEDULE_WRITE])
|
||||
@ApiOperation({
|
||||
summary: "Create a schedule",
|
||||
description: `
|
||||
The point of creating schedules is for event types to be available at specific times.
|
||||
|
||||
First goal of schedules is to have a default schedule. If you are platform customer and created managed users, then it is important to note that each managed user should have a default schedule.
|
||||
1. If you passed \`timeZone\` when creating managed user, then the default schedule from Monday to Friday from 9AM to 5PM will be created with that timezone. Managed user can then change the default schedule via \`AvailabilitySettings\` atom.
|
||||
2. If you did not, then we assume you want that user has specific schedule right away. You should create default schedule by specifying
|
||||
\`"isDefault": true\` in the request body. Until the user has a default schedule that user can't be booked or manage his / her schedule via the AvailabilitySettings atom.
|
||||
|
||||
Second goal is to create other schedules that event types can point to, so that when that event is booked availability is not checked against the default schedule but against that specific schedule.
|
||||
After creating a non default schedule you can update event type to point to that schedule via the PATCH \`event-types/{eventTypeId}\` endpoint.
|
||||
|
||||
When specifying start time and end time for each day use 24 hour format e.g. 08:00, 15:00 etc.
|
||||
`,
|
||||
})
|
||||
async createSchedule(
|
||||
@GetUser() user: UserWithProfile,
|
||||
@Body() bodySchedule: CreateScheduleInput_2024_06_11
|
||||
@@ -59,7 +86,7 @@ export class SchedulesController_2024_06_11 {
|
||||
@Permissions([SCHEDULE_READ])
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: "Returns the default schedule",
|
||||
description: "Returns the default schedule of the authenticated user",
|
||||
type: GetDefaultScheduleOutput_2024_06_11,
|
||||
})
|
||||
async getDefaultSchedule(@GetUser() user: UserWithProfile): Promise<GetScheduleOutput_2024_06_11> {
|
||||
@@ -88,6 +115,9 @@ export class SchedulesController_2024_06_11 {
|
||||
|
||||
@Get("/")
|
||||
@Permissions([SCHEDULE_READ])
|
||||
@ApiOperation({
|
||||
description: "Returns all schedules of the authenticated user",
|
||||
})
|
||||
async getSchedules(@GetUser() user: UserWithProfile): Promise<GetSchedulesOutput_2024_06_11> {
|
||||
const schedules = await this.schedulesService.getUserSchedules(user.id);
|
||||
|
||||
|
||||
-1
@@ -79,7 +79,6 @@ export class OAuthClientUsersController {
|
||||
`Creating user with data: ${JSON.stringify(body, null, 2)} for OAuth Client with ID ${oAuthClientId}`
|
||||
);
|
||||
const client = await this.oauthRepository.getOAuthClient(oAuthClientId);
|
||||
console.log("asap createUser client", JSON.stringify(client, null, 2));
|
||||
|
||||
const isPlatformManaged = true;
|
||||
const { user, tokens } = await this.oAuthClientUsersService.createOauthClientUser(
|
||||
|
||||
@@ -29,7 +29,11 @@ export class CreateManagedUserInput {
|
||||
@IsTimeZone()
|
||||
@IsOptional()
|
||||
@CapitalizeTimeZone()
|
||||
@ApiProperty({ example: "America/New_York" })
|
||||
@ApiProperty({
|
||||
example: "America/New_York",
|
||||
description: `Timezone is used to create user's default schedule from Monday to Friday from 9AM to 5PM. If it is not passed then user does not have
|
||||
a default schedule and it must be created manually via the /schedules endpoint. Until the schedule is created, the user can't access availability atom to set his / her availability nor booked.`,
|
||||
})
|
||||
timeZone?: string;
|
||||
|
||||
@IsEnum(Locales)
|
||||
|
||||
+2792
-1782
File diff suppressed because it is too large
Load Diff
+66
-22
@@ -21,11 +21,15 @@ const inputBookingFieldTypes = [
|
||||
|
||||
export class PhoneFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "phone", description: "only allowed value for type is `phone`" })
|
||||
type!: "phone";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -44,11 +48,15 @@ export class PhoneFieldInput_2024_06_14 {
|
||||
|
||||
export class AddressFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "address", description: "only allowed value for type is `address`" })
|
||||
type!: "address";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -68,11 +76,15 @@ export class AddressFieldInput_2024_06_14 {
|
||||
|
||||
export class TextFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "text", description: "only allowed value for type is `text`" })
|
||||
type!: "text";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -92,11 +104,15 @@ export class TextFieldInput_2024_06_14 {
|
||||
|
||||
export class NumberFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "number", description: "only allowed value for type is `number`" })
|
||||
type!: "number";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -116,11 +132,15 @@ export class NumberFieldInput_2024_06_14 {
|
||||
|
||||
export class TextAreaFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "textarea", description: "only allowed value for type is `textarea`" })
|
||||
type!: "textarea";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -140,11 +160,15 @@ export class TextAreaFieldInput_2024_06_14 {
|
||||
|
||||
export class SelectFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "select", description: "only allowed value for type is `select`" })
|
||||
type!: "select";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -168,11 +192,15 @@ export class SelectFieldInput_2024_06_14 {
|
||||
|
||||
export class MultiSelectFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "multiselect", description: "only allowed value for type is `multiselect`" })
|
||||
type!: "multiselect";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -190,11 +218,15 @@ export class MultiSelectFieldInput_2024_06_14 {
|
||||
|
||||
export class MultiEmailFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "multiemail", description: "only allowed value for type is `multiemail`" })
|
||||
type!: "multiemail";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -214,11 +246,15 @@ export class MultiEmailFieldInput_2024_06_14 {
|
||||
|
||||
export class CheckboxGroupFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "checkbox", description: "only allowed value for type is `checkbox`" })
|
||||
type!: "checkbox";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -236,11 +272,15 @@ export class CheckboxGroupFieldInput_2024_06_14 {
|
||||
|
||||
export class RadioGroupFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "radio", description: "only allowed value for type is `radio`" })
|
||||
type!: "radio";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@@ -258,11 +298,15 @@ export class RadioGroupFieldInput_2024_06_14 {
|
||||
|
||||
export class BooleanFieldInput_2024_06_14 {
|
||||
@IsIn(inputBookingFieldTypes)
|
||||
@DocsProperty()
|
||||
@DocsProperty({ example: "boolean", description: "only allowed value for type is `boolean`" })
|
||||
type!: "boolean";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Unique identifier for the field in format `some-slug`. It is used to access response to this booking field during the booking",
|
||||
example: "some-slug",
|
||||
})
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
|
||||
+22
@@ -1,4 +1,5 @@
|
||||
import { BadRequestException } from "@nestjs/common";
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
|
||||
import {
|
||||
IsEnum,
|
||||
@@ -29,6 +30,10 @@ export type TransformFutureBookingsLimitSchema_2024_06_14 = {
|
||||
// Base class for common properties and validation
|
||||
class BookingWindowBase {
|
||||
@IsEnum(BookingWindowPeriodInputTypeEnum_2024_06_14)
|
||||
@ApiProperty({
|
||||
enum: ["businessDays", "calendarDays", "range"],
|
||||
description: "Whether the window should be business days, calendar days or a range of dates",
|
||||
})
|
||||
type!: BookingWindowPeriodInputType_2024_06_14;
|
||||
}
|
||||
|
||||
@@ -36,20 +41,32 @@ class BookingWindowBase {
|
||||
export class BusinessDaysWindow_2024_06_14 extends BookingWindowBase {
|
||||
@IsNumber()
|
||||
@IsDefined()
|
||||
@ApiProperty({ example: 5, description: "How many business day into the future can this event be booked" })
|
||||
value!: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@ApiProperty({
|
||||
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.",
|
||||
})
|
||||
rolling?: boolean;
|
||||
}
|
||||
|
||||
export class CalendarDaysWindow_2024_06_14 extends BookingWindowBase {
|
||||
@IsNumber()
|
||||
@IsDefined()
|
||||
@ApiProperty({ example: 5, description: "How many calendar days into the future can this event be booked" })
|
||||
value!: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@ApiProperty({
|
||||
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.",
|
||||
})
|
||||
rolling?: boolean;
|
||||
}
|
||||
|
||||
@@ -58,6 +75,11 @@ export class RangeWindow_2024_06_14 extends BookingWindowBase {
|
||||
@ArrayNotEmpty()
|
||||
@IsDateString({}, { each: true })
|
||||
@IsDefined()
|
||||
@ApiProperty({
|
||||
type: [String],
|
||||
example: ["2030-09-05", "2030-09-09"],
|
||||
description: "Date range for when this event can be booked.",
|
||||
})
|
||||
value!: string[];
|
||||
}
|
||||
|
||||
|
||||
+126
-4
@@ -1,4 +1,4 @@
|
||||
import { ApiProperty as DocsProperty } from "@nestjs/swagger";
|
||||
import { ApiProperty as DocsProperty, getSchemaPath, ApiExtraModels } from "@nestjs/swagger";
|
||||
import { Type, Transform } from "class-transformer";
|
||||
import {
|
||||
IsString,
|
||||
@@ -13,6 +13,19 @@ import {
|
||||
|
||||
import { SchedulingType } from "@calcom/platform-enums";
|
||||
|
||||
import {
|
||||
AddressFieldInput_2024_06_14,
|
||||
BooleanFieldInput_2024_06_14,
|
||||
CheckboxGroupFieldInput_2024_06_14,
|
||||
MultiEmailFieldInput_2024_06_14,
|
||||
MultiSelectFieldInput_2024_06_14,
|
||||
NumberFieldInput_2024_06_14,
|
||||
PhoneFieldInput_2024_06_14,
|
||||
RadioGroupFieldInput_2024_06_14,
|
||||
SelectFieldInput_2024_06_14,
|
||||
TextAreaFieldInput_2024_06_14,
|
||||
TextFieldInput_2024_06_14,
|
||||
} from "./booking-fields.input";
|
||||
import type { InputBookingField_2024_06_14 } from "./booking-fields.input";
|
||||
import { ValidateInputBookingFields_2024_06_14 } from "./booking-fields.input";
|
||||
import { BookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input";
|
||||
@@ -21,8 +34,19 @@ import {
|
||||
ValidateBookingLimistsDuration,
|
||||
} from "./booking-limits-duration.input";
|
||||
import type { BookingWindow_2024_06_14 } from "./booking-window.input";
|
||||
import { ValidateBookingWindow } from "./booking-window.input";
|
||||
import { ValidateLocations_2024_06_14 } from "./locations.input";
|
||||
import {
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
CalendarDaysWindow_2024_06_14,
|
||||
RangeWindow_2024_06_14,
|
||||
ValidateBookingWindow,
|
||||
} from "./booking-window.input";
|
||||
import {
|
||||
AddressLocation_2024_06_14,
|
||||
IntegrationLocation_2024_06_14,
|
||||
LinkLocation_2024_06_14,
|
||||
PhoneLocation_2024_06_14,
|
||||
ValidateLocations_2024_06_14,
|
||||
} from "./locations.input";
|
||||
import type { Location_2024_06_14 } from "./locations.input";
|
||||
import { Recurrence_2024_06_14 } from "./recurrence.input";
|
||||
|
||||
@@ -30,7 +54,28 @@ export const CREATE_EVENT_LENGTH_EXAMPLE = 60;
|
||||
export const CREATE_EVENT_TITLE_EXAMPLE = "Learn the secrets of masterchief!";
|
||||
export const CREATE_EVENT_DESCRIPTION_EXAMPLE =
|
||||
"Discover the culinary wonders of the Argentina by making the best flan ever!";
|
||||
export const CREATE_EVENT_SLUG_EXAMPLE = "learn-the-secrets-of-masterchief";
|
||||
|
||||
@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 CreateEventTypeInput_2024_06_14 {
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@@ -42,6 +87,7 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
title!: string;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_SLUG_EXAMPLE })
|
||||
slug!: string;
|
||||
|
||||
@IsOptional()
|
||||
@@ -51,63 +97,131 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
|
||||
@IsOptional()
|
||||
@ValidateLocations_2024_06_14()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Locations where the event will take place. If not provided, cal video link will be used as the location.",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(AddressLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(LinkLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(IntegrationLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(PhoneLocation_2024_06_14) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
locations?: Location_2024_06_14[];
|
||||
|
||||
@IsOptional()
|
||||
@ValidateInputBookingFields_2024_06_14()
|
||||
@DocsProperty({
|
||||
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: [
|
||||
{ $ref: getSchemaPath(PhoneFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(AddressFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(TextFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(NumberFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(TextAreaFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(SelectFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(MultiSelectFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(MultiEmailFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(CheckboxGroupFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(RadioGroupFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(BooleanFieldInput_2024_06_14) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingFields?: InputBookingField_2024_06_14[];
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty({ description: "If true, person booking this event't cant add guests via their emails." })
|
||||
disableGuests?: boolean;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
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.`,
|
||||
})
|
||||
slotInterval?: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@IsOptional()
|
||||
@DocsProperty({ description: "Minimum number of minutes before the event that a booking can be made." })
|
||||
minimumBookingNotice?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
description: "Time spaces that can be pre-pended before an event to give more time before it.",
|
||||
})
|
||||
beforeEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
description: "Time spaces that can be appended after an event to give more time after it.",
|
||||
})
|
||||
afterEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"If you want that this event has different schedule than user's default one you can specify it here.",
|
||||
})
|
||||
scheduleId?: number;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => BookingLimitsCount_2024_06_14)
|
||||
@ValidateBookingLimistsCount()
|
||||
@DocsProperty({ description: "Limit how many times this event can be booked" })
|
||||
bookingLimitsCount?: BookingLimitsCount_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"This will limit your availability for this event type to one slot per day, scheduled at the earliest available time.",
|
||||
})
|
||||
onlyShowFirstAvailableSlot?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => BookingLimitsDuration_2024_06_14)
|
||||
@ValidateBookingLimistsDuration()
|
||||
@DocsProperty({ description: "Limit total amount of time that this event can be booked" })
|
||||
bookingLimitsDuration?: BookingLimitsDuration_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingWindow()
|
||||
@DocsProperty({
|
||||
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) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingWindow?: BookingWindow_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty({ description: "Offset timeslots shown to bookers by a specified number of minutes" })
|
||||
offsetStart?: number;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => Recurrence_2024_06_14)
|
||||
@DocsProperty({
|
||||
description: "Create a recurring event that can be booked once but will occur multiple times",
|
||||
})
|
||||
recurrence?: Recurrence_2024_06_14;
|
||||
}
|
||||
|
||||
@@ -120,14 +234,20 @@ export enum HostPriority {
|
||||
}
|
||||
export class Host {
|
||||
@IsInt()
|
||||
@DocsProperty({ description: "Which user is the host of this event" })
|
||||
userId!: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Only relevant for round robin event types. If true then the user must attend round robin event always.",
|
||||
})
|
||||
mandatory?: boolean = false;
|
||||
|
||||
@IsEnum(HostPriority)
|
||||
@IsOptional()
|
||||
@DocsProperty({ enum: HostPriority })
|
||||
priority?: keyof typeof HostPriority = "medium";
|
||||
}
|
||||
|
||||
@@ -156,6 +276,8 @@ export class CreateTeamEventTypeInput_2024_06_14 extends CreateEventTypeInput_20
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description: "If true, all current and future team members will be assigned to this event type",
|
||||
})
|
||||
assignAllTeamMembers?: boolean;
|
||||
}
|
||||
|
||||
+17
@@ -1,23 +1,40 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { Transform } from "class-transformer";
|
||||
import { IsOptional, IsString } from "class-validator";
|
||||
|
||||
export class GetEventTypesQuery_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@ApiProperty({
|
||||
description:
|
||||
"The username of the user to get event types for. If only username provided will get all event types.",
|
||||
})
|
||||
username?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
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.",
|
||||
})
|
||||
eventSlug?: string;
|
||||
|
||||
@IsOptional()
|
||||
@TransformUsernames()
|
||||
@ApiProperty({
|
||||
description:
|
||||
"Get dynamic event type for multiple usernames separated by comma. e.g `usernames=alice,bob`",
|
||||
type: String,
|
||||
})
|
||||
usernames?: string[];
|
||||
}
|
||||
|
||||
export class GetTeamEventTypesQuery_2024_06_14 {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
description: "Slug of team event type to return.",
|
||||
})
|
||||
eventSlug?: string;
|
||||
}
|
||||
|
||||
|
||||
+8
-1
@@ -9,6 +9,7 @@ const locations = ["address", "link", "integration", "phone"] as const;
|
||||
|
||||
export class AddressLocation_2024_06_14 {
|
||||
@IsIn(locations)
|
||||
@DocsProperty({ example: "address", description: "only allowed value for type is `address`" })
|
||||
type!: "address";
|
||||
|
||||
@IsString()
|
||||
@@ -16,11 +17,13 @@ export class AddressLocation_2024_06_14 {
|
||||
address!: string;
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
public!: boolean;
|
||||
}
|
||||
|
||||
export class LinkLocation_2024_06_14 {
|
||||
@IsIn(locations)
|
||||
@DocsProperty({ example: "link", description: "only allowed value for type is `link`" })
|
||||
type!: "link";
|
||||
|
||||
@IsUrl()
|
||||
@@ -28,6 +31,7 @@ export class LinkLocation_2024_06_14 {
|
||||
link!: string;
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
public!: boolean;
|
||||
}
|
||||
|
||||
@@ -36,15 +40,17 @@ export type Integration_2024_06_14 = (typeof integrations)[number];
|
||||
|
||||
export class IntegrationLocation_2024_06_14 {
|
||||
@IsIn(locations)
|
||||
@DocsProperty({ example: "integration", description: "only allowed value for type is `integration`" })
|
||||
type!: "integration";
|
||||
|
||||
@IsIn(integrations)
|
||||
@DocsProperty({ example: integrations[0] })
|
||||
@DocsProperty({ example: integrations[0], enum: integrations })
|
||||
integration!: Integration_2024_06_14;
|
||||
}
|
||||
|
||||
export class PhoneLocation_2024_06_14 {
|
||||
@IsIn(locations)
|
||||
@DocsProperty({ example: "phone", description: "only allowed value for type is `phone`" })
|
||||
type!: "phone";
|
||||
|
||||
@IsPhoneNumber()
|
||||
@@ -52,6 +58,7 @@ export class PhoneLocation_2024_06_14 {
|
||||
phone!: string;
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
public!: boolean;
|
||||
}
|
||||
|
||||
|
||||
+152
-90
@@ -1,157 +1,244 @@
|
||||
import { ApiProperty as DocsProperty } from "@nestjs/swagger";
|
||||
import { ApiProperty as DocsProperty, getSchemaPath, ApiExtraModels } from "@nestjs/swagger";
|
||||
import { Type } from "class-transformer";
|
||||
import { IsString, IsInt, IsBoolean, IsOptional, Min, ValidateNested, IsArray } from "class-validator";
|
||||
|
||||
import type { InputBookingField_2024_06_14 } from "./booking-fields.input";
|
||||
import { ValidateInputBookingFields_2024_06_14 } from "./booking-fields.input";
|
||||
import {
|
||||
AddressFieldInput_2024_06_14,
|
||||
BooleanFieldInput_2024_06_14,
|
||||
CheckboxGroupFieldInput_2024_06_14,
|
||||
MultiEmailFieldInput_2024_06_14,
|
||||
MultiSelectFieldInput_2024_06_14,
|
||||
NumberFieldInput_2024_06_14,
|
||||
PhoneFieldInput_2024_06_14,
|
||||
RadioGroupFieldInput_2024_06_14,
|
||||
SelectFieldInput_2024_06_14,
|
||||
TextAreaFieldInput_2024_06_14,
|
||||
TextFieldInput_2024_06_14,
|
||||
ValidateInputBookingFields_2024_06_14,
|
||||
} from "./booking-fields.input";
|
||||
import { BookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input";
|
||||
import {
|
||||
BookingLimitsDuration_2024_06_14,
|
||||
ValidateBookingLimistsDuration,
|
||||
} from "./booking-limits-duration.input";
|
||||
import { ValidateBookingWindow, type BookingWindow_2024_06_14 } from "./booking-window.input";
|
||||
import { Host } from "./create-event-type.input";
|
||||
import { ValidateLocations_2024_06_14 } from "./locations.input";
|
||||
import {
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
CalendarDaysWindow_2024_06_14,
|
||||
RangeWindow_2024_06_14,
|
||||
ValidateBookingWindow,
|
||||
type BookingWindow_2024_06_14,
|
||||
} from "./booking-window.input";
|
||||
import {
|
||||
CREATE_EVENT_DESCRIPTION_EXAMPLE,
|
||||
CREATE_EVENT_LENGTH_EXAMPLE,
|
||||
CREATE_EVENT_SLUG_EXAMPLE,
|
||||
CREATE_EVENT_TITLE_EXAMPLE,
|
||||
Host,
|
||||
} from "./create-event-type.input";
|
||||
import {
|
||||
AddressLocation_2024_06_14,
|
||||
IntegrationLocation_2024_06_14,
|
||||
LinkLocation_2024_06_14,
|
||||
PhoneLocation_2024_06_14,
|
||||
ValidateLocations_2024_06_14,
|
||||
} from "./locations.input";
|
||||
import type { Location_2024_06_14 } from "./locations.input";
|
||||
import { Recurrence_2024_06_14 } from "./recurrence.input";
|
||||
|
||||
@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 UpdateEventTypeInput_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty({ example: CREATE_EVENT_LENGTH_EXAMPLE })
|
||||
lengthInMinutes?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_TITLE_EXAMPLE })
|
||||
title?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@DocsProperty({ example: CREATE_EVENT_SLUG_EXAMPLE })
|
||||
slug?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE })
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateLocations_2024_06_14()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"Locations where the event will take place. If not provided, cal video link will be used as the location.",
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(AddressLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(LinkLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(IntegrationLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(PhoneLocation_2024_06_14) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
locations?: Location_2024_06_14[];
|
||||
|
||||
@IsOptional()
|
||||
@ValidateInputBookingFields_2024_06_14()
|
||||
@DocsProperty({
|
||||
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: [
|
||||
{ $ref: getSchemaPath(PhoneFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(AddressFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(TextFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(NumberFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(TextAreaFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(SelectFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(MultiSelectFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(MultiEmailFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(CheckboxGroupFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(RadioGroupFieldInput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(BooleanFieldInput_2024_06_14) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingFields?: InputBookingField_2024_06_14[];
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty({ description: "If true, person booking this event't cant add guests via their emails." })
|
||||
disableGuests?: boolean;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
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.`,
|
||||
})
|
||||
slotInterval?: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@IsOptional()
|
||||
@DocsProperty({ description: "Minimum number of minutes before the event that a booking can be made." })
|
||||
minimumBookingNotice?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
description: "Time spaces that can be pre-pended before an event to give more time before it.",
|
||||
})
|
||||
beforeEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
description: "Time spaces that can be appended after an event to give more time after it.",
|
||||
})
|
||||
afterEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"If you want that this event has different schedule than user's default one you can specify it here.",
|
||||
})
|
||||
scheduleId?: number;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => BookingLimitsCount_2024_06_14)
|
||||
@ValidateBookingLimistsCount()
|
||||
@DocsProperty({ description: "Limit how many times this event can be booked" })
|
||||
bookingLimitsCount?: BookingLimitsCount_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"This will limit your availability for this event type to one slot per day, scheduled at the earliest available time.",
|
||||
})
|
||||
onlyShowFirstAvailableSlot?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => BookingLimitsDuration_2024_06_14)
|
||||
@ValidateBookingLimistsDuration()
|
||||
@DocsProperty({ description: "Limit total amount of time that this event can be booked" })
|
||||
bookingLimitsDuration?: BookingLimitsDuration_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingWindow()
|
||||
@DocsProperty({
|
||||
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) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingWindow?: BookingWindow_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty({ description: "Offset timeslots shown to bookers by a specified number of minutes" })
|
||||
offsetStart?: number;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => Recurrence_2024_06_14)
|
||||
@DocsProperty({
|
||||
description: "Create a recurring event that can be booked once but will occur multiple times",
|
||||
})
|
||||
recurrence?: Recurrence_2024_06_14;
|
||||
}
|
||||
export class UpdateTeamEventTypeInput_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty()
|
||||
lengthInMinutes?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
title?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
slug?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateLocations_2024_06_14()
|
||||
@DocsProperty()
|
||||
locations?: Location_2024_06_14[];
|
||||
|
||||
@IsOptional()
|
||||
@ValidateInputBookingFields_2024_06_14()
|
||||
@DocsProperty()
|
||||
bookingFields?: InputBookingField_2024_06_14[];
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
disableGuests?: boolean;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
slotInterval?: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
minimumBookingNotice?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
beforeEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
afterEventBuffer?: number;
|
||||
|
||||
@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()
|
||||
@@ -162,33 +249,8 @@ export class UpdateTeamEventTypeInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
@DocsProperty({
|
||||
description: "If true, all current and future team members will be assigned to this event type",
|
||||
})
|
||||
assignAllTeamMembers?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => BookingLimitsCount_2024_06_14)
|
||||
@ValidateBookingLimistsCount()
|
||||
bookingLimitsCount?: BookingLimitsCount_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
onlyShowFirstAvailableSlot?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => BookingLimitsDuration_2024_06_14)
|
||||
@ValidateBookingLimistsDuration()
|
||||
bookingLimitsDuration?: BookingLimitsDuration_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingWindow()
|
||||
bookingWindow?: BookingWindow_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
offsetStart?: number;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => Recurrence_2024_06_14)
|
||||
recurrence?: Recurrence_2024_06_14;
|
||||
}
|
||||
|
||||
+158
-18
@@ -1,4 +1,5 @@
|
||||
import { BadRequestException } from "@nestjs/common";
|
||||
import { ApiProperty as DocsProperty } from "@nestjs/swagger";
|
||||
import { plainToInstance } from "class-transformer";
|
||||
import { IsBoolean, IsString } from "class-validator";
|
||||
import type { ValidationOptions, ValidatorConstraintInterface } from "class-validator";
|
||||
@@ -18,156 +19,295 @@ import {
|
||||
BooleanFieldInput_2024_06_14,
|
||||
} from "../inputs";
|
||||
|
||||
class NameDefaultFieldOutput_2024_06_14 {
|
||||
export class NameDefaultFieldOutput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always true because it's a default field",
|
||||
example: true,
|
||||
default: true,
|
||||
})
|
||||
isDefault = true;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "name",
|
||||
})
|
||||
slug!: "name";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "name",
|
||||
})
|
||||
type!: "name";
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
required!: true;
|
||||
}
|
||||
|
||||
class EmailDefaultFieldOutput_2024_06_14 {
|
||||
export class EmailDefaultFieldOutput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always true because it's a default field",
|
||||
example: true,
|
||||
default: true,
|
||||
})
|
||||
isDefault = true;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "email",
|
||||
})
|
||||
slug!: "email";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "email",
|
||||
})
|
||||
type!: "email";
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
required!: true;
|
||||
}
|
||||
|
||||
class LocationDefaultFieldOutput_2024_06_14 {
|
||||
export class LocationDefaultFieldOutput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always true because it's a default field",
|
||||
example: true,
|
||||
default: true,
|
||||
})
|
||||
isDefault = true;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "location",
|
||||
})
|
||||
slug!: "location";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "radioInput",
|
||||
})
|
||||
type!: "radioInput";
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
required!: false;
|
||||
}
|
||||
|
||||
class RescheduleReasonDefaultFieldOutput_2024_06_14 {
|
||||
export class RescheduleReasonDefaultFieldOutput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always true because it's a default field",
|
||||
example: true,
|
||||
default: true,
|
||||
})
|
||||
isDefault = true;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "rescheduleReason",
|
||||
})
|
||||
slug!: "rescheduleReason";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "textarea",
|
||||
})
|
||||
type!: "textarea";
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
required!: false;
|
||||
}
|
||||
|
||||
class TitleDefaultFieldOutput_2024_06_14 {
|
||||
export class TitleDefaultFieldOutput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always true because it's a default field",
|
||||
example: true,
|
||||
default: true,
|
||||
})
|
||||
isDefault = true;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "title",
|
||||
})
|
||||
slug!: "title";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "text",
|
||||
})
|
||||
type!: "text";
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
required!: true;
|
||||
}
|
||||
|
||||
class NotesDefaultFieldOutput_2024_06_14 {
|
||||
export class NotesDefaultFieldOutput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always true because it's a default field",
|
||||
example: true,
|
||||
default: true,
|
||||
})
|
||||
isDefault = true;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "notes",
|
||||
})
|
||||
slug!: "notes";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "textarea",
|
||||
})
|
||||
type!: "textarea";
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
required!: false;
|
||||
}
|
||||
|
||||
class GuestsDefaultFieldOutput_2024_06_14 {
|
||||
export class GuestsDefaultFieldOutput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always true because it's a default field",
|
||||
example: true,
|
||||
default: true,
|
||||
})
|
||||
isDefault = true;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "guests",
|
||||
})
|
||||
slug!: "guests";
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
default: "multiemail",
|
||||
})
|
||||
type!: "multiemail";
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
required!: false;
|
||||
}
|
||||
|
||||
class PhoneFieldOutput_2024_06_14 extends PhoneFieldInput_2024_06_14 {
|
||||
export class PhoneFieldOutput_2024_06_14 extends PhoneFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class AddressFieldOutput_2024_06_14 extends AddressFieldInput_2024_06_14 {
|
||||
export class AddressFieldOutput_2024_06_14 extends AddressFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class TextFieldOutput_2024_06_14 extends TextFieldInput_2024_06_14 {
|
||||
export class TextFieldOutput_2024_06_14 extends TextFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class NumberFieldOutput_2024_06_14 extends NumberFieldInput_2024_06_14 {
|
||||
export class NumberFieldOutput_2024_06_14 extends NumberFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class TextAreaFieldOutput_2024_06_14 extends TextAreaFieldInput_2024_06_14 {
|
||||
export class TextAreaFieldOutput_2024_06_14 extends TextAreaFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class SelectFieldOutput_2024_06_14 extends SelectFieldInput_2024_06_14 {
|
||||
export class SelectFieldOutput_2024_06_14 extends SelectFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class MultiSelectFieldOutput_2024_06_14 extends MultiSelectFieldInput_2024_06_14 {
|
||||
export class MultiSelectFieldOutput_2024_06_14 extends MultiSelectFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class MultiEmailFieldOutput_2024_06_14 extends MultiEmailFieldInput_2024_06_14 {
|
||||
export class MultiEmailFieldOutput_2024_06_14 extends MultiEmailFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class CheckboxGroupFieldOutput_2024_06_14 extends CheckboxGroupFieldInput_2024_06_14 {
|
||||
export class CheckboxGroupFieldOutput_2024_06_14 extends CheckboxGroupFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class RadioGroupFieldOutput_2024_06_14 extends RadioGroupFieldInput_2024_06_14 {
|
||||
export class RadioGroupFieldOutput_2024_06_14 extends RadioGroupFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
class BooleanFieldOutput_2024_06_14 extends BooleanFieldInput_2024_06_14 {
|
||||
export class BooleanFieldOutput_2024_06_14 extends BooleanFieldInput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@DocsProperty({
|
||||
description: "This property is always false because it's not default field but custom field",
|
||||
example: false,
|
||||
default: false,
|
||||
})
|
||||
isDefault = false;
|
||||
}
|
||||
|
||||
|
||||
+155
-112
@@ -1,4 +1,4 @@
|
||||
import { ApiProperty as DocsProperty } from "@nestjs/swagger";
|
||||
import { ApiProperty as DocsProperty, getSchemaPath, ApiExtraModels } from "@nestjs/swagger";
|
||||
import { Type } from "class-transformer";
|
||||
import {
|
||||
IsArray,
|
||||
@@ -12,10 +12,42 @@ import {
|
||||
} from "class-validator";
|
||||
|
||||
import type { Location_2024_06_14, BookingWindow_2024_06_14 } from "../inputs";
|
||||
import { Host as TeamEventTypeHostInput, BookingLimitsDuration_2024_06_14 } from "../inputs";
|
||||
import {
|
||||
Host as TeamEventTypeHostInput,
|
||||
BookingLimitsDuration_2024_06_14,
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
CalendarDaysWindow_2024_06_14,
|
||||
RangeWindow_2024_06_14,
|
||||
} from "../inputs";
|
||||
import { Recurrence_2024_06_14 } from "../inputs";
|
||||
import type { BookingLimitsCount_2024_06_14 } from "../inputs/booking-limits-count.input";
|
||||
import { ValidateLocations_2024_06_14 } from "../inputs/locations.input";
|
||||
import { BookingLimitsCount_2024_06_14 } from "../inputs/booking-limits-count.input";
|
||||
import {
|
||||
AddressLocation_2024_06_14,
|
||||
IntegrationLocation_2024_06_14,
|
||||
LinkLocation_2024_06_14,
|
||||
PhoneLocation_2024_06_14,
|
||||
ValidateLocations_2024_06_14,
|
||||
} from "../inputs/locations.input";
|
||||
import {
|
||||
EmailDefaultFieldOutput_2024_06_14,
|
||||
NameDefaultFieldOutput_2024_06_14,
|
||||
LocationDefaultFieldOutput_2024_06_14,
|
||||
RescheduleReasonDefaultFieldOutput_2024_06_14,
|
||||
TitleDefaultFieldOutput_2024_06_14,
|
||||
NotesDefaultFieldOutput_2024_06_14,
|
||||
GuestsDefaultFieldOutput_2024_06_14,
|
||||
AddressFieldOutput_2024_06_14,
|
||||
BooleanFieldOutput_2024_06_14,
|
||||
CheckboxGroupFieldOutput_2024_06_14,
|
||||
MultiEmailFieldOutput_2024_06_14,
|
||||
MultiSelectFieldOutput_2024_06_14,
|
||||
NumberFieldOutput_2024_06_14,
|
||||
PhoneFieldOutput_2024_06_14,
|
||||
RadioGroupFieldOutput_2024_06_14,
|
||||
SelectFieldOutput_2024_06_14,
|
||||
TextAreaFieldOutput_2024_06_14,
|
||||
TextFieldOutput_2024_06_14,
|
||||
} from "../outputs/booking-fields.output";
|
||||
import type { OutputBookingField_2024_06_14 } from "./booking-fields.output";
|
||||
import { ValidateOutputBookingFields_2024_06_14 } from "./booking-fields.output";
|
||||
|
||||
@@ -52,239 +84,250 @@ class User_2024_06_14 {
|
||||
metadata!: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export class EventTypeOutput_2024_06_14 {
|
||||
@ApiExtraModels(
|
||||
AddressLocation_2024_06_14,
|
||||
LinkLocation_2024_06_14,
|
||||
IntegrationLocation_2024_06_14,
|
||||
PhoneLocation_2024_06_14,
|
||||
EmailDefaultFieldOutput_2024_06_14,
|
||||
NameDefaultFieldOutput_2024_06_14,
|
||||
LocationDefaultFieldOutput_2024_06_14,
|
||||
RescheduleReasonDefaultFieldOutput_2024_06_14,
|
||||
TitleDefaultFieldOutput_2024_06_14,
|
||||
NotesDefaultFieldOutput_2024_06_14,
|
||||
GuestsDefaultFieldOutput_2024_06_14,
|
||||
AddressFieldOutput_2024_06_14,
|
||||
BooleanFieldOutput_2024_06_14,
|
||||
CheckboxGroupFieldOutput_2024_06_14,
|
||||
MultiEmailFieldOutput_2024_06_14,
|
||||
MultiSelectFieldOutput_2024_06_14,
|
||||
NumberFieldOutput_2024_06_14,
|
||||
PhoneFieldOutput_2024_06_14,
|
||||
RadioGroupFieldOutput_2024_06_14,
|
||||
SelectFieldOutput_2024_06_14,
|
||||
TextAreaFieldOutput_2024_06_14,
|
||||
TextFieldOutput_2024_06_14,
|
||||
BookingLimitsDuration_2024_06_14,
|
||||
BusinessDaysWindow_2024_06_14,
|
||||
CalendarDaysWindow_2024_06_14,
|
||||
RangeWindow_2024_06_14
|
||||
)
|
||||
class BaseEventTypeOutput_2024_06_14 {
|
||||
@IsInt()
|
||||
@DocsProperty({ example: 1 })
|
||||
id!: number;
|
||||
|
||||
@IsInt()
|
||||
ownerId!: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty({ example: 60 })
|
||||
lengthInMinutes!: number;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({ example: "Learn the secrets of masterchief!" })
|
||||
title!: string;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({ example: "learn-the-secrets-of-masterchief" })
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({
|
||||
example: "Discover the culinary wonders of the Argentina by making the best flan ever!",
|
||||
})
|
||||
description!: string;
|
||||
|
||||
@ValidateLocations_2024_06_14()
|
||||
@DocsProperty({
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(AddressLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(LinkLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(IntegrationLocation_2024_06_14) },
|
||||
{ $ref: getSchemaPath(PhoneLocation_2024_06_14) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
locations!: Location_2024_06_14[];
|
||||
|
||||
@ValidateOutputBookingFields_2024_06_14()
|
||||
@DocsProperty({
|
||||
oneOf: [
|
||||
{ $ref: getSchemaPath(NameDefaultFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(EmailDefaultFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(LocationDefaultFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(RescheduleReasonDefaultFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(TitleDefaultFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(NotesDefaultFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(GuestsDefaultFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(PhoneFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(AddressFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(TextFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(NumberFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(TextAreaFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(SelectFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(MultiSelectFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(MultiEmailFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(CheckboxGroupFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(RadioGroupFieldOutput_2024_06_14) },
|
||||
{ $ref: getSchemaPath(BooleanFieldOutput_2024_06_14) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingFields!: OutputBookingField_2024_06_14[];
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
disableGuests!: boolean;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({ example: 60, type: Number })
|
||||
slotInterval?: number | null;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@IsOptional()
|
||||
@DocsProperty({ example: 0 })
|
||||
minimumBookingNotice?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({ example: 0 })
|
||||
beforeEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({ example: 0 })
|
||||
afterEventBuffer?: number;
|
||||
|
||||
@IsEnum(SchedulingTypeEnum)
|
||||
schedulingType!: EventTypesOutputSchedulingType | null;
|
||||
|
||||
@Type(() => Recurrence_2024_06_14)
|
||||
@DocsProperty()
|
||||
recurrence!: Recurrence_2024_06_14 | null;
|
||||
|
||||
@Type(() => Object)
|
||||
@DocsProperty()
|
||||
metadata!: Record<string, unknown>;
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
requiresConfirmation!: boolean;
|
||||
|
||||
@IsInt()
|
||||
@DocsProperty()
|
||||
price!: number;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
currency!: string;
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
lockTimeZoneToggleOnBookingPage!: boolean;
|
||||
|
||||
@IsInt()
|
||||
@DocsProperty()
|
||||
seatsPerTimeSlot!: number | null;
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
forwardParamsSuccessRedirect!: boolean | null;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty()
|
||||
successRedirectUrl!: string | null;
|
||||
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
seatsShowAvailabilityCount!: boolean | null;
|
||||
|
||||
@IsBoolean()
|
||||
isInstantEvent!: boolean;
|
||||
|
||||
users!: User_2024_06_14[];
|
||||
|
||||
@IsInt()
|
||||
@DocsProperty()
|
||||
scheduleId!: number | null;
|
||||
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
@Type(() => BookingLimitsCount_2024_06_14)
|
||||
bookingLimitsCount?: BookingLimitsCount_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@DocsProperty()
|
||||
onlyShowFirstAvailableSlot?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => BookingLimitsDuration_2024_06_14)
|
||||
@DocsProperty()
|
||||
bookingLimitsDuration?: BookingLimitsDuration_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
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) },
|
||||
],
|
||||
type: "array",
|
||||
})
|
||||
@Type(() => Object)
|
||||
bookingWindow?: BookingWindow_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty()
|
||||
offsetStart?: number;
|
||||
}
|
||||
|
||||
export class TeamEventTypeResponseHost extends TeamEventTypeHostInput {
|
||||
@IsString()
|
||||
@DocsProperty({ example: "John Doe" })
|
||||
name!: string;
|
||||
}
|
||||
|
||||
export class TeamEventTypeOutput_2024_06_14 {
|
||||
export class EventTypeOutput_2024_06_14 extends BaseEventTypeOutput_2024_06_14 {
|
||||
@IsInt()
|
||||
@DocsProperty({ example: 1 })
|
||||
id!: number;
|
||||
@DocsProperty({ example: 10 })
|
||||
ownerId!: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
lengthInMinutes!: number;
|
||||
|
||||
@IsString()
|
||||
title!: string;
|
||||
|
||||
@IsString()
|
||||
slug!: string;
|
||||
|
||||
@IsString()
|
||||
description!: string;
|
||||
|
||||
@ValidateLocations_2024_06_14()
|
||||
locations!: Location_2024_06_14[];
|
||||
|
||||
@ValidateOutputBookingFields_2024_06_14()
|
||||
bookingFields!: OutputBookingField_2024_06_14[];
|
||||
|
||||
@IsBoolean()
|
||||
disableGuests!: boolean;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
slotInterval?: number | null;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@IsOptional()
|
||||
minimumBookingNotice?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
beforeEventBuffer?: number;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
afterEventBuffer?: number;
|
||||
@Type(() => User_2024_06_14)
|
||||
@IsArray()
|
||||
@DocsProperty()
|
||||
users!: User_2024_06_14[];
|
||||
}
|
||||
|
||||
export class TeamEventTypeOutput_2024_06_14 extends BaseEventTypeOutput_2024_06_14 {
|
||||
@IsEnum(SchedulingTypeEnum)
|
||||
@DocsProperty({ enum: SchedulingTypeEnum })
|
||||
schedulingType!: EventTypesOutputSchedulingType | null;
|
||||
|
||||
@Type(() => Recurrence_2024_06_14)
|
||||
recurrence!: Recurrence_2024_06_14 | null;
|
||||
|
||||
@Type(() => Object)
|
||||
metadata!: Record<string, unknown>;
|
||||
|
||||
@IsBoolean()
|
||||
requiresConfirmation!: boolean;
|
||||
|
||||
@IsInt()
|
||||
price!: number;
|
||||
|
||||
@IsString()
|
||||
currency!: string;
|
||||
|
||||
@IsBoolean()
|
||||
lockTimeZoneToggleOnBookingPage!: boolean;
|
||||
|
||||
@IsInt()
|
||||
seatsPerTimeSlot!: number | null;
|
||||
|
||||
@IsBoolean()
|
||||
forwardParamsSuccessRedirect!: boolean | null;
|
||||
|
||||
@IsString()
|
||||
successRedirectUrl!: string | null;
|
||||
|
||||
@IsBoolean()
|
||||
seatsShowAvailabilityCount!: boolean | null;
|
||||
|
||||
@IsBoolean()
|
||||
isInstantEvent!: boolean;
|
||||
|
||||
@IsInt()
|
||||
scheduleId!: number | null;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
teamId?: number | null;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
ownerId?: number | null;
|
||||
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@DocsProperty({
|
||||
description:
|
||||
"For managed event types parent event type is the event type that this event type is based on",
|
||||
})
|
||||
parentEventTypeId?: number | null;
|
||||
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => TeamEventTypeResponseHost)
|
||||
@IsArray()
|
||||
@DocsProperty()
|
||||
hosts!: TeamEventTypeResponseHost[];
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
assignAllTeamMembers?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
bookingLimitsCount?: BookingLimitsCount_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
onlyShowFirstAvailableSlot?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@Type(() => BookingLimitsDuration_2024_06_14)
|
||||
bookingLimitsDuration?: BookingLimitsDuration_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
bookingWindow?: BookingWindow_2024_06_14;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
offsetStart?: number;
|
||||
}
|
||||
|
||||
+31
-12
@@ -18,17 +18,21 @@ import { TIME_FORMAT_HH_MM, WEEK_DAYS } from "../constants";
|
||||
export class ScheduleAvailabilityInput_2024_06_11 {
|
||||
@IsArray()
|
||||
@IsIn(WEEK_DAYS, { each: true })
|
||||
@ApiProperty({ example: ["Monday", "Tuesday"] })
|
||||
@ApiProperty({
|
||||
example: ["Monday", "Tuesday"],
|
||||
description: "Array of days when schedule is active.",
|
||||
enum: WEEK_DAYS,
|
||||
})
|
||||
days!: WeekDay[];
|
||||
|
||||
@IsString()
|
||||
@Matches(TIME_FORMAT_HH_MM, { message: "startTime must be a valid time format HH:MM" })
|
||||
@ApiProperty({ example: "09:00" })
|
||||
@ApiProperty({ example: "08:00", description: "startTime must be a valid time in format HH:MM e.g. 08:00" })
|
||||
startTime!: string;
|
||||
|
||||
@IsString()
|
||||
@Matches(TIME_FORMAT_HH_MM, { message: "endTime must be a valid time format HH:MM" })
|
||||
@ApiProperty({ example: "10:00" })
|
||||
@ApiProperty({ example: "15:00", description: "endTime must be a valid time in format HH:MM e.g. 15:00" })
|
||||
endTime!: string;
|
||||
}
|
||||
|
||||
@@ -39,22 +43,25 @@ export class ScheduleOverrideInput_2024_06_11 {
|
||||
|
||||
@IsString()
|
||||
@Matches(TIME_FORMAT_HH_MM, { message: "startTime must be a valid time format HH:MM" })
|
||||
@ApiProperty({ example: "12:00" })
|
||||
@ApiProperty({ example: "12:00", description: "startTime must be a valid time in format HH:MM e.g. 12:00" })
|
||||
startTime!: string;
|
||||
|
||||
@IsString()
|
||||
@Matches(TIME_FORMAT_HH_MM, { message: "endTime must be a valid time format HH:MM" })
|
||||
@ApiProperty({ example: "13:00" })
|
||||
@ApiProperty({ example: "13:00", description: "endTime must be a valid time in format HH:MM e.g. 13:00" })
|
||||
endTime!: string;
|
||||
}
|
||||
|
||||
export class CreateScheduleInput_2024_06_11 {
|
||||
@IsString()
|
||||
@ApiProperty({ example: "One-on-one coaching" })
|
||||
@ApiProperty({ example: "Catch up hours" })
|
||||
name!: string;
|
||||
|
||||
@IsTimeZone()
|
||||
@ApiProperty({ example: "Europe/Rome" })
|
||||
@ApiProperty({
|
||||
example: "Europe/Rome",
|
||||
description: "Timezone is used to calculate available times when an event using the schedule is booked.",
|
||||
})
|
||||
timeZone!: string;
|
||||
|
||||
@IsArray()
|
||||
@@ -63,11 +70,18 @@ export class CreateScheduleInput_2024_06_11 {
|
||||
@Type(() => ScheduleAvailabilityInput_2024_06_11)
|
||||
@ApiProperty({
|
||||
type: [ScheduleAvailabilityInput_2024_06_11],
|
||||
description:
|
||||
"Each object contains days and times when the user is available. If not passed, the default availability is Monday to Friday from 09:00 to 17:00.",
|
||||
example: [
|
||||
{
|
||||
days: ["Monday", "Tuesday"],
|
||||
startTime: "09:00",
|
||||
endTime: "10:00",
|
||||
startTime: "17:00",
|
||||
endTime: "19:00",
|
||||
},
|
||||
{
|
||||
days: ["Wednesday", "Thursday"],
|
||||
startTime: "16:00",
|
||||
endTime: "20:00",
|
||||
},
|
||||
],
|
||||
required: false,
|
||||
@@ -75,7 +89,11 @@ export class CreateScheduleInput_2024_06_11 {
|
||||
availability?: ScheduleAvailabilityInput_2024_06_11[];
|
||||
|
||||
@IsBoolean()
|
||||
@ApiProperty({ example: true })
|
||||
@ApiProperty({
|
||||
example: true,
|
||||
description: `Each user should have 1 default schedule. If you specified \`timeZone\` when creating managed user, then the default schedule will be created with that timezone.
|
||||
Default schedule means that if an event type is not tied to a specific schedule then the default schedule is used.`,
|
||||
})
|
||||
isDefault!: boolean;
|
||||
|
||||
@IsArray()
|
||||
@@ -84,11 +102,12 @@ export class CreateScheduleInput_2024_06_11 {
|
||||
@Type(() => ScheduleOverrideInput_2024_06_11)
|
||||
@ApiProperty({
|
||||
type: [ScheduleOverrideInput_2024_06_11],
|
||||
description: "Need to change availability for a specific date? Add an override.",
|
||||
example: [
|
||||
{
|
||||
date: "2024-05-20",
|
||||
startTime: "12:00",
|
||||
endTime: "14:00",
|
||||
startTime: "18:00",
|
||||
endTime: "21:00",
|
||||
},
|
||||
],
|
||||
required: false,
|
||||
|
||||
@@ -25,7 +25,7 @@ export class ScheduleOutput_2024_06_11 {
|
||||
ownerId!: number;
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ example: "One-on-one coaching" })
|
||||
@ApiProperty({ example: "Catch up hours" })
|
||||
name!: string;
|
||||
|
||||
@IsTimeZone()
|
||||
@@ -40,8 +40,13 @@ export class ScheduleOutput_2024_06_11 {
|
||||
example: [
|
||||
{
|
||||
days: ["Monday", "Tuesday"],
|
||||
startTime: "09:00",
|
||||
endTime: "10:00",
|
||||
startTime: "17:00",
|
||||
endTime: "19:00",
|
||||
},
|
||||
{
|
||||
days: ["Wednesday", "Thursday"],
|
||||
startTime: "16:00",
|
||||
endTime: "20:00",
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -60,8 +65,8 @@ export class ScheduleOutput_2024_06_11 {
|
||||
example: [
|
||||
{
|
||||
date: "2024-05-20",
|
||||
startTime: "12:00",
|
||||
endTime: "13:00",
|
||||
startTime: "18:00",
|
||||
endTime: "21:00",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user