Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: v2 event-types #16854

Merged
merged 8 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,016 changes: 672 additions & 344 deletions apps/api/v2/swagger/documentation.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ApiProperty } from "@nestjs/swagger";
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
import { ValidatorConstraint, registerDecorator } from "class-validator";
import { IsEnum, ValidatorConstraint, registerDecorator } from "class-validator";

import {
BookerLayoutsInputEnum_2024_06_14,
Expand Down Expand Up @@ -44,9 +45,16 @@ function IsValidLayout(validationOptions?: ValidationOptions) {
}

export class BookerLayouts_2024_06_14 {
@IsValidLayout({ message: "defaultLayout must be one of the valid layouts." })
@IsValidLayout({ message: "defaultLayout must be one of the valid layouts - month, week or column" })
@ApiProperty({ type: String, enum: BookerLayoutsInputEnum_2024_06_14 })
@IsEnum(BookerLayoutsInputEnum_2024_06_14)
defaultLayout!: BookerLayoutsInputEnum_2024_06_14;

@IsValidLayout({ message: "enabledLayouts must be one of the valid layouts." })
@ApiProperty({ type: [String], enum: BookerLayoutsInputEnum_2024_06_14 })
@IsEnum(BookerLayoutsInputEnum_2024_06_14, {
each: true,
message: "enabledLayouts must contain only valid layouts - month, week or column",
})
enabledLayouts!: BookerLayoutsInputEnum_2024_06_14[];
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiProperty } from "@nestjs/swagger";
import { ApiPropertyOptional } from "@nestjs/swagger";
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
import { IsBoolean, IsInt, IsOptional, Min, ValidatorConstraint, registerDecorator } from "class-validator";

Expand All @@ -14,7 +14,7 @@ export class BaseBookingLimitsCount_2024_06_14 {
@IsOptional()
@IsInt()
@Min(1)
@ApiProperty({
@ApiPropertyOptional({
description: "The number of bookings per day",
example: 1,
})
Expand All @@ -23,7 +23,7 @@ export class BaseBookingLimitsCount_2024_06_14 {
@IsOptional()
@IsInt()
@Min(1)
@ApiProperty({
@ApiPropertyOptional({
description: "The number of bookings per week",
example: 2,
})
Expand All @@ -32,7 +32,7 @@ export class BaseBookingLimitsCount_2024_06_14 {
@IsOptional()
@IsInt()
@Min(1)
@ApiProperty({
@ApiPropertyOptional({
description: "The number of bookings per month",
example: 3,
})
Expand All @@ -41,7 +41,7 @@ export class BaseBookingLimitsCount_2024_06_14 {
@IsOptional()
@IsInt()
@Min(1)
@ApiProperty({
@ApiPropertyOptional({
description: "The number of bookings per year",
example: 4,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiProperty } from "@nestjs/swagger";
import { ApiPropertyOptional } from "@nestjs/swagger";
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
import { IsBoolean, IsInt, IsOptional, Min, ValidatorConstraint, registerDecorator } from "class-validator";

Expand All @@ -8,7 +8,7 @@ export class BaseBookingLimitsDuration_2024_06_14 {
@IsOptional()
@IsInt()
@Min(15)
@ApiProperty({
@ApiPropertyOptional({
description: "The duration of bookings per day (must be a multiple of 15)",
example: 60,
})
Expand All @@ -17,7 +17,7 @@ export class BaseBookingLimitsDuration_2024_06_14 {
@IsOptional()
@IsInt()
@Min(15)
@ApiProperty({
@ApiPropertyOptional({
description: "The duration of bookings per week (must be a multiple of 15)",
example: 120,
})
Expand All @@ -26,7 +26,7 @@ export class BaseBookingLimitsDuration_2024_06_14 {
@IsOptional()
@IsInt()
@Min(15)
@ApiProperty({
@ApiPropertyOptional({
description: "The duration of bookings per month (must be a multiple of 15)",
example: 180,
})
Expand All @@ -35,7 +35,7 @@ export class BaseBookingLimitsDuration_2024_06_14 {
@IsOptional()
@IsInt()
@Min(15)
@ApiProperty({
@ApiPropertyOptional({
description: "The duration of bookings per year (must be a multiple of 15)",
example: 240,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import type { ValidatorConstraintInterface, ValidationOptions } from "class-validator";
import {
IsEnum,
Expand Down Expand Up @@ -47,7 +47,7 @@ export class BusinessDaysWindow_2024_06_14 extends BookingWindowBase {

@IsOptional()
@IsBoolean()
@ApiProperty({
@ApiPropertyOptional({
example: true,
description:
"If true, the window will be rolling aka from the moment that someone is trying to book this event. Otherwise it will be specified amount of days from the current date.",
Expand All @@ -67,7 +67,7 @@ export class CalendarDaysWindow_2024_06_14 extends BookingWindowBase {

@IsOptional()
@IsBoolean()
@ApiProperty({
@ApiPropertyOptional({
example: true,
description:
"If true, the window will be rolling aka from the moment that someone is trying to book this event. Otherwise it will be specified amount of days from the current date.",
Expand Down
Loading
Loading