Update /booking _post.ts to have eventTypeId as required (#254)

Update` /booking` `_post.ts` to have 
- eventTypeId as a required field
- example for request body
- Updated schema that represents actual usage
pull/9078/head
Syed Ali Shahbaz 2023-04-12 20:46:19 +05:30 committed by GitHub
parent 386ad87e64
commit fab5eb948c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 52 additions and 21 deletions

View File

@ -24,12 +24,20 @@ import { defaultResponder } from "@calcom/lib/server";
* schema: * schema:
* type: object * type: object
* required: * required:
* - eventTypeId
* - start * - start
* - end * - end
* - name
* - email
* - timeZone
* - language
* - metadata
* - customInputs
* - location
* properties: * properties:
* title: * eventTypeId:
* type: string * type: integer
* description: 'Booking event title' * description: 'ID of the event type to book'
* start: * start:
* type: string * type: string
* format: date-time * format: date-time
@ -38,6 +46,32 @@ import { defaultResponder } from "@calcom/lib/server";
* type: string * type: string
* format: date-time * format: date-time
* description: 'End time of the Event' * description: 'End time of the Event'
* name:
* type: string
* description: 'Name of the Attendee'
* email:
* type: string
* format: email
* description: 'Email ID of the Attendee'
* timeZone:
* type: string
* description: 'TimeZone of the Attendee'
* language:
* type: string
* description: 'Language of the Attendee'
* metadata:
* type: object
* properties: {}
* description: 'Any metadata associated with the booking'
* customInputs:
* type: array
* items: {}
* location:
* type: string
* description: 'Meeting location'
* title:
* type: string
* description: 'Booking event title'
* recurringEventId: * recurringEventId:
* type: integer * type: integer
* description: 'Recurring event ID if the event is recurring' * description: 'Recurring event ID if the event is recurring'
@ -47,9 +81,6 @@ import { defaultResponder } from "@calcom/lib/server";
* status: * status:
* type: string * type: string
* description: 'Acceptable values one of ["ACCEPTED", "PENDING", "CANCELLED", "REJECTED"]' * description: 'Acceptable values one of ["ACCEPTED", "PENDING", "CANCELLED", "REJECTED"]'
* location:
* type: string
* description: 'Meeting location'
* seatsPerTimeSlot: * seatsPerTimeSlot:
* type: integer * type: integer
* description: 'The number of seats for each time slot' * description: 'The number of seats for each time slot'
@ -59,21 +90,21 @@ import { defaultResponder } from "@calcom/lib/server";
* smsReminderNumber: * smsReminderNumber:
* type: number * type: number
* description: 'SMS reminder number' * description: 'SMS reminder number'
* attendees: * examples:
* type: array * New Booking example:
* description: 'List of attendees of the booking' * value:
* items: * {
* type: object * "eventTypeId": 1,
* properties: * "start": "2023-05-01T14:00:00Z",
* name: * "end": "2023-05-01T15:00:00Z",
* type: string * "name": "John Doe",
* email: * "email": "john.doe@example.com",
* type: string * "timeZone": "America/New_York",
* format: email * "language": "en-US",
* timeZone: * "metadata": {},
* type: string * "customInputs": [],
* locale: * "location": "Conference Room A"
* type: string * }
* *
* tags: * tags:
* - bookings * - bookings