Update availabilities _post swagger def (#210)
- Adds more specs to the swagger definition in /availabilities for doc experimentationpull/9078/head
parent
e5827b035d
commit
4080e5bc5e
|
@ -17,6 +17,12 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
|
||||||
* type: integer
|
* type: integer
|
||||||
* required: true
|
* required: true
|
||||||
* description: ID of the availability to delete
|
* description: ID of the availability to delete
|
||||||
|
* - in: query
|
||||||
|
* name: apiKey
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: integer
|
||||||
|
* description: Your API key
|
||||||
* tags:
|
* tags:
|
||||||
* - availabilities
|
* - availabilities
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
|
|
|
@ -18,6 +18,12 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
|
||||||
* type: integer
|
* type: integer
|
||||||
* required: true
|
* required: true
|
||||||
* description: ID of the availability to get
|
* description: ID of the availability to get
|
||||||
|
* - in: query
|
||||||
|
* name: apiKey
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: integer
|
||||||
|
* description: Your API key
|
||||||
* tags:
|
* tags:
|
||||||
* - availabilities
|
* - availabilities
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
|
@ -26,7 +32,9 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
|
||||||
* 200:
|
* 200:
|
||||||
* description: OK
|
* description: OK
|
||||||
* 401:
|
* 401:
|
||||||
* description: Unauthorized
|
* description: Authorization information is missing or invalid
|
||||||
|
* 404:
|
||||||
|
* description: Availability not found
|
||||||
*/
|
*/
|
||||||
export async function getHandler(req: NextApiRequest) {
|
export async function getHandler(req: NextApiRequest) {
|
||||||
const { prisma, query } = req;
|
const { prisma, query } = req;
|
||||||
|
|
|
@ -14,6 +14,19 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
|
||||||
* patch:
|
* patch:
|
||||||
* operationId: editAvailabilityById
|
* operationId: editAvailabilityById
|
||||||
* summary: Edit an existing availability
|
* summary: Edit an existing availability
|
||||||
|
* parameters:
|
||||||
|
* - in: query
|
||||||
|
* name: apiKey
|
||||||
|
* required: true
|
||||||
|
* description: Your API key
|
||||||
|
* schema:
|
||||||
|
* type: integer
|
||||||
|
* - in: path
|
||||||
|
* name: id
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: integer
|
||||||
|
* description: ID of the availability to edit
|
||||||
* requestBody:
|
* requestBody:
|
||||||
* description: Edit an existing availability related to one of your bookings
|
* description: Edit an existing availability related to one of your bookings
|
||||||
* required: true
|
* required: true
|
||||||
|
@ -24,20 +37,28 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
|
||||||
* properties:
|
* properties:
|
||||||
* days:
|
* days:
|
||||||
* type: array
|
* type: array
|
||||||
* example: email@example.com
|
* description: Array of integers depicting weekdays
|
||||||
|
* items:
|
||||||
|
* type: integer
|
||||||
|
* enum: [0, 1, 2, 3, 4, 5]
|
||||||
|
* scheduleId:
|
||||||
|
* type: integer
|
||||||
|
* description: ID of schedule this availability is associated with
|
||||||
* startTime:
|
* startTime:
|
||||||
* type: string
|
* type: string
|
||||||
* example: 1970-01-01T17:00:00.000Z
|
* description: Start time of the availability
|
||||||
* endTime:
|
* endTime:
|
||||||
* type: string
|
* type: string
|
||||||
* example: 1970-01-01T17:00:00.000Z
|
* description: End time of the availability
|
||||||
* parameters:
|
* examples:
|
||||||
* - in: path
|
* availability:
|
||||||
* name: id
|
* summary: An example of availability
|
||||||
* schema:
|
* value:
|
||||||
* type: integer
|
* scheduleId: 123
|
||||||
* required: true
|
* days: [1,2,3,5]
|
||||||
* description: ID of the availability to edit
|
* startTime: 1970-01-01T17:00:00.000Z
|
||||||
|
* endTime: 1970-01-01T17:00:00.000Z
|
||||||
|
*
|
||||||
* tags:
|
* tags:
|
||||||
* - availabilities
|
* - availabilities
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
|
|
|
@ -14,6 +14,13 @@ import {
|
||||||
* post:
|
* post:
|
||||||
* operationId: addAvailability
|
* operationId: addAvailability
|
||||||
* summary: Creates a new availability
|
* summary: Creates a new availability
|
||||||
|
* parameters:
|
||||||
|
* - in: query
|
||||||
|
* name: apiKey
|
||||||
|
* requiried: true
|
||||||
|
* description: Your API key
|
||||||
|
* schema:
|
||||||
|
* type: integer
|
||||||
* requestBody:
|
* requestBody:
|
||||||
* description: Edit an existing availability related to one of your bookings
|
* description: Edit an existing availability related to one of your bookings
|
||||||
* required: true
|
* required: true
|
||||||
|
@ -28,13 +35,29 @@ import {
|
||||||
* properties:
|
* properties:
|
||||||
* days:
|
* days:
|
||||||
* type: array
|
* type: array
|
||||||
* example: email@example.com
|
* description: Array of integers depicting weekdays
|
||||||
|
* items:
|
||||||
|
* type: integer
|
||||||
|
* enum: [0, 1, 2, 3, 4, 5]
|
||||||
|
* scheduleId:
|
||||||
|
* type: integer
|
||||||
|
* description: ID of schedule this availability is associated with
|
||||||
* startTime:
|
* startTime:
|
||||||
* type: string
|
* type: string
|
||||||
* example: 1970-01-01T17:00:00.000Z
|
* description: Start time of the availability
|
||||||
* endTime:
|
* endTime:
|
||||||
* type: string
|
* type: string
|
||||||
* example: 1970-01-01T17:00:00.000Z
|
* description: End time of the availability
|
||||||
|
* examples:
|
||||||
|
* availability:
|
||||||
|
* summary: An example of availability
|
||||||
|
* value:
|
||||||
|
* scheduleId: 123
|
||||||
|
* days: [1,2,3,5]
|
||||||
|
* startTime: 1970-01-01T17:00:00.000Z
|
||||||
|
* endTime: 1970-01-01T17:00:00.000Z
|
||||||
|
*
|
||||||
|
*
|
||||||
* tags:
|
* tags:
|
||||||
* - availabilities
|
* - availabilities
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
|
|
Loading…
Reference in New Issue