refactor: v2 recurring bookings allow specifying recurrence count (#16989)

* fix: CreateBookingInputPipe

* refactor: allow specifying recurrence count

* Update input.service.ts
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2024-10-14 17:59:53 +03:00
1 parent b8b9d04897
commit c2085c6be9
4 files changed
+333 -17

No files matched your search

@@ -102,10 +102,10 @@ export class CreateBookingInputPipe implements PipeTransform {
private isRecurringBookingInput(
value: CreateBookingInput
): value is CreateRecurringBookingInput_2024_08_13 {
return value.hasOwnProperty("recurringEventTypeId");
return value.hasOwnProperty("eventTypeId");
}
private isInstantBookingInput(value: CreateBookingInput): value is CreateRecurringBookingInput_2024_08_13 {
private isInstantBookingInput(value: CreateBookingInput): value is CreateInstantBookingInput_2024_08_13 {
return value.hasOwnProperty("instant") && "instant" in value && value.instant === true;
}
}
@@ -13,6 +13,7 @@ import {
IsUrl,
IsObject,
IsBoolean,
Min,
} from "class-validator";
import type { BookingLanguageType } from "./language";
@@ -180,6 +181,18 @@ export class CreateRecurringBookingInput_2024_08_13 {
@IsOptional()
guests?: string[];
@ApiProperty({
type: String,
description:
"Deprecated - use 'location' instead. Meeting URL just for this booking. Displayed in email and calendar event. If not provided then cal video link will be generated.",
example: "https://example.com/meeting",
required: false,
deprecated: true,
})
@IsUrl()
@IsOptional()
meetingUrl?: string;
@ApiProperty({
type: String,
description: "Location for this booking. Displayed in email and calendar event.",
@@ -210,4 +223,16 @@ export class CreateRecurringBookingInput_2024_08_13 {
@IsObject()
@IsOptional()
bookingFieldsResponses?: Record<string, unknown>;
@ApiPropertyOptional({
type: Number,
description: `The number of recurrences. If not provided then event type recurrence count will be used. Can't be more than
event type recurrence count`,
example: 5,
required: false,
})
@IsOptional()
@IsInt()
@Min(1)
recurrenceCount?: number;
}