feat: extend api/v2/event-types (#16128)
* feat: extended api/v2/event-types to add more attributes - additional attributes added * bookingLimits * onlyShowFirstAvailableSlot * durationLimits * offsetStart * bookingWindow * add swagger docs * type fix * extend api/v2/teams/[teamId]/event-types * added tests * extend api/v2/orgs/[orgId]/teams/[teamid]/event-types * update: added tests to get and update event-type as well * rename variables - bookingLimits -> bookingLimitsCount - durationLimits -> bookingLimitsDuration * refactor: rename bookingLimits and durationLimits, add descriptions - Renamed `bookingLimits` to `bookingLimitsCount` - Renamed `durationLimits` to `bookingLimitsDuration` - Added descriptions with examples to `bookingLimitsCount` and `bookingLimitsDuration` * feat: add unit tests for transformation logic in api-request and api-response - Added tests for `transformApiEventTypeIntervalLimits` - Added tests for `transformApiEventTypeFutureBookingLimits` * fix: type errors * feat: added custom validators for BookingLimitsCount and BookingLimitsDuration * fix: unit-tests * Update CHANGELOG.md * refactor: update imports to use platform-libraries from @calcom/platform-libraries-1.2.3 * fix: prevent double transformation of bookingWindow and bookingFields - resolving e2e test failures --------- Co-authored-by: Morgan <[email protected]>
This commit is contained in:
1 parent
894c0fc8a7
commit
8fbc76d59a
28 files changed
+1261
-5956
No files matched your search
+2
-2
@@ -1,7 +1,7 @@
|
||||
import type { BookerProps } from "@calcom/features/bookings/Booker";
|
||||
import { getFieldIdentifier } from "@calcom/features/form-builder/utils/getFieldIdentifier";
|
||||
import { defaultEvents } from "@calcom/lib/defaultEvents";
|
||||
import type { CommonField, OptionsField, SystemField } from "@calcom/lib/event-types/transformers";
|
||||
import type { UserField, SystemField } from "@calcom/lib/event-types/transformers";
|
||||
import {
|
||||
transformApiEventTypeLocations,
|
||||
transformApiEventTypeBookingFields,
|
||||
@@ -210,7 +210,7 @@ function getLocations(locations: EventTypeOutput_2024_06_14["locations"]) {
|
||||
}
|
||||
|
||||
function getBookingFields(bookingFields: EventTypeOutput_2024_06_14["bookingFields"]) {
|
||||
const transformedBookingFields: (CommonField | SystemField | OptionsField)[] =
|
||||
const transformedBookingFields: (SystemField | UserField)[] =
|
||||
transformApiEventTypeBookingFields(bookingFields);
|
||||
|
||||
// These fields should be added before other user fields
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
## 0.0.28
|
||||
• Feature: Added support for new event-type limits in the API.
|
||||
• Introduced the transformApiEventTypeFutureBookingLimits translator in packages/lib/event-types/transformers/api-request.ts. This enables the “Limit future bookings” feature in the event-type API.
|
||||
• Introduced the transformApiEventTypeIntervalLimits translator in packages/lib/event-types/transformers/api-request.ts. This allows the “Limit total booking duration” and “Limit booking frequency” features in the event-type API.
|
||||
• Added getResponseEventTypeIntervalLimits translator in packages/lib/event-types/transformers/api-response.ts to return data in a more human-friendly format.
|
||||
• Added getResponseEventTypeFutureBookingLimits translator in packages/lib/event-types/transformers/api-response.ts to improve the clarity and readability of the response data.
|
||||
|
||||
## 0.0.26
|
||||
Update `packages/app-store/office365calendar/lib/CalendarService.ts` "translateEvent" content so that in microsoft outlook calendar event the description
|
||||
has newlines instead of being all in 1 line.
|
||||
@@ -6,7 +13,6 @@ has newlines instead of being all in 1 line.
|
||||
Refactor "packages/lib/event-types/transformers/api-request.ts" getResponseEventTypeBookingFields - make sure that booking fields with options don't have
|
||||
undefines options.
|
||||
|
||||
|
||||
## 0.0.24
|
||||
Refactor "packages/lib/event-types/transformers/api-request.ts" - we access event-type booking fields in database and then distinguish them as either
|
||||
created by the user or system. Then in v2 api "event-types_2024_06_14/services/output-event-types.service.ts" we first parse them and then filter
|
||||
|
||||
@@ -93,13 +93,18 @@ export { EventTypeMetaDataSchema, userMetadata } from "@calcom/prisma/zod-utils"
|
||||
|
||||
export {
|
||||
transformApiEventTypeBookingFields,
|
||||
transformApiEventTypeIntervalLimits,
|
||||
transformApiEventTypeLocations,
|
||||
getResponseEventTypeLocations,
|
||||
getResponseEventTypeBookingFields,
|
||||
TransformedLocationsSchema,
|
||||
BookingFieldsSchema,
|
||||
getResponseEventTypeIntervalLimits,
|
||||
getResponseEventTypeFutureBookingLimits,
|
||||
transformApiEventTypeFutureBookingLimits,
|
||||
} from "@calcom/lib/event-types/transformers";
|
||||
|
||||
export { parseBookingLimit } from "@calcom/lib";
|
||||
export type { SystemField, UserField } from "@calcom/lib/event-types/transformers";
|
||||
|
||||
export { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
|
||||
import { IsInt, IsOptional, Min, ValidatorConstraint, registerDecorator } from "class-validator";
|
||||
|
||||
export type BookingLimitsKeyOutputType_2024_06_14 = "PER_DAY" | "PER_WEEK" | "PER_MONTH" | "PER_YEAR";
|
||||
export type BookingLimitsKeysInputType = "day" | "week" | "month" | "year";
|
||||
export type TransformBookingLimitsSchema_2024_06_14 = {
|
||||
[K in BookingLimitsKeyOutputType_2024_06_14]?: number;
|
||||
};
|
||||
|
||||
export class BookingLimitsCount_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@ApiProperty({
|
||||
description: "The number of bookings per day",
|
||||
example: 1,
|
||||
})
|
||||
day?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@ApiProperty({
|
||||
description: "The number of bookings per week",
|
||||
example: 2,
|
||||
})
|
||||
week?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@ApiProperty({
|
||||
description: "The number of bookings per month",
|
||||
example: 3,
|
||||
})
|
||||
month?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@ApiProperty({
|
||||
description: "The number of bookings per year",
|
||||
example: 4,
|
||||
})
|
||||
year?: number;
|
||||
}
|
||||
|
||||
// Custom validator to handle the union type
|
||||
@ValidatorConstraint({ name: "BookingLimitsCountValidator", async: false })
|
||||
class BookingLimitsCountValidator implements ValidatorConstraintInterface {
|
||||
private errorDetails: {
|
||||
invalidLimit?: string;
|
||||
comparedLimit?: string;
|
||||
} = {};
|
||||
validate(value: BookingLimitsCount_2024_06_14) {
|
||||
if (!value) return false;
|
||||
|
||||
const { day, week, month, year } = value;
|
||||
|
||||
// Check if 'day' exceeds 'week', 'month', or 'year'
|
||||
if (day && ((week && day > week) || (month && day > month) || (year && day > year))) {
|
||||
this.errorDetails.invalidLimit = "day";
|
||||
this.errorDetails.comparedLimit = week && day > week ? "week" : month && day > month ? "month" : "year";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if 'week' exceeds 'month' or 'year'
|
||||
if (week && ((month && week > month) || (year && week > year))) {
|
||||
this.errorDetails.invalidLimit = "week";
|
||||
this.errorDetails.comparedLimit = month && week > month ? "month" : "year";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if 'month' exceeds 'year'
|
||||
if (month && year && month > year) {
|
||||
this.errorDetails.invalidLimit = "month";
|
||||
this.errorDetails.comparedLimit = "year";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultMessage() {
|
||||
const { invalidLimit, comparedLimit } = this.errorDetails;
|
||||
return `Invalid booking limits: The number of bookings for ${invalidLimit} cannot exceed the number of bookings for ${comparedLimit}.`;
|
||||
}
|
||||
}
|
||||
|
||||
export function ValidateBookingLimistsCount(validationOptions?: ValidationOptions) {
|
||||
return function (object: any, propertyName: string) {
|
||||
registerDecorator({
|
||||
name: "ValidateBookingLimistsCount",
|
||||
target: object.constructor,
|
||||
propertyName: propertyName,
|
||||
options: validationOptions,
|
||||
validator: new BookingLimitsCountValidator(),
|
||||
});
|
||||
};
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
|
||||
import { IsInt, IsOptional, Min, ValidatorConstraint, registerDecorator } from "class-validator";
|
||||
|
||||
export class BookingLimitsDuration_2024_06_14 {
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(15)
|
||||
@ApiProperty({
|
||||
description: "The duration of bookings per day (must be a multiple of 15)",
|
||||
example: 60,
|
||||
})
|
||||
day?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(15)
|
||||
@ApiProperty({
|
||||
description: "The duration of bookings per week (must be a multiple of 15)",
|
||||
example: 120,
|
||||
})
|
||||
week?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(15)
|
||||
@ApiProperty({
|
||||
description: "The duration of bookings per month (must be a multiple of 15)",
|
||||
example: 180,
|
||||
})
|
||||
month?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(15)
|
||||
@ApiProperty({
|
||||
description: "The duration of bookings per year (must be a multiple of 15)",
|
||||
example: 240,
|
||||
})
|
||||
year?: number;
|
||||
}
|
||||
|
||||
@ValidatorConstraint({ name: "BookingLimitsDurationValidator", async: false })
|
||||
class BookingLimitsDurationValidator implements ValidatorConstraintInterface {
|
||||
private errorDetails: {
|
||||
invalidLimit?: string;
|
||||
comparedLimit?: string;
|
||||
} = {};
|
||||
validate(value: BookingLimitsDuration_2024_06_14) {
|
||||
if (!value) return false;
|
||||
|
||||
const { day, week, month, year } = value;
|
||||
|
||||
// Check if 'day' exceeds 'week', 'month', or 'year'
|
||||
if (day && ((week && day > week) || (month && day > month) || (year && day > year))) {
|
||||
this.errorDetails.invalidLimit = "day";
|
||||
this.errorDetails.comparedLimit = week && day > week ? "week" : month && day > month ? "month" : "year";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if 'week' exceeds 'month' or 'year'
|
||||
if (week && ((month && week > month) || (year && week > year))) {
|
||||
this.errorDetails.invalidLimit = "week";
|
||||
this.errorDetails.comparedLimit = month && week > month ? "month" : "year";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if 'month' exceeds 'year'
|
||||
if (month && year && month > year) {
|
||||
this.errorDetails.invalidLimit = "month";
|
||||
this.errorDetails.comparedLimit = "year";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultMessage() {
|
||||
const { invalidLimit, comparedLimit } = this.errorDetails;
|
||||
return `Invalid booking durations: The duration of bookings for ${invalidLimit} cannot exceed the duration of bookings for ${comparedLimit}.`;
|
||||
}
|
||||
}
|
||||
|
||||
export function ValidateBookingLimistsDuration(validationOptions?: ValidationOptions) {
|
||||
return function (object: any, propertyName: string) {
|
||||
registerDecorator({
|
||||
name: "ValidateBookingLimistsDuration",
|
||||
target: object.constructor,
|
||||
propertyName: propertyName,
|
||||
options: validationOptions,
|
||||
validator: new BookingLimitsDurationValidator(),
|
||||
});
|
||||
};
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
import { BadRequestException } from "@nestjs/common";
|
||||
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
|
||||
import {
|
||||
IsEnum,
|
||||
IsNumber,
|
||||
IsArray,
|
||||
ArrayNotEmpty,
|
||||
IsDateString,
|
||||
IsDefined,
|
||||
IsOptional,
|
||||
ValidatorConstraint,
|
||||
registerDecorator,
|
||||
IsBoolean,
|
||||
} from "class-validator";
|
||||
|
||||
import { BookingWindowPeriodInputTypeEnum_2024_06_14 } from "./enums/booking-window.enum";
|
||||
|
||||
export type BookingWindowPeriodInputType_2024_06_14 = "businessDays" | "calendarDays" | "range";
|
||||
export type BookingWindowPeriodOutputType_2024_06_14 = "RANGE" | "ROLLING_WINDOW" | "ROLLING";
|
||||
|
||||
export type TransformFutureBookingsLimitSchema_2024_06_14 = {
|
||||
periodType: BookingWindowPeriodOutputType_2024_06_14;
|
||||
periodDays?: number;
|
||||
periodCountCalendarDays?: boolean;
|
||||
periodStartDate?: Date;
|
||||
periodEndDate?: Date;
|
||||
};
|
||||
|
||||
// Base class for common properties and validation
|
||||
class BookingWindowBase {
|
||||
@IsEnum(BookingWindowPeriodInputTypeEnum_2024_06_14)
|
||||
type!: BookingWindowPeriodInputType_2024_06_14;
|
||||
}
|
||||
|
||||
// Separate classes for different value types
|
||||
export class BusinessDaysWindow_2024_06_14 extends BookingWindowBase {
|
||||
@IsNumber()
|
||||
@IsDefined()
|
||||
value!: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
rolling?: boolean;
|
||||
}
|
||||
|
||||
export class CalendarDaysWindow_2024_06_14 extends BookingWindowBase {
|
||||
@IsNumber()
|
||||
@IsDefined()
|
||||
value!: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
rolling?: boolean;
|
||||
}
|
||||
|
||||
export class RangeWindow_2024_06_14 extends BookingWindowBase {
|
||||
@IsArray()
|
||||
@ArrayNotEmpty()
|
||||
@IsDateString({}, { each: true })
|
||||
@IsDefined()
|
||||
value!: string[];
|
||||
}
|
||||
|
||||
export type BookingWindow_2024_06_14 =
|
||||
| BusinessDaysWindow_2024_06_14
|
||||
| CalendarDaysWindow_2024_06_14
|
||||
| RangeWindow_2024_06_14;
|
||||
|
||||
// Custom validator to handle the union type
|
||||
@ValidatorConstraint({ name: "bookingWindowValidator", async: false })
|
||||
class BookingWindowValidator implements ValidatorConstraintInterface {
|
||||
validate(value: BookingWindow_2024_06_14) {
|
||||
if (!value || !value.type) {
|
||||
throw new BadRequestException(`'BookingWindow' must have a type`);
|
||||
}
|
||||
|
||||
switch (value.type) {
|
||||
case BookingWindowPeriodInputTypeEnum_2024_06_14.businessDays:
|
||||
case BookingWindowPeriodInputTypeEnum_2024_06_14.calendarDays:
|
||||
return (
|
||||
typeof value.value === "number" &&
|
||||
(typeof (value as BusinessDaysWindow_2024_06_14 | CalendarDaysWindow_2024_06_14).rolling ===
|
||||
"undefined" ||
|
||||
typeof (value as BusinessDaysWindow_2024_06_14 | CalendarDaysWindow_2024_06_14).rolling ===
|
||||
"boolean")
|
||||
);
|
||||
case BookingWindowPeriodInputTypeEnum_2024_06_14.range:
|
||||
return (
|
||||
Array.isArray(value.value) &&
|
||||
value.value.every((date: any) => typeof date === "string" && !isNaN(Date.parse(date)))
|
||||
);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
defaultMessage() {
|
||||
return "Invalid bookingWindow structure.";
|
||||
}
|
||||
}
|
||||
|
||||
export function ValidateBookingWindow(validationOptions?: ValidationOptions) {
|
||||
return function (object: any, propertyName: string) {
|
||||
registerDecorator({
|
||||
name: "ValidateBookingWindow",
|
||||
target: object.constructor,
|
||||
propertyName: propertyName,
|
||||
options: validationOptions,
|
||||
validator: new BookingWindowValidator(),
|
||||
});
|
||||
};
|
||||
}
|
||||
+31
-54
@@ -13,6 +13,13 @@ import {
|
||||
|
||||
import type { BookingField_2024_06_14 } from "./booking-fields.input";
|
||||
import { ValidateBookingFields_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 type { BookingWindow_2024_06_14 } from "./booking-window.input";
|
||||
import { ValidateBookingWindow } from "./booking-window.input";
|
||||
import { SchedulingType } from "./enums/scheduling-type";
|
||||
import { ValidateLocations_2024_06_14 } from "./locations.input";
|
||||
import type { Location_2024_06_14 } from "./locations.input";
|
||||
@@ -72,6 +79,29 @@ export class CreateEventTypeInput_2024_06_14 {
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
scheduleId?: number;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
export enum HostPriority {
|
||||
@@ -94,60 +124,7 @@ export class Host {
|
||||
priority?: keyof typeof HostPriority = "medium";
|
||||
}
|
||||
|
||||
export class CreateTeamEventTypeInput_2024_06_14 {
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@DocsProperty({ example: CREATE_EVENT_LENGTH_EXAMPLE })
|
||||
lengthInMinutes!: number;
|
||||
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_TITLE_EXAMPLE })
|
||||
title!: string;
|
||||
|
||||
@IsString()
|
||||
slug!: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@DocsProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE })
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateLocations_2024_06_14()
|
||||
@DocsProperty()
|
||||
locations?: Location_2024_06_14[];
|
||||
|
||||
@IsOptional()
|
||||
@ValidateBookingFields_2024_06_14()
|
||||
@DocsProperty()
|
||||
bookingFields?: BookingField_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;
|
||||
|
||||
export class CreateTeamEventTypeInput_2024_06_14 extends CreateEventTypeInput_2024_06_14 {
|
||||
@Transform(({ value }) => {
|
||||
if (value === "collective") {
|
||||
return SchedulingType.COLLECTIVE;
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
export enum BookingWindowPeriodInputTypeEnum_2024_06_14 {
|
||||
businessDays = "businessDays",
|
||||
calendarDays = "calendarDays",
|
||||
range = "range",
|
||||
}
|
||||
|
||||
export enum BookingWindowPeriodOutputTypeEnum_2024_06_14 {
|
||||
RANGE = "RANGE",
|
||||
ROLLING_WINDOW = "ROLLING_WINDOW",
|
||||
ROLLING = "ROLLING",
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
export enum BookingLimitsEnum_2024_06_14 {
|
||||
day = "PER_DAY",
|
||||
week = "PER_WEEK",
|
||||
month = "PER_MONTH",
|
||||
year = "PER_YEAR",
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
export * from "./create-event-type.input";
|
||||
export * from "./booking-limits-duration.input";
|
||||
export * from "./booking-limits-count.input";
|
||||
export * from "./booking-window.input";
|
||||
export * from "./locations.input";
|
||||
export * from "./booking-fields.input";
|
||||
export * from "./recurring-event.input";
|
||||
|
||||
+52
@@ -4,6 +4,12 @@ import { IsString, IsInt, IsBoolean, IsOptional, Min, ValidateNested, IsArray }
|
||||
|
||||
import type { BookingField_2024_06_14 } from "./booking-fields.input";
|
||||
import { ValidateBookingFields_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 type { Location_2024_06_14 } from "./locations.input";
|
||||
@@ -58,6 +64,29 @@ export class UpdateEventTypeInput_2024_06_14 {
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
scheduleId?: number;
|
||||
|
||||
@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;
|
||||
}
|
||||
export class UpdateTeamEventTypeInput_2024_06_14 {
|
||||
@IsOptional()
|
||||
@@ -128,4 +157,27 @@ export class UpdateTeamEventTypeInput_2024_06_14 {
|
||||
@IsOptional()
|
||||
@DocsProperty()
|
||||
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;
|
||||
}
|
||||
+41
-2
@@ -11,10 +11,11 @@ import {
|
||||
ValidateNested,
|
||||
} from "class-validator";
|
||||
|
||||
import type { Location_2024_06_14, BookingField_2024_06_14 } from "../inputs";
|
||||
import { Host as TeamEventTypeHostInput } from "../inputs";
|
||||
import type { Location_2024_06_14, BookingField_2024_06_14, BookingWindow_2024_06_14 } from "../inputs";
|
||||
import { Host as TeamEventTypeHostInput, BookingLimitsDuration_2024_06_14 } from "../inputs";
|
||||
import { RecurringEvent_2024_06_14 } from "../inputs";
|
||||
import { ValidateBookingFields_2024_06_14 } from "../inputs/booking-fields.input";
|
||||
import type { BookingLimitsCount_2024_06_14 } from "../inputs/booking-limits-count.input";
|
||||
import { ValidateLocations_2024_06_14 } from "../inputs/locations.input";
|
||||
|
||||
enum SchedulingTypeEnum {
|
||||
@@ -137,6 +138,25 @@ export class EventTypeOutput_2024_06_14 {
|
||||
|
||||
@IsInt()
|
||||
scheduleId!: number | null;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
export class TeamEventTypeResponseHost extends TeamEventTypeHostInput {
|
||||
@@ -247,4 +267,23 @@ export class TeamEventTypeOutput_2024_06_14 {
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
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;
|
||||
}
|
||||
Reference in new issue
Block a user