refactor: v2 return host username (#17880)

* fix: v2 return booking with host username

* auto gen docs

* auto gen docs
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2024-11-27 15:15:12 +00:00
1 parent 240ab60c5f
commit 999019c6f0
5 files changed
+99 -14

No files matched your search

@@ -69,7 +69,7 @@ export class SeatedAttendee extends Attendee {
metadata?: Record<string, string>;
}
class Host {
class BookingHost {
@ApiProperty({ type: Number, example: 1 })
@IsInt()
@Expose()
@@ -80,6 +80,11 @@ class Host {
@Expose()
name!: string;
@ApiProperty({ type: String, example: "jane100" })
@IsString()
@Expose()
username!: string;
@ApiProperty({ type: String, example: "America/Los_Angeles" })
@IsTimeZone()
@Expose()
@@ -119,11 +124,11 @@ class BaseBookingOutput_2024_08_13 {
@Expose()
description!: string;
@ApiProperty({ type: [Host] })
@ApiProperty({ type: [BookingHost] })
@ValidateNested({ each: true })
@Type(() => Host)
@Type(() => BookingHost)
@Expose()
hosts!: Host[];
hosts!: BookingHost[];
@ApiProperty({ enum: ["cancelled", "accepted", "rejected", "pending"], example: "accepted" })
@IsEnum(["cancelled", "accepted", "rejected", "pending"])