docs: v2 reschedule and cancel booking (#20011)

This commit is contained in:
Lauris Skraucis
2025-03-12 16:36:32 +02:00
committed by GitHub
parent 8af5145b56
commit 4ff543efc7
3 changed files with 1006 additions and 2561 deletions
@@ -39,11 +39,15 @@ import { Request } from "express";
import { BOOKING_READ, BOOKING_WRITE, SUCCESS_STATUS } from "@calcom/platform-constants";
import {
CancelBookingInput,
CancelBookingInput_2024_08_13,
CancelBookingInputPipe,
CancelSeatedBookingInput_2024_08_13,
GetBookingOutput_2024_08_13,
GetBookingsOutput_2024_08_13,
RescheduleBookingInput,
RescheduleBookingInput_2024_08_13,
RescheduleBookingInputPipe,
RescheduleSeatedBookingInput_2024_08_13,
} from "@calcom/platform-types";
import {
CreateBookingInputPipe,
@@ -99,7 +103,7 @@ export class BookingsController_2024_08_13 {
],
},
description:
"Accepts different types of booking input: CreateBookingInput_2024_08_13, CreateInstantBookingInput_2024_08_13, or CreateRecurringBookingInput_2024_08_13",
"Accepts different types of booking input: Create Booking (Option 1), Create Instant Booking (Option 2), or Create Recurring Booking (Option 3)",
})
@ApiExtraModels(
CreateBookingInput_2024_08_13,
@@ -172,9 +176,19 @@ export class BookingsController_2024_08_13 {
@UseGuards(BookingUidGuard)
@ApiOperation({
summary: "Reschedule a booking",
description:
"Reschedule a booking by passing `:bookingUid` of the booking that should be rescheduled and pass request body with a new start time to create a new booking.",
description: "Reschedule a booking or seated booking",
})
@ApiBody({
schema: {
oneOf: [
{ $ref: getSchemaPath(RescheduleBookingInput_2024_08_13) },
{ $ref: getSchemaPath(RescheduleSeatedBookingInput_2024_08_13) },
],
},
description:
"Accepts different types of reschedule booking input: Reschedule Booking (Option 1) or Reschedule Seated Booking (Option 2)",
})
@ApiExtraModels(RescheduleBookingInput_2024_08_13, RescheduleSeatedBookingInput_2024_08_13)
async rescheduleBooking(
@Param("bookingUid") bookingUid: string,
@Body(new RescheduleBookingInputPipe())
@@ -199,6 +213,17 @@ export class BookingsController_2024_08_13 {
For seated bookings to cancel one individual booking provide :bookingUid and :seatUid in the request body. For recurring seated bookings it is not possible to cancel all of them with 1 call
like with non-seated recurring bookings by providing recurring bookind uid - you have to cancel each recurrence booking by its bookingUid + seatUid.`,
})
@ApiBody({
schema: {
oneOf: [
{ $ref: getSchemaPath(CancelBookingInput_2024_08_13) },
{ $ref: getSchemaPath(CancelSeatedBookingInput_2024_08_13) },
],
},
description:
"Accepts different types of cancel booking input: Cancel Booking (Option 1) or Cancel Seated Booking (Option 2)",
})
@ApiExtraModels(CancelBookingInput_2024_08_13, CancelSeatedBookingInput_2024_08_13)
async cancelBooking(
@Req() request: Request,
@Param("bookingUid") bookingUid: string,
+190 -12
View File
@@ -3606,7 +3606,7 @@
],
"requestBody": {
"required": true,
"description": "Accepts different types of booking input: CreateBookingInput_2024_08_13, CreateInstantBookingInput_2024_08_13, or CreateRecurringBookingInput_2024_08_13",
"description": "Accepts different types of booking input: Create Booking (Option 1), Create Instant Booking (Option 2), or Create Recurring Booking (Option 3)",
"content": {
"application/json": {
"schema": {
@@ -3922,7 +3922,7 @@
"post": {
"operationId": "BookingsController_2024_08_13_rescheduleBooking",
"summary": "Reschedule a booking",
"description": "Reschedule a booking by passing `:bookingUid` of the booking that should be rescheduled and pass request body with a new start time to create a new booking.",
"description": "Reschedule a booking or seated booking",
"parameters": [
{
"name": "cal-api-version",
@@ -3942,6 +3942,24 @@
}
}
],
"requestBody": {
"required": true,
"description": "Accepts different types of reschedule booking input: Reschedule Booking (Option 1) or Reschedule Seated Booking (Option 2)",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/RescheduleBookingInput_2024_08_13"
},
{
"$ref": "#/components/schemas/RescheduleSeatedBookingInput_2024_08_13"
}
]
}
}
}
},
"responses": {
"201": {
"description": "",
@@ -3983,6 +4001,24 @@
}
}
],
"requestBody": {
"required": true,
"description": "Accepts different types of cancel booking input: Cancel Booking (Option 1) or Cancel Seated Booking (Option 2)",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/CancelBookingInput_2024_08_13"
},
{
"$ref": "#/components/schemas/CancelSeatedBookingInput_2024_08_13"
}
]
}
}
}
},
"responses": {
"200": {
"description": "",
@@ -5640,6 +5676,16 @@
"schema": {
"type": "number"
}
},
{
"name": "offset",
"required": false,
"in": "query",
"description": "The number of items to skip",
"example": 0,
"schema": {
"type": "number"
}
}
],
"responses": {
@@ -11671,7 +11717,10 @@
"default": false
},
"metadata": {
"type": "string"
"type": "object",
"example": {
"key": "value"
}
},
"theme": {
"type": "string"
@@ -11810,7 +11859,11 @@
"type": "boolean"
},
"metadata": {
"type": "string"
"type": "object",
"description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
"example": {
"key": "value"
}
},
"theme": {
"type": "string"
@@ -11888,7 +11941,11 @@
"type": "boolean"
},
"metadata": {
"type": "string"
"type": "object",
"description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
"example": {
"key": "value"
}
},
"theme": {
"type": "string"
@@ -15017,7 +15074,11 @@
"type": "boolean"
},
"metadata": {
"type": "string"
"type": "object",
"description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
"example": {
"key": "value"
}
},
"theme": {
"type": "string"
@@ -15129,7 +15190,10 @@
"default": false
},
"metadata": {
"type": "string"
"type": "object",
"example": {
"key": "value"
}
},
"theme": {
"type": "string"
@@ -15407,7 +15471,11 @@
"example": "CalTeam"
},
"metadata": {
"type": "object"
"type": "object",
"description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
"example": {
"key": "value"
}
}
},
"required": [
@@ -15425,7 +15493,10 @@
"minLength": 1
},
"metadata": {
"type": "object"
"type": "object",
"example": {
"key": "value"
}
},
"apiKey": {
"type": "string"
@@ -15468,7 +15539,10 @@
"minLength": 1
},
"metadata": {
"type": "object"
"type": "object",
"example": {
"key": "value"
}
}
},
"required": [
@@ -15529,7 +15603,11 @@
"example": "CalTeam"
},
"metadata": {
"type": "string"
"type": "object",
"description": "You can store any additional data you want here.\nMetadata must have at most 50 keys, each key up to 40 characters.\nValues can be strings (up to 500 characters), numbers, or booleans.",
"example": {
"key": "value"
}
}
}
},
@@ -16313,7 +16391,36 @@
"example": "cal-video",
"enum": [
"cal-video",
"google-meet"
"google-meet",
"zoom",
"whereby-video",
"whatsapp-video",
"webex-video",
"telegram-video",
"tandem",
"sylaps-video",
"skype-video",
"sirius-video",
"signal-video",
"shimmer-video",
"salesroom-video",
"roam-video",
"riverside-video",
"ping-video",
"office365-video",
"mirotalk-video",
"jitsi",
"jelly-video",
"jelly-conferencing",
"huddle",
"facetime-video",
"element-call-video",
"eightxeight-video",
"discord-video",
"demodesk-video",
"campsite-conferencing",
"campfire-video",
"around-video"
]
}
},
@@ -17853,6 +17960,51 @@
"data"
]
},
"RescheduleBookingInput_2024_08_13": {
"type": "object",
"properties": {
"start": {
"type": "string",
"description": "Start time in ISO 8601 format for the new booking",
"example": "2024-08-13T10:00:00Z"
},
"rescheduledBy": {
"type": "string",
"description": "Email of the person who is rescheduling the booking - only needed when rescheduling a booking that requires a confirmation.\nIf event type owner email is provided then rescheduled booking will be automatically confirmed. If attendee email or no email is passed then the event type\nowner will have to confirm the rescheduled booking."
},
"reschedulingReason": {
"type": "string",
"example": "User requested reschedule",
"description": "Reason for rescheduling the booking"
}
},
"required": [
"start"
]
},
"RescheduleSeatedBookingInput_2024_08_13": {
"type": "object",
"properties": {
"start": {
"type": "string",
"description": "Start time in ISO 8601 format for the new booking",
"example": "2024-08-13T10:00:00Z"
},
"rescheduledBy": {
"type": "string",
"description": "Email of the person who is rescheduling the booking - only needed when rescheduling a booking that requires a confirmation.\nIf event type owner email is provided then rescheduled booking will be automatically confirmed. If attendee email or no email is passed then the event type\nowner will have to confirm the rescheduled booking."
},
"seatUid": {
"type": "string",
"example": "3be561a9-31f1-4b8e-aefc-9d9a085f0dd1",
"description": "Uid of the specific seat within booking."
}
},
"required": [
"start",
"seatUid"
]
},
"RescheduleBookingOutput_2024_08_13": {
"type": "object",
"properties": {
@@ -17887,6 +18039,32 @@
"data"
]
},
"CancelBookingInput_2024_08_13": {
"type": "object",
"properties": {
"cancellationReason": {
"type": "string",
"example": "User requested cancellation"
},
"cancelSubsequentBookings": {
"type": "boolean",
"description": "For recurring non-seated booking - if true, cancel booking with the bookingUid of the individual recurrence and all recurrences that come after it."
}
}
},
"CancelSeatedBookingInput_2024_08_13": {
"type": "object",
"properties": {
"seatUid": {
"type": "string",
"example": "3be561a9-31f1-4b8e-aefc-9d9a085f0dd1",
"description": "Uid of the specific seat within booking."
}
},
"required": [
"seatUid"
]
},
"CancelBookingOutput_2024_08_13": {
"type": "object",
"properties": {
File diff suppressed because it is too large Load Diff