From 4d9777af8b1408e88a2e7cf5a6404aed3a9557fa Mon Sep 17 00:00:00 2001 From: Lauris Skraucis Date: Fri, 27 Sep 2024 11:48:22 +0200 Subject: [PATCH] docs: v2 event-types (#16854) * docs: optional get event-types query params * docs: create event type input * docs: update event type input * docs: child inputs of create and update event type inputs * docs: updated swagger * refactor: add disabled option to booking window * refactor: seats description * swagger --- apps/api/v2/swagger/documentation.json | 972 ++++++++++++------ .../inputs/booker-layouts.input.ts | 12 +- .../inputs/booking-limits-count.input.ts | 10 +- .../inputs/booking-limits-duration.input.ts | 10 +- .../inputs/booking-window.input.ts | 6 +- .../inputs/create-event-type.input.ts | 113 +- .../inputs/get-event-types-query.input.ts | 10 +- .../inputs/update-event-type.input.ts | 136 ++- 8 files changed, 856 insertions(+), 413 deletions(-) diff --git a/apps/api/v2/swagger/documentation.json b/apps/api/v2/swagger/documentation.json index 26aae1e2aa..17f6255ac0 100644 --- a/apps/api/v2/swagger/documentation.json +++ b/apps/api/v2/swagger/documentation.json @@ -1193,7 +1193,7 @@ }, { "name": "eventSlug", - "required": true, + "required": false, "in": "query", "description": "Slug of team event type to return.", "schema": { @@ -3248,6 +3248,7 @@ "/v2/calendars/ics-feed/save": { "post": { "operationId": "CalendarsController_createIcsFeed", + "summary": "Save an ICS feed", "parameters": [], "requestBody": { "required": true, @@ -3279,6 +3280,7 @@ "/v2/calendars/ics-feed/check": { "get": { "operationId": "CalendarsController_checkIcsFeed", + "summary": "Check an ICS feed", "parameters": [], "responses": { "200": { @@ -3637,7 +3639,7 @@ }, { "name": "username", - "required": true, + "required": false, "in": "query", "description": "The username of the user to get event types for. If only username provided will get all event types.", "schema": { @@ -3646,7 +3648,7 @@ }, { "name": "eventSlug", - "required": true, + "required": false, "in": "query", "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.", "schema": { @@ -3655,7 +3657,7 @@ }, { "name": "usernames", - "required": true, + "required": false, "in": "query", "description": "Get dynamic event type for multiple usernames separated by comma. e.g `usernames=alice,bob`", "schema": { @@ -4447,7 +4449,7 @@ "post": { "operationId": "SchedulesController_2024_06_11_createSchedule", "summary": "Create a schedule", - "description": "\n The point of creating schedules is for event types to be available at specific times.\n\n 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.\n 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.\n 2. If you did not, then we assume you want that user has specific schedule right away. You should create default schedule by specifying\n `\"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.\n\n 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.\n After creating a non default schedule you can update event type to point to that schedule via the PATCH `event-types/{eventTypeId}` endpoint.\n\n When specifying start time and end time for each day use 24 hour format e.g. 08:00, 15:00 etc.\n ", + "description": "\n Create a schedule for the authenticated user.\n\n The point of creating schedules is for event types to be available at specific times.\n\n The 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.\n 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. The managed user can then change the default schedule via the `AvailabilitySettings` atom.\n 2. If you did not, then we assume you want the user to have this specific schedule right away. You should create a default schedule by specifying\n `\"isDefault\": true` in the request body. Until the user has a default schedule the user can't be booked nor manage their schedule via the AvailabilitySettings atom.\n\n The second goal of schedules is to create another schedule that event types can point to. This is useful for when an event is booked because availability is not checked against the default schedule but instead against that specific schedule.\n After creating a non-default schedule, you can update an event type to point to that schedule via the PATCH `event-types/{eventTypeId}` endpoint.\n\n When specifying start time and end time for each day use the 24 hour format e.g. 08:00, 15:00 etc.\n ", "parameters": [ { "name": "Authorization", @@ -4496,7 +4498,8 @@ }, "get": { "operationId": "SchedulesController_2024_06_11_getSchedules", - "summary": "Get all schedules (of the authenticated user)", + "summary": "Get all schedules", + "description": "Get all schedules of the authenticated user.", "parameters": [ { "name": "Authorization", @@ -4537,7 +4540,8 @@ "/v2/schedules/default": { "get": { "operationId": "SchedulesController_2024_06_11_getDefaultSchedule", - "summary": "Get default schedule (of the authenticated user)", + "summary": "Get default schedule", + "description": "Get the default schedule of the authenticated user.", "parameters": [ { "name": "Authorization", @@ -4560,7 +4564,7 @@ ], "responses": { "200": { - "description": "Returns the default schedule of the authenticated user", + "description": "", "content": { "application/json": { "schema": { @@ -6193,8 +6197,7 @@ }, "required": [ "type", - "value", - "rolling" + "value" ] }, "CalendarDaysWindow_2024_06_14": { @@ -6222,8 +6225,7 @@ }, "required": [ "type", - "value", - "rolling" + "value" ] }, "RangeWindow_2024_06_14": { @@ -6255,6 +6257,227 @@ "value" ] }, + "BaseBookingLimitsCount_2024_06_14": { + "type": "object", + "properties": { + "day": { + "type": "number", + "description": "The number of bookings per day", + "example": 1 + }, + "week": { + "type": "number", + "description": "The number of bookings per week", + "example": 2 + }, + "month": { + "type": "number", + "description": "The number of bookings per month", + "example": 3 + }, + "year": { + "type": "number", + "description": "The number of bookings per year", + "example": 4 + } + } + }, + "Disabled_2024_06_14": { + "type": "object", + "properties": { + "disabled": { + "type": "boolean", + "description": "Indicates if the option is disabled", + "example": true, + "default": false + } + }, + "required": [ + "disabled" + ] + }, + "BaseBookingLimitsDuration_2024_06_14": { + "type": "object", + "properties": { + "day": { + "type": "number", + "description": "The duration of bookings per day (must be a multiple of 15)", + "example": 60 + }, + "week": { + "type": "number", + "description": "The duration of bookings per week (must be a multiple of 15)", + "example": 120 + }, + "month": { + "type": "number", + "description": "The duration of bookings per month (must be a multiple of 15)", + "example": 180 + }, + "year": { + "type": "number", + "description": "The duration of bookings per year (must be a multiple of 15)", + "example": 240 + } + } + }, + "Recurrence_2024_06_14": { + "type": "object", + "properties": { + "interval": { + "type": "number", + "example": 10, + "description": "Repeats every {count} week | month | year" + }, + "occurrences": { + "type": "number", + "example": 10, + "description": "Repeats for a maximum of {count} events" + }, + "frequency": { + "type": "string", + "enum": [ + "yearly", + "monthly", + "weekly" + ] + } + }, + "required": [ + "interval", + "occurrences", + "frequency" + ] + }, + "NoticeThreshold_2024_06_14": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The unit of time for the notice threshold (e.g., minutes, hours)", + "example": "minutes" + }, + "count": { + "type": "number", + "description": "The time value for the notice threshold", + "example": 30 + } + }, + "required": [ + "unit", + "count" + ] + }, + "BaseConfirmationPolicy_2024_06_14": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The policy that determines when confirmation is required", + "example": "always" + }, + "noticeThreshold": { + "description": "The notice threshold required before confirmation is needed. Required when type is 'time'.", + "allOf": [ + { + "$ref": "#/components/schemas/NoticeThreshold_2024_06_14" + } + ] + } + }, + "required": [ + "type" + ] + }, + "Seats_2024_06_14": { + "type": "object", + "properties": { + "seatsPerTimeSlot": { + "type": "number", + "description": "Number of seats available per time slot", + "example": 4 + }, + "showAttendeeInfo": { + "type": "boolean", + "description": "Show attendee information to other guests", + "example": true + }, + "showAvailabilityCount": { + "type": "boolean", + "description": "Display the count of available seats", + "example": true + } + }, + "required": [ + "seatsPerTimeSlot", + "showAttendeeInfo", + "showAvailabilityCount" + ] + }, + "BookerLayouts_2024_06_14": { + "type": "object", + "properties": { + "defaultLayout": { + "type": "string", + "enum": [ + "month", + "week", + "column" + ] + }, + "enabledLayouts": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "month", + "week", + "column" + ] + } + } + }, + "required": [ + "defaultLayout", + "enabledLayouts" + ] + }, + "EventTypeColor_2024_06_14": { + "type": "object", + "properties": { + "lightThemeHex": { + "type": "string", + "description": "Color used for event types in light theme", + "example": "#292929" + }, + "darkThemeHex": { + "type": "string", + "description": "Color used for event types in dark theme", + "example": "#fafafa" + } + }, + "required": [ + "lightThemeHex", + "darkThemeHex" + ] + }, + "DestinationCalendar_2024_06_14": { + "type": "object", + "properties": { + "integration": { + "type": "string", + "description": "The integration type of the destination calendar. Refer to the /api/v2/calendars endpoint to retrieve the integration type of your connected calendars." + }, + "externalId": { + "type": "string", + "description": "The external ID of the destination calendar. Refer to the /api/v2/calendars endpoint to retrieve the external IDs of your connected calendars." + } + }, + "required": [ + "integration", + "externalId" + ] + }, "CreateEventTypeInput_2024_06_14": { "type": "object", "properties": { @@ -6360,63 +6583,124 @@ "description": "If you want that this event has different schedule than user's default one you can specify it here." }, "bookingLimitsCount": { - "type": "object", - "description": "Limit how many times this event can be booked" + "description": "Limit how many times this event can be booked", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseBookingLimitsCount_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "onlyShowFirstAvailableSlot": { "type": "boolean", "description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time." }, "bookingLimitsDuration": { - "type": "object", - "description": "Limit total amount of time that this event can be booked" + "description": "Limit total amount of time that this event can be booked", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseBookingLimitsDuration_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "bookingWindow": { - "type": "array", "description": "Limit how far in the future this event can be booked", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14" - }, - { - "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14" - }, - { - "$ref": "#/components/schemas/RangeWindow_2024_06_14" - } - ] - } + "oneOf": [ + { + "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/RangeWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "offsetStart": { "type": "number", "description": "Offset timeslots shown to bookers by a specified number of minutes" }, + "bookerLayouts": { + "description": "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.", + "allOf": [ + { + "$ref": "#/components/schemas/BookerLayouts_2024_06_14" + } + ] + }, + "confirmationPolicy": { + "description": "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseConfirmationPolicy_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, + "recurrence": { + "description": "Create a recurring event type.", + "oneOf": [ + { + "$ref": "#/components/schemas/Recurrence_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, + "requiresBookerEmailVerification": { + "type": "boolean" + }, + "hideCalendarNotes": { + "type": "boolean" + }, + "lockTimeZoneToggleOnBookingPage": { + "type": "boolean" + }, + "color": { + "$ref": "#/components/schemas/EventTypeColor_2024_06_14" + }, + "seats": { + "description": "Create an event type with multiple seats.", + "oneOf": [ + { + "$ref": "#/components/schemas/Seats_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, "customName": { "type": "string", "description": "Customizable event name with valid variables: \n {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name}, \n {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION}, \n {HOST/ATTENDEE}, {HOST}, {ATTENDEE}, {USER}", "example": "{Event type title} between {Organiser} and {Scheduler}" + }, + "destinationCalendar": { + "$ref": "#/components/schemas/DestinationCalendar_2024_06_14" + }, + "useDestinationCalendarEmail": { + "type": "boolean" + }, + "hideCalendarEventDetails": { + "type": "boolean" } }, "required": [ "lengthInMinutes", "title", - "slug", - "description", - "locations", - "bookingFields", - "disableGuests", - "slotInterval", - "minimumBookingNotice", - "beforeEventBuffer", - "afterEventBuffer", - "scheduleId", - "bookingLimitsCount", - "onlyShowFirstAvailableSlot", - "bookingLimitsDuration", - "bookingWindow", - "offsetStart", - "customName" + "slug" ] }, "EmailDefaultFieldOutput_2024_06_14": { @@ -7213,104 +7497,6 @@ "isDefault" ] }, - "BaseBookingLimitsDuration_2024_06_14": { - "type": "object", - "properties": { - "day": { - "type": "number", - "minimum": 15, - "description": "The duration of bookings per day (must be a multiple of 15)", - "example": 60 - }, - "week": { - "type": "number", - "minimum": 15, - "description": "The duration of bookings per week (must be a multiple of 15)", - "example": 120 - }, - "month": { - "type": "number", - "minimum": 15, - "description": "The duration of bookings per month (must be a multiple of 15)", - "example": 180 - }, - "year": { - "type": "number", - "minimum": 15, - "description": "The duration of bookings per year (must be a multiple of 15)", - "example": 240 - }, - "disabled": { - "type": "boolean", - "default": false - } - } - }, - "BookerLayouts_2024_06_14": { - "type": "object", - "properties": {} - }, - "EventTypeColor_2024_06_14": { - "type": "object", - "properties": { - "lightThemeHex": { - "type": "string", - "description": "Color used for event types in light theme", - "example": "#292929" - }, - "darkThemeHex": { - "type": "string", - "description": "Color used for event types in dark theme", - "example": "#fafafa" - } - }, - "required": [ - "lightThemeHex", - "darkThemeHex" - ] - }, - "Seats_2024_06_14": { - "type": "object", - "properties": { - "seatsPerTimeSlot": { - "type": "number", - "description": "Number of seats available per time slot", - "example": 4 - }, - "showAttendeeInfo": { - "type": "boolean", - "description": "Show attendee information to other guests", - "example": true - }, - "showAvailabilityCount": { - "type": "boolean", - "description": "Display the count of available seats", - "example": true - } - }, - "required": [ - "seatsPerTimeSlot", - "showAttendeeInfo", - "showAvailabilityCount" - ] - }, - "DestinationCalendar_2024_06_14": { - "type": "object", - "properties": { - "integration": { - "type": "string", - "description": "The integration type of the destination calendar. Refer to the /api/v2/calendars endpoint to retrieve the integration type of your connected calendars." - }, - "externalId": { - "type": "string", - "description": "The external ID of the destination calendar. Refer to the /api/v2/calendars endpoint to retrieve the external IDs of your connected calendars." - } - }, - "required": [ - "integration", - "externalId" - ] - }, "EventTypeOutput_2024_06_14": { "type": "object", "properties": { @@ -7504,9 +7690,6 @@ "hideCalendarNotes": { "type": "boolean" }, - "hideCalendarEventDetails": { - "type": "boolean" - }, "color": { "$ref": "#/components/schemas/EventTypeColor_2024_06_14" }, @@ -7525,6 +7708,9 @@ "useDestinationCalendarEmail": { "type": "boolean" }, + "hideCalendarEventDetails": { + "type": "boolean" + }, "ownerId": { "type": "number", "example": 10 @@ -7568,13 +7754,13 @@ "confirmationPolicy", "requiresBookerEmailVerification", "hideCalendarNotes", - "hideCalendarEventDetails", "color", "seats", "offsetStart", "customName", "destinationCalendar", "useDestinationCalendarEmail", + "hideCalendarEventDetails", "ownerId", "users" ] @@ -7752,64 +7938,120 @@ "description": "If you want that this event has different schedule than user's default one you can specify it here." }, "bookingLimitsCount": { - "type": "object", - "description": "Limit how many times this event can be booked" + "description": "Limit how many times this event can be booked", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseBookingLimitsCount_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "onlyShowFirstAvailableSlot": { "type": "boolean", "description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time." }, "bookingLimitsDuration": { - "type": "object", - "description": "Limit total amount of time that this event can be booked" + "description": "Limit total amount of time that this event can be booked", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseBookingLimitsDuration_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "bookingWindow": { - "type": "array", "description": "Limit how far in the future this event can be booked", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14" - }, - { - "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14" - }, - { - "$ref": "#/components/schemas/RangeWindow_2024_06_14" - } - ] - } + "oneOf": [ + { + "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/RangeWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "offsetStart": { "type": "number", "description": "Offset timeslots shown to bookers by a specified number of minutes" }, + "bookerLayouts": { + "description": "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.", + "allOf": [ + { + "$ref": "#/components/schemas/BookerLayouts_2024_06_14" + } + ] + }, + "confirmationPolicy": { + "description": "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseConfirmationPolicy_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, + "recurrence": { + "description": "Create a recurring event type.", + "oneOf": [ + { + "$ref": "#/components/schemas/Recurrence_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, + "requiresBookerEmailVerification": { + "type": "boolean" + }, + "hideCalendarNotes": { + "type": "boolean" + }, + "lockTimeZoneToggleOnBookingPage": { + "type": "boolean" + }, + "color": { + "$ref": "#/components/schemas/EventTypeColor_2024_06_14" + }, + "seats": { + "description": "Create an event type with multiple seats.", + "oneOf": [ + { + "$ref": "#/components/schemas/Seats_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, "customName": { "type": "string", "description": "Customizable event name with valid variables: \n {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name}, \n {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION}, \n {HOST/ATTENDEE}, {HOST}, {ATTENDEE}, {USER}", "example": "{Event type title} between {Organiser} and {Scheduler}" + }, + "destinationCalendar": { + "$ref": "#/components/schemas/DestinationCalendar_2024_06_14" + }, + "useDestinationCalendarEmail": { + "type": "boolean" + }, + "hideCalendarEventDetails": { + "type": "boolean" } - }, - "required": [ - "lengthInMinutes", - "title", - "slug", - "description", - "locations", - "bookingFields", - "disableGuests", - "slotInterval", - "minimumBookingNotice", - "beforeEventBuffer", - "afterEventBuffer", - "scheduleId", - "bookingLimitsCount", - "onlyShowFirstAvailableSlot", - "bookingLimitsDuration", - "bookingWindow", - "offsetStart", - "customName" - ] + } }, "UpdateEventTypeOutput_2024_06_14": { "type": "object", @@ -9032,6 +9274,32 @@ "data" ] }, + "Host": { + "type": "object", + "properties": { + "userId": { + "type": "number", + "description": "Which user is the host of this event" + }, + "mandatory": { + "type": "boolean", + "description": "Only relevant for round robin event types. If true then the user must attend round robin event always." + }, + "priority": { + "type": "string", + "enum": [ + "lowest", + "low", + "medium", + "high", + "highest" + ] + } + }, + "required": [ + "userId" + ] + }, "CreateTeamEventTypeInput_2024_06_14": { "type": "object", "properties": { @@ -9137,50 +9405,126 @@ "description": "If you want that this event has different schedule than user's default one you can specify it here." }, "bookingLimitsCount": { - "type": "object", - "description": "Limit how many times this event can be booked" + "description": "Limit how many times this event can be booked", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseBookingLimitsCount_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "onlyShowFirstAvailableSlot": { "type": "boolean", "description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time." }, "bookingLimitsDuration": { - "type": "object", - "description": "Limit total amount of time that this event can be booked" + "description": "Limit total amount of time that this event can be booked", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseBookingLimitsDuration_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "bookingWindow": { - "type": "array", "description": "Limit how far in the future this event can be booked", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14" - }, - { - "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14" - }, - { - "$ref": "#/components/schemas/RangeWindow_2024_06_14" - } - ] - } + "oneOf": [ + { + "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/RangeWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "offsetStart": { "type": "number", "description": "Offset timeslots shown to bookers by a specified number of minutes" }, + "bookerLayouts": { + "description": "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.", + "allOf": [ + { + "$ref": "#/components/schemas/BookerLayouts_2024_06_14" + } + ] + }, + "confirmationPolicy": { + "description": "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseConfirmationPolicy_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, + "recurrence": { + "description": "Create a recurring event type.", + "oneOf": [ + { + "$ref": "#/components/schemas/Recurrence_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, + "requiresBookerEmailVerification": { + "type": "boolean" + }, + "hideCalendarNotes": { + "type": "boolean" + }, + "lockTimeZoneToggleOnBookingPage": { + "type": "boolean" + }, + "color": { + "$ref": "#/components/schemas/EventTypeColor_2024_06_14" + }, + "seats": { + "description": "Create an event type with multiple seats.", + "oneOf": [ + { + "$ref": "#/components/schemas/Seats_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, "customName": { "type": "string", "description": "Customizable event name with valid variables: \n {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name}, \n {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION}, \n {HOST/ATTENDEE}, {HOST}, {ATTENDEE}, {USER}", "example": "{Event type title} between {Organiser} and {Scheduler}" }, + "destinationCalendar": { + "$ref": "#/components/schemas/DestinationCalendar_2024_06_14" + }, + "useDestinationCalendarEmail": { + "type": "boolean" + }, + "hideCalendarEventDetails": { + "type": "boolean" + }, "schedulingType": { "type": "object" }, "hosts": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Host" } }, "assignAllTeamMembers": { @@ -9192,24 +9536,8 @@ "lengthInMinutes", "title", "slug", - "description", - "locations", - "bookingFields", - "disableGuests", - "slotInterval", - "minimumBookingNotice", - "beforeEventBuffer", - "afterEventBuffer", - "scheduleId", - "bookingLimitsCount", - "onlyShowFirstAvailableSlot", - "bookingLimitsDuration", - "bookingWindow", - "offsetStart", - "customName", "schedulingType", - "hosts", - "assignAllTeamMembers" + "hosts" ] }, "CreateTeamEventTypeOutput": { @@ -9242,38 +9570,6 @@ "data" ] }, - "Recurrence_2024_06_14": { - "type": "object", - "properties": { - "interval": { - "type": "number", - "example": 10, - "description": "Repeats every {count} week | month | year" - }, - "occurrences": { - "type": "number", - "example": 10, - "description": "Repeats for a maximum of {count} events" - }, - "frequency": { - "enum": [ - "yearly", - "monthly", - "weekly" - ], - "type": "string" - }, - "disabled": { - "type": "boolean", - "default": false - } - }, - "required": [ - "interval", - "occurrences", - "frequency" - ] - }, "TeamEventTypeResponseHost": { "type": "object", "properties": { @@ -9513,9 +9809,6 @@ "hideCalendarNotes": { "type": "boolean" }, - "hideCalendarEventDetails": { - "type": "boolean" - }, "color": { "$ref": "#/components/schemas/EventTypeColor_2024_06_14" }, @@ -9535,6 +9828,9 @@ "useDestinationCalendarEmail": { "type": "boolean" }, + "hideCalendarEventDetails": { + "type": "boolean" + }, "teamId": { "type": "number", "nullable": true @@ -9836,76 +10132,130 @@ "description": "If you want that this event has different schedule than user's default one you can specify it here." }, "bookingLimitsCount": { - "type": "object", - "description": "Limit how many times this event can be booked" + "description": "Limit how many times this event can be booked", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseBookingLimitsCount_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "onlyShowFirstAvailableSlot": { "type": "boolean", "description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time." }, "bookingLimitsDuration": { - "type": "object", - "description": "Limit total amount of time that this event can be booked" + "description": "Limit total amount of time that this event can be booked", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseBookingLimitsDuration_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "bookingWindow": { - "type": "array", "description": "Limit how far in the future this event can be booked", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14" - }, - { - "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14" - }, - { - "$ref": "#/components/schemas/RangeWindow_2024_06_14" - } - ] - } + "oneOf": [ + { + "$ref": "#/components/schemas/BusinessDaysWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/CalendarDaysWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/RangeWindow_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] }, "offsetStart": { "type": "number", "description": "Offset timeslots shown to bookers by a specified number of minutes" }, + "bookerLayouts": { + "description": "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.", + "allOf": [ + { + "$ref": "#/components/schemas/BookerLayouts_2024_06_14" + } + ] + }, + "confirmationPolicy": { + "description": "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.", + "oneOf": [ + { + "$ref": "#/components/schemas/BaseConfirmationPolicy_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, + "recurrence": { + "description": "Create a recurring event type.", + "oneOf": [ + { + "$ref": "#/components/schemas/Recurrence_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, + "requiresBookerEmailVerification": { + "type": "boolean" + }, + "hideCalendarNotes": { + "type": "boolean" + }, + "lockTimeZoneToggleOnBookingPage": { + "type": "boolean" + }, + "color": { + "$ref": "#/components/schemas/EventTypeColor_2024_06_14" + }, + "seats": { + "description": "Create an event type with multiple seats.", + "oneOf": [ + { + "$ref": "#/components/schemas/Seats_2024_06_14" + }, + { + "$ref": "#/components/schemas/Disabled_2024_06_14" + } + ] + }, "customName": { "type": "string", "description": "Customizable event name with valid variables: \n {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name}, \n {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION}, \n {HOST/ATTENDEE}, {HOST}, {ATTENDEE}, {USER}", "example": "{Event type title} between {Organiser} and {Scheduler}" }, + "destinationCalendar": { + "$ref": "#/components/schemas/DestinationCalendar_2024_06_14" + }, + "useDestinationCalendarEmail": { + "type": "boolean" + }, + "hideCalendarEventDetails": { + "type": "boolean" + }, "hosts": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Host" } }, "assignAllTeamMembers": { "type": "boolean", "description": "If true, all current and future team members will be assigned to this event type" } - }, - "required": [ - "lengthInMinutes", - "title", - "slug", - "description", - "locations", - "bookingFields", - "disableGuests", - "slotInterval", - "minimumBookingNotice", - "beforeEventBuffer", - "afterEventBuffer", - "scheduleId", - "bookingLimitsCount", - "onlyShowFirstAvailableSlot", - "bookingLimitsDuration", - "bookingWindow", - "offsetStart", - "customName", - "hosts", - "assignAllTeamMembers" - ] + } }, "UpdateTeamEventTypeOutput": { "type": "object", @@ -11682,28 +12032,6 @@ "attendee" ] }, - "Host": { - "type": "object", - "properties": { - "id": { - "type": "number", - "example": 1 - }, - "name": { - "type": "string", - "example": "Jane Doe" - }, - "timeZone": { - "type": "string", - "example": "America/Los_Angeles" - } - }, - "required": [ - "id", - "name", - "timeZone" - ] - }, "BookingOutput_2024_08_13": { "type": "object", "properties": { diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booker-layouts.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booker-layouts.input.ts index 19c2538db6..44315a1208 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booker-layouts.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booker-layouts.input.ts @@ -1,5 +1,6 @@ +import { ApiProperty } from "@nestjs/swagger"; import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator"; -import { ValidatorConstraint, registerDecorator } from "class-validator"; +import { IsEnum, ValidatorConstraint, registerDecorator } from "class-validator"; import { BookerLayoutsInputEnum_2024_06_14, @@ -44,9 +45,16 @@ function IsValidLayout(validationOptions?: ValidationOptions) { } export class BookerLayouts_2024_06_14 { - @IsValidLayout({ message: "defaultLayout must be one of the valid layouts." }) + @IsValidLayout({ message: "defaultLayout must be one of the valid layouts - month, week or column" }) + @ApiProperty({ type: String, enum: BookerLayoutsInputEnum_2024_06_14 }) + @IsEnum(BookerLayoutsInputEnum_2024_06_14) defaultLayout!: BookerLayoutsInputEnum_2024_06_14; @IsValidLayout({ message: "enabledLayouts must be one of the valid layouts." }) + @ApiProperty({ type: [String], enum: BookerLayoutsInputEnum_2024_06_14 }) + @IsEnum(BookerLayoutsInputEnum_2024_06_14, { + each: true, + message: "enabledLayouts must contain only valid layouts - month, week or column", + }) enabledLayouts!: BookerLayoutsInputEnum_2024_06_14[]; } diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-count.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-count.input.ts index 3a2024e687..bb9d8ef9ec 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-count.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-count.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator"; import { IsBoolean, IsInt, IsOptional, Min, ValidatorConstraint, registerDecorator } from "class-validator"; @@ -14,7 +14,7 @@ export class BaseBookingLimitsCount_2024_06_14 { @IsOptional() @IsInt() @Min(1) - @ApiProperty({ + @ApiPropertyOptional({ description: "The number of bookings per day", example: 1, }) @@ -23,7 +23,7 @@ export class BaseBookingLimitsCount_2024_06_14 { @IsOptional() @IsInt() @Min(1) - @ApiProperty({ + @ApiPropertyOptional({ description: "The number of bookings per week", example: 2, }) @@ -32,7 +32,7 @@ export class BaseBookingLimitsCount_2024_06_14 { @IsOptional() @IsInt() @Min(1) - @ApiProperty({ + @ApiPropertyOptional({ description: "The number of bookings per month", example: 3, }) @@ -41,7 +41,7 @@ export class BaseBookingLimitsCount_2024_06_14 { @IsOptional() @IsInt() @Min(1) - @ApiProperty({ + @ApiPropertyOptional({ description: "The number of bookings per year", example: 4, }) diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-duration.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-duration.input.ts index e3e02c3d4a..13ad1ef03d 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-duration.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-duration.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator"; import { IsBoolean, IsInt, IsOptional, Min, ValidatorConstraint, registerDecorator } from "class-validator"; @@ -8,7 +8,7 @@ export class BaseBookingLimitsDuration_2024_06_14 { @IsOptional() @IsInt() @Min(15) - @ApiProperty({ + @ApiPropertyOptional({ description: "The duration of bookings per day (must be a multiple of 15)", example: 60, }) @@ -17,7 +17,7 @@ export class BaseBookingLimitsDuration_2024_06_14 { @IsOptional() @IsInt() @Min(15) - @ApiProperty({ + @ApiPropertyOptional({ description: "The duration of bookings per week (must be a multiple of 15)", example: 120, }) @@ -26,7 +26,7 @@ export class BaseBookingLimitsDuration_2024_06_14 { @IsOptional() @IsInt() @Min(15) - @ApiProperty({ + @ApiPropertyOptional({ description: "The duration of bookings per month (must be a multiple of 15)", example: 180, }) @@ -35,7 +35,7 @@ export class BaseBookingLimitsDuration_2024_06_14 { @IsOptional() @IsInt() @Min(15) - @ApiProperty({ + @ApiPropertyOptional({ description: "The duration of bookings per year (must be a multiple of 15)", example: 240, }) diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-window.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-window.input.ts index f762a4883f..307b4ad6d1 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-window.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-window.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator"; import { IsEnum, @@ -47,7 +47,7 @@ export class BusinessDaysWindow_2024_06_14 extends BookingWindowBase { @IsOptional() @IsBoolean() - @ApiProperty({ + @ApiPropertyOptional({ example: true, description: "If true, the window will be rolling aka from the moment that someone is trying to book this event. Otherwise it will be specified amount of days from the current date.", @@ -67,7 +67,7 @@ export class CalendarDaysWindow_2024_06_14 extends BookingWindowBase { @IsOptional() @IsBoolean() - @ApiProperty({ + @ApiPropertyOptional({ example: true, description: "If true, the window will be rolling aka from the moment that someone is trying to book this event. Otherwise it will be specified amount of days from the current date.", diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts index c0128a8ba1..d1c9cd47e1 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts @@ -1,4 +1,9 @@ -import { ApiProperty as DocsProperty, getSchemaPath, ApiExtraModels } from "@nestjs/swagger"; +import { + ApiProperty as DocsProperty, + ApiPropertyOptional as DocsPropertyOptional, + getSchemaPath, + ApiExtraModels, +} from "@nestjs/swagger"; import { Type, Transform, Expose } from "class-transformer"; import { IsString, @@ -30,9 +35,12 @@ import { import type { InputBookingField_2024_06_14 } from "./booking-fields.input"; import { ValidateInputBookingFields_2024_06_14 } from "./booking-fields.input"; import type { BookingLimitsCount_2024_06_14 } from "./booking-limits-count.input"; -import { ValidateBookingLimistsCount } from "./booking-limits-count.input"; +import { BaseBookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input"; import type { BookingLimitsDuration_2024_06_14 } from "./booking-limits-duration.input"; -import { ValidateBookingLimistsDuration } from "./booking-limits-duration.input"; +import { + BaseBookingLimitsDuration_2024_06_14, + ValidateBookingLimistsDuration, +} from "./booking-limits-duration.input"; import type { BookingWindow_2024_06_14 } from "./booking-window.input"; import { BusinessDaysWindow_2024_06_14, @@ -41,7 +49,7 @@ import { ValidateBookingWindow, } from "./booking-window.input"; import type { ConfirmationPolicy_2024_06_14 } from "./confirmation-policy.input"; -import { ValidateConfirmationPolicy } from "./confirmation-policy.input"; +import { BaseConfirmationPolicy_2024_06_14, ValidateConfirmationPolicy } from "./confirmation-policy.input"; import { DestinationCalendar_2024_06_14 } from "./destination-calendar.input"; import { Disabled_2024_06_14 } from "./disabled.input"; import { EventTypeColor_2024_06_14 } from "./event-type-color.input"; @@ -80,7 +88,13 @@ export const CREATE_EVENT_SLUG_EXAMPLE = "learn-the-secrets-of-masterchief"; BooleanFieldInput_2024_06_14, BusinessDaysWindow_2024_06_14, CalendarDaysWindow_2024_06_14, - RangeWindow_2024_06_14 + RangeWindow_2024_06_14, + BaseBookingLimitsCount_2024_06_14, + Disabled_2024_06_14, + BaseBookingLimitsDuration_2024_06_14, + Recurrence_2024_06_14, + BaseConfirmationPolicy_2024_06_14, + Seats_2024_06_14 ) export class CreateEventTypeInput_2024_06_14 { @IsInt() @@ -98,12 +112,12 @@ export class CreateEventTypeInput_2024_06_14 { @IsOptional() @IsString() - @DocsProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE }) + @DocsPropertyOptional({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE }) description?: string; @IsOptional() @ValidateLocations_2024_06_14() - @DocsProperty({ + @DocsPropertyOptional({ description: "Locations where the event will take place. If not provided, cal video link will be used as the location.", oneOf: [ @@ -119,7 +133,7 @@ export class CreateEventTypeInput_2024_06_14 { @IsOptional() @ValidateInputBookingFields_2024_06_14() - @DocsProperty({ + @DocsPropertyOptional({ description: "Custom fields that can be added to the booking form when the event is booked by someone. By default booking form has name and email field.", oneOf: [ @@ -142,12 +156,14 @@ export class CreateEventTypeInput_2024_06_14 { @IsBoolean() @IsOptional() - @DocsProperty({ description: "If true, person booking this event't cant add guests via their emails." }) + @DocsPropertyOptional({ + description: "If true, person booking this event't cant add guests via their emails.", + }) disableGuests?: boolean; @IsInt() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: `Number representing length of each slot when event is booked. By default it equal length of the event type. If event length is 60 minutes then we would have slots 9AM, 10AM, 11AM etc. but if it was changed to 30 minutes then we would have slots 9AM, 9:30AM, 10AM, 10:30AM etc. as the available times to book the 60 minute event.`, @@ -157,26 +173,28 @@ export class CreateEventTypeInput_2024_06_14 { @IsInt() @Min(0) @IsOptional() - @DocsProperty({ description: "Minimum number of minutes before the event that a booking can be made." }) + @DocsPropertyOptional({ + description: "Minimum number of minutes before the event that a booking can be made.", + }) minimumBookingNotice?: number; @IsInt() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: "Time spaces that can be pre-pended before an event to give more time before it.", }) beforeEventBuffer?: number; @IsInt() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: "Time spaces that can be appended after an event to give more time after it.", }) afterEventBuffer?: number; @IsInt() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: "If you want that this event has different schedule than user's default one you can specify it here.", }) @@ -184,12 +202,19 @@ export class CreateEventTypeInput_2024_06_14 { @IsOptional() @ValidateBookingLimistsCount() - @DocsProperty({ description: "Limit how many times this event can be booked" }) + @DocsPropertyOptional({ + description: "Limit how many times this event can be booked", + oneOf: [ + { $ref: getSchemaPath(BaseBookingLimitsCount_2024_06_14) }, + { $ref: getSchemaPath(Disabled_2024_06_14) }, + ], + }) + @Type(() => Object) bookingLimitsCount?: BookingLimitsCount_2024_06_14; @IsOptional() @IsBoolean() - @DocsProperty({ + @DocsPropertyOptional({ description: "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time.", }) @@ -197,19 +222,26 @@ export class CreateEventTypeInput_2024_06_14 { @IsOptional() @ValidateBookingLimistsDuration() - @DocsProperty({ description: "Limit total amount of time that this event can be booked" }) + @DocsPropertyOptional({ + description: "Limit total amount of time that this event can be booked", + oneOf: [ + { $ref: getSchemaPath(BaseBookingLimitsDuration_2024_06_14) }, + { $ref: getSchemaPath(Disabled_2024_06_14) }, + ], + }) + @Type(() => Object) bookingLimitsDuration?: BookingLimitsDuration_2024_06_14; @IsOptional() @ValidateBookingWindow() - @DocsProperty({ + @DocsPropertyOptional({ description: "Limit how far in the future this event can be booked", oneOf: [ { $ref: getSchemaPath(BusinessDaysWindow_2024_06_14) }, { $ref: getSchemaPath(CalendarDaysWindow_2024_06_14) }, { $ref: getSchemaPath(RangeWindow_2024_06_14) }, + { $ref: getSchemaPath(Disabled_2024_06_14) }, ], - type: "array", }) @Type(() => Object) bookingWindow?: BookingWindow_2024_06_14; @@ -217,18 +249,32 @@ export class CreateEventTypeInput_2024_06_14 { @IsOptional() @IsInt() @Min(1) - @DocsProperty({ description: "Offset timeslots shown to bookers by a specified number of minutes" }) + @DocsPropertyOptional({ description: "Offset timeslots shown to bookers by a specified number of minutes" }) offsetStart?: number; @IsOptional() + @DocsPropertyOptional({ + description: + "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.", + }) @Type(() => BookerLayouts_2024_06_14) bookerLayouts?: BookerLayouts_2024_06_14; @IsOptional() @ValidateConfirmationPolicy() + @DocsPropertyOptional({ + description: + "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.", + oneOf: [ + { $ref: getSchemaPath(BaseConfirmationPolicy_2024_06_14) }, + { $ref: getSchemaPath(Disabled_2024_06_14) }, + ], + }) + @Type(() => Object) confirmationPolicy?: ConfirmationPolicy_2024_06_14; @ValidateNested() + @IsOptional() @Transform(({ value }) => { if (value && typeof value === "object") { if ("interval" in value) { @@ -240,21 +286,30 @@ export class CreateEventTypeInput_2024_06_14 { return value; }) @ValidateNested() + @DocsPropertyOptional({ + description: "Create a recurring event type.", + oneOf: [{ $ref: getSchemaPath(Recurrence_2024_06_14) }, { $ref: getSchemaPath(Disabled_2024_06_14) }], + }) + @Type(() => Object) recurrence?: Recurrence_2024_06_14 | Disabled_2024_06_14; @IsOptional() @IsBoolean() + @DocsPropertyOptional() requiresBookerEmailVerification?: boolean; @IsOptional() @IsBoolean() + @DocsPropertyOptional() hideCalendarNotes?: boolean; @IsOptional() @IsBoolean() + @DocsPropertyOptional() lockTimeZoneToggleOnBookingPage?: boolean; @IsOptional() + @DocsPropertyOptional() @Type(() => EventTypeColor_2024_06_14) color?: EventTypeColor_2024_06_14; @@ -270,11 +325,16 @@ export class CreateEventTypeInput_2024_06_14 { return value; }) @ValidateNested() + @DocsPropertyOptional({ + description: "Create an event type with multiple seats.", + oneOf: [{ $ref: getSchemaPath(Seats_2024_06_14) }, { $ref: getSchemaPath(Disabled_2024_06_14) }], + }) + @Type(() => Object) seats?: Seats_2024_06_14 | Disabled_2024_06_14; @IsOptional() @IsString() - @DocsProperty({ + @DocsPropertyOptional({ description: `Customizable event name with valid variables: {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name}, {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION}, @@ -284,15 +344,18 @@ export class CreateEventTypeInput_2024_06_14 { customName?: string; @IsOptional() + @DocsPropertyOptional() @Type(() => DestinationCalendar_2024_06_14) destinationCalendar?: DestinationCalendar_2024_06_14; @IsOptional() @IsBoolean() + @DocsPropertyOptional() useDestinationCalendarEmail?: boolean; @IsOptional() @IsBoolean() + @DocsPropertyOptional() hideCalendarEventDetails?: boolean; } @@ -312,7 +375,7 @@ export class Host { @IsOptional() @Expose() @IsBoolean() - @DocsProperty({ + @DocsPropertyOptional({ description: "Only relevant for round robin event types. If true then the user must attend round robin event always.", }) @@ -321,7 +384,7 @@ export class Host { @IsEnum(HostPriority) @Expose() @IsOptional() - @DocsProperty({ enum: HostPriority }) + @DocsPropertyOptional({ enum: HostPriority }) priority?: keyof typeof HostPriority = "medium"; } @@ -345,12 +408,12 @@ export class CreateTeamEventTypeInput_2024_06_14 extends CreateEventTypeInput_20 @ValidateNested({ each: true }) @Type(() => Host) @IsArray() - @DocsProperty() + @DocsProperty({ type: [Host] }) hosts!: Host[]; @IsBoolean() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: "If true, all current and future team members will be assigned to this event type", }) assignAllTeamMembers?: boolean; diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/get-event-types-query.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/get-event-types-query.input.ts index a63edab4f0..3133d9b8b8 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/get-event-types-query.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/get-event-types-query.input.ts @@ -1,11 +1,11 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { Transform } from "class-transformer"; import { IsOptional, IsString } from "class-validator"; export class GetEventTypesQuery_2024_06_14 { @IsOptional() @IsString() - @ApiProperty({ + @ApiPropertyOptional({ description: "The username of the user to get event types for. If only username provided will get all event types.", }) @@ -13,7 +13,7 @@ export class GetEventTypesQuery_2024_06_14 { @IsString() @IsOptional() - @ApiProperty({ + @ApiPropertyOptional({ description: "Slug of event type to return. Notably, if eventSlug is provided then username must be provided too, because multiple users can have event with same slug.", }) @@ -21,7 +21,7 @@ export class GetEventTypesQuery_2024_06_14 { @IsOptional() @TransformUsernames() - @ApiProperty({ + @ApiPropertyOptional({ description: "Get dynamic event type for multiple usernames separated by comma. e.g `usernames=alice,bob`", type: String, @@ -32,7 +32,7 @@ export class GetEventTypesQuery_2024_06_14 { export class GetTeamEventTypesQuery_2024_06_14 { @IsString() @IsOptional() - @ApiProperty({ + @ApiPropertyOptional({ description: "Slug of team event type to return.", }) eventSlug?: string; diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts index 4bc857b178..43b73db6a2 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts @@ -1,4 +1,9 @@ -import { ApiProperty as DocsProperty, getSchemaPath, ApiExtraModels } from "@nestjs/swagger"; +import { + ApiProperty as DocsProperty, + ApiPropertyOptional as DocsPropertyOptional, + getSchemaPath, + ApiExtraModels, +} from "@nestjs/swagger"; import { Type, Transform } from "class-transformer"; import { IsString, IsInt, IsBoolean, IsOptional, Min, ValidateNested, IsArray } from "class-validator"; @@ -19,9 +24,12 @@ import { ValidateInputBookingFields_2024_06_14, } from "./booking-fields.input"; import type { BookingLimitsCount_2024_06_14 } from "./booking-limits-count.input"; -import { ValidateBookingLimistsCount } from "./booking-limits-count.input"; +import { BaseBookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input"; import type { BookingLimitsDuration_2024_06_14 } from "./booking-limits-duration.input"; -import { ValidateBookingLimistsDuration } from "./booking-limits-duration.input"; +import { + BaseBookingLimitsDuration_2024_06_14, + ValidateBookingLimistsDuration, +} from "./booking-limits-duration.input"; import { BusinessDaysWindow_2024_06_14, CalendarDaysWindow_2024_06_14, @@ -30,7 +38,7 @@ import { type BookingWindow_2024_06_14, } from "./booking-window.input"; import type { ConfirmationPolicy_2024_06_14 } from "./confirmation-policy.input"; -import { ValidateConfirmationPolicy } from "./confirmation-policy.input"; +import { BaseConfirmationPolicy_2024_06_14, ValidateConfirmationPolicy } from "./confirmation-policy.input"; import { CREATE_EVENT_DESCRIPTION_EXAMPLE, CREATE_EVENT_LENGTH_EXAMPLE, @@ -70,33 +78,39 @@ import { Seats_2024_06_14 } from "./seats.input"; BooleanFieldInput_2024_06_14, BusinessDaysWindow_2024_06_14, CalendarDaysWindow_2024_06_14, - RangeWindow_2024_06_14 + RangeWindow_2024_06_14, + BaseBookingLimitsCount_2024_06_14, + Disabled_2024_06_14, + BaseBookingLimitsDuration_2024_06_14, + Recurrence_2024_06_14, + BaseConfirmationPolicy_2024_06_14, + Seats_2024_06_14 ) export class UpdateEventTypeInput_2024_06_14 { @IsOptional() @IsInt() @Min(1) - @DocsProperty({ example: CREATE_EVENT_LENGTH_EXAMPLE }) + @DocsPropertyOptional({ example: CREATE_EVENT_LENGTH_EXAMPLE }) lengthInMinutes?: number; @IsOptional() @IsString() - @DocsProperty({ example: CREATE_EVENT_TITLE_EXAMPLE }) + @DocsPropertyOptional({ example: CREATE_EVENT_TITLE_EXAMPLE }) title?: string; @IsOptional() @IsString() - @DocsProperty({ example: CREATE_EVENT_SLUG_EXAMPLE }) + @DocsPropertyOptional({ example: CREATE_EVENT_SLUG_EXAMPLE }) slug?: string; @IsOptional() @IsString() - @DocsProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE }) + @DocsPropertyOptional({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE }) description?: string; @IsOptional() @ValidateLocations_2024_06_14() - @DocsProperty({ + @DocsPropertyOptional({ description: "Locations where the event will take place. If not provided, cal video link will be used as the location.", oneOf: [ @@ -112,7 +126,7 @@ export class UpdateEventTypeInput_2024_06_14 { @IsOptional() @ValidateInputBookingFields_2024_06_14() - @DocsProperty({ + @DocsPropertyOptional({ description: "Custom fields that can be added to the booking form when the event is booked by someone. By default booking form has name and email field.", oneOf: [ @@ -135,12 +149,14 @@ export class UpdateEventTypeInput_2024_06_14 { @IsBoolean() @IsOptional() - @DocsProperty({ description: "If true, person booking this event't cant add guests via their emails." }) + @DocsPropertyOptional({ + description: "If true, person booking this event't cant add guests via their emails.", + }) disableGuests?: boolean; @IsInt() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: `Number representing length of each slot when event is booked. By default it equal length of the event type. If event length is 60 minutes then we would have slots 9AM, 10AM, 11AM etc. but if it was changed to 30 minutes then we would have slots 9AM, 9:30AM, 10AM, 10:30AM etc. as the available times to book the 60 minute event.`, @@ -150,26 +166,28 @@ export class UpdateEventTypeInput_2024_06_14 { @IsInt() @Min(0) @IsOptional() - @DocsProperty({ description: "Minimum number of minutes before the event that a booking can be made." }) + @DocsPropertyOptional({ + description: "Minimum number of minutes before the event that a booking can be made.", + }) minimumBookingNotice?: number; @IsInt() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: "Time spaces that can be pre-pended before an event to give more time before it.", }) beforeEventBuffer?: number; @IsInt() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: "Time spaces that can be appended after an event to give more time after it.", }) afterEventBuffer?: number; @IsInt() @IsOptional() - @DocsProperty({ + @DocsPropertyOptional({ description: "If you want that this event has different schedule than user's default one you can specify it here.", }) @@ -177,12 +195,19 @@ export class UpdateEventTypeInput_2024_06_14 { @IsOptional() @ValidateBookingLimistsCount() - @DocsProperty({ description: "Limit how many times this event can be booked" }) + @DocsPropertyOptional({ + description: "Limit how many times this event can be booked", + oneOf: [ + { $ref: getSchemaPath(BaseBookingLimitsCount_2024_06_14) }, + { $ref: getSchemaPath(Disabled_2024_06_14) }, + ], + }) + @Type(() => Object) bookingLimitsCount?: BookingLimitsCount_2024_06_14; @IsOptional() @IsBoolean() - @DocsProperty({ + @DocsPropertyOptional({ description: "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time.", }) @@ -190,19 +215,26 @@ export class UpdateEventTypeInput_2024_06_14 { @IsOptional() @ValidateBookingLimistsDuration() - @DocsProperty({ description: "Limit total amount of time that this event can be booked" }) + @DocsPropertyOptional({ + description: "Limit total amount of time that this event can be booked", + oneOf: [ + { $ref: getSchemaPath(BaseBookingLimitsDuration_2024_06_14) }, + { $ref: getSchemaPath(Disabled_2024_06_14) }, + ], + }) + @Type(() => Object) bookingLimitsDuration?: BookingLimitsDuration_2024_06_14; @IsOptional() @ValidateBookingWindow() - @DocsProperty({ + @DocsPropertyOptional({ description: "Limit how far in the future this event can be booked", oneOf: [ { $ref: getSchemaPath(BusinessDaysWindow_2024_06_14) }, { $ref: getSchemaPath(CalendarDaysWindow_2024_06_14) }, { $ref: getSchemaPath(RangeWindow_2024_06_14) }, + { $ref: getSchemaPath(Disabled_2024_06_14) }, ], - type: "array", }) @Type(() => Object) bookingWindow?: BookingWindow_2024_06_14; @@ -210,17 +242,32 @@ export class UpdateEventTypeInput_2024_06_14 { @IsOptional() @IsInt() @Min(1) - @DocsProperty({ description: "Offset timeslots shown to bookers by a specified number of minutes" }) + @DocsPropertyOptional({ description: "Offset timeslots shown to bookers by a specified number of minutes" }) offsetStart?: number; @IsOptional() + @DocsPropertyOptional({ + description: + "Should booker have week, month or column view. Specify default layout and enabled layouts user can pick.", + }) @Type(() => BookerLayouts_2024_06_14) bookerLayouts?: BookerLayouts_2024_06_14; @IsOptional() @ValidateConfirmationPolicy() + @DocsPropertyOptional({ + description: + "Specify how the booking needs to be manually confirmed before it is pushed to the integrations and a confirmation mail is sent.", + oneOf: [ + { $ref: getSchemaPath(BaseConfirmationPolicy_2024_06_14) }, + { $ref: getSchemaPath(Disabled_2024_06_14) }, + ], + }) + @Type(() => Object) confirmationPolicy?: ConfirmationPolicy_2024_06_14; + @ValidateNested() + @IsOptional() @Transform(({ value }) => { if (value && typeof value === "object") { if ("interval" in value) { @@ -232,21 +279,30 @@ export class UpdateEventTypeInput_2024_06_14 { return value; }) @ValidateNested() + @DocsPropertyOptional({ + description: "Create a recurring event type.", + oneOf: [{ $ref: getSchemaPath(Recurrence_2024_06_14) }, { $ref: getSchemaPath(Disabled_2024_06_14) }], + }) + @Type(() => Object) recurrence?: Recurrence_2024_06_14 | Disabled_2024_06_14; @IsOptional() @IsBoolean() + @DocsPropertyOptional() requiresBookerEmailVerification?: boolean; @IsOptional() @IsBoolean() + @DocsPropertyOptional() hideCalendarNotes?: boolean; @IsOptional() @IsBoolean() + @DocsPropertyOptional() lockTimeZoneToggleOnBookingPage?: boolean; @IsOptional() + @DocsPropertyOptional() @Type(() => EventTypeColor_2024_06_14) color?: EventTypeColor_2024_06_14; @@ -262,11 +318,16 @@ export class UpdateEventTypeInput_2024_06_14 { return value; }) @ValidateNested() + @DocsPropertyOptional({ + description: "Create an event type with multiple seats.", + oneOf: [{ $ref: getSchemaPath(Seats_2024_06_14) }, { $ref: getSchemaPath(Disabled_2024_06_14) }], + }) + @Type(() => Object) seats?: Seats_2024_06_14 | Disabled_2024_06_14; @IsOptional() @IsString() - @DocsProperty({ + @DocsPropertyOptional({ description: `Customizable event name with valid variables: {Event type title}, {Organiser}, {Scheduler}, {Location}, {Organiser first name}, {Scheduler first name}, {Scheduler last name}, {Event duration}, {LOCATION}, @@ -276,50 +337,33 @@ export class UpdateEventTypeInput_2024_06_14 { customName?: string; @IsOptional() + @DocsPropertyOptional() @Type(() => DestinationCalendar_2024_06_14) destinationCalendar?: DestinationCalendar_2024_06_14; @IsOptional() @IsBoolean() + @DocsPropertyOptional() useDestinationCalendarEmail?: boolean; @IsOptional() @IsBoolean() + @DocsPropertyOptional() hideCalendarEventDetails?: boolean; } -@ApiExtraModels( - AddressLocation_2024_06_14, - LinkLocation_2024_06_14, - IntegrationLocation_2024_06_14, - PhoneLocation_2024_06_14, - PhoneFieldInput_2024_06_14, - AddressFieldInput_2024_06_14, - TextFieldInput_2024_06_14, - NumberFieldInput_2024_06_14, - TextAreaFieldInput_2024_06_14, - SelectFieldInput_2024_06_14, - MultiSelectFieldInput_2024_06_14, - MultiEmailFieldInput_2024_06_14, - CheckboxGroupFieldInput_2024_06_14, - RadioGroupFieldInput_2024_06_14, - BooleanFieldInput_2024_06_14, - BusinessDaysWindow_2024_06_14, - CalendarDaysWindow_2024_06_14, - RangeWindow_2024_06_14 -) export class UpdateTeamEventTypeInput_2024_06_14 extends UpdateEventTypeInput_2024_06_14 { @ValidateNested({ each: true }) @Type(() => Host) @IsArray() @IsOptional() - @DocsProperty() + @DocsPropertyOptional({ type: [Host] }) hosts?: Host[]; @IsOptional() @IsBoolean() @DocsProperty() - @DocsProperty({ + @DocsPropertyOptional({ description: "If true, all current and future team members will be assigned to this event type", }) assignAllTeamMembers?: boolean;