docs: booking attendee absent (#22094)
* refactor: booking attendee absent * docs: swagger generate
This commit is contained in:
@@ -21402,7 +21402,8 @@
|
||||
"OOO_CREATED",
|
||||
"AFTER_HOSTS_CAL_VIDEO_NO_SHOW",
|
||||
"AFTER_GUESTS_CAL_VIDEO_NO_SHOW",
|
||||
"FORM_SUBMITTED_NO_EVENT"
|
||||
"FORM_SUBMITTED_NO_EVENT",
|
||||
"RESERVATION_EXPIRED"
|
||||
]
|
||||
},
|
||||
"secret": {
|
||||
@@ -21479,7 +21480,8 @@
|
||||
"OOO_CREATED",
|
||||
"AFTER_HOSTS_CAL_VIDEO_NO_SHOW",
|
||||
"AFTER_GUESTS_CAL_VIDEO_NO_SHOW",
|
||||
"FORM_SUBMITTED_NO_EVENT"
|
||||
"FORM_SUBMITTED_NO_EVENT",
|
||||
"RESERVATION_EXPIRED"
|
||||
]
|
||||
},
|
||||
"secret": {
|
||||
@@ -23975,7 +23977,7 @@
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"Attendee": {
|
||||
"CreateBookingAttendee": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
@@ -24112,7 +24114,7 @@
|
||||
"description": "The attendee's details.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/CreateBookingAttendee"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -24239,7 +24241,7 @@
|
||||
"description": "The attendee's details.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/CreateBookingAttendee"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -24372,7 +24374,7 @@
|
||||
"description": "The attendee's details.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/CreateBookingAttendee"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -24541,6 +24543,85 @@
|
||||
"slug"
|
||||
]
|
||||
},
|
||||
"BookingAttendee": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"example": "John Doe"
|
||||
},
|
||||
"email": {
|
||||
"type": "string",
|
||||
"example": "john@example.com"
|
||||
},
|
||||
"timeZone": {
|
||||
"type": "string",
|
||||
"example": "America/New_York"
|
||||
},
|
||||
"language": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ar",
|
||||
"ca",
|
||||
"de",
|
||||
"es",
|
||||
"eu",
|
||||
"he",
|
||||
"id",
|
||||
"ja",
|
||||
"lv",
|
||||
"pl",
|
||||
"ro",
|
||||
"sr",
|
||||
"th",
|
||||
"vi",
|
||||
"az",
|
||||
"cs",
|
||||
"el",
|
||||
"es-419",
|
||||
"fi",
|
||||
"hr",
|
||||
"it",
|
||||
"km",
|
||||
"nl",
|
||||
"pt",
|
||||
"ru",
|
||||
"sv",
|
||||
"tr",
|
||||
"zh-CN",
|
||||
"bg",
|
||||
"da",
|
||||
"en",
|
||||
"et",
|
||||
"fr",
|
||||
"hu",
|
||||
"iw",
|
||||
"ko",
|
||||
"no",
|
||||
"pt-BR",
|
||||
"sk",
|
||||
"ta",
|
||||
"uk",
|
||||
"zh-TW"
|
||||
],
|
||||
"example": "en"
|
||||
},
|
||||
"absent": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"phoneNumber": {
|
||||
"type": "string",
|
||||
"example": "+1234567890"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"email",
|
||||
"timeZone",
|
||||
"absent"
|
||||
]
|
||||
},
|
||||
"BookingOutput_2024_08_13": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -24657,7 +24738,7 @@
|
||||
"attendees": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/BookingAttendee"
|
||||
}
|
||||
},
|
||||
"guests": {
|
||||
@@ -24814,7 +24895,7 @@
|
||||
"attendees": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/BookingAttendee"
|
||||
}
|
||||
},
|
||||
"guests": {
|
||||
@@ -25925,6 +26006,21 @@
|
||||
"data"
|
||||
]
|
||||
},
|
||||
"MarkAbsentAttendee": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"absent": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"email",
|
||||
"absent"
|
||||
]
|
||||
},
|
||||
"MarkAbsentBookingInput_2024_08_13": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -25936,7 +26032,7 @@
|
||||
"attendees": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/MarkAbsentAttendee"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19759,7 +19759,8 @@
|
||||
"OOO_CREATED",
|
||||
"AFTER_HOSTS_CAL_VIDEO_NO_SHOW",
|
||||
"AFTER_GUESTS_CAL_VIDEO_NO_SHOW",
|
||||
"FORM_SUBMITTED_NO_EVENT"
|
||||
"FORM_SUBMITTED_NO_EVENT",
|
||||
"RESERVATION_EXPIRED"
|
||||
]
|
||||
},
|
||||
"secret": {
|
||||
@@ -19826,7 +19827,8 @@
|
||||
"OOO_CREATED",
|
||||
"AFTER_HOSTS_CAL_VIDEO_NO_SHOW",
|
||||
"AFTER_GUESTS_CAL_VIDEO_NO_SHOW",
|
||||
"FORM_SUBMITTED_NO_EVENT"
|
||||
"FORM_SUBMITTED_NO_EVENT",
|
||||
"RESERVATION_EXPIRED"
|
||||
]
|
||||
},
|
||||
"secret": {
|
||||
@@ -21957,7 +21959,7 @@
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"Attendee": {
|
||||
"CreateBookingAttendee": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
@@ -22085,7 +22087,7 @@
|
||||
"description": "The attendee's details.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/CreateBookingAttendee"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -22203,7 +22205,7 @@
|
||||
"description": "The attendee's details.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/CreateBookingAttendee"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -22326,7 +22328,7 @@
|
||||
"description": "The attendee's details.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/CreateBookingAttendee"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -22477,6 +22479,80 @@
|
||||
},
|
||||
"required": ["id", "slug"]
|
||||
},
|
||||
"BookingAttendee": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"example": "John Doe"
|
||||
},
|
||||
"email": {
|
||||
"type": "string",
|
||||
"example": "john@example.com"
|
||||
},
|
||||
"timeZone": {
|
||||
"type": "string",
|
||||
"example": "America/New_York"
|
||||
},
|
||||
"language": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ar",
|
||||
"ca",
|
||||
"de",
|
||||
"es",
|
||||
"eu",
|
||||
"he",
|
||||
"id",
|
||||
"ja",
|
||||
"lv",
|
||||
"pl",
|
||||
"ro",
|
||||
"sr",
|
||||
"th",
|
||||
"vi",
|
||||
"az",
|
||||
"cs",
|
||||
"el",
|
||||
"es-419",
|
||||
"fi",
|
||||
"hr",
|
||||
"it",
|
||||
"km",
|
||||
"nl",
|
||||
"pt",
|
||||
"ru",
|
||||
"sv",
|
||||
"tr",
|
||||
"zh-CN",
|
||||
"bg",
|
||||
"da",
|
||||
"en",
|
||||
"et",
|
||||
"fr",
|
||||
"hu",
|
||||
"iw",
|
||||
"ko",
|
||||
"no",
|
||||
"pt-BR",
|
||||
"sk",
|
||||
"ta",
|
||||
"uk",
|
||||
"zh-TW"
|
||||
],
|
||||
"example": "en"
|
||||
},
|
||||
"absent": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"phoneNumber": {
|
||||
"type": "string",
|
||||
"example": "+1234567890"
|
||||
}
|
||||
},
|
||||
"required": ["name", "email", "timeZone", "absent"]
|
||||
},
|
||||
"BookingOutput_2024_08_13": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -22588,7 +22664,7 @@
|
||||
"attendees": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/BookingAttendee"
|
||||
}
|
||||
},
|
||||
"guests": {
|
||||
@@ -22737,7 +22813,7 @@
|
||||
"attendees": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/BookingAttendee"
|
||||
}
|
||||
},
|
||||
"guests": {
|
||||
@@ -23758,6 +23834,18 @@
|
||||
},
|
||||
"required": ["status", "data"]
|
||||
},
|
||||
"MarkAbsentAttendee": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"absent": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["email", "absent"]
|
||||
},
|
||||
"MarkAbsentBookingInput_2024_08_13": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -23769,7 +23857,7 @@
|
||||
"attendees": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Attendee"
|
||||
"$ref": "#/components/schemas/MarkAbsentAttendee"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ function RequireEmailOrPhone(validationOptions?: ValidationOptions) {
|
||||
constraints: [],
|
||||
validator: {
|
||||
validate(_: unknown, args: ValidationArguments) {
|
||||
const obj = args.object as Attendee;
|
||||
const obj = args.object as CreateBookingAttendee;
|
||||
|
||||
const hasPhoneNumber = !!obj.phoneNumber;
|
||||
const hasEmail = !!obj.email;
|
||||
@@ -95,7 +95,7 @@ function RequireEmailOrPhone(validationOptions?: ValidationOptions) {
|
||||
}
|
||||
|
||||
@RequireEmailOrPhone()
|
||||
class Attendee {
|
||||
class CreateBookingAttendee {
|
||||
@ApiProperty({
|
||||
type: String,
|
||||
description: "The name of the attendee.",
|
||||
@@ -222,13 +222,13 @@ export class CreateBookingInput_2024_08_13 {
|
||||
start!: string;
|
||||
|
||||
@ApiProperty({
|
||||
type: Attendee,
|
||||
type: CreateBookingAttendee,
|
||||
description: "The attendee's details.",
|
||||
})
|
||||
@IsDefined()
|
||||
@ValidateNested()
|
||||
@Type(() => Attendee)
|
||||
attendee!: Attendee;
|
||||
@Type(() => CreateBookingAttendee)
|
||||
attendee!: CreateBookingAttendee;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
type: Object,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { Type } from "class-transformer";
|
||||
import { IsOptional, IsBoolean, IsEmail, IsArray, ArrayMinSize, ValidateNested } from "class-validator";
|
||||
|
||||
class Attendee {
|
||||
class MarkAbsentAttendee {
|
||||
@IsEmail()
|
||||
@ApiProperty()
|
||||
email!: string;
|
||||
@@ -21,8 +21,8 @@ export class MarkAbsentBookingInput_2024_08_13 {
|
||||
@ArrayMinSize(1)
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => Attendee)
|
||||
@Type(() => MarkAbsentAttendee)
|
||||
@IsOptional()
|
||||
@ApiPropertyOptional({ type: [Attendee] })
|
||||
attendees?: Attendee[];
|
||||
@ApiPropertyOptional({ type: [MarkAbsentAttendee] })
|
||||
attendees?: MarkAbsentAttendee[];
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
import type { BookingLanguageType } from "../inputs/language";
|
||||
import { BookingLanguage } from "../inputs/language";
|
||||
|
||||
class Attendee {
|
||||
class BookingAttendee {
|
||||
@ApiProperty({ type: String, example: "John Doe" })
|
||||
@IsString()
|
||||
@Expose()
|
||||
@@ -52,7 +52,7 @@ class Attendee {
|
||||
phoneNumber?: string;
|
||||
}
|
||||
|
||||
export class SeatedAttendee extends Attendee {
|
||||
export class SeatedAttendee extends BookingAttendee {
|
||||
@ApiProperty({ type: String, example: "3be561a9-31f1-4b8e-aefc-9d9a085f0dd1" })
|
||||
@IsString()
|
||||
@Expose()
|
||||
@@ -264,11 +264,11 @@ class BaseBookingOutput_2024_08_13 {
|
||||
}
|
||||
|
||||
export class BookingOutput_2024_08_13 extends BaseBookingOutput_2024_08_13 {
|
||||
@ApiProperty({ type: [Attendee] })
|
||||
@ApiProperty({ type: [BookingAttendee] })
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => Attendee)
|
||||
@Type(() => BookingAttendee)
|
||||
@Expose()
|
||||
attendees!: Attendee[];
|
||||
attendees!: BookingAttendee[];
|
||||
|
||||
@ApiPropertyOptional({
|
||||
type: [String],
|
||||
|
||||
Reference in New Issue
Block a user