From d9929974e000b4b295ca486c96369e1b704bd042 Mon Sep 17 00:00:00 2001 From: supalarry Date: Sat, 15 Feb 2025 11:56:51 +0100 Subject: [PATCH 1/5] wip: routing forms responses --- .../organizations/organizations.module.ts | 2 + ...ions-routing-forms-responses.controller.ts | 36 + ...izations-routing-forms-responses.module.ts | 10 + .../get-routing-form-responses.output.ts | 19 + .../outputs/routing-form-response.output.ts | 35 + .../routing-forms-responses.module.ts | 11 + .../routing-forms-responses.repository.ts | 18 + .../routing-forms-responses.service.ts | 12 + apps/api/v2/swagger/documentation.json | 89 +- docs/api-reference/v2/openapi.json | 2992 ++++------------- 10 files changed, 878 insertions(+), 2346 deletions(-) create mode 100644 apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts create mode 100644 apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts create mode 100644 apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts create mode 100644 apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts create mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts create mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts create mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts diff --git a/apps/api/v2/src/modules/organizations/organizations.module.ts b/apps/api/v2/src/modules/organizations/organizations.module.ts index 4991f1e9acaaee..f5abb08f897505 100644 --- a/apps/api/v2/src/modules/organizations/organizations.module.ts +++ b/apps/api/v2/src/modules/organizations/organizations.module.ts @@ -29,6 +29,7 @@ import { OrganizationsTeamsMembershipsRepository } from "@/modules/organizations import { OrganizationsTeamsRepository } from "@/modules/organizations/repositories/organizations-teams.repository"; import { OrganizationsUsersRepository } from "@/modules/organizations/repositories/organizations-users.repository"; import { OrganizationsWebhooksRepository } from "@/modules/organizations/repositories/organizations-webhooks.repository"; +import { OrganizationsRoutingFormsModule } from "@/modules/organizations/routing-forms/organizations-routing-forms-responses.module"; import { OrganizationAttributeOptionService } from "@/modules/organizations/services/attributes/organization-attributes-option.service"; import { OrganizationAttributesService } from "@/modules/organizations/services/attributes/organization-attributes.service"; import { InputOrganizationsEventTypesService } from "@/modules/organizations/services/event-types/input.service"; @@ -62,6 +63,7 @@ import { Module } from "@nestjs/common"; EventTypesModule_2024_06_14, TeamsEventTypesModule, TeamsModule, + OrganizationsRoutingFormsModule, ], providers: [ OrganizationsRepository, diff --git a/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts b/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts new file mode 100644 index 00000000000000..c62ac9ae97bfa8 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts @@ -0,0 +1,36 @@ +import { API_VERSIONS_VALUES } from "@/lib/api-versions"; +import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard"; +import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard"; +import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; +import { RoutingFormResponseDto } from "@/modules/organizations/routing-forms/outputs/routing-form-response.output"; +import { Controller, Get, Param, UseGuards } from "@nestjs/common"; +import { ApiOperation, ApiTags } from "@nestjs/swagger"; +import { plainToClass } from "class-transformer"; + +import { SUCCESS_STATUS } from "@calcom/platform-constants"; + +import { RoutingFormsResponsesService } from "../../../routing-forms-responses/routing-forms-responses.service"; +import { GetRoutingFormResponsesOutput } from "../outputs/get-routing-form-responses.output"; + +@Controller({ + path: "/v2/organizations/:orgId/forms/:formId/responses", + version: API_VERSIONS_VALUES, +}) +@ApiTags("Organizations Routing Forms") +@UseGuards(ApiAuthGuard, IsOrgGuard, IsAdminAPIEnabledGuard) +export class OrganizationsRoutingFormsResponsesController { + constructor(private readonly routingFormsResponsesService: RoutingFormsResponsesService) {} + + @Get() + @ApiOperation({ summary: "Get routing form responses" }) + async getRoutingFormResponses(@Param("formId") formId: string): Promise { + const responses = await this.routingFormsResponsesService.getRoutingFormResponses(formId); + + return { + status: SUCCESS_STATUS, + data: responses.map((response) => + plainToClass(RoutingFormResponseDto, response, { strategy: "excludeAll" }) + ), + }; + } +} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts b/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts new file mode 100644 index 00000000000000..c089e079c1db4d --- /dev/null +++ b/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts @@ -0,0 +1,10 @@ +import { RoutingFormsResponsesModule } from "@/modules/routing-forms-responses/routing-forms-responses.module"; +import { Module } from "@nestjs/common"; + +import { OrganizationsRoutingFormsResponsesController } from "./controllers/organizations-routing-forms-responses.controller"; + +@Module({ + imports: [RoutingFormsResponsesModule], + controllers: [OrganizationsRoutingFormsResponsesController], +}) +export class OrganizationsRoutingFormsModule {} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts b/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts new file mode 100644 index 00000000000000..3a0902dbc0254a --- /dev/null +++ b/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts @@ -0,0 +1,19 @@ +import { ApiProperty } from "@nestjs/swagger"; +import { Expose, Type } from "class-transformer"; +import { IsEnum } from "class-validator"; + +import { SUCCESS_STATUS } from "@calcom/platform-constants"; +import { ERROR_STATUS } from "@calcom/platform-constants"; + +import { RoutingFormResponseDto } from "./routing-form-response.output"; + +export class GetRoutingFormResponsesOutput { + @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] }) + @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) + status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS; + + @ApiProperty({ type: [RoutingFormResponseDto] }) + @Expose() + @Type(() => RoutingFormResponseDto) + data!: RoutingFormResponseDto[]; +} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts b/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts new file mode 100644 index 00000000000000..73c43782216c99 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts @@ -0,0 +1,35 @@ +import { ApiProperty } from "@nestjs/swagger"; +import { Expose, Type } from "class-transformer"; +import { IsDate, IsInt, IsString } from "class-validator"; + +export class RoutingFormResponseDto { + @ApiProperty() + @IsInt() + @Expose() + id!: string; + + @ApiProperty() + @IsInt() + @Expose() + formId!: string; + + @ApiProperty() + @IsString() + @Expose() + formFillerId!: string; + + @ApiProperty() + @Expose() + @IsString() + routedToBookingUid!: string; + + @ApiProperty() + @Expose() + @Type(() => Object) + response!: Record; + + @ApiProperty() + @Expose() + @IsDate() + createdAt!: Date; +} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts new file mode 100644 index 00000000000000..b1d60aecb583f1 --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts @@ -0,0 +1,11 @@ +import { PrismaModule } from "@/modules/prisma/prisma.module"; +import { RoutingFormsResponsesRepository } from "@/modules/routing-forms-responses/routing-forms-responses.repository"; +import { RoutingFormsResponsesService } from "@/modules/routing-forms-responses/routing-forms-responses.service"; +import { Module } from "@nestjs/common"; + +@Module({ + imports: [PrismaModule], + providers: [RoutingFormsResponsesService, RoutingFormsResponsesRepository], + exports: [RoutingFormsResponsesService, RoutingFormsResponsesRepository], +}) +export class RoutingFormsResponsesModule {} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts new file mode 100644 index 00000000000000..b079f43aa3fc77 --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts @@ -0,0 +1,18 @@ +import { PrismaReadService } from "@/modules/prisma/prisma-read.service"; +import { Injectable } from "@nestjs/common"; + +@Injectable() +export class RoutingFormsResponsesRepository { + constructor(private readonly dbRead: PrismaReadService) {} + + async getRoutingFormResponses(routingFormId: string) { + return this.dbRead.prisma.app_RoutingForms_FormResponse.findMany({ + where: { + formId: routingFormId, + }, + orderBy: { + createdAt: "desc", + }, + }); + } +} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts new file mode 100644 index 00000000000000..ab214d1dbc08c4 --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts @@ -0,0 +1,12 @@ +import { Injectable } from "@nestjs/common"; + +import { RoutingFormsResponsesRepository } from "./routing-forms-responses.repository"; + +@Injectable() +export class RoutingFormsResponsesService { + constructor(private readonly routingFormsRepository: RoutingFormsResponsesRepository) {} + + async getRoutingFormResponses(formId: string) { + return await this.routingFormsRepository.getRoutingFormResponses(formId); + } +} diff --git a/apps/api/v2/swagger/documentation.json b/apps/api/v2/swagger/documentation.json index cd53b6c371ac14..ecfb52da3aaad7 100644 --- a/apps/api/v2/swagger/documentation.json +++ b/apps/api/v2/swagger/documentation.json @@ -5030,6 +5030,37 @@ ] } }, + "/v2/organizations/{orgId}/forms/{formId}/responses": { + "get": { + "operationId": "OrganizationsRoutingFormsResponsesController_getRoutingFormResponses", + "summary": "Get routing form responses", + "parameters": [ + { + "name": "formId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRoutingFormResponsesOutput" + } + } + } + } + }, + "tags": [ + "Organizations Routing Forms" + ] + } + }, "/v2/schedules": { "post": { "operationId": "SchedulesController_2024_06_11_createSchedule", @@ -12698,8 +12729,7 @@ } }, "required": [ - "callId", - "agentId" + "callId" ] }, "CreatePhoneCallOutput": { @@ -14303,6 +14333,61 @@ "data" ] }, + "RoutingFormResponseDto": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "formId": { + "type": "string" + }, + "formFillerId": { + "type": "string" + }, + "routedToBookingUid": { + "type": "string" + }, + "response": { + "type": "object" + }, + "createdAt": { + "format": "date-time", + "type": "string" + } + }, + "required": [ + "id", + "formId", + "formFillerId", + "routedToBookingUid", + "response", + "createdAt" + ] + }, + "GetRoutingFormResponsesOutput": { + "type": "object", + "properties": { + "status": { + "type": "string", + "example": "success", + "enum": [ + "success", + "error" + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RoutingFormResponseDto" + } + } + }, + "required": [ + "status", + "data" + ] + }, "ProviderVerifyClientData": { "type": "object", "properties": { diff --git a/docs/api-reference/v2/openapi.json b/docs/api-reference/v2/openapi.json index 85ec2d01e8fabe..e6a39dcec5abf6 100644 --- a/docs/api-reference/v2/openapi.json +++ b/docs/api-reference/v2/openapi.json @@ -27,9 +27,7 @@ } } }, - "tags": [ - "Platform / Cal Provider" - ] + "tags": ["Platform / Cal Provider"] } }, "/v2/provider/{clientId}/access-token": { @@ -58,9 +56,7 @@ } } }, - "tags": [ - "Platform / Cal Provider" - ] + "tags": ["Platform / Cal Provider"] } }, "/v2/oauth-clients/{clientId}/users": { @@ -99,9 +95,7 @@ } } }, - "tags": [ - "Platform / Managed Users" - ] + "tags": ["Platform / Managed Users"] }, "post": { "operationId": "OAuthClientUsersController_createUser", @@ -138,9 +132,7 @@ } } }, - "tags": [ - "Platform / Managed Users" - ] + "tags": ["Platform / Managed Users"] } }, "/v2/oauth-clients/{clientId}/users/{userId}": { @@ -177,9 +169,7 @@ } } }, - "tags": [ - "Platform / Managed Users" - ] + "tags": ["Platform / Managed Users"] }, "patch": { "operationId": "OAuthClientUsersController_updateUser", @@ -224,9 +214,7 @@ } } }, - "tags": [ - "Platform / Managed Users" - ] + "tags": ["Platform / Managed Users"] }, "delete": { "operationId": "OAuthClientUsersController_deleteUser", @@ -261,9 +249,7 @@ } } }, - "tags": [ - "Platform / Managed Users" - ] + "tags": ["Platform / Managed Users"] } }, "/v2/oauth-clients/{clientId}/users/{userId}/force-refresh": { @@ -301,9 +287,7 @@ } } }, - "tags": [ - "Platform / Managed Users" - ] + "tags": ["Platform / Managed Users"] } }, "/v2/oauth/{clientId}/refresh": { @@ -352,9 +336,7 @@ } } }, - "tags": [ - "Platform / Managed Users" - ] + "tags": ["Platform / Managed Users"] } }, "/v2/oauth-clients/{clientId}/webhooks": { @@ -393,9 +375,7 @@ } } }, - "tags": [ - "Platform / Webhooks" - ] + "tags": ["Platform / Webhooks"] }, "get": { "operationId": "OAuthClientWebhooksController_getOAuthClientWebhooks", @@ -442,9 +422,7 @@ } } }, - "tags": [ - "Platform / Webhooks" - ] + "tags": ["Platform / Webhooks"] }, "delete": { "operationId": "OAuthClientWebhooksController_deleteAllOAuthClientWebhooks", @@ -471,9 +449,7 @@ } } }, - "tags": [ - "Platform / Webhooks" - ] + "tags": ["Platform / Webhooks"] } }, "/v2/oauth-clients/{clientId}/webhooks/{webhookId}": { @@ -512,9 +488,7 @@ } } }, - "tags": [ - "Platform / Webhooks" - ] + "tags": ["Platform / Webhooks"] }, "get": { "operationId": "OAuthClientWebhooksController_getOAuthClientWebhook", @@ -532,9 +506,7 @@ } } }, - "tags": [ - "Platform / Webhooks" - ] + "tags": ["Platform / Webhooks"] }, "delete": { "operationId": "OAuthClientWebhooksController_deleteOAuthClientWebhook", @@ -552,9 +524,7 @@ } } }, - "tags": [ - "Platform / Webhooks" - ] + "tags": ["Platform / Webhooks"] } }, "/v2/organizations/{orgId}/attributes": { @@ -603,9 +573,7 @@ } } }, - "tags": [ - "Orgs / Attributes" - ] + "tags": ["Orgs / Attributes"] }, "post": { "operationId": "OrganizationsAttributesController_createOrganizationAttribute", @@ -642,9 +610,7 @@ } } }, - "tags": [ - "Orgs / Attributes" - ] + "tags": ["Orgs / Attributes"] } }, "/v2/organizations/{orgId}/attributes/{attributeId}": { @@ -681,9 +647,7 @@ } } }, - "tags": [ - "Orgs / Attributes" - ] + "tags": ["Orgs / Attributes"] }, "patch": { "operationId": "OrganizationsAttributesController_updateOrganizationAttribute", @@ -728,9 +692,7 @@ } } }, - "tags": [ - "Orgs / Attributes" - ] + "tags": ["Orgs / Attributes"] }, "delete": { "operationId": "OrganizationsAttributesController_deleteOrganizationAttribute", @@ -765,9 +727,7 @@ } } }, - "tags": [ - "Orgs / Attributes" - ] + "tags": ["Orgs / Attributes"] } }, "/v2/organizations/{orgId}/attributes/{attributeId}/options": { @@ -814,9 +774,7 @@ } } }, - "tags": [ - "Orgs / Attributes / Options" - ] + "tags": ["Orgs / Attributes / Options"] }, "get": { "operationId": "OrganizationsOptionsAttributesController_getOrganizationAttributeOptions", @@ -851,9 +809,7 @@ } } }, - "tags": [ - "Orgs / Attributes / Options" - ] + "tags": ["Orgs / Attributes / Options"] } }, "/v2/organizations/{orgId}/attributes/{attributeId}/options/{optionId}": { @@ -898,9 +854,7 @@ } } }, - "tags": [ - "Orgs / Attributes / Options" - ] + "tags": ["Orgs / Attributes / Options"] }, "patch": { "operationId": "OrganizationsOptionsAttributesController_updateOrganizationAttributeOption", @@ -953,9 +907,7 @@ } } }, - "tags": [ - "Orgs / Attributes / Options" - ] + "tags": ["Orgs / Attributes / Options"] } }, "/v2/organizations/{orgId}/attributes/options/{userId}": { @@ -1002,9 +954,7 @@ } } }, - "tags": [ - "Orgs / Attributes / Options" - ] + "tags": ["Orgs / Attributes / Options"] }, "get": { "operationId": "OrganizationsOptionsAttributesController_getOrganizationAttributeOptionsForUser", @@ -1039,9 +989,7 @@ } } }, - "tags": [ - "Orgs / Attributes / Options" - ] + "tags": ["Orgs / Attributes / Options"] } }, "/v2/organizations/{orgId}/attributes/options/{userId}/{attributeOptionId}": { @@ -1086,9 +1034,7 @@ } } }, - "tags": [ - "Orgs / Attributes / Options" - ] + "tags": ["Orgs / Attributes / Options"] } }, "/v2/organizations/{orgId}/teams/{teamId}/event-types": { @@ -1135,9 +1081,7 @@ } } }, - "tags": [ - "Orgs / Event Types" - ] + "tags": ["Orgs / Event Types"] }, "get": { "operationId": "OrganizationsEventTypesController_getTeamEventTypes", @@ -1182,9 +1126,7 @@ } } }, - "tags": [ - "Orgs / Event Types" - ] + "tags": ["Orgs / Event Types"] } }, "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}": { @@ -1221,9 +1163,7 @@ } } }, - "tags": [ - "Orgs / Event Types" - ] + "tags": ["Orgs / Event Types"] }, "patch": { "operationId": "OrganizationsEventTypesController_updateTeamEventType", @@ -1268,9 +1208,7 @@ } } }, - "tags": [ - "Orgs / Event Types" - ] + "tags": ["Orgs / Event Types"] }, "delete": { "operationId": "OrganizationsEventTypesController_deleteTeamEventType", @@ -1305,9 +1243,7 @@ } } }, - "tags": [ - "Orgs / Event Types" - ] + "tags": ["Orgs / Event Types"] } }, "/v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": { @@ -1354,9 +1290,7 @@ } } }, - "tags": [ - "Orgs / Event Types" - ] + "tags": ["Orgs / Event Types"] } }, "/v2/organizations/{orgId}/teams/event-types": { @@ -1405,9 +1339,7 @@ } } }, - "tags": [ - "Orgs / Event Types" - ] + "tags": ["Orgs / Event Types"] } }, "/v2/organizations/{orgId}/memberships": { @@ -1456,9 +1388,7 @@ } } }, - "tags": [ - "Orgs / Memberships" - ] + "tags": ["Orgs / Memberships"] }, "post": { "operationId": "OrganizationsMembershipsController_createMembership", @@ -1495,9 +1425,7 @@ } } }, - "tags": [ - "Orgs / Memberships" - ] + "tags": ["Orgs / Memberships"] } }, "/v2/organizations/{orgId}/memberships/{membershipId}": { @@ -1534,9 +1462,7 @@ } } }, - "tags": [ - "Orgs / Memberships" - ] + "tags": ["Orgs / Memberships"] }, "delete": { "operationId": "OrganizationsMembershipsController_deleteMembership", @@ -1571,9 +1497,7 @@ } } }, - "tags": [ - "Orgs / Memberships" - ] + "tags": ["Orgs / Memberships"] }, "patch": { "operationId": "OrganizationsMembershipsController_updateMembership", @@ -1618,9 +1542,7 @@ } } }, - "tags": [ - "Orgs / Memberships" - ] + "tags": ["Orgs / Memberships"] } }, "/v2/organizations/{orgId}/schedules": { @@ -1669,9 +1591,7 @@ } } }, - "tags": [ - "Orgs / Schedules" - ] + "tags": ["Orgs / Schedules"] } }, "/v2/organizations/{orgId}/users/{userId}/schedules": { @@ -1710,10 +1630,7 @@ } } }, - "tags": [ - "Orgs / Schedules", - "Orgs / Users / Schedules" - ] + "tags": ["Orgs / Schedules", "Orgs / Users / Schedules"] }, "get": { "operationId": "OrganizationsSchedulesController_getUserSchedules", @@ -1740,10 +1657,7 @@ } } }, - "tags": [ - "Orgs / Schedules", - "Orgs / Users / Schedules" - ] + "tags": ["Orgs / Schedules", "Orgs / Users / Schedules"] } }, "/v2/organizations/{orgId}/users/{userId}/schedules/{scheduleId}": { @@ -1780,10 +1694,7 @@ } } }, - "tags": [ - "Orgs / Schedules", - "Orgs / Users / Schedules" - ] + "tags": ["Orgs / Schedules", "Orgs / Users / Schedules"] }, "patch": { "operationId": "OrganizationsSchedulesController_updateUserSchedule", @@ -1828,10 +1739,7 @@ } } }, - "tags": [ - "Orgs / Schedules", - "Orgs / Users / Schedules" - ] + "tags": ["Orgs / Schedules", "Orgs / Users / Schedules"] }, "delete": { "operationId": "OrganizationsSchedulesController_deleteUserSchedule", @@ -1866,10 +1774,7 @@ } } }, - "tags": [ - "Orgs / Schedules", - "Orgs / Users / Schedules" - ] + "tags": ["Orgs / Schedules", "Orgs / Users / Schedules"] } }, "/v2/organizations/{orgId}/teams": { @@ -1918,10 +1823,7 @@ } } }, - "tags": [ - "Orgs / Teams", - "Teams" - ] + "tags": ["Orgs / Teams", "Teams"] }, "post": { "operationId": "OrganizationsTeamsController_createTeam", @@ -1966,9 +1868,7 @@ } } }, - "tags": [ - "Orgs / Teams" - ] + "tags": ["Orgs / Teams"] } }, "/v2/organizations/{orgId}/teams/me": { @@ -2017,9 +1917,7 @@ } } }, - "tags": [ - "Orgs / Teams" - ] + "tags": ["Orgs / Teams"] } }, "/v2/organizations/{orgId}/teams/{teamId}": { @@ -2039,9 +1937,7 @@ } } }, - "tags": [ - "Orgs / Teams" - ] + "tags": ["Orgs / Teams"] }, "delete": { "operationId": "OrganizationsTeamsController_deleteTeam", @@ -2076,9 +1972,7 @@ } } }, - "tags": [ - "Orgs / Teams" - ] + "tags": ["Orgs / Teams"] }, "patch": { "operationId": "OrganizationsTeamsController_updateTeam", @@ -2123,9 +2017,7 @@ } } }, - "tags": [ - "Orgs / Teams" - ] + "tags": ["Orgs / Teams"] } }, "/v2/organizations/{orgId}/teams/{teamId}/bookings": { @@ -2143,13 +2035,7 @@ "type": "array", "items": { "type": "string", - "enum": [ - "upcoming", - "recurring", - "past", - "cancelled", - "unconfirmed" - ] + "enum": ["upcoming", "recurring", "past", "cancelled", "unconfirmed"] } } }, @@ -2220,10 +2106,7 @@ "description": "Sort results by their start time in ascending or descending order.", "example": "?sortStart=asc OR ?sortStart=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -2234,10 +2117,7 @@ "description": "Sort results by their end time in ascending or descending order.", "example": "?sortEnd=asc OR ?sortEnd=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -2248,10 +2128,7 @@ "description": "Sort results by their creation time (when booking was made) in ascending or descending order.", "example": "?sortCreated=asc OR ?sortCreated=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -2299,9 +2176,7 @@ } } }, - "tags": [ - "Orgs / Teams / Bookings" - ] + "tags": ["Orgs / Teams / Bookings"] } }, "/v2/organizations/{orgId}/teams/{teamId}/memberships": { @@ -2358,9 +2233,7 @@ } } }, - "tags": [ - "Orgs / Teams / Memberships" - ] + "tags": ["Orgs / Teams / Memberships"] }, "post": { "operationId": "OrganizationsTeamsMembershipsController_createOrgTeamMembership", @@ -2405,9 +2278,7 @@ } } }, - "tags": [ - "Orgs / Teams / Memberships" - ] + "tags": ["Orgs / Teams / Memberships"] } }, "/v2/organizations/{orgId}/teams/{teamId}/memberships/{membershipId}": { @@ -2452,9 +2323,7 @@ } } }, - "tags": [ - "Orgs / Teams / Memberships" - ] + "tags": ["Orgs / Teams / Memberships"] }, "delete": { "operationId": "OrganizationsTeamsMembershipsController_deleteOrgTeamMembership", @@ -2497,9 +2366,7 @@ } } }, - "tags": [ - "Orgs / Teams / Memberships" - ] + "tags": ["Orgs / Teams / Memberships"] }, "patch": { "operationId": "OrganizationsTeamsMembershipsController_updateOrgTeamMembership", @@ -2552,9 +2419,7 @@ } } }, - "tags": [ - "Orgs / Teams / Memberships" - ] + "tags": ["Orgs / Teams / Memberships"] } }, "/v2/organizations/{orgId}/teams/{teamId}/users/{userId}/schedules": { @@ -2583,10 +2448,7 @@ } } }, - "tags": [ - "Orgs / Teams / Schedules", - "Orgs / Teams / Users / Schedules" - ] + "tags": ["Orgs / Teams / Schedules", "Orgs / Teams / Users / Schedules"] } }, "/v2/organizations/{orgId}/users": { @@ -2650,9 +2512,7 @@ } } }, - "tags": [ - "Orgs / Users" - ] + "tags": ["Orgs / Users"] }, "post": { "operationId": "OrganizationsUsersController_createOrganizationUser", @@ -2689,9 +2549,7 @@ } } }, - "tags": [ - "Orgs / Users" - ] + "tags": ["Orgs / Users"] } }, "/v2/organizations/{orgId}/users/{userId}": { @@ -2738,9 +2596,7 @@ } } }, - "tags": [ - "Orgs / Users" - ] + "tags": ["Orgs / Users"] }, "delete": { "operationId": "OrganizationsUsersController_deleteOrganizationUser", @@ -2775,9 +2631,7 @@ } } }, - "tags": [ - "Orgs / Users" - ] + "tags": ["Orgs / Users"] } }, "/v2/organizations/{orgId}/users/{userId}/ooo": { @@ -2820,10 +2674,7 @@ "description": "Sort results by their start time in ascending or descending order.", "example": "?sortStart=asc OR ?sortStart=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -2834,10 +2685,7 @@ "description": "Sort results by their end time in ascending or descending order.", "example": "?sortEnd=asc OR ?sortEnd=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } } @@ -2847,9 +2695,7 @@ "description": "" } }, - "tags": [ - "Orgs / Users / OOO" - ] + "tags": ["Orgs / Users / OOO"] }, "post": { "operationId": "OrganizationsUsersOOOController_createOrganizationUserOOO", @@ -2879,9 +2725,7 @@ "description": "" } }, - "tags": [ - "Orgs / Users / OOO" - ] + "tags": ["Orgs / Users / OOO"] } }, "/v2/organizations/{orgId}/users/{userId}/ooo/{oooId}": { @@ -2921,9 +2765,7 @@ "description": "" } }, - "tags": [ - "Orgs / Users / OOO" - ] + "tags": ["Orgs / Users / OOO"] }, "delete": { "operationId": "OrganizationsUsersOOOController_deleteOrganizationUserOOO", @@ -2943,9 +2785,7 @@ "description": "" } }, - "tags": [ - "Orgs / Users / OOO" - ] + "tags": ["Orgs / Users / OOO"] } }, "/v2/organizations/{orgId}/ooo": { @@ -2988,10 +2828,7 @@ "description": "Sort results by their start time in ascending or descending order.", "example": "?sortStart=asc OR ?sortStart=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -3002,10 +2839,7 @@ "description": "Sort results by their end time in ascending or descending order.", "example": "?sortEnd=asc OR ?sortEnd=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -3025,9 +2859,7 @@ "description": "" } }, - "tags": [ - "Orgs / Users / OOO" - ] + "tags": ["Orgs / Users / OOO"] } }, "/v2/organizations/{orgId}/webhooks": { @@ -3076,9 +2908,7 @@ } } }, - "tags": [ - "Orgs / Webhooks" - ] + "tags": ["Orgs / Webhooks"] }, "post": { "operationId": "OrganizationsWebhooksController_createOrganizationWebhook", @@ -3115,9 +2945,7 @@ } } }, - "tags": [ - "Orgs / Webhooks" - ] + "tags": ["Orgs / Webhooks"] } }, "/v2/organizations/{orgId}/webhooks/{webhookId}": { @@ -3146,9 +2974,7 @@ } } }, - "tags": [ - "Orgs / Webhooks" - ] + "tags": ["Orgs / Webhooks"] }, "delete": { "operationId": "OrganizationsWebhooksController_deleteWebhook", @@ -3175,9 +3001,7 @@ } } }, - "tags": [ - "Orgs / Webhooks" - ] + "tags": ["Orgs / Webhooks"] }, "patch": { "operationId": "OrganizationsWebhooksController_updateOrgWebhook", @@ -3214,9 +3038,7 @@ } } }, - "tags": [ - "Orgs / Webhooks" - ] + "tags": ["Orgs / Webhooks"] } }, "/v2/bookings": { @@ -3268,9 +3090,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] }, "get": { "operationId": "BookingsController_2024_08_13_getBookings", @@ -3295,13 +3115,7 @@ "type": "array", "items": { "type": "string", - "enum": [ - "upcoming", - "recurring", - "past", - "cancelled", - "unconfirmed" - ] + "enum": ["upcoming", "recurring", "past", "cancelled", "unconfirmed"] } } }, @@ -3412,10 +3226,7 @@ "description": "Sort results by their start time in ascending or descending order.", "example": "?sortStart=asc OR ?sortStart=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -3426,10 +3237,7 @@ "description": "Sort results by their end time in ascending or descending order.", "example": "?sortEnd=asc OR ?sortEnd=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -3440,10 +3248,7 @@ "description": "Sort results by their creation time (when booking was made) in ascending or descending order.", "example": "?sortCreated=asc OR ?sortCreated=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -3454,10 +3259,7 @@ "description": "Sort results by their updated time (for example when booking status changes) in ascending or descending order.", "example": "?sortUpdated=asc OR ?sortUpdated=desc", "schema": { - "enum": [ - "asc", - "desc" - ], + "enum": ["asc", "desc"], "type": "string" } }, @@ -3503,9 +3305,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/bookings/{bookingUid}": { @@ -3544,9 +3344,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/bookings/{bookingUid}/reschedule": { @@ -3585,9 +3383,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/bookings/{bookingUid}/cancel": { @@ -3626,9 +3422,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/bookings/{bookingUid}/mark-absent": { @@ -3685,9 +3479,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/bookings/{bookingUid}/reassign": { @@ -3734,9 +3526,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/bookings/{bookingUid}/reassign/{userId}": { @@ -3801,9 +3591,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/bookings/{bookingUid}/confirm": { @@ -3850,9 +3638,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/bookings/{bookingUid}/decline": { @@ -3909,9 +3695,7 @@ } } }, - "tags": [ - "Bookings" - ] + "tags": ["Bookings"] } }, "/v2/calendars/ics-feed/save": { @@ -3941,9 +3725,7 @@ } } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/calendars/ics-feed/check": { @@ -3963,9 +3745,7 @@ } } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/calendars/busy-times": { @@ -4033,9 +3813,7 @@ } } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/calendars": { @@ -4055,9 +3833,7 @@ } } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/calendars/{calendar}/connect": { @@ -4094,9 +3870,7 @@ } } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/calendars/{calendar}/save": { @@ -4134,9 +3908,7 @@ "description": "" } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/calendars/{calendar}/credentials": { @@ -4158,9 +3930,7 @@ "description": "" } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/calendars/{calendar}/check": { @@ -4189,9 +3959,7 @@ } } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/calendars/{calendar}/disconnect": { @@ -4230,9 +3998,7 @@ } } }, - "tags": [ - "Calendars" - ] + "tags": ["Calendars"] } }, "/v2/conferencing/{app}/connect": { @@ -4261,9 +4027,7 @@ } } }, - "tags": [ - "Conferencing" - ] + "tags": ["Conferencing"] } }, "/v2/conferencing/{app}/oauth/auth-url": { @@ -4316,9 +4080,7 @@ } } }, - "tags": [ - "Conferencing" - ] + "tags": ["Conferencing"] } }, "/v2/conferencing/{app}/oauth/callback": { @@ -4356,9 +4118,7 @@ "description": "" } }, - "tags": [ - "Conferencing" - ] + "tags": ["Conferencing"] } }, "/v2/conferencing": { @@ -4378,9 +4138,7 @@ } } }, - "tags": [ - "Conferencing" - ] + "tags": ["Conferencing"] } }, "/v2/conferencing/{app}/default": { @@ -4409,9 +4167,7 @@ } } }, - "tags": [ - "Conferencing" - ] + "tags": ["Conferencing"] } }, "/v2/conferencing/default": { @@ -4431,9 +4187,7 @@ } } }, - "tags": [ - "Conferencing" - ] + "tags": ["Conferencing"] } }, "/v2/conferencing/{app}/disconnect": { @@ -4462,9 +4216,7 @@ } } }, - "tags": [ - "Conferencing" - ] + "tags": ["Conferencing"] } }, "/v2/destination-calendars": { @@ -4494,9 +4246,7 @@ } } }, - "tags": [ - "Destination Calendars" - ] + "tags": ["Destination Calendars"] } }, "/v2/event-types": { @@ -4545,9 +4295,7 @@ } } }, - "tags": [ - "Event Types" - ] + "tags": ["Event Types"] }, "get": { "operationId": "EventTypesController_2024_06_14_getEventTypes", @@ -4620,9 +4368,7 @@ } } }, - "tags": [ - "Event Types" - ] + "tags": ["Event Types"] } }, "/v2/event-types/{eventTypeId}": { @@ -4669,9 +4415,7 @@ } } }, - "tags": [ - "Event Types" - ] + "tags": ["Event Types"] }, "patch": { "operationId": "EventTypesController_2024_06_14_updateEventType", @@ -4726,9 +4470,7 @@ } } }, - "tags": [ - "Event Types" - ] + "tags": ["Event Types"] }, "delete": { "operationId": "EventTypesController_2024_06_14_deleteEventType", @@ -4773,9 +4515,7 @@ } } }, - "tags": [ - "Event Types" - ] + "tags": ["Event Types"] } }, "/v2/event-types/{eventTypeId}/webhooks": { @@ -4814,9 +4554,7 @@ } } }, - "tags": [ - "Event Types / Webhooks" - ] + "tags": ["Event Types / Webhooks"] }, "get": { "operationId": "EventTypeWebhooksController_getEventTypeWebhooks", @@ -4863,9 +4601,7 @@ } } }, - "tags": [ - "Event Types / Webhooks" - ] + "tags": ["Event Types / Webhooks"] }, "delete": { "operationId": "EventTypeWebhooksController_deleteAllEventTypeWebhooks", @@ -4892,9 +4628,7 @@ } } }, - "tags": [ - "Event Types / Webhooks" - ] + "tags": ["Event Types / Webhooks"] } }, "/v2/event-types/{eventTypeId}/webhooks/{webhookId}": { @@ -4933,9 +4667,7 @@ } } }, - "tags": [ - "Event Types / Webhooks" - ] + "tags": ["Event Types / Webhooks"] }, "get": { "operationId": "EventTypeWebhooksController_getEventTypeWebhook", @@ -4953,9 +4685,7 @@ } } }, - "tags": [ - "Event Types / Webhooks" - ] + "tags": ["Event Types / Webhooks"] }, "delete": { "operationId": "EventTypeWebhooksController_deleteEventTypeWebhook", @@ -4973,9 +4703,7 @@ } } }, - "tags": [ - "Event Types / Webhooks" - ] + "tags": ["Event Types / Webhooks"] } }, "/v2/me": { @@ -4995,9 +4723,7 @@ } } }, - "tags": [ - "Me" - ] + "tags": ["Me"] }, "patch": { "operationId": "MeController_updateMe", @@ -5025,9 +4751,36 @@ } } }, - "tags": [ - "Me" - ] + "tags": ["Me"] + } + }, + "/v2/organizations/{orgId}/forms/{formId}/responses": { + "get": { + "operationId": "OrganizationsRoutingFormsResponsesController_getRoutingFormResponses", + "summary": "Get routing form responses", + "parameters": [ + { + "name": "formId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRoutingFormResponsesOutput" + } + } + } + } + }, + "tags": ["Organizations Routing Forms"] } }, "/v2/schedules": { @@ -5077,9 +4830,7 @@ } } }, - "tags": [ - "Schedules" - ] + "tags": ["Schedules"] }, "get": { "operationId": "SchedulesController_2024_06_11_getSchedules", @@ -5117,9 +4868,7 @@ } } }, - "tags": [ - "Schedules" - ] + "tags": ["Schedules"] } }, "/v2/schedules/default": { @@ -5159,9 +4908,7 @@ } } }, - "tags": [ - "Schedules" - ] + "tags": ["Schedules"] } }, "/v2/schedules/{scheduleId}": { @@ -5208,9 +4955,7 @@ } } }, - "tags": [ - "Schedules" - ] + "tags": ["Schedules"] }, "patch": { "operationId": "SchedulesController_2024_06_11_updateSchedule", @@ -5265,9 +5010,7 @@ } } }, - "tags": [ - "Schedules" - ] + "tags": ["Schedules"] }, "delete": { "operationId": "SchedulesController_2024_06_11_deleteSchedule", @@ -5312,9 +5055,7 @@ } } }, - "tags": [ - "Schedules" - ] + "tags": ["Schedules"] } }, "/v2/selected-calendars": { @@ -5344,9 +5085,7 @@ } } }, - "tags": [ - "Selected Calendars" - ] + "tags": ["Selected Calendars"] }, "delete": { "operationId": "SelectedCalendarsController_removeSelectedCalendar", @@ -5389,9 +5128,7 @@ } } }, - "tags": [ - "Selected Calendars" - ] + "tags": ["Selected Calendars"] } }, "/v2/slots": { @@ -5569,9 +5306,7 @@ } } }, - "tags": [ - "Slots" - ] + "tags": ["Slots"] } }, "/v2/slots/reservations": { @@ -5612,9 +5347,7 @@ } } }, - "tags": [ - "Slots" - ] + "tags": ["Slots"] } }, "/v2/slots/reservations/{uid}": { @@ -5652,9 +5385,7 @@ } } }, - "tags": [ - "Slots" - ] + "tags": ["Slots"] }, "patch": { "operationId": "SlotsController_2024_09_04_updateReservedSlot", @@ -5700,9 +5431,7 @@ } } }, - "tags": [ - "Slots" - ] + "tags": ["Slots"] }, "delete": { "operationId": "SlotsController_2024_09_04_deleteReservedSlot", @@ -5740,9 +5469,7 @@ } } }, - "tags": [ - "Slots" - ] + "tags": ["Slots"] } }, "/v2/stripe/connect": { @@ -5771,9 +5498,7 @@ } } }, - "tags": [ - "Stripe" - ] + "tags": ["Stripe"] } }, "/v2/stripe/save": { @@ -5810,9 +5535,7 @@ } } }, - "tags": [ - "Stripe" - ] + "tags": ["Stripe"] } }, "/v2/stripe/check": { @@ -5832,9 +5555,7 @@ } } }, - "tags": [ - "Stripe" - ] + "tags": ["Stripe"] } }, "/v2/stripe/check/{teamId}": { @@ -5863,9 +5584,7 @@ } } }, - "tags": [ - "Stripe" - ] + "tags": ["Stripe"] } }, "/v2/teams": { @@ -5895,9 +5614,7 @@ } } }, - "tags": [ - "Teams" - ] + "tags": ["Teams"] }, "get": { "operationId": "TeamsController_getTeams", @@ -5915,9 +5632,7 @@ } } }, - "tags": [ - "Teams" - ] + "tags": ["Teams"] } }, "/v2/teams/{teamId}": { @@ -5946,9 +5661,7 @@ } } }, - "tags": [ - "Teams" - ] + "tags": ["Teams"] }, "patch": { "operationId": "TeamsController_updateTeam", @@ -5985,9 +5698,7 @@ } } }, - "tags": [ - "Teams" - ] + "tags": ["Teams"] }, "delete": { "operationId": "TeamsController_deleteTeam", @@ -6014,9 +5725,7 @@ } } }, - "tags": [ - "Teams" - ] + "tags": ["Teams"] } }, "/v2/teams/{teamId}/event-types": { @@ -6055,9 +5764,7 @@ } } }, - "tags": [ - "Teams / Event Types" - ] + "tags": ["Teams / Event Types"] }, "get": { "operationId": "TeamsEventTypesController_getTeamEventTypes", @@ -6102,9 +5809,7 @@ } } }, - "tags": [ - "Teams / Event Types" - ] + "tags": ["Teams / Event Types"] } }, "/v2/teams/{teamId}/event-types/{eventTypeId}": { @@ -6141,9 +5846,7 @@ } } }, - "tags": [ - "Teams / Event Types" - ] + "tags": ["Teams / Event Types"] }, "patch": { "operationId": "TeamsEventTypesController_updateTeamEventType", @@ -6188,9 +5891,7 @@ } } }, - "tags": [ - "Teams / Event Types" - ] + "tags": ["Teams / Event Types"] }, "delete": { "operationId": "TeamsEventTypesController_deleteTeamEventType", @@ -6225,9 +5926,7 @@ } } }, - "tags": [ - "Teams / Event Types" - ] + "tags": ["Teams / Event Types"] } }, "/v2/teams/{teamId}/event-types/{eventTypeId}/create-phone-call": { @@ -6274,9 +5973,7 @@ } } }, - "tags": [ - "Teams / Event Types" - ] + "tags": ["Teams / Event Types"] } }, "/v2/teams/{teamId}/memberships": { @@ -6315,9 +6012,7 @@ } } }, - "tags": [ - "Teams / Memberships" - ] + "tags": ["Teams / Memberships"] }, "get": { "operationId": "TeamsMembershipsController_getTeamMemberships", @@ -6364,9 +6059,7 @@ } } }, - "tags": [ - "Teams / Memberships" - ] + "tags": ["Teams / Memberships"] } }, "/v2/teams/{teamId}/memberships/{membershipId}": { @@ -6403,9 +6096,7 @@ } } }, - "tags": [ - "Teams / Memberships" - ] + "tags": ["Teams / Memberships"] }, "patch": { "operationId": "TeamsMembershipsController_updateTeamMembership", @@ -6450,9 +6141,7 @@ } } }, - "tags": [ - "Teams / Memberships" - ] + "tags": ["Teams / Memberships"] }, "delete": { "operationId": "TeamsMembershipsController_deleteTeamMembership", @@ -6487,9 +6176,7 @@ } } }, - "tags": [ - "Teams / Memberships" - ] + "tags": ["Teams / Memberships"] } }, "/v2/timezones": { @@ -6509,9 +6196,7 @@ } } }, - "tags": [ - "Timezones" - ] + "tags": ["Timezones"] } }, "/v2/webhooks": { @@ -6541,9 +6226,7 @@ } } }, - "tags": [ - "Webhooks" - ] + "tags": ["Webhooks"] }, "get": { "operationId": "WebhooksController_getWebhooks", @@ -6583,9 +6266,7 @@ } } }, - "tags": [ - "Webhooks" - ] + "tags": ["Webhooks"] } }, "/v2/webhooks/{webhookId}": { @@ -6624,9 +6305,7 @@ } } }, - "tags": [ - "Webhooks" - ] + "tags": ["Webhooks"] }, "get": { "operationId": "WebhooksController_getWebhook", @@ -6644,9 +6323,7 @@ } } }, - "tags": [ - "Webhooks" - ] + "tags": ["Webhooks"] }, "delete": { "operationId": "WebhooksController_deleteWebhook", @@ -6673,9 +6350,7 @@ } } }, - "tags": [ - "Webhooks" - ] + "tags": ["Webhooks"] } } }, @@ -6805,10 +6480,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -6817,10 +6489,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateManagedUserInput": { "type": "object", @@ -6836,25 +6505,14 @@ }, "timeFormat": { "type": "number", - "enum": [ - 12, - 24 - ], + "enum": [12, 24], "example": 12, "description": "Must be a number 12 or 24" }, "weekStart": { "type": "string", "example": "Monday", - "enum": [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday" - ] + "enum": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] }, "timeZone": { "type": "string", @@ -6915,10 +6573,7 @@ "description": "URL of the user's avatar image" } }, - "required": [ - "email", - "name" - ] + "required": ["email", "name"] }, "CreateManagedUserData": { "type": "object", @@ -6936,12 +6591,7 @@ "type": "number" } }, - "required": [ - "user", - "accessToken", - "refreshToken", - "accessTokenExpiresAt" - ] + "required": ["user", "accessToken", "refreshToken", "accessTokenExpiresAt"] }, "CreateManagedUserOutput": { "type": "object", @@ -6949,10 +6599,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/CreateManagedUserData" @@ -6961,10 +6608,7 @@ "type": "object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetManagedUserOutput": { "type": "object", @@ -6972,19 +6616,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/ManagedUserOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateManagedUserInput": { "type": "object", @@ -6997,10 +6635,7 @@ }, "timeFormat": { "type": "number", - "enum": [ - 12, - 24 - ], + "enum": [12, 24], "example": 12, "description": "Must be 12 or 24" }, @@ -7009,15 +6644,7 @@ }, "weekStart": { "type": "string", - "enum": [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday" - ], + "enum": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], "example": "Monday" }, "timeZone": { @@ -7093,11 +6720,7 @@ "type": "number" } }, - "required": [ - "accessToken", - "refreshToken", - "accessTokenExpiresAt" - ] + "required": ["accessToken", "refreshToken", "accessTokenExpiresAt"] }, "KeysResponseDto": { "type": "object", @@ -7105,19 +6728,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/KeysDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateOAuthClientInput": { "type": "object", @@ -7150,11 +6767,7 @@ "type": "boolean" } }, - "required": [ - "name", - "redirectUris", - "permissions" - ] + "required": ["name", "redirectUris", "permissions"] }, "DataDto": { "type": "object", @@ -7168,20 +6781,14 @@ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoib2F1dGgtY2xpZW50Iiwi" } }, - "required": [ - "clientId", - "clientSecret" - ] + "required": ["clientId", "clientSecret"] }, "CreateOAuthClientResponseDto": { "type": "object", "properties": { "status": { "type": "string", - "enum": [ - "success", - "error" - ], + "enum": ["success", "error"], "example": "success" }, "data": { @@ -7196,10 +6803,7 @@ ] } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "PlatformOAuthClientDto": { "type": "object", @@ -7226,9 +6830,7 @@ "example": "https://example.com/logo.png" }, "redirectUris": { - "example": [ - "https://example.com/callback" - ], + "example": ["https://example.com/callback"], "type": "array", "items": { "type": "string" @@ -7244,15 +6846,7 @@ "example": "2024-03-23T08:33:21.851Z" } }, - "required": [ - "id", - "name", - "secret", - "permissions", - "redirectUris", - "organizationId", - "createdAt" - ] + "required": ["id", "name", "secret", "permissions", "redirectUris", "organizationId", "createdAt"] }, "GetOAuthClientsResponseDto": { "type": "object", @@ -7260,10 +6854,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -7272,10 +6863,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetOAuthClientResponseDto": { "type": "object", @@ -7283,19 +6871,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/PlatformOAuthClientDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateOAuthClientInput": { "type": "object", @@ -7334,9 +6916,7 @@ "description": "Managed user's refresh token." } }, - "required": [ - "refreshToken" - ] + "required": ["refreshToken"] }, "InputAddressLocation_2024_06_14": { "type": "object", @@ -7354,11 +6934,7 @@ "type": "boolean" } }, - "required": [ - "type", - "address", - "public" - ] + "required": ["type", "address", "public"] }, "InputLinkLocation_2024_06_14": { "type": "object", @@ -7376,11 +6952,7 @@ "type": "boolean" } }, - "required": [ - "type", - "link", - "public" - ] + "required": ["type", "link", "public"] }, "InputIntegrationLocation_2024_06_14": { "type": "object", @@ -7393,16 +6965,10 @@ "integration": { "type": "string", "example": "cal-video", - "enum": [ - "cal-video", - "google-meet" - ] + "enum": ["cal-video", "google-meet"] } }, - "required": [ - "type", - "integration" - ] + "required": ["type", "integration"] }, "InputPhoneLocation_2024_06_14": { "type": "object", @@ -7420,11 +6986,7 @@ "type": "boolean" } }, - "required": [ - "type", - "phone", - "public" - ] + "required": ["type", "phone", "public"] }, "PhoneFieldInput_2024_06_14": { "type": "object", @@ -7457,14 +7019,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "placeholder", - "hidden" - ] + "required": ["type", "slug", "label", "required", "placeholder", "hidden"] }, "AddressFieldInput_2024_06_14": { "type": "object", @@ -7499,14 +7054,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "placeholder", - "hidden" - ] + "required": ["type", "slug", "label", "required", "placeholder", "hidden"] }, "TextFieldInput_2024_06_14": { "type": "object", @@ -7541,14 +7089,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "placeholder", - "hidden" - ] + "required": ["type", "slug", "label", "required", "placeholder", "hidden"] }, "NumberFieldInput_2024_06_14": { "type": "object", @@ -7583,14 +7124,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "placeholder", - "hidden" - ] + "required": ["type", "slug", "label", "required", "placeholder", "hidden"] }, "TextAreaFieldInput_2024_06_14": { "type": "object", @@ -7625,14 +7159,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "placeholder", - "hidden" - ] + "required": ["type", "slug", "label", "required", "placeholder", "hidden"] }, "SelectFieldInput_2024_06_14": { "type": "object", @@ -7659,10 +7186,7 @@ "example": "Select..." }, "options": { - "example": [ - "Option 1", - "Option 2" - ], + "example": ["Option 1", "Option 2"], "type": "array", "items": { "type": "string" @@ -7677,15 +7201,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "placeholder", - "options", - "hidden" - ] + "required": ["type", "slug", "label", "required", "placeholder", "options", "hidden"] }, "MultiSelectFieldInput_2024_06_14": { "type": "object", @@ -7708,10 +7224,7 @@ "type": "boolean" }, "options": { - "example": [ - "Option 1", - "Option 2" - ], + "example": ["Option 1", "Option 2"], "type": "array", "items": { "type": "string" @@ -7726,14 +7239,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "options", - "hidden" - ] + "required": ["type", "slug", "label", "required", "options", "hidden"] }, "MultiEmailFieldInput_2024_06_14": { "type": "object", @@ -7768,14 +7274,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "placeholder", - "hidden" - ] + "required": ["type", "slug", "label", "required", "placeholder", "hidden"] }, "CheckboxGroupFieldInput_2024_06_14": { "type": "object", @@ -7798,10 +7297,7 @@ "type": "boolean" }, "options": { - "example": [ - "Checkbox 1", - "Checkbox 2" - ], + "example": ["Checkbox 1", "Checkbox 2"], "type": "array", "items": { "type": "string" @@ -7816,14 +7312,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "options", - "hidden" - ] + "required": ["type", "slug", "label", "required", "options", "hidden"] }, "RadioGroupFieldInput_2024_06_14": { "type": "object", @@ -7846,10 +7335,7 @@ "type": "boolean" }, "options": { - "example": [ - "Radio 1", - "Radio 2" - ], + "example": ["Radio 1", "Radio 2"], "type": "array", "items": { "type": "string" @@ -7864,14 +7350,7 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "options", - "hidden" - ] + "required": ["type", "slug", "label", "required", "options", "hidden"] }, "BooleanFieldInput_2024_06_14": { "type": "object", @@ -7901,24 +7380,14 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "type", - "slug", - "label", - "required", - "hidden" - ] + "required": ["type", "slug", "label", "required", "hidden"] }, "BusinessDaysWindow_2024_06_14": { "type": "object", "properties": { "type": { "type": "string", - "enum": [ - "businessDays", - "calendarDays", - "range" - ], + "enum": ["businessDays", "calendarDays", "range"], "description": "Whether the window should be business days, calendar days or a range of dates" }, "value": { @@ -7932,21 +7401,14 @@ "description": "\n Determines the behavior of the booking window:\n - If **true**, the window is rolling. This means the number of available days will always be equal the specified 'value' \n and adjust dynamically as bookings are made. For example, if 'value' is 3 and availability is only on Mondays, \n a booker attempting to schedule on November 10 will see slots on November 11, 18, and 25. As one of these days \n becomes fully booked, a new day (e.g., December 2) will open up to ensure 3 available days are always visible.\n - If **false**, the window is fixed. This means the booking window only considers the next 'value' days from the\n moment someone is trying to book. For example, if 'value' is 3, availability is only on Mondays, and the current \n date is November 10, the booker will only see slots on November 11 because the window is restricted to the next \n 3 calendar days (November 10–12).\n " } }, - "required": [ - "type", - "value" - ] + "required": ["type", "value"] }, "CalendarDaysWindow_2024_06_14": { "type": "object", "properties": { "type": { "type": "string", - "enum": [ - "businessDays", - "calendarDays", - "range" - ], + "enum": ["businessDays", "calendarDays", "range"], "description": "Whether the window should be business days, calendar days or a range of dates" }, "value": { @@ -7960,28 +7422,18 @@ "description": "\n Determines the behavior of the booking window:\n - If **true**, the window is rolling. This means the number of available days will always be equal the specified 'value' \n and adjust dynamically as bookings are made. For example, if 'value' is 3 and availability is only on Mondays, \n a booker attempting to schedule on November 10 will see slots on November 11, 18, and 25. As one of these days \n becomes fully booked, a new day (e.g., December 2) will open up to ensure 3 available days are always visible.\n - If **false**, the window is fixed. This means the booking window only considers the next 'value' days from the\n moment someone is trying to book. For example, if 'value' is 3, availability is only on Mondays, and the current \n date is November 10, the booker will only see slots on November 11 because the window is restricted to the next \n 3 calendar days (November 10–12).\n " } }, - "required": [ - "type", - "value" - ] + "required": ["type", "value"] }, "RangeWindow_2024_06_14": { "type": "object", "properties": { "type": { "type": "string", - "enum": [ - "businessDays", - "calendarDays", - "range" - ], + "enum": ["businessDays", "calendarDays", "range"], "description": "Whether the window should be business days, calendar days or a range of dates" }, "value": { - "example": [ - "2030-09-05", - "2030-09-09" - ], + "example": ["2030-09-05", "2030-09-09"], "description": "Date range for when this event can be booked.", "type": "array", "items": { @@ -7989,10 +7441,7 @@ } } }, - "required": [ - "type", - "value" - ] + "required": ["type", "value"] }, "BaseBookingLimitsCount_2024_06_14": { "type": "object", @@ -8033,9 +7482,7 @@ "default": false } }, - "required": [ - "disabled" - ] + "required": ["disabled"] }, "BaseBookingLimitsDuration_2024_06_14": { "type": "object", @@ -8077,18 +7524,10 @@ }, "frequency": { "type": "string", - "enum": [ - "yearly", - "monthly", - "weekly" - ] + "enum": ["yearly", "monthly", "weekly"] } }, - "required": [ - "interval", - "occurrences", - "frequency" - ] + "required": ["interval", "occurrences", "frequency"] }, "NoticeThreshold_2024_06_14": { "type": "object", @@ -8104,10 +7543,7 @@ "example": 30 } }, - "required": [ - "unit", - "count" - ] + "required": ["unit", "count"] }, "BaseConfirmationPolicy_2024_06_14": { "type": "object", @@ -8126,9 +7562,7 @@ ] } }, - "required": [ - "type" - ] + "required": ["type"] }, "Seats_2024_06_14": { "type": "object", @@ -8149,11 +7583,7 @@ "example": true } }, - "required": [ - "seatsPerTimeSlot", - "showAttendeeInfo", - "showAvailabilityCount" - ] + "required": ["seatsPerTimeSlot", "showAttendeeInfo", "showAvailabilityCount"] }, "InputAttendeeAddressLocation_2024_06_14": { "type": "object", @@ -8164,9 +7594,7 @@ "description": "only allowed value for type is `attendeeAddress`" } }, - "required": [ - "type" - ] + "required": ["type"] }, "InputAttendeePhoneLocation_2024_06_14": { "type": "object", @@ -8177,9 +7605,7 @@ "description": "only allowed value for type is `attendeePhone`" } }, - "required": [ - "type" - ] + "required": ["type"] }, "InputAttendeeDefinedLocation_2024_06_14": { "type": "object", @@ -8190,9 +7616,7 @@ "description": "only allowed value for type is `attendeeDefined`" } }, - "required": [ - "type" - ] + "required": ["type"] }, "NameDefaultFieldInput_2024_06_14": { "type": "object", @@ -8213,11 +7637,7 @@ "description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if URL contains query parameter `&name=bob`, the name field will be prefilled with this value and disabled." } }, - "required": [ - "type", - "label", - "placeholder" - ] + "required": ["type", "label", "placeholder"] }, "EmailDefaultFieldInput_2024_06_14": { "type": "object", @@ -8241,12 +7661,7 @@ "description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if URL contains query parameter `&email=bob@gmail.com`, the email field will be prefilled with this value and disabled." } }, - "required": [ - "type", - "label", - "required", - "placeholder" - ] + "required": ["type", "label", "required", "placeholder"] }, "TitleDefaultFieldInput_2024_06_14": { "type": "object", @@ -8274,9 +7689,7 @@ "description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if URL contains query parameter `&title=journey`, the title field will be prefilled with this value and disabled." } }, - "required": [ - "slug" - ] + "required": ["slug"] }, "NotesDefaultFieldInput_2024_06_14": { "type": "object", @@ -8304,9 +7717,7 @@ "description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if URL contains query parameter `¬es=journey`, the notes field will be prefilled with this value and disabled." } }, - "required": [ - "slug" - ] + "required": ["slug"] }, "GuestsDefaultFieldInput_2024_06_14": { "type": "object", @@ -8334,9 +7745,7 @@ "description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if URL contains query parameter `&guests=bob@cal.com`, the guests field will be prefilled with this value and disabled." } }, - "required": [ - "slug" - ] + "required": ["slug"] }, "RescheduleReasonDefaultFieldInput_2024_06_14": { "type": "object", @@ -8364,37 +7773,24 @@ "description": "Disable this booking field if the URL contains query parameter with key equal to the slug and prefill it with the provided value. For example, if URL contains query parameter `&rescheduleReason=travel`, the rescheduleReason field will be prefilled with this value and disabled." } }, - "required": [ - "slug" - ] + "required": ["slug"] }, "BookerLayouts_2024_06_14": { "type": "object", "properties": { "defaultLayout": { "type": "string", - "enum": [ - "month", - "week", - "column" - ] + "enum": ["month", "week", "column"] }, "enabledLayouts": { "type": "array", "items": { "type": "string", - "enum": [ - "month", - "week", - "column" - ] + "enum": ["month", "week", "column"] } } }, - "required": [ - "defaultLayout", - "enabledLayouts" - ] + "required": ["defaultLayout", "enabledLayouts"] }, "EventTypeColor_2024_06_14": { "type": "object", @@ -8410,10 +7806,7 @@ "example": "#fafafa" } }, - "required": [ - "lightThemeHex", - "darkThemeHex" - ] + "required": ["lightThemeHex", "darkThemeHex"] }, "DestinationCalendar_2024_06_14": { "type": "object", @@ -8427,10 +7820,7 @@ "description": "The external ID of the destination calendar. Refer to the /api/v2/calendars endpoint to retrieve the external IDs of your connected calendars." } }, - "required": [ - "integration", - "externalId" - ] + "required": ["integration", "externalId"] }, "CreateEventTypeInput_2024_06_14": { "type": "object", @@ -8440,11 +7830,7 @@ "example": 60 }, "lengthInMinutesOptions": { - "example": [ - 15, - 30, - 60 - ], + "example": [15, 30, 60], "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", "type": "array", "items": { @@ -8695,11 +8081,7 @@ "example": "https://masterchief.com/argentina/flan/video/9129412" } }, - "required": [ - "lengthInMinutes", - "title", - "slug" - ] + "required": ["lengthInMinutes", "title", "slug"] }, "OutputAddressLocation_2024_06_14": { "type": "object", @@ -8726,11 +8108,7 @@ "type": "boolean" } }, - "required": [ - "type", - "address", - "public" - ] + "required": ["type", "address", "public"] }, "OutputLinkLocation_2024_06_14": { "type": "object", @@ -8757,11 +8135,7 @@ "type": "boolean" } }, - "required": [ - "type", - "link", - "public" - ] + "required": ["type", "link", "public"] }, "OutputIntegrationLocation_2024_06_14": { "type": "object", @@ -8828,10 +8202,7 @@ "description": "Credential ID associated with the integration" } }, - "required": [ - "type", - "integration" - ] + "required": ["type", "integration"] }, "OutputPhoneLocation_2024_06_14": { "type": "object", @@ -8858,11 +8229,7 @@ "type": "boolean" } }, - "required": [ - "type", - "phone", - "public" - ] + "required": ["type", "phone", "public"] }, "OutputConferencingLocation_2024_06_14": { "type": "object", @@ -8884,9 +8251,7 @@ "description": "only allowed value for type is `conferencing`" } }, - "required": [ - "type" - ] + "required": ["type"] }, "OutputUnknownLocation_2024_06_14": { "type": "object", @@ -8911,10 +8276,7 @@ "type": "string" } }, - "required": [ - "type", - "location" - ] + "required": ["type", "location"] }, "EmailDefaultFieldOutput_2024_06_14": { "type": "object", @@ -8965,12 +8327,7 @@ "default": "email" } }, - "required": [ - "type", - "required", - "isDefault", - "slug" - ] + "required": ["type", "required", "isDefault", "slug"] }, "NameDefaultFieldOutput_2024_06_14": { "type": "object", @@ -9020,12 +8377,7 @@ "type": "boolean" } }, - "required": [ - "type", - "isDefault", - "slug", - "required" - ] + "required": ["type", "isDefault", "slug", "required"] }, "LocationDefaultFieldOutput_2024_06_14": { "type": "object", @@ -9053,26 +8405,14 @@ "description": "If true show under event type settings but don't show this booking field in the Booker. If false show in both." } }, - "required": [ - "isDefault", - "slug", - "type", - "required", - "hidden" - ] + "required": ["isDefault", "slug", "type", "required", "hidden"] }, "RescheduleReasonDefaultFieldOutput_2024_06_14": { "type": "object", "properties": { "slug": { "type": "string", - "enum": [ - "name", - "email", - "title", - "notes", - "guests" - ], + "enum": ["name", "email", "title", "notes", "guests"], "example": "rescheduleReason", "description": "only allowed value for type is `rescheduleReason`", "default": "rescheduleReason" @@ -9105,24 +8445,14 @@ "default": "textarea" } }, - "required": [ - "slug", - "isDefault", - "type" - ] + "required": ["slug", "isDefault", "type"] }, "TitleDefaultFieldOutput_2024_06_14": { "type": "object", "properties": { "slug": { "type": "string", - "enum": [ - "name", - "email", - "title", - "notes", - "guests" - ], + "enum": ["name", "email", "title", "notes", "guests"], "example": "title", "description": "only allowed value for type is `title`", "default": "title" @@ -9155,24 +8485,14 @@ "default": "text" } }, - "required": [ - "slug", - "isDefault", - "type" - ] + "required": ["slug", "isDefault", "type"] }, "NotesDefaultFieldOutput_2024_06_14": { "type": "object", "properties": { "slug": { "type": "string", - "enum": [ - "name", - "email", - "title", - "notes", - "guests" - ], + "enum": ["name", "email", "title", "notes", "guests"], "example": "notes", "description": "only allowed value for type is `notes`", "default": "notes" @@ -9205,24 +8525,14 @@ "default": "textarea" } }, - "required": [ - "slug", - "isDefault", - "type" - ] + "required": ["slug", "isDefault", "type"] }, "GuestsDefaultFieldOutput_2024_06_14": { "type": "object", "properties": { "slug": { "type": "string", - "enum": [ - "name", - "email", - "title", - "notes", - "guests" - ], + "enum": ["name", "email", "title", "notes", "guests"], "example": "guests", "description": "only allowed value for type is `guests`", "default": "guests" @@ -9255,11 +8565,7 @@ "default": "multiemail" } }, - "required": [ - "slug", - "isDefault", - "type" - ] + "required": ["slug", "isDefault", "type"] }, "AddressFieldOutput_2024_06_14": { "type": "object", @@ -9315,14 +8621,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "hidden", "isDefault"] }, "BooleanFieldOutput_2024_06_14": { "type": "object", @@ -9373,14 +8672,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "hidden", "isDefault"] }, "CheckboxGroupFieldOutput_2024_06_14": { "type": "object", @@ -9418,10 +8710,7 @@ "type": "boolean" }, "options": { - "example": [ - "Checkbox 1", - "Checkbox 2" - ], + "example": ["Checkbox 1", "Checkbox 2"], "type": "array", "items": { "type": "string" @@ -9442,15 +8731,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "options", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "options", "hidden", "isDefault"] }, "MultiEmailFieldOutput_2024_06_14": { "type": "object", @@ -9506,14 +8787,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "hidden", "isDefault"] }, "MultiSelectFieldOutput_2024_06_14": { "type": "object", @@ -9551,10 +8825,7 @@ "type": "boolean" }, "options": { - "example": [ - "Option 1", - "Option 2" - ], + "example": ["Option 1", "Option 2"], "type": "array", "items": { "type": "string" @@ -9575,15 +8846,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "options", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "options", "hidden", "isDefault"] }, "NumberFieldOutput_2024_06_14": { "type": "object", @@ -9639,14 +8902,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "hidden", "isDefault"] }, "PhoneFieldOutput_2024_06_14": { "type": "object", @@ -9700,14 +8956,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "hidden", "isDefault"] }, "RadioGroupFieldOutput_2024_06_14": { "type": "object", @@ -9745,10 +8994,7 @@ "type": "boolean" }, "options": { - "example": [ - "Radio 1", - "Radio 2" - ], + "example": ["Radio 1", "Radio 2"], "type": "array", "items": { "type": "string" @@ -9769,15 +9015,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "options", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "options", "hidden", "isDefault"] }, "SelectFieldOutput_2024_06_14": { "type": "object", @@ -9819,10 +9057,7 @@ "example": "Select..." }, "options": { - "example": [ - "Option 1", - "Option 2" - ], + "example": ["Option 1", "Option 2"], "type": "array", "items": { "type": "string" @@ -9843,15 +9078,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "options", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "options", "hidden", "isDefault"] }, "TextAreaFieldOutput_2024_06_14": { "type": "object", @@ -9907,14 +9134,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "hidden", "isDefault"] }, "TextFieldOutput_2024_06_14": { "type": "object", @@ -9970,14 +9190,7 @@ "example": false } }, - "required": [ - "type", - "slug", - "label", - "required", - "hidden", - "isDefault" - ] + "required": ["type", "slug", "label", "required", "hidden", "isDefault"] }, "EventTypeOutput_2024_06_14": { "type": "object", @@ -9991,11 +9204,7 @@ "example": 60 }, "lengthInMinutesOptions": { - "example": [ - 15, - 30, - 60 - ], + "example": [15, 30, 60], "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", "type": "array", "items": { @@ -10260,30 +9469,21 @@ "properties": { "status": { "type": "string", - "enum": [ - "success", - "error" - ], + "enum": ["success", "error"], "example": "success" }, "data": { "$ref": "#/components/schemas/EventTypeOutput_2024_06_14" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetEventTypeOutput_2024_06_14": { "type": "object", "properties": { "status": { "type": "string", - "enum": [ - "success", - "error" - ], + "enum": ["success", "error"], "example": "success" }, "data": { @@ -10295,20 +9495,14 @@ ] } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetEventTypesOutput_2024_06_14": { "type": "object", "properties": { "status": { "type": "string", - "enum": [ - "success", - "error" - ], + "enum": ["success", "error"], "example": "success" }, "data": { @@ -10318,10 +9512,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateEventTypeInput_2024_06_14": { "type": "object", @@ -10331,11 +9522,7 @@ "example": 60 }, "lengthInMinutesOptions": { - "example": [ - 15, - 30, - 60 - ], + "example": [15, 30, 60], "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", "type": "array", "items": { @@ -10592,20 +9779,14 @@ "properties": { "status": { "type": "string", - "enum": [ - "success", - "error" - ], + "enum": ["success", "error"], "example": "success" }, "data": { "$ref": "#/components/schemas/EventTypeOutput_2024_06_14" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteData_2024_06_14": { "type": "object", @@ -10626,32 +9807,21 @@ "type": "string" } }, - "required": [ - "id", - "lengthInMinutes", - "title", - "slug" - ] + "required": ["id", "lengthInMinutes", "title", "slug"] }, "DeleteEventTypeOutput_2024_06_14": { "type": "object", "properties": { "status": { "type": "string", - "enum": [ - "success", - "error" - ], + "enum": ["success", "error"], "example": "success" }, "data": { "$ref": "#/components/schemas/DeleteData_2024_06_14" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "SelectedCalendarsInputDto": { "type": "object", @@ -10666,11 +9836,7 @@ "type": "number" } }, - "required": [ - "integration", - "externalId", - "credentialId" - ] + "required": ["integration", "externalId", "credentialId"] }, "SelectedCalendarOutputDto": { "type": "object", @@ -10689,12 +9855,7 @@ "nullable": true } }, - "required": [ - "userId", - "integration", - "externalId", - "credentialId" - ] + "required": ["userId", "integration", "externalId", "credentialId"] }, "SelectedCalendarOutputResponseDto": { "type": "object", @@ -10702,19 +9863,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/SelectedCalendarOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "OrgTeamOutputDto": { "type": "object", @@ -10787,11 +9942,7 @@ "default": "Sunday" } }, - "required": [ - "id", - "name", - "isOrganization" - ] + "required": ["id", "name", "isOrganization"] }, "OrgTeamsOutputResponseDto": { "type": "object", @@ -10799,10 +9950,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -10811,10 +9959,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "OrgMeTeamsOutputResponseDto": { "type": "object", @@ -10822,10 +9967,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -10834,10 +9976,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "OrgTeamOutputResponseDto": { "type": "object", @@ -10845,19 +9984,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OrgTeamOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateOrgTeamDto": { "type": "object", @@ -11013,40 +10146,19 @@ "default": true } }, - "required": [ - "name" - ] + "required": ["name"] }, "ScheduleAvailabilityInput_2024_06_11": { "type": "object", "properties": { "days": { "type": "array", - "enum": [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday" - ], - "example": [ - "Monday", - "Tuesday" - ], + "enum": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], + "example": ["Monday", "Tuesday"], "description": "Array of days when schedule is active.", "items": { "type": "string", - "enum": [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday" - ] + "enum": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] } }, "startTime": { @@ -11062,11 +10174,7 @@ "description": "endTime must be a valid time in format HH:MM e.g. 15:00" } }, - "required": [ - "days", - "startTime", - "endTime" - ] + "required": ["days", "startTime", "endTime"] }, "ScheduleOverrideInput_2024_06_11": { "type": "object", @@ -11088,11 +10196,7 @@ "description": "endTime must be a valid time in format HH:MM e.g. 13:00" } }, - "required": [ - "date", - "startTime", - "endTime" - ] + "required": ["date", "startTime", "endTime"] }, "ScheduleOutput_2024_06_11": { "type": "object", @@ -11116,18 +10220,12 @@ "availability": { "example": [ { - "days": [ - "Monday", - "Tuesday" - ], + "days": ["Monday", "Tuesday"], "startTime": "17:00", "endTime": "19:00" }, { - "days": [ - "Wednesday", - "Thursday" - ], + "days": ["Wednesday", "Thursday"], "startTime": "16:00", "endTime": "20:00" } @@ -11155,15 +10253,7 @@ } } }, - "required": [ - "id", - "ownerId", - "name", - "timeZone", - "availability", - "isDefault", - "overrides" - ] + "required": ["id", "ownerId", "name", "timeZone", "availability", "isDefault", "overrides"] }, "GetSchedulesOutput_2024_06_11": { "type": "object", @@ -11171,10 +10261,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -11186,10 +10273,7 @@ "type": "object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateScheduleInput_2024_06_11": { "type": "object", @@ -11207,18 +10291,12 @@ "description": "Each object contains days and times when the user is available. If not passed, the default availability is Monday to Friday from 09:00 to 17:00.", "example": [ { - "days": [ - "Monday", - "Tuesday" - ], + "days": ["Monday", "Tuesday"], "startTime": "17:00", "endTime": "19:00" }, { - "days": [ - "Wednesday", - "Thursday" - ], + "days": ["Wednesday", "Thursday"], "startTime": "16:00", "endTime": "20:00" } @@ -11248,11 +10326,7 @@ } } }, - "required": [ - "name", - "timeZone", - "isDefault" - ] + "required": ["name", "timeZone", "isDefault"] }, "CreateScheduleOutput_2024_06_11": { "type": "object", @@ -11260,19 +10334,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/ScheduleOutput_2024_06_11" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetScheduleOutput_2024_06_11": { "type": "object", @@ -11280,10 +10348,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "nullable": true, @@ -11297,10 +10362,7 @@ "type": "object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateScheduleInput_2024_06_11": { "type": "object", @@ -11316,10 +10378,7 @@ "availability": { "example": [ { - "days": [ - "Monday", - "Tuesday" - ], + "days": ["Monday", "Tuesday"], "startTime": "09:00", "endTime": "10:00" } @@ -11354,10 +10413,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/ScheduleOutput_2024_06_11" @@ -11366,10 +10422,7 @@ "type": "object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteScheduleOutput_2024_06_11": { "type": "object", @@ -11377,15 +10430,10 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] } }, - "required": [ - "status" - ] + "required": ["status"] }, "ProfileOutput": { "type": "object", @@ -11412,11 +10460,7 @@ "example": "john_doe" } }, - "required": [ - "id", - "organizationId", - "userId" - ] + "required": ["id", "organizationId", "userId"] }, "GetOrgUsersWithProfileOutput": { "type": "object", @@ -11552,15 +10596,7 @@ ] } }, - "required": [ - "id", - "email", - "timeZone", - "weekStart", - "hideBranding", - "createdDate", - "profile" - ] + "required": ["id", "email", "timeZone", "weekStart", "hideBranding", "createdDate", "profile"] }, "GetOrganizationUsersResponseDTO": { "type": "object", @@ -11568,10 +10604,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -11580,10 +10613,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateOrganizationUserInput": { "type": "object", @@ -11661,20 +10691,14 @@ "organizationRole": { "type": "string", "default": "MEMBER", - "enum": [ - "MEMBER", - "ADMIN", - "OWNER" - ] + "enum": ["MEMBER", "ADMIN", "OWNER"] }, "autoAccept": { "type": "boolean", "default": true } }, - "required": [ - "email" - ] + "required": ["email"] }, "GetOrganizationUserOutput": { "type": "object", @@ -11682,19 +10706,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/GetOrgUsersWithProfileOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateOrganizationUserInput": { "type": "object", @@ -11717,23 +10735,13 @@ }, "role": { "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean" } }, - "required": [ - "id", - "userId", - "teamId", - "accepted", - "role" - ] + "required": ["id", "userId", "teamId", "accepted", "role"] }, "GetAllOrgMemberships": { "type": "object", @@ -11741,19 +10749,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OrgMembershipOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateOrgMembershipDto": { "type": "object", @@ -11768,21 +10770,14 @@ "role": { "type": "string", "default": "MEMBER", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean", "default": false } }, - "required": [ - "userId", - "role" - ] + "required": ["userId", "role"] }, "CreateOrgMembershipOutput": { "type": "object", @@ -11790,19 +10785,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OrgMembershipOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetOrgMembership": { "type": "object", @@ -11810,19 +10799,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OrgMembershipOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteOrgMembership": { "type": "object", @@ -11830,19 +10813,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OrgMembershipOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateOrgMembershipDto": { "type": "object", @@ -11852,11 +10829,7 @@ }, "role": { "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean" @@ -11869,19 +10842,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OrgMembershipOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "Host": { "type": "object", @@ -11896,18 +10863,10 @@ }, "priority": { "type": "string", - "enum": [ - "lowest", - "low", - "medium", - "high", - "highest" - ] + "enum": ["lowest", "low", "medium", "high", "highest"] } }, - "required": [ - "userId" - ] + "required": ["userId"] }, "CreateTeamEventTypeInput_2024_06_14": { "type": "object", @@ -11917,11 +10876,7 @@ "example": 60 }, "lengthInMinutesOptions": { - "example": [ - 15, - 30, - 60 - ], + "example": [15, 30, 60], "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", "type": "array", "items": { @@ -12185,13 +11140,7 @@ "description": "If true, all current and future team members will be assigned to this event type" } }, - "required": [ - "lengthInMinutes", - "title", - "slug", - "schedulingType", - "hosts" - ] + "required": ["lengthInMinutes", "title", "slug", "schedulingType", "hosts"] }, "CreateTeamEventTypeOutput": { "type": "object", @@ -12199,10 +11148,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -12218,10 +11164,7 @@ ] } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "TeamEventTypeResponseHost": { "type": "object", @@ -12238,13 +11181,7 @@ "priority": { "type": "string", "default": "medium", - "enum": [ - "lowest", - "low", - "medium", - "high", - "highest" - ] + "enum": ["lowest", "low", "medium", "high", "highest"] }, "name": { "type": "string", @@ -12256,10 +11193,7 @@ "example": "https://cal.com/api/avatar/d95949bc-ccb1-400f-acf6-045c51a16856.png" } }, - "required": [ - "userId", - "name" - ] + "required": ["userId", "name"] }, "EventTypeTeam": { "type": "object", @@ -12292,9 +11226,7 @@ "type": "string" } }, - "required": [ - "id" - ] + "required": ["id"] }, "TeamEventTypeOutput_2024_06_14": { "type": "object", @@ -12309,11 +11241,7 @@ "example": 60 }, "lengthInMinutesOptions": { - "example": [ - 15, - 30, - 60 - ], + "example": [15, 30, 60], "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", "type": "array", "items": { @@ -12569,11 +11497,7 @@ "schedulingType": { "type": "string", "nullable": true, - "enum": [ - "ROUND_ROBIN", - "COLLECTIVE", - "MANAGED" - ] + "enum": ["ROUND_ROBIN", "COLLECTIVE", "MANAGED"] }, "team": { "$ref": "#/components/schemas/EventTypeTeam" @@ -12609,19 +11533,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamEventTypeOutput_2024_06_14" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreatePhoneCallInput": { "type": "object", @@ -12647,10 +11565,7 @@ }, "templateType": { "default": "CUSTOM_TEMPLATE", - "enum": [ - "CHECK_IN_APPOINTMENT", - "CUSTOM_TEMPLATE" - ], + "enum": ["CHECK_IN_APPOINTMENT", "CUSTOM_TEMPLATE"], "type": "string", "description": "Template type" }, @@ -12679,13 +11594,7 @@ "description": "General prompt" } }, - "required": [ - "yourPhoneNumber", - "numberToCall", - "calApiKey", - "enabled", - "templateType" - ] + "required": ["yourPhoneNumber", "numberToCall", "calApiKey", "enabled", "templateType"] }, "Data": { "type": "object", @@ -12697,10 +11606,7 @@ "type": "string" } }, - "required": [ - "callId", - "agentId" - ] + "required": ["callId"] }, "CreatePhoneCallOutput": { "type": "object", @@ -12708,19 +11614,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/Data" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetTeamEventTypesOutput": { "type": "object", @@ -12728,10 +11628,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -12740,10 +11637,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateTeamEventTypeInput_2024_06_14": { "type": "object", @@ -12753,11 +11647,7 @@ "example": 60 }, "lengthInMinutesOptions": { - "example": [ - 15, - 30, - 60 - ], + "example": [15, 30, 60], "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", "type": "array", "items": { @@ -13025,10 +11915,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -13044,10 +11931,7 @@ ] } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteTeamEventTypeOutput": { "type": "object", @@ -13055,19 +11939,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "MembershipUserOutputDto": { "type": "object", @@ -13085,9 +11963,7 @@ "type": "string" } }, - "required": [ - "email" - ] + "required": ["email"] }, "OrgTeamMembershipOutputDto": { "type": "object", @@ -13106,11 +11982,7 @@ }, "role": { "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean" @@ -13119,14 +11991,7 @@ "$ref": "#/components/schemas/MembershipUserOutputDto" } }, - "required": [ - "id", - "userId", - "teamId", - "accepted", - "role", - "user" - ] + "required": ["id", "userId", "teamId", "accepted", "role", "user"] }, "OrgTeamMembershipsOutputResponseDto": { "type": "object", @@ -13134,10 +11999,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -13146,10 +12008,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "OrgTeamMembershipOutputResponseDto": { "type": "object", @@ -13157,19 +12016,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OrgTeamMembershipOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateOrgTeamMembershipDto": { "type": "object", @@ -13179,11 +12032,7 @@ }, "role": { "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean" @@ -13203,21 +12052,14 @@ "role": { "type": "string", "default": "MEMBER", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean", "default": false } }, - "required": [ - "userId", - "role" - ] + "required": ["userId", "role"] }, "Attribute": { "type": "object", @@ -13235,12 +12077,7 @@ "type": { "type": "string", "description": "The type of the attribute", - "enum": [ - "TEXT", - "NUMBER", - "SINGLE_SELECT", - "MULTI_SELECT" - ] + "enum": ["TEXT", "NUMBER", "SINGLE_SELECT", "MULTI_SELECT"] }, "name": { "type": "string", @@ -13263,14 +12100,7 @@ "example": true } }, - "required": [ - "id", - "teamId", - "type", - "name", - "slug", - "enabled" - ] + "required": ["id", "teamId", "type", "name", "slug", "enabled"] }, "GetOrganizationAttributesOutput": { "type": "object", @@ -13278,10 +12108,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -13290,10 +12117,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetSingleAttributeOutput": { "type": "object", @@ -13301,10 +12125,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "nullable": true, @@ -13315,10 +12136,7 @@ ] } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateOrganizationAttributeOptionInput": { "type": "object", @@ -13330,10 +12148,7 @@ "type": "string" } }, - "required": [ - "value", - "slug" - ] + "required": ["value", "slug"] }, "CreateOrganizationAttributeInput": { "type": "object", @@ -13346,12 +12161,7 @@ }, "type": { "type": "string", - "enum": [ - "TEXT", - "NUMBER", - "SINGLE_SELECT", - "MULTI_SELECT" - ] + "enum": ["TEXT", "NUMBER", "SINGLE_SELECT", "MULTI_SELECT"] }, "options": { "type": "array", @@ -13363,12 +12173,7 @@ "type": "boolean" } }, - "required": [ - "name", - "slug", - "type", - "options" - ] + "required": ["name", "slug", "type", "options"] }, "CreateOrganizationAttributesOutput": { "type": "object", @@ -13376,19 +12181,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/Attribute" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateOrganizationAttributeInput": { "type": "object", @@ -13401,12 +12200,7 @@ }, "type": { "type": "string", - "enum": [ - "TEXT", - "NUMBER", - "SINGLE_SELECT", - "MULTI_SELECT" - ] + "enum": ["TEXT", "NUMBER", "SINGLE_SELECT", "MULTI_SELECT"] }, "enabled": { "type": "boolean" @@ -13419,19 +12213,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/Attribute" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteOrganizationAttributesOutput": { "type": "object", @@ -13439,19 +12227,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/Attribute" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "OptionOutput": { "type": "object", @@ -13477,12 +12259,7 @@ "example": "option-slug" } }, - "required": [ - "id", - "attributeId", - "value", - "slug" - ] + "required": ["id", "attributeId", "value", "slug"] }, "CreateAttributeOptionOutput": { "type": "object", @@ -13490,19 +12267,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OptionOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteAttributeOptionOutput": { "type": "object", @@ -13510,19 +12281,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OptionOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateOrganizationAttributeOptionInput": { "type": "object", @@ -13541,19 +12306,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OptionOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetAllAttributeOptionOutput": { "type": "object", @@ -13561,10 +12320,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -13573,10 +12329,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "AssignOrganizationAttributeOptionToUserInput": { "type": "object", @@ -13591,9 +12344,7 @@ "type": "string" } }, - "required": [ - "attributeId" - ] + "required": ["attributeId"] }, "AssignOptionUserOutputData": { "type": "object", @@ -13611,11 +12362,7 @@ "description": "The value of the option" } }, - "required": [ - "id", - "memberId", - "attributeOptionId" - ] + "required": ["id", "memberId", "attributeOptionId"] }, "AssignOptionUserOutput": { "type": "object", @@ -13623,19 +12370,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/AssignOptionUserOutputData" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UnassignOptionUserOutput": { "type": "object", @@ -13643,19 +12384,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/AssignOptionUserOutputData" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetOptionUserOutputData": { "type": "object", @@ -13677,12 +12412,7 @@ "description": "The slug of the option" } }, - "required": [ - "id", - "attributeId", - "value", - "slug" - ] + "required": ["id", "attributeId", "value", "slug"] }, "GetOptionUserOutput": { "type": "object", @@ -13690,10 +12420,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -13702,10 +12429,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "TeamWebhookOutputDto": { "type": "object", @@ -13737,14 +12461,7 @@ "type": "string" } }, - "required": [ - "payloadTemplate", - "teamId", - "id", - "triggers", - "subscriberUrl", - "active" - ] + "required": ["payloadTemplate", "teamId", "id", "triggers", "subscriberUrl", "active"] }, "TeamWebhooksOutputResponseDto": { "type": "object", @@ -13752,10 +12469,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -13764,10 +12478,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateWebhookInputDto": { "type": "object", @@ -13820,11 +12531,7 @@ "type": "string" } }, - "required": [ - "active", - "subscriberUrl", - "triggers" - ] + "required": ["active", "subscriberUrl", "triggers"] }, "TeamWebhookOutputResponseDto": { "type": "object", @@ -13832,19 +12539,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamWebhookOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateWebhookInputDto": { "type": "object", @@ -13927,19 +12628,10 @@ "type": "string", "description": "the reason for the out of office entry, if applicable", "example": "vacation", - "enum": [ - "unspecified", - "vacation", - "travel", - "sick", - "public_holiday" - ] + "enum": ["unspecified", "vacation", "travel", "sick", "public_holiday"] } }, - "required": [ - "start", - "end" - ] + "required": ["start", "end"] }, "UpdateOutOfOfficeEntryDto": { "type": "object", @@ -13970,13 +12662,7 @@ "type": "string", "description": "the reason for the out of office entry, if applicable", "example": "vacation", - "enum": [ - "unspecified", - "vacation", - "travel", - "sick", - "public_holiday" - ] + "enum": ["unspecified", "vacation", "travel", "sick", "public_holiday"] } } }, @@ -13987,9 +12673,7 @@ "type": "string" } }, - "required": [ - "authUrl" - ] + "required": ["authUrl"] }, "StripConnectOutputResponseDto": { "type": "object", @@ -13997,19 +12681,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/StripConnectOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "StripCredentialsSaveOutputResponseDto": { "type": "object", @@ -14018,9 +12696,7 @@ "type": "string" } }, - "required": [ - "url" - ] + "required": ["url"] }, "StripCredentialsCheckOutputResponseDto": { "type": "object", @@ -14030,9 +12706,7 @@ "example": "success" } }, - "required": [ - "status" - ] + "required": ["status"] }, "GetDefaultScheduleOutput_2024_06_11": { "type": "object", @@ -14040,19 +12714,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/ScheduleOutput_2024_06_11" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateTeamInput": { "type": "object", @@ -14131,9 +12799,7 @@ "default": true } }, - "required": [ - "name" - ] + "required": ["name"] }, "CreateTeamOutput": { "type": "object", @@ -14141,10 +12807,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -14158,10 +12821,7 @@ "description": "Either an Output object or a TeamOutputDto." } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "TeamOutputDto": { "type": "object", @@ -14234,11 +12894,7 @@ "default": "Sunday" } }, - "required": [ - "id", - "name", - "isOrganization" - ] + "required": ["id", "name", "isOrganization"] }, "GetTeamOutput": { "type": "object", @@ -14246,19 +12902,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetTeamsOutput": { "type": "object", @@ -14266,10 +12916,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -14278,10 +12925,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateTeamOutput": { "type": "object", @@ -14289,19 +12933,55 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] + }, + "RoutingFormResponseDto": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "formId": { + "type": "string" + }, + "formFillerId": { + "type": "string" + }, + "routedToBookingUid": { + "type": "string" + }, + "response": { + "type": "object" + }, + "createdAt": { + "format": "date-time", + "type": "string" + } + }, + "required": ["id", "formId", "formFillerId", "routedToBookingUid", "response", "createdAt"] + }, + "GetRoutingFormResponsesOutput": { + "type": "object", + "properties": { + "status": { + "type": "string", + "example": "success", + "enum": ["success", "error"] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RoutingFormResponseDto" + } + } + }, + "required": ["status", "data"] }, "ProviderVerifyClientData": { "type": "object", @@ -14316,11 +12996,7 @@ "type": "string" } }, - "required": [ - "clientId", - "organizationId", - "name" - ] + "required": ["clientId", "organizationId", "name"] }, "ProviderVerifyClientOutput": { "type": "object", @@ -14328,19 +13004,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/ProviderVerifyClientData" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "ProviderVerifyAccessTokenOutput": { "type": "object", @@ -14348,15 +13018,10 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] } }, - "required": [ - "status" - ] + "required": ["status"] }, "MeOrgOutput": { "type": "object", @@ -14368,10 +13033,7 @@ "type": "number" } }, - "required": [ - "isPlatform", - "id" - ] + "required": ["isPlatform", "id"] }, "MeOutput": { "type": "object", @@ -14423,19 +13085,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/MeOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateMeOutput": { "type": "object", @@ -14443,29 +13099,20 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/MeOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CreateIcsFeedInputDto": { "type": "object", "properties": { "urls": { "type": "array", - "example": [ - "https://cal.com/ics/feed.ics", - "http://cal.com/ics/feed.ics" - ], + "example": ["https://cal.com/ics/feed.ics", "http://cal.com/ics/feed.ics"], "description": "An array of ICS URLs", "items": { "type": "string", @@ -14479,9 +13126,7 @@ "description": "Whether to allowing writing to the calendar or not" } }, - "required": [ - "urls" - ] + "required": ["urls"] }, "CreateIcsFeedOutput": { "type": "object", @@ -14521,14 +13166,7 @@ "description": "Whether the calendar credentials are valid or not" } }, - "required": [ - "id", - "type", - "userId", - "teamId", - "appId", - "invalid" - ] + "required": ["id", "type", "userId", "teamId", "appId", "invalid"] }, "CreateIcsFeedOutputResponseDto": { "type": "object", @@ -14536,19 +13174,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/CreateIcsFeedOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "BusyTimesOutput": { "type": "object", @@ -14566,10 +13198,7 @@ "nullable": true } }, - "required": [ - "start", - "end" - ] + "required": ["start", "end"] }, "GetBusyTimesOutput": { "type": "object", @@ -14577,10 +13206,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -14589,10 +13215,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "Integration": { "type": "object", @@ -14697,13 +13320,7 @@ "type": "number" } }, - "required": [ - "externalId", - "primary", - "readOnly", - "isSelected", - "credentialId" - ] + "required": ["externalId", "primary", "readOnly", "isSelected", "credentialId"] }, "Calendar": { "type": "object", @@ -14734,12 +13351,7 @@ "type": "number" } }, - "required": [ - "externalId", - "readOnly", - "isSelected", - "credentialId" - ] + "required": ["externalId", "readOnly", "isSelected", "credentialId"] }, "ConnectedCalendar": { "type": "object", @@ -14760,10 +13372,7 @@ } } }, - "required": [ - "integration", - "credentialId" - ] + "required": ["integration", "credentialId"] }, "DestinationCalendar": { "type": "object", @@ -14833,10 +13442,7 @@ "$ref": "#/components/schemas/DestinationCalendar" } }, - "required": [ - "connectedCalendars", - "destinationCalendar" - ] + "required": ["connectedCalendars", "destinationCalendar"] }, "ConnectedCalendarsOutput": { "type": "object", @@ -14844,19 +13450,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/ConnectedCalendarsData" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteCalendarCredentialsInputBodyDto": { "type": "object", @@ -14867,9 +13467,7 @@ "description": "Credential ID of the calendar to delete, as returned by the /calendars endpoint" } }, - "required": [ - "id" - ] + "required": ["id"] }, "DeletedCalendarCredentialsOutputDto": { "type": "object", @@ -14897,14 +13495,7 @@ "nullable": true } }, - "required": [ - "id", - "type", - "userId", - "teamId", - "appId", - "invalid" - ] + "required": ["id", "type", "userId", "teamId", "appId", "invalid"] }, "DeletedCalendarCredentialsOutputResponseDto": { "type": "object", @@ -14912,19 +13503,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/DeletedCalendarCredentialsOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "Attendee": { "type": "object", @@ -15000,10 +13585,7 @@ "default": "en" } }, - "required": [ - "name", - "timeZone" - ] + "required": ["name", "timeZone"] }, "CreateBookingInput_2024_08_13": { "type": "object", @@ -15033,10 +13615,7 @@ }, "guests": { "description": "An optional list of guest emails attending the event.", - "example": [ - "guest1@example.com", - "guest2@example.com" - ], + "example": ["guest1@example.com", "guest2@example.com"], "type": "array", "items": { "type": "string" @@ -15068,11 +13647,7 @@ } } }, - "required": [ - "start", - "eventTypeId", - "attendee" - ] + "required": ["start", "eventTypeId", "attendee"] }, "CreateInstantBookingInput_2024_08_13": { "type": "object", @@ -15102,10 +13677,7 @@ }, "guests": { "description": "An optional list of guest emails attending the event.", - "example": [ - "guest1@example.com", - "guest2@example.com" - ], + "example": ["guest1@example.com", "guest2@example.com"], "type": "array", "items": { "type": "string" @@ -15142,12 +13714,7 @@ "example": true } }, - "required": [ - "start", - "eventTypeId", - "attendee", - "instant" - ] + "required": ["start", "eventTypeId", "attendee", "instant"] }, "CreateRecurringBookingInput_2024_08_13": { "type": "object", @@ -15177,10 +13744,7 @@ }, "guests": { "description": "An optional list of guest emails attending the event.", - "example": [ - "guest1@example.com", - "guest2@example.com" - ], + "example": ["guest1@example.com", "guest2@example.com"], "type": "array", "items": { "type": "string" @@ -15217,11 +13781,7 @@ "example": 5 } }, - "required": [ - "start", - "eventTypeId", - "attendee" - ] + "required": ["start", "eventTypeId", "attendee"] }, "BookingHost": { "type": "object", @@ -15247,13 +13807,7 @@ "example": "America/Los_Angeles" } }, - "required": [ - "id", - "name", - "email", - "username", - "timeZone" - ] + "required": ["id", "name", "email", "username", "timeZone"] }, "EventType": { "type": "object", @@ -15267,10 +13821,7 @@ "example": "some-event" } }, - "required": [ - "id", - "slug" - ] + "required": ["id", "slug"] }, "BookingOutput_2024_08_13": { "type": "object", @@ -15299,12 +13850,7 @@ }, "status": { "type": "string", - "enum": [ - "cancelled", - "accepted", - "rejected", - "pending" - ], + "enum": ["cancelled", "accepted", "rejected", "pending"], "example": "accepted" }, "cancellationReason": { @@ -15376,6 +13922,10 @@ "key": "value" } }, + "rating": { + "type": "number", + "example": 4 + }, "attendees": { "type": "array", "items": { @@ -15383,10 +13933,7 @@ } }, "guests": { - "example": [ - "guest1@example.com", - "guest2@example.com" - ], + "example": ["guest1@example.com", "guest2@example.com"], "type": "array", "items": { "type": "string" @@ -15447,12 +13994,7 @@ }, "status": { "type": "string", - "enum": [ - "cancelled", - "accepted", - "rejected", - "pending" - ], + "enum": ["cancelled", "accepted", "rejected", "pending"], "example": "accepted" }, "cancellationReason": { @@ -15524,6 +14066,10 @@ "key": "value" } }, + "rating": { + "type": "number", + "example": 4 + }, "attendees": { "type": "array", "items": { @@ -15531,10 +14077,7 @@ } }, "guests": { - "example": [ - "guest1@example.com", - "guest2@example.com" - ], + "example": ["guest1@example.com", "guest2@example.com"], "type": "array", "items": { "type": "string" @@ -15662,14 +14205,7 @@ } } }, - "required": [ - "name", - "email", - "timeZone", - "absent", - "seatUid", - "bookingFieldsResponses" - ] + "required": ["name", "email", "timeZone", "absent", "seatUid", "bookingFieldsResponses"] }, "CreateSeatedBookingOutput_2024_08_13": { "type": "object", @@ -15698,12 +14234,7 @@ }, "status": { "type": "string", - "enum": [ - "cancelled", - "accepted", - "rejected", - "pending" - ], + "enum": ["cancelled", "accepted", "rejected", "pending"], "example": "accepted" }, "cancellationReason": { @@ -15775,6 +14306,10 @@ "key": "value" } }, + "rating": { + "type": "number", + "example": 4 + }, "seatUid": { "type": "string", "example": "3be561a9-31f1-4b8e-aefc-9d9a085f0dd1" @@ -15833,12 +14368,7 @@ }, "status": { "type": "string", - "enum": [ - "cancelled", - "accepted", - "rejected", - "pending" - ], + "enum": ["cancelled", "accepted", "rejected", "pending"], "example": "accepted" }, "cancellationReason": { @@ -15910,6 +14440,10 @@ "key": "value" } }, + "rating": { + "type": "number", + "example": 4 + }, "seatUid": { "type": "string", "example": "3be561a9-31f1-4b8e-aefc-9d9a085f0dd1" @@ -15952,10 +14486,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -15981,10 +14512,7 @@ "description": "Booking data, which can be either a BookingOutput object or an array of RecurringBookingOutput objects" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetSeatedBookingOutput_2024_08_13": { "type": "object", @@ -16013,12 +14541,7 @@ }, "status": { "type": "string", - "enum": [ - "cancelled", - "accepted", - "rejected", - "pending" - ], + "enum": ["cancelled", "accepted", "rejected", "pending"], "example": "accepted" }, "cancellationReason": { @@ -16090,6 +14613,10 @@ "key": "value" } }, + "rating": { + "type": "number", + "example": 4 + }, "attendees": { "type": "array", "items": { @@ -16143,12 +14670,7 @@ }, "status": { "type": "string", - "enum": [ - "cancelled", - "accepted", - "rejected", - "pending" - ], + "enum": ["cancelled", "accepted", "rejected", "pending"], "example": "accepted" }, "cancellationReason": { @@ -16220,6 +14742,10 @@ "key": "value" } }, + "rating": { + "type": "number", + "example": 4 + }, "attendees": { "type": "array", "items": { @@ -16257,10 +14783,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -16295,10 +14818,7 @@ "type": "object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetBookingsOutput_2024_08_13": { "type": "object", @@ -16306,10 +14826,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -16335,10 +14852,7 @@ "type": "object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "RescheduleBookingOutput_2024_08_13": { "type": "object", @@ -16346,10 +14860,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -16369,10 +14880,7 @@ "description": "Booking data, which can be either a BookingOutput object or a RecurringBookingOutput object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "CancelBookingOutput_2024_08_13": { "type": "object", @@ -16380,10 +14888,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -16415,10 +14920,7 @@ "description": "Booking data, which can be either a BookingOutput object, a RecurringBookingOutput object, or an array of RecurringBookingOutput objects" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "MarkAbsentBookingInput_2024_08_13": { "type": "object", @@ -16442,10 +14944,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -16459,10 +14958,7 @@ "description": "Booking data, which can be either a BookingOutput object or a RecurringBookingOutput object" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "ReassignedToDto": { "type": "object", @@ -16480,11 +14976,7 @@ "example": "john.doe@example.com" } }, - "required": [ - "id", - "name", - "email" - ] + "required": ["id", "name", "email"] }, "ReassignBookingOutput_2024_08_13": { "type": "object", @@ -16492,10 +14984,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "oneOf": [ @@ -16511,10 +15000,7 @@ ] } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "ReassignToUserBookingInput_2024_08_13": { "type": "object", @@ -16549,20 +15035,14 @@ "role": { "type": "string", "default": "MEMBER", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean", "default": false } }, - "required": [ - "userId" - ] + "required": ["userId"] }, "TeamMembershipOutput": { "type": "object", @@ -16581,23 +15061,13 @@ }, "role": { "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean" } }, - "required": [ - "id", - "userId", - "teamId", - "accepted", - "role" - ] + "required": ["id", "userId", "teamId", "accepted", "role"] }, "CreateTeamMembershipOutput": { "type": "object", @@ -16605,19 +15075,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamMembershipOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetTeamMembershipOutput": { "type": "object", @@ -16625,19 +15089,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamMembershipOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetTeamMembershipsOutput": { "type": "object", @@ -16645,19 +15103,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamMembershipOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UpdateTeamMembershipInput": { "type": "object", @@ -16667,11 +15119,7 @@ }, "role": { "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] + "enum": ["MEMBER", "OWNER", "ADMIN"] }, "disableImpersonation": { "type": "boolean" @@ -16684,19 +15132,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamMembershipOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteTeamMembershipOutput": { "type": "object", @@ -16704,19 +15146,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/TeamMembershipOutput" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "ReserveSlotInput_2024_09_04": { "type": "object", @@ -16742,10 +15178,7 @@ "description": "ONLY for authenticated requests with api key, access token or OAuth credentials (ID + secret).\n \n For how many minutes the slot should be reserved - for this long time noone else can book this event type at `start` time. If not provided, defaults to 5 minutes." } }, - "required": [ - "eventTypeId", - "slotStart" - ] + "required": ["eventTypeId", "slotStart"] }, "ReserveSlotOutput_2024_09_04": { "type": "object", @@ -16802,19 +15235,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/ReserveSlotOutput_2024_09_04" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetReservedSlotOutput_2024_09_04": { "type": "object", @@ -16822,10 +15249,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "nullable": true, @@ -16836,10 +15260,7 @@ ] } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UserWebhookOutputDto": { "type": "object", @@ -16871,14 +15292,7 @@ "type": "string" } }, - "required": [ - "payloadTemplate", - "userId", - "id", - "triggers", - "subscriberUrl", - "active" - ] + "required": ["payloadTemplate", "userId", "id", "triggers", "subscriberUrl", "active"] }, "UserWebhookOutputResponseDto": { "type": "object", @@ -16886,19 +15300,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/UserWebhookOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "UserWebhooksOutputResponseDto": { "type": "object", @@ -16906,10 +15314,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -16918,10 +15323,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "EventTypeWebhookOutputDto": { "type": "object", @@ -16953,14 +15355,7 @@ "type": "string" } }, - "required": [ - "payloadTemplate", - "eventTypeId", - "id", - "triggers", - "subscriberUrl", - "active" - ] + "required": ["payloadTemplate", "eventTypeId", "id", "triggers", "subscriberUrl", "active"] }, "EventTypeWebhookOutputResponseDto": { "type": "object", @@ -16968,19 +15363,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/EventTypeWebhookOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "EventTypeWebhooksOutputResponseDto": { "type": "object", @@ -16988,10 +15377,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -17000,10 +15386,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DeleteManyWebhooksOutputResponseDto": { "type": "object", @@ -17011,19 +15394,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "string" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "OAuthClientWebhookOutputDto": { "type": "object", @@ -17055,14 +15432,7 @@ "type": "string" } }, - "required": [ - "payloadTemplate", - "oAuthClientId", - "id", - "triggers", - "subscriberUrl", - "active" - ] + "required": ["payloadTemplate", "oAuthClientId", "id", "triggers", "subscriberUrl", "active"] }, "OAuthClientWebhookOutputResponseDto": { "type": "object", @@ -17070,19 +15440,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/OAuthClientWebhookOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "OAuthClientWebhooksOutputResponseDto": { "type": "object", @@ -17090,10 +15454,7 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -17102,10 +15463,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "DestinationCalendarsInputBodyDto": { "type": "object", @@ -17114,11 +15472,7 @@ "type": "string", "example": "apple_calendar", "description": "The calendar service you want to integrate, as returned by the /calendars endpoint", - "enum": [ - "apple_calendar", - "google_calendar", - "office365_calendar" - ] + "enum": ["apple_calendar", "google_calendar", "office365_calendar"] }, "externalId": { "type": "string", @@ -17126,10 +15480,7 @@ "description": "Unique identifier used to represent the specfic calendar, as returned by the /calendars endpoint" } }, - "required": [ - "integration", - "externalId" - ] + "required": ["integration", "externalId"] }, "DestinationCalendarsOutputDto": { "type": "object", @@ -17148,12 +15499,7 @@ "nullable": true } }, - "required": [ - "userId", - "integration", - "externalId", - "credentialId" - ] + "required": ["userId", "integration", "externalId", "credentialId"] }, "DestinationCalendarsOutputResponseDto": { "type": "object", @@ -17161,19 +15507,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/DestinationCalendarsOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "ConferencingAppsOutputDto": { "type": "object", @@ -17198,30 +15538,20 @@ "description": "Whether if the connection is working or not." } }, - "required": [ - "id", - "type", - "userId" - ] + "required": ["id", "type", "userId"] }, "ConferencingAppOutputResponseDto": { "type": "object", "properties": { "status": { "type": "string", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/ConferencingAppsOutputDto" } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "GetConferencingAppsOauthUrlResponseDto": { "type": "object", @@ -17229,25 +15559,17 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] } }, - "required": [ - "status" - ] + "required": ["status"] }, "ConferencingAppsOutputResponseDto": { "type": "object", "properties": { "status": { "type": "string", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "type": "array", @@ -17256,10 +15578,7 @@ } } }, - "required": [ - "status", - "data" - ] + "required": ["status", "data"] }, "SetDefaultConferencingAppOutputResponseDto": { "type": "object", @@ -17267,15 +15586,10 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] } }, - "required": [ - "status" - ] + "required": ["status"] }, "DefaultConferencingAppsOutputDto": { "type": "object", @@ -17294,18 +15608,13 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] }, "data": { "$ref": "#/components/schemas/DefaultConferencingAppsOutputDto" } }, - "required": [ - "status" - ] + "required": ["status"] }, "DisconnectConferencingAppOutputResponseDto": { "type": "object", @@ -17313,16 +15622,11 @@ "status": { "type": "string", "example": "success", - "enum": [ - "success", - "error" - ] + "enum": ["success", "error"] } }, - "required": [ - "status" - ] + "required": ["status"] } } } -} \ No newline at end of file +} From b641c06592cd9314008e81c4584039bd42393ac7 Mon Sep 17 00:00:00 2001 From: supalarry Date: Mon, 17 Feb 2025 12:39:24 +0100 Subject: [PATCH 2/5] refactor structure --- ...ions-routing-forms-responses.controller.ts | 36 ----------- ...izations-routing-forms-responses.module.ts | 10 --- .../outputs/routing-form-response.output.ts | 35 ----------- ...izations-teams-routing-forms.controller.ts | 36 +++++++++++ ...rganizations-teams-routing-forms.module.ts | 13 ++++ ...izations-teams-routing-forms.repository.ts | 19 ++++++ .../get-routing-form-responses.output.ts | 11 ++-- .../outputs/routing-form-response.output.ts | 61 +++++++++++++++++++ .../outputs/routing-form.output.ts | 60 ++++++++++++++++++ ...s-teams-routing-forms-responses.service.ts | 13 ++++ .../routing-forms-responses.module.ts | 11 ---- .../routing-forms-responses.repository.ts | 18 ------ .../routing-forms-responses.service.ts | 12 ---- 13 files changed, 207 insertions(+), 128 deletions(-) delete mode 100644 apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts delete mode 100644 apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts delete mode 100644 apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller.ts create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module.ts create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository.ts rename apps/api/v2/src/modules/organizations/{ => teams}/routing-forms/outputs/get-routing-form-responses.output.ts (64%) create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form-response.output.ts create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form.output.ts create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service.ts delete mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts delete mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts delete mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts diff --git a/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts b/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts deleted file mode 100644 index c62ac9ae97bfa8..00000000000000 --- a/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { API_VERSIONS_VALUES } from "@/lib/api-versions"; -import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard"; -import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard"; -import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; -import { RoutingFormResponseDto } from "@/modules/organizations/routing-forms/outputs/routing-form-response.output"; -import { Controller, Get, Param, UseGuards } from "@nestjs/common"; -import { ApiOperation, ApiTags } from "@nestjs/swagger"; -import { plainToClass } from "class-transformer"; - -import { SUCCESS_STATUS } from "@calcom/platform-constants"; - -import { RoutingFormsResponsesService } from "../../../routing-forms-responses/routing-forms-responses.service"; -import { GetRoutingFormResponsesOutput } from "../outputs/get-routing-form-responses.output"; - -@Controller({ - path: "/v2/organizations/:orgId/forms/:formId/responses", - version: API_VERSIONS_VALUES, -}) -@ApiTags("Organizations Routing Forms") -@UseGuards(ApiAuthGuard, IsOrgGuard, IsAdminAPIEnabledGuard) -export class OrganizationsRoutingFormsResponsesController { - constructor(private readonly routingFormsResponsesService: RoutingFormsResponsesService) {} - - @Get() - @ApiOperation({ summary: "Get routing form responses" }) - async getRoutingFormResponses(@Param("formId") formId: string): Promise { - const responses = await this.routingFormsResponsesService.getRoutingFormResponses(formId); - - return { - status: SUCCESS_STATUS, - data: responses.map((response) => - plainToClass(RoutingFormResponseDto, response, { strategy: "excludeAll" }) - ), - }; - } -} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts b/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts deleted file mode 100644 index c089e079c1db4d..00000000000000 --- a/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { RoutingFormsResponsesModule } from "@/modules/routing-forms-responses/routing-forms-responses.module"; -import { Module } from "@nestjs/common"; - -import { OrganizationsRoutingFormsResponsesController } from "./controllers/organizations-routing-forms-responses.controller"; - -@Module({ - imports: [RoutingFormsResponsesModule], - controllers: [OrganizationsRoutingFormsResponsesController], -}) -export class OrganizationsRoutingFormsModule {} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts b/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts deleted file mode 100644 index 73c43782216c99..00000000000000 --- a/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ApiProperty } from "@nestjs/swagger"; -import { Expose, Type } from "class-transformer"; -import { IsDate, IsInt, IsString } from "class-validator"; - -export class RoutingFormResponseDto { - @ApiProperty() - @IsInt() - @Expose() - id!: string; - - @ApiProperty() - @IsInt() - @Expose() - formId!: string; - - @ApiProperty() - @IsString() - @Expose() - formFillerId!: string; - - @ApiProperty() - @Expose() - @IsString() - routedToBookingUid!: string; - - @ApiProperty() - @Expose() - @Type(() => Object) - response!: Record; - - @ApiProperty() - @Expose() - @IsDate() - createdAt!: Date; -} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller.ts new file mode 100644 index 00000000000000..8336ae7fcdd974 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller.ts @@ -0,0 +1,36 @@ +import { API_VERSIONS_VALUES } from "@/lib/api-versions"; +import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard"; +import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard"; +import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; +import { RoutingFormOutput } from "@/modules/organizations/teams/routing-forms/outputs/routing-form.output"; +import { OrganizationsTeamsRoutingFormsService } from "@/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service"; +import { Controller, Get, Param, UseGuards } from "@nestjs/common"; +import { ApiOperation, ApiTags } from "@nestjs/swagger"; +import { plainToClass } from "class-transformer"; + +import { SUCCESS_STATUS } from "@calcom/platform-constants"; + +import { GetRoutingFormOutput } from "../outputs/get-routing-form-responses.output"; + +@Controller({ + path: "/v2/organizations/:orgId/teams/:teamId/routing-forms/:formId", + version: API_VERSIONS_VALUES, +}) +@ApiTags("Organizations Routing Forms") +@UseGuards(ApiAuthGuard, IsOrgGuard, IsAdminAPIEnabledGuard) +export class OrganizationsTeamsRoutingFormsController { + constructor( + private readonly organizationsTeamsRoutingFormsService: OrganizationsTeamsRoutingFormsService + ) {} + + @Get() + @ApiOperation({ summary: "Get routing form" }) + async getRoutingForm(@Param("formId") formId: string): Promise { + const routingForm = await this.organizationsTeamsRoutingFormsService.getRoutingFormWithResponses(formId); + + return { + status: SUCCESS_STATUS, + data: plainToClass(RoutingFormOutput, routingForm, { strategy: "excludeAll" }), + }; + } +} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module.ts new file mode 100644 index 00000000000000..5cb24fe4823698 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module.ts @@ -0,0 +1,13 @@ +import { OrganizationsTeamsRoutingFormsController } from "@/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller"; +import { PrismaModule } from "@/modules/prisma/prisma.module"; +import { Module } from "@nestjs/common"; + +import { OrganizationsTeamsRoutingFormsRepository } from "./organizations-teams-routing-forms.repository"; +import { OrganizationsTeamsRoutingFormsService } from "./services/organizations-teams-routing-forms-responses.service"; + +@Module({ + imports: [PrismaModule], + providers: [OrganizationsTeamsRoutingFormsService, OrganizationsTeamsRoutingFormsRepository], + controllers: [OrganizationsTeamsRoutingFormsController], +}) +export class OrganizationsTeamsRoutingFormsModule {} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository.ts new file mode 100644 index 00000000000000..4fa9eeecaa80d0 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository.ts @@ -0,0 +1,19 @@ +import { PrismaReadService } from "@/modules/prisma/prisma-read.service"; +import { Injectable } from "@nestjs/common"; + +@Injectable() +export class OrganizationsTeamsRoutingFormsRepository { + constructor(private readonly dbRead: PrismaReadService) {} + + async getRoutingFormWithResponses(orgId: number, teamId: number, routingFormId: string) { + return this.dbRead.prisma.app_RoutingForms_Form.findUnique({ + where: { + id: routingFormId, + team: { + id: teamId, + parentId: orgId, + }, + }, + }); + } +} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts similarity index 64% rename from apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts rename to apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts index 3a0902dbc0254a..29d74e26fc039a 100644 --- a/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts @@ -1,3 +1,4 @@ +import { RoutingFormOutput } from "@/modules/organizations/teams/routing-forms/outputs/routing-form.output"; import { ApiProperty } from "@nestjs/swagger"; import { Expose, Type } from "class-transformer"; import { IsEnum } from "class-validator"; @@ -5,15 +6,13 @@ import { IsEnum } from "class-validator"; import { SUCCESS_STATUS } from "@calcom/platform-constants"; import { ERROR_STATUS } from "@calcom/platform-constants"; -import { RoutingFormResponseDto } from "./routing-form-response.output"; - -export class GetRoutingFormResponsesOutput { +export class GetRoutingFormOutput { @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] }) @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS; - @ApiProperty({ type: [RoutingFormResponseDto] }) + @ApiProperty({ type: RoutingFormOutput }) @Expose() - @Type(() => RoutingFormResponseDto) - data!: RoutingFormResponseDto[]; + @Type(() => RoutingFormOutput) + data!: RoutingFormOutput; } diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form-response.output.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form-response.output.ts new file mode 100644 index 00000000000000..6e2271cd98999e --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form-response.output.ts @@ -0,0 +1,61 @@ +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; +import { Expose } from "class-transformer"; +import { IsDate, IsInt, IsNotEmpty, IsOptional, IsString } from "class-validator"; + +class FormResponseValue { + @ApiProperty() + @IsString() + @IsNotEmpty() + @Expose() + label!: string; + + @ApiPropertyOptional() + @IsString() + @IsOptional() + @Expose() + identifier?: string; + + @ApiProperty() + @Expose() + value!: string | number | string[]; +} + +export class RoutingFormResponseOutput { + @ApiProperty() + @IsInt() + @Expose() + id!: string; + + @ApiProperty({ + example: { "f00b26df-f54b-4985-8d98-17c5482c6a24": { label: "participant", value: "bob" } }, + }) + @Expose() + response!: Record; + + @ApiProperty() + @IsInt() + @Expose() + formId!: string; + + @ApiProperty() + @IsString() + @Expose() + formFillerId!: string; + + @ApiProperty() + @Expose() + @IsString() + @IsOptional() + routedToBookingUid?: string; + + @ApiProperty() + @IsString() + @IsOptional() + @Expose() + chosenRouteId?: string; + + @ApiProperty() + @Expose() + @IsDate() + createdAt!: Date; +} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form.output.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form.output.ts new file mode 100644 index 00000000000000..c97a14e87cf7f3 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form.output.ts @@ -0,0 +1,60 @@ +import { RoutingFormResponseOutput } from "@/modules/organizations/teams/routing-forms/outputs/routing-form-response.output"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; +import { Expose, Type } from "class-transformer"; +import { + IsArray, + IsBoolean, + IsDate, + IsEnum, + IsInt, + IsNotEmpty, + IsObject, + IsOptional, + IsString, + ValidateNested, +} from "class-validator"; + +export class RoutingFormOutput { + @ApiProperty() + @IsString() + @Expose() + id!: string; + + @ApiProperty() + @IsString() + @Expose() + name!: string; + + @ApiPropertyOptional() + @IsString() + @IsOptional() + @Expose() + description?: string; + + @ApiProperty() + @IsInt() + @Expose() + position!: number; + + @ApiProperty() + @IsBoolean() + @Expose() + disabled!: boolean; + + @ApiProperty() + @IsDate() + @Expose() + createdAt!: Date; + + @ApiProperty() + @IsDate() + @Expose() + updatedAt!: Date; + + @ApiProperty({ type: [RoutingFormResponseOutput] }) + @ValidateNested({ each: true }) + @Type(() => RoutingFormResponseOutput) + @IsArray() + @Expose() + responses!: RoutingFormResponseOutput[]; +} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service.ts new file mode 100644 index 00000000000000..0deed34f67856f --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service.ts @@ -0,0 +1,13 @@ +import { OrganizationsTeamsRoutingFormsRepository } from "@/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository"; +import { Injectable } from "@nestjs/common"; + +@Injectable() +export class OrganizationsTeamsRoutingFormsService { + constructor( + private readonly organizationsTeamsRoutingFormsRepository: OrganizationsTeamsRoutingFormsRepository + ) {} + + async getRoutingFormWithResponses(routingFormId: string) { + return await this.organizationsTeamsRoutingFormsRepository.getRoutingFormWithResponses(routingFormId); + } +} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts deleted file mode 100644 index b1d60aecb583f1..00000000000000 --- a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { PrismaModule } from "@/modules/prisma/prisma.module"; -import { RoutingFormsResponsesRepository } from "@/modules/routing-forms-responses/routing-forms-responses.repository"; -import { RoutingFormsResponsesService } from "@/modules/routing-forms-responses/routing-forms-responses.service"; -import { Module } from "@nestjs/common"; - -@Module({ - imports: [PrismaModule], - providers: [RoutingFormsResponsesService, RoutingFormsResponsesRepository], - exports: [RoutingFormsResponsesService, RoutingFormsResponsesRepository], -}) -export class RoutingFormsResponsesModule {} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts deleted file mode 100644 index b079f43aa3fc77..00000000000000 --- a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { PrismaReadService } from "@/modules/prisma/prisma-read.service"; -import { Injectable } from "@nestjs/common"; - -@Injectable() -export class RoutingFormsResponsesRepository { - constructor(private readonly dbRead: PrismaReadService) {} - - async getRoutingFormResponses(routingFormId: string) { - return this.dbRead.prisma.app_RoutingForms_FormResponse.findMany({ - where: { - formId: routingFormId, - }, - orderBy: { - createdAt: "desc", - }, - }); - } -} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts deleted file mode 100644 index ab214d1dbc08c4..00000000000000 --- a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Injectable } from "@nestjs/common"; - -import { RoutingFormsResponsesRepository } from "./routing-forms-responses.repository"; - -@Injectable() -export class RoutingFormsResponsesService { - constructor(private readonly routingFormsRepository: RoutingFormsResponsesRepository) {} - - async getRoutingFormResponses(formId: string) { - return await this.routingFormsRepository.getRoutingFormResponses(formId); - } -} From a4879d0200dd8a14bb7942c1a463f390c54cc0a9 Mon Sep 17 00:00:00 2001 From: supalarry Date: Tue, 18 Feb 2025 10:44:04 +0100 Subject: [PATCH 3/5] Revert "refactor structure" This reverts commit b641c06592cd9314008e81c4584039bd42393ac7. --- ...ions-routing-forms-responses.controller.ts | 36 +++++++++++ ...izations-routing-forms-responses.module.ts | 10 +++ .../get-routing-form-responses.output.ts | 11 ++-- .../outputs/routing-form-response.output.ts | 35 +++++++++++ ...izations-teams-routing-forms.controller.ts | 36 ----------- ...rganizations-teams-routing-forms.module.ts | 13 ---- ...izations-teams-routing-forms.repository.ts | 19 ------ .../outputs/routing-form-response.output.ts | 61 ------------------- .../outputs/routing-form.output.ts | 60 ------------------ ...s-teams-routing-forms-responses.service.ts | 13 ---- .../routing-forms-responses.module.ts | 11 ++++ .../routing-forms-responses.repository.ts | 18 ++++++ .../routing-forms-responses.service.ts | 12 ++++ 13 files changed, 128 insertions(+), 207 deletions(-) create mode 100644 apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts create mode 100644 apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts rename apps/api/v2/src/modules/organizations/{teams => }/routing-forms/outputs/get-routing-form-responses.output.ts (64%) create mode 100644 apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts delete mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller.ts delete mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module.ts delete mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository.ts delete mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form-response.output.ts delete mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form.output.ts delete mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service.ts create mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts create mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts create mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts diff --git a/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts b/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts new file mode 100644 index 00000000000000..c62ac9ae97bfa8 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts @@ -0,0 +1,36 @@ +import { API_VERSIONS_VALUES } from "@/lib/api-versions"; +import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard"; +import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard"; +import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; +import { RoutingFormResponseDto } from "@/modules/organizations/routing-forms/outputs/routing-form-response.output"; +import { Controller, Get, Param, UseGuards } from "@nestjs/common"; +import { ApiOperation, ApiTags } from "@nestjs/swagger"; +import { plainToClass } from "class-transformer"; + +import { SUCCESS_STATUS } from "@calcom/platform-constants"; + +import { RoutingFormsResponsesService } from "../../../routing-forms-responses/routing-forms-responses.service"; +import { GetRoutingFormResponsesOutput } from "../outputs/get-routing-form-responses.output"; + +@Controller({ + path: "/v2/organizations/:orgId/forms/:formId/responses", + version: API_VERSIONS_VALUES, +}) +@ApiTags("Organizations Routing Forms") +@UseGuards(ApiAuthGuard, IsOrgGuard, IsAdminAPIEnabledGuard) +export class OrganizationsRoutingFormsResponsesController { + constructor(private readonly routingFormsResponsesService: RoutingFormsResponsesService) {} + + @Get() + @ApiOperation({ summary: "Get routing form responses" }) + async getRoutingFormResponses(@Param("formId") formId: string): Promise { + const responses = await this.routingFormsResponsesService.getRoutingFormResponses(formId); + + return { + status: SUCCESS_STATUS, + data: responses.map((response) => + plainToClass(RoutingFormResponseDto, response, { strategy: "excludeAll" }) + ), + }; + } +} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts b/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts new file mode 100644 index 00000000000000..c089e079c1db4d --- /dev/null +++ b/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts @@ -0,0 +1,10 @@ +import { RoutingFormsResponsesModule } from "@/modules/routing-forms-responses/routing-forms-responses.module"; +import { Module } from "@nestjs/common"; + +import { OrganizationsRoutingFormsResponsesController } from "./controllers/organizations-routing-forms-responses.controller"; + +@Module({ + imports: [RoutingFormsResponsesModule], + controllers: [OrganizationsRoutingFormsResponsesController], +}) +export class OrganizationsRoutingFormsModule {} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts b/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts similarity index 64% rename from apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts rename to apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts index 29d74e26fc039a..3a0902dbc0254a 100644 --- a/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts +++ b/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts @@ -1,4 +1,3 @@ -import { RoutingFormOutput } from "@/modules/organizations/teams/routing-forms/outputs/routing-form.output"; import { ApiProperty } from "@nestjs/swagger"; import { Expose, Type } from "class-transformer"; import { IsEnum } from "class-validator"; @@ -6,13 +5,15 @@ import { IsEnum } from "class-validator"; import { SUCCESS_STATUS } from "@calcom/platform-constants"; import { ERROR_STATUS } from "@calcom/platform-constants"; -export class GetRoutingFormOutput { +import { RoutingFormResponseDto } from "./routing-form-response.output"; + +export class GetRoutingFormResponsesOutput { @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] }) @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS; - @ApiProperty({ type: RoutingFormOutput }) + @ApiProperty({ type: [RoutingFormResponseDto] }) @Expose() - @Type(() => RoutingFormOutput) - data!: RoutingFormOutput; + @Type(() => RoutingFormResponseDto) + data!: RoutingFormResponseDto[]; } diff --git a/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts b/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts new file mode 100644 index 00000000000000..73c43782216c99 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts @@ -0,0 +1,35 @@ +import { ApiProperty } from "@nestjs/swagger"; +import { Expose, Type } from "class-transformer"; +import { IsDate, IsInt, IsString } from "class-validator"; + +export class RoutingFormResponseDto { + @ApiProperty() + @IsInt() + @Expose() + id!: string; + + @ApiProperty() + @IsInt() + @Expose() + formId!: string; + + @ApiProperty() + @IsString() + @Expose() + formFillerId!: string; + + @ApiProperty() + @Expose() + @IsString() + routedToBookingUid!: string; + + @ApiProperty() + @Expose() + @Type(() => Object) + response!: Record; + + @ApiProperty() + @Expose() + @IsDate() + createdAt!: Date; +} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller.ts deleted file mode 100644 index 8336ae7fcdd974..00000000000000 --- a/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { API_VERSIONS_VALUES } from "@/lib/api-versions"; -import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard"; -import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard"; -import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; -import { RoutingFormOutput } from "@/modules/organizations/teams/routing-forms/outputs/routing-form.output"; -import { OrganizationsTeamsRoutingFormsService } from "@/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service"; -import { Controller, Get, Param, UseGuards } from "@nestjs/common"; -import { ApiOperation, ApiTags } from "@nestjs/swagger"; -import { plainToClass } from "class-transformer"; - -import { SUCCESS_STATUS } from "@calcom/platform-constants"; - -import { GetRoutingFormOutput } from "../outputs/get-routing-form-responses.output"; - -@Controller({ - path: "/v2/organizations/:orgId/teams/:teamId/routing-forms/:formId", - version: API_VERSIONS_VALUES, -}) -@ApiTags("Organizations Routing Forms") -@UseGuards(ApiAuthGuard, IsOrgGuard, IsAdminAPIEnabledGuard) -export class OrganizationsTeamsRoutingFormsController { - constructor( - private readonly organizationsTeamsRoutingFormsService: OrganizationsTeamsRoutingFormsService - ) {} - - @Get() - @ApiOperation({ summary: "Get routing form" }) - async getRoutingForm(@Param("formId") formId: string): Promise { - const routingForm = await this.organizationsTeamsRoutingFormsService.getRoutingFormWithResponses(formId); - - return { - status: SUCCESS_STATUS, - data: plainToClass(RoutingFormOutput, routingForm, { strategy: "excludeAll" }), - }; - } -} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module.ts deleted file mode 100644 index 5cb24fe4823698..00000000000000 --- a/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { OrganizationsTeamsRoutingFormsController } from "@/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms.controller"; -import { PrismaModule } from "@/modules/prisma/prisma.module"; -import { Module } from "@nestjs/common"; - -import { OrganizationsTeamsRoutingFormsRepository } from "./organizations-teams-routing-forms.repository"; -import { OrganizationsTeamsRoutingFormsService } from "./services/organizations-teams-routing-forms-responses.service"; - -@Module({ - imports: [PrismaModule], - providers: [OrganizationsTeamsRoutingFormsService, OrganizationsTeamsRoutingFormsRepository], - controllers: [OrganizationsTeamsRoutingFormsController], -}) -export class OrganizationsTeamsRoutingFormsModule {} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository.ts deleted file mode 100644 index 4fa9eeecaa80d0..00000000000000 --- a/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { PrismaReadService } from "@/modules/prisma/prisma-read.service"; -import { Injectable } from "@nestjs/common"; - -@Injectable() -export class OrganizationsTeamsRoutingFormsRepository { - constructor(private readonly dbRead: PrismaReadService) {} - - async getRoutingFormWithResponses(orgId: number, teamId: number, routingFormId: string) { - return this.dbRead.prisma.app_RoutingForms_Form.findUnique({ - where: { - id: routingFormId, - team: { - id: teamId, - parentId: orgId, - }, - }, - }); - } -} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form-response.output.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form-response.output.ts deleted file mode 100644 index 6e2271cd98999e..00000000000000 --- a/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form-response.output.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; -import { Expose } from "class-transformer"; -import { IsDate, IsInt, IsNotEmpty, IsOptional, IsString } from "class-validator"; - -class FormResponseValue { - @ApiProperty() - @IsString() - @IsNotEmpty() - @Expose() - label!: string; - - @ApiPropertyOptional() - @IsString() - @IsOptional() - @Expose() - identifier?: string; - - @ApiProperty() - @Expose() - value!: string | number | string[]; -} - -export class RoutingFormResponseOutput { - @ApiProperty() - @IsInt() - @Expose() - id!: string; - - @ApiProperty({ - example: { "f00b26df-f54b-4985-8d98-17c5482c6a24": { label: "participant", value: "bob" } }, - }) - @Expose() - response!: Record; - - @ApiProperty() - @IsInt() - @Expose() - formId!: string; - - @ApiProperty() - @IsString() - @Expose() - formFillerId!: string; - - @ApiProperty() - @Expose() - @IsString() - @IsOptional() - routedToBookingUid?: string; - - @ApiProperty() - @IsString() - @IsOptional() - @Expose() - chosenRouteId?: string; - - @ApiProperty() - @Expose() - @IsDate() - createdAt!: Date; -} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form.output.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form.output.ts deleted file mode 100644 index c97a14e87cf7f3..00000000000000 --- a/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/routing-form.output.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { RoutingFormResponseOutput } from "@/modules/organizations/teams/routing-forms/outputs/routing-form-response.output"; -import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; -import { Expose, Type } from "class-transformer"; -import { - IsArray, - IsBoolean, - IsDate, - IsEnum, - IsInt, - IsNotEmpty, - IsObject, - IsOptional, - IsString, - ValidateNested, -} from "class-validator"; - -export class RoutingFormOutput { - @ApiProperty() - @IsString() - @Expose() - id!: string; - - @ApiProperty() - @IsString() - @Expose() - name!: string; - - @ApiPropertyOptional() - @IsString() - @IsOptional() - @Expose() - description?: string; - - @ApiProperty() - @IsInt() - @Expose() - position!: number; - - @ApiProperty() - @IsBoolean() - @Expose() - disabled!: boolean; - - @ApiProperty() - @IsDate() - @Expose() - createdAt!: Date; - - @ApiProperty() - @IsDate() - @Expose() - updatedAt!: Date; - - @ApiProperty({ type: [RoutingFormResponseOutput] }) - @ValidateNested({ each: true }) - @Type(() => RoutingFormResponseOutput) - @IsArray() - @Expose() - responses!: RoutingFormResponseOutput[]; -} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service.ts deleted file mode 100644 index 0deed34f67856f..00000000000000 --- a/apps/api/v2/src/modules/organizations/teams/routing-forms/services/organizations-teams-routing-forms-responses.service.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { OrganizationsTeamsRoutingFormsRepository } from "@/modules/organizations/teams/routing-forms/organizations-teams-routing-forms.repository"; -import { Injectable } from "@nestjs/common"; - -@Injectable() -export class OrganizationsTeamsRoutingFormsService { - constructor( - private readonly organizationsTeamsRoutingFormsRepository: OrganizationsTeamsRoutingFormsRepository - ) {} - - async getRoutingFormWithResponses(routingFormId: string) { - return await this.organizationsTeamsRoutingFormsRepository.getRoutingFormWithResponses(routingFormId); - } -} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts new file mode 100644 index 00000000000000..b1d60aecb583f1 --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts @@ -0,0 +1,11 @@ +import { PrismaModule } from "@/modules/prisma/prisma.module"; +import { RoutingFormsResponsesRepository } from "@/modules/routing-forms-responses/routing-forms-responses.repository"; +import { RoutingFormsResponsesService } from "@/modules/routing-forms-responses/routing-forms-responses.service"; +import { Module } from "@nestjs/common"; + +@Module({ + imports: [PrismaModule], + providers: [RoutingFormsResponsesService, RoutingFormsResponsesRepository], + exports: [RoutingFormsResponsesService, RoutingFormsResponsesRepository], +}) +export class RoutingFormsResponsesModule {} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts new file mode 100644 index 00000000000000..b079f43aa3fc77 --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.repository.ts @@ -0,0 +1,18 @@ +import { PrismaReadService } from "@/modules/prisma/prisma-read.service"; +import { Injectable } from "@nestjs/common"; + +@Injectable() +export class RoutingFormsResponsesRepository { + constructor(private readonly dbRead: PrismaReadService) {} + + async getRoutingFormResponses(routingFormId: string) { + return this.dbRead.prisma.app_RoutingForms_FormResponse.findMany({ + where: { + formId: routingFormId, + }, + orderBy: { + createdAt: "desc", + }, + }); + } +} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts new file mode 100644 index 00000000000000..ab214d1dbc08c4 --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts @@ -0,0 +1,12 @@ +import { Injectable } from "@nestjs/common"; + +import { RoutingFormsResponsesRepository } from "./routing-forms-responses.repository"; + +@Injectable() +export class RoutingFormsResponsesService { + constructor(private readonly routingFormsRepository: RoutingFormsResponsesRepository) {} + + async getRoutingFormResponses(formId: string) { + return await this.routingFormsRepository.getRoutingFormResponses(formId); + } +} From 1fa359834e61a99de07a79943f2e7de544d1dbb2 Mon Sep 17 00:00:00 2001 From: supalarry Date: Tue, 18 Feb 2025 16:00:43 +0100 Subject: [PATCH 4/5] routing forms --- .../is-routing-form-in-team.guard.ts | 40 ++++ .../organizations/organizations.module.ts | 4 +- ...ions-routing-forms-responses.controller.ts | 6 +- ...izations-routing-forms-responses.module.ts | 10 - .../outputs/routing-form-response.output.ts | 35 ---- ...ing-forms-responses.controller.e2e-spec.ts | 197 ++++++++++++++++++ ...eams-routing-forms-responses.controller.ts | 52 +++++ ...ns-teams-routing-forms-responses.module.ts | 17 ++ .../get-routing-form-responses.output.ts | 12 +- .../routing-forms-responses.module.ts | 16 +- .../routing-forms-responses.service.ts | 12 -- .../routing-forms-responses-output.service.ts | 31 +++ .../routing-forms-responses.service.ts | 17 ++ .../routing-forms/routing-forms.module.ts | 10 + .../routing-forms/routing-forms.repository.ts | 16 ++ apps/api/v2/swagger/documentation.json | 74 ++++--- .../routing-forms.repository.fixture.ts | 26 +++ docs/api-reference/v2/openapi.json | 70 ++++--- packages/platform/types/index.ts | 1 + .../platform/types/routing-forms/index.ts | 1 + .../types/routing-forms/responses/index.ts | 1 + .../responses/routing-form-response.output.ts | 54 +++++ 22 files changed, 564 insertions(+), 138 deletions(-) create mode 100644 apps/api/v2/src/modules/auth/guards/routing-forms/is-routing-form-in-team.guard.ts delete mode 100644 apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts delete mode 100644 apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.e2e-spec.ts create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.ts create mode 100644 apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms-responses.module.ts rename apps/api/v2/src/modules/organizations/{ => teams}/routing-forms/outputs/get-routing-form-responses.output.ts (54%) delete mode 100644 apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts create mode 100644 apps/api/v2/src/modules/routing-forms-responses/services/routing-forms-responses-output.service.ts create mode 100644 apps/api/v2/src/modules/routing-forms-responses/services/routing-forms-responses.service.ts create mode 100644 apps/api/v2/src/modules/routing-forms/routing-forms.module.ts create mode 100644 apps/api/v2/src/modules/routing-forms/routing-forms.repository.ts create mode 100644 apps/api/v2/test/fixtures/repository/routing-forms.repository.fixture.ts create mode 100644 packages/platform/types/routing-forms/index.ts create mode 100644 packages/platform/types/routing-forms/responses/index.ts create mode 100644 packages/platform/types/routing-forms/responses/routing-form-response.output.ts diff --git a/apps/api/v2/src/modules/auth/guards/routing-forms/is-routing-form-in-team.guard.ts b/apps/api/v2/src/modules/auth/guards/routing-forms/is-routing-form-in-team.guard.ts new file mode 100644 index 00000000000000..5dc2ab93e68714 --- /dev/null +++ b/apps/api/v2/src/modules/auth/guards/routing-forms/is-routing-form-in-team.guard.ts @@ -0,0 +1,40 @@ +import { RoutingFormsRepository } from "@/modules/routing-forms/routing-forms.repository"; +import { + Injectable, + CanActivate, + ExecutionContext, + ForbiddenException, + NotFoundException, +} from "@nestjs/common"; +import { Request } from "express"; + +import { Team } from "@calcom/prisma/client"; + +@Injectable() +export class IsRoutingFormInTeam implements CanActivate { + constructor(private routingFormsRepository: RoutingFormsRepository) {} + + async canActivate(context: ExecutionContext): Promise { + const request = context.switchToHttp().getRequest(); + const teamId: string = request.params.teamId; + const routingFormId: string = request.params.routingFormId; + + if (!routingFormId) { + throw new ForbiddenException("No routing form id found in request params."); + } + + if (!teamId) { + throw new ForbiddenException("No team id found in request params."); + } + + const routingForm = await this.routingFormsRepository.getTeamRoutingForm(Number(teamId), routingFormId); + + if (!routingForm) { + throw new NotFoundException( + `Team with id=(${teamId}) routing form with id=(${routingFormId}) not found.` + ); + } + + return true; + } +} diff --git a/apps/api/v2/src/modules/organizations/organizations.module.ts b/apps/api/v2/src/modules/organizations/organizations.module.ts index f5abb08f897505..c5a87ebae27597 100644 --- a/apps/api/v2/src/modules/organizations/organizations.module.ts +++ b/apps/api/v2/src/modules/organizations/organizations.module.ts @@ -29,7 +29,6 @@ import { OrganizationsTeamsMembershipsRepository } from "@/modules/organizations import { OrganizationsTeamsRepository } from "@/modules/organizations/repositories/organizations-teams.repository"; import { OrganizationsUsersRepository } from "@/modules/organizations/repositories/organizations-users.repository"; import { OrganizationsWebhooksRepository } from "@/modules/organizations/repositories/organizations-webhooks.repository"; -import { OrganizationsRoutingFormsModule } from "@/modules/organizations/routing-forms/organizations-routing-forms-responses.module"; import { OrganizationAttributeOptionService } from "@/modules/organizations/services/attributes/organization-attributes-option.service"; import { OrganizationAttributesService } from "@/modules/organizations/services/attributes/organization-attributes.service"; import { InputOrganizationsEventTypesService } from "@/modules/organizations/services/event-types/input.service"; @@ -42,6 +41,7 @@ import { OrganizationsTeamsService } from "@/modules/organizations/services/orga import { OrganizationsUsersService } from "@/modules/organizations/services/organizations-users-service"; import { OrganizationsWebhooksService } from "@/modules/organizations/services/organizations-webhooks.service"; import { OrganizationsService } from "@/modules/organizations/services/organizations.service"; +import { OrganizationsTeamsRoutingFormsModule } from "@/modules/organizations/teams/routing-forms/organizations-teams-routing-forms-responses.module"; import { PrismaModule } from "@/modules/prisma/prisma.module"; import { RedisModule } from "@/modules/redis/redis.module"; import { StripeModule } from "@/modules/stripe/stripe.module"; @@ -63,7 +63,7 @@ import { Module } from "@nestjs/common"; EventTypesModule_2024_06_14, TeamsEventTypesModule, TeamsModule, - OrganizationsRoutingFormsModule, + OrganizationsTeamsRoutingFormsModule, ], providers: [ OrganizationsRepository, diff --git a/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts b/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts index c62ac9ae97bfa8..50efe4b800813e 100644 --- a/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts +++ b/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts @@ -2,14 +2,14 @@ import { API_VERSIONS_VALUES } from "@/lib/api-versions"; import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard"; import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard"; import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; -import { RoutingFormResponseDto } from "@/modules/organizations/routing-forms/outputs/routing-form-response.output"; +import { RoutingFormResponseOutput } from "@/modules/organizations/routing-forms/outputs/routing-form-response.output"; import { Controller, Get, Param, UseGuards } from "@nestjs/common"; import { ApiOperation, ApiTags } from "@nestjs/swagger"; import { plainToClass } from "class-transformer"; import { SUCCESS_STATUS } from "@calcom/platform-constants"; -import { RoutingFormsResponsesService } from "../../../routing-forms-responses/routing-forms-responses.service"; +import { RoutingFormsResponsesService } from "../../../routing-forms-responses/services/routing-forms-responses.service"; import { GetRoutingFormResponsesOutput } from "../outputs/get-routing-form-responses.output"; @Controller({ @@ -29,7 +29,7 @@ export class OrganizationsRoutingFormsResponsesController { return { status: SUCCESS_STATUS, data: responses.map((response) => - plainToClass(RoutingFormResponseDto, response, { strategy: "excludeAll" }) + plainToClass(RoutingFormResponseOutput, response, { strategy: "excludeAll" }) ), }; } diff --git a/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts b/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts deleted file mode 100644 index c089e079c1db4d..00000000000000 --- a/apps/api/v2/src/modules/organizations/routing-forms/organizations-routing-forms-responses.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { RoutingFormsResponsesModule } from "@/modules/routing-forms-responses/routing-forms-responses.module"; -import { Module } from "@nestjs/common"; - -import { OrganizationsRoutingFormsResponsesController } from "./controllers/organizations-routing-forms-responses.controller"; - -@Module({ - imports: [RoutingFormsResponsesModule], - controllers: [OrganizationsRoutingFormsResponsesController], -}) -export class OrganizationsRoutingFormsModule {} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts b/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts deleted file mode 100644 index 73c43782216c99..00000000000000 --- a/apps/api/v2/src/modules/organizations/routing-forms/outputs/routing-form-response.output.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ApiProperty } from "@nestjs/swagger"; -import { Expose, Type } from "class-transformer"; -import { IsDate, IsInt, IsString } from "class-validator"; - -export class RoutingFormResponseDto { - @ApiProperty() - @IsInt() - @Expose() - id!: string; - - @ApiProperty() - @IsInt() - @Expose() - formId!: string; - - @ApiProperty() - @IsString() - @Expose() - formFillerId!: string; - - @ApiProperty() - @Expose() - @IsString() - routedToBookingUid!: string; - - @ApiProperty() - @Expose() - @Type(() => Object) - response!: Record; - - @ApiProperty() - @Expose() - @IsDate() - createdAt!: Date; -} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.e2e-spec.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.e2e-spec.ts new file mode 100644 index 00000000000000..ddc80bf93480ab --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.e2e-spec.ts @@ -0,0 +1,197 @@ +import { bootstrap } from "@/app"; +import { AppModule } from "@/app.module"; +import { GetRoutingFormResponsesOutput } from "@/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output"; +import { PrismaModule } from "@/modules/prisma/prisma.module"; +import { TokensModule } from "@/modules/tokens/tokens.module"; +import { UsersModule } from "@/modules/users/users.module"; +import { INestApplication } from "@nestjs/common"; +import { NestExpressApplication } from "@nestjs/platform-express"; +import { Test } from "@nestjs/testing"; +import { User } from "@prisma/client"; +import * as request from "supertest"; +import { ApiKeysRepositoryFixture } from "test/fixtures/repository/api-keys.repository.fixture"; +import { MembershipRepositoryFixture } from "test/fixtures/repository/membership.repository.fixture"; +import { OrganizationRepositoryFixture } from "test/fixtures/repository/organization.repository.fixture"; +import { ProfileRepositoryFixture } from "test/fixtures/repository/profiles.repository.fixture"; +import { RoutingFormsRepositoryFixture } from "test/fixtures/repository/routing-forms.repository.fixture"; +import { TeamRepositoryFixture } from "test/fixtures/repository/team.repository.fixture"; +import { UserRepositoryFixture } from "test/fixtures/repository/users.repository.fixture"; +import { randomString } from "test/utils/randomString"; + +import { SUCCESS_STATUS } from "@calcom/platform-constants"; +import { Team } from "@calcom/prisma/client"; + +describe("Organizations Teams Routing Forms Responses", () => { + let app: INestApplication; + + let userRepositoryFixture: UserRepositoryFixture; + let organizationsRepositoryFixture: OrganizationRepositoryFixture; + + let teamsRepositoryFixture: TeamRepositoryFixture; + let profileRepositoryFixture: ProfileRepositoryFixture; + let routingFormsRepositoryFixture: RoutingFormsRepositoryFixture; + let apiKeysRepositoryFixture: ApiKeysRepositoryFixture; + let membershipsRepositoryFixture: MembershipRepositoryFixture; + + let org: Team; + let orgTeam: Team; + + const authEmail = `organizations-teams-routing-forms-responses-user-${randomString()}@api.com`; + let user: User; + let apiKeyString: string; + + let routingFormId: string; + const routingFormResponses = [ + { + id: 1, + formFillerId: "cm78tvkvd0001kh8jq0tu5iq9", + response: { + "participant-field": { + label: "participant", + value: "mamut", + }, + }, + createdAt: new Date("2025-02-17T09:03:18.121Z"), + }, + ]; + + beforeAll(async () => { + const moduleRef = await Test.createTestingModule({ + imports: [AppModule, PrismaModule, UsersModule, TokensModule], + }).compile(); + + userRepositoryFixture = new UserRepositoryFixture(moduleRef); + organizationsRepositoryFixture = new OrganizationRepositoryFixture(moduleRef); + teamsRepositoryFixture = new TeamRepositoryFixture(moduleRef); + profileRepositoryFixture = new ProfileRepositoryFixture(moduleRef); + routingFormsRepositoryFixture = new RoutingFormsRepositoryFixture(moduleRef); + apiKeysRepositoryFixture = new ApiKeysRepositoryFixture(moduleRef); + membershipsRepositoryFixture = new MembershipRepositoryFixture(moduleRef); + + org = await organizationsRepositoryFixture.create({ + name: `organizations-teams-routing-forms-responses-organization-${randomString()}`, + isOrganization: true, + }); + + user = await userRepositoryFixture.create({ + email: authEmail, + username: authEmail, + }); + + const { keyString } = await apiKeysRepositoryFixture.createApiKey(user.id, null); + apiKeyString = keyString; + + orgTeam = await teamsRepositoryFixture.create({ + name: `organizations-teams-routing-forms-responses-team-${randomString()}`, + isOrganization: false, + parent: { connect: { id: org.id } }, + }); + + await membershipsRepositoryFixture.create({ + role: "ADMIN", + user: { connect: { id: user.id } }, + team: { connect: { id: org.id } }, + }); + + await membershipsRepositoryFixture.create({ + role: "ADMIN", + user: { connect: { id: user.id } }, + team: { connect: { id: orgTeam.id } }, + }); + + await profileRepositoryFixture.create({ + uid: `usr-${user.id}`, + username: authEmail, + organization: { + connect: { + id: org.id, + }, + }, + user: { + connect: { + id: user.id, + }, + }, + }); + + const routingForm = await routingFormsRepositoryFixture.create({ + name: "Test Routing Form", + description: null, + position: 0, + disabled: false, + fields: JSON.stringify([ + { + type: "text", + label: "participant", + required: true, + }, + ]), + routes: JSON.stringify([ + { + action: { type: "customPageMessage", value: "Thank you for your response" }, + }, + ]), + user: { + connect: { + id: user.id, + }, + }, + team: { + connect: { + id: orgTeam.id, + }, + }, + responses: { + create: routingFormResponses, + }, + }); + routingFormId = routingForm.id; + + app = moduleRef.createNestApplication(); + bootstrap(app as NestExpressApplication); + + await app.init(); + }); + + it("should not get routing form responses for non existing org", async () => { + return request(app.getHttpServer()) + .get(`/v2/organizations/99999/teams/${orgTeam.id}/routing-forms/${routingFormId}/responses`) + .expect(401); + }); + + it("should not get routing form responses for non existing team", async () => { + return request(app.getHttpServer()) + .get(`/v2/organizations/${org.id}/teams/99999/routing-forms/${routingFormId}/responses`) + .expect(401); + }); + + it("should not get routing form responses for non existing routing form", async () => { + return request(app.getHttpServer()) + .get(`/v2/organizations/${org.id}/teams/${orgTeam.id}/routing-forms/99999/responses`) + .expect(401); + }); + + it("should get routing form responses", async () => { + return request(app.getHttpServer()) + .get(`/v2/organizations/${org.id}/teams/${orgTeam.id}/routing-forms/${routingFormId}/responses`) + .set({ Authorization: `Bearer cal_test_${apiKeyString}` }) + .expect(200) + .then((response) => { + const responseBody: GetRoutingFormResponsesOutput = response.body; + expect(responseBody.status).toEqual(SUCCESS_STATUS); + const responseData = responseBody.data; + expect(responseData).toBeDefined(); + expect(responseData.length).toEqual(1); + expect(responseData[0].id).toEqual(routingFormResponses[0].id); + expect(responseData[0].response).toEqual(routingFormResponses[0].response); + expect(responseData[0].formFillerId).toEqual(routingFormResponses[0].formFillerId); + expect(responseData[0].createdAt).toEqual(routingFormResponses[0].createdAt.toISOString()); + }); + }); + + afterAll(async () => { + await userRepositoryFixture.deleteByEmail(user.email); + await organizationsRepositoryFixture.delete(org.id); + await app.close(); + }); +}); diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.ts new file mode 100644 index 00000000000000..cff980b761f778 --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/controllers/organizations-teams-routing-forms-responses.controller.ts @@ -0,0 +1,52 @@ +import { API_VERSIONS_VALUES } from "@/lib/api-versions"; +import { PlatformPlan } from "@/modules/auth/decorators/billing/platform-plan.decorator"; +import { Roles } from "@/modules/auth/decorators/roles/roles.decorator"; +import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard"; +import { PlatformPlanGuard } from "@/modules/auth/guards/billing/platform-plan.guard"; +import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard"; +import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; +import { IsRoutingFormInTeam } from "@/modules/auth/guards/routing-forms/is-routing-form-in-team.guard"; +import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard"; +import { Controller, Get, Param, UseGuards } from "@nestjs/common"; +import { ApiOperation, ApiTags } from "@nestjs/swagger"; +import { plainToClass } from "class-transformer"; + +import { SUCCESS_STATUS } from "@calcom/platform-constants"; +import { RoutingFormResponseOutput } from "@calcom/platform-types"; + +import { RoutingFormsResponsesService } from "../../../../routing-forms-responses/services/routing-forms-responses.service"; +import { GetRoutingFormResponsesOutput } from "../outputs/get-routing-form-responses.output"; + +@Controller({ + path: "/v2/organizations/:orgId/teams/:teamId/routing-forms/:routingFormId/responses", + version: API_VERSIONS_VALUES, +}) +@ApiTags("Orgs / Teams / Routing forms / Responses") +@UseGuards( + ApiAuthGuard, + IsOrgGuard, + IsTeamInOrg, + IsRoutingFormInTeam, + PlatformPlanGuard, + IsAdminAPIEnabledGuard +) +export class OrganizationsTeamsRoutingFormsResponsesController { + constructor(private readonly routingFormsResponsesService: RoutingFormsResponsesService) {} + + @Get() + @ApiOperation({ summary: "Get routing form responses" }) + @Roles("ORG_ADMIN") + @PlatformPlan("ESSENTIALS") + async getRoutingFormResponses( + @Param("routingFormId") routingFormId: string + ): Promise { + const routingFormResponses = await this.routingFormsResponsesService.getRoutingFormResponses( + routingFormId + ); + + return { + status: SUCCESS_STATUS, + data: routingFormResponses, + }; + } +} diff --git a/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms-responses.module.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms-responses.module.ts new file mode 100644 index 00000000000000..37ddd54928c6ff --- /dev/null +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/organizations-teams-routing-forms-responses.module.ts @@ -0,0 +1,17 @@ +import { OrganizationsRepository } from "@/modules/organizations/organizations.repository"; +import { OrganizationsTeamsRepository } from "@/modules/organizations/repositories/organizations-teams.repository"; +import { PrismaModule } from "@/modules/prisma/prisma.module"; +import { RedisModule } from "@/modules/redis/redis.module"; +import { RoutingFormsResponsesModule } from "@/modules/routing-forms-responses/routing-forms-responses.module"; +import { RoutingFormsModule } from "@/modules/routing-forms/routing-forms.module"; +import { StripeModule } from "@/modules/stripe/stripe.module"; +import { Module } from "@nestjs/common"; + +import { OrganizationsTeamsRoutingFormsResponsesController } from "./controllers/organizations-teams-routing-forms-responses.controller"; + +@Module({ + imports: [PrismaModule, StripeModule, RedisModule, RoutingFormsResponsesModule, RoutingFormsModule], + providers: [OrganizationsRepository, OrganizationsTeamsRepository], + controllers: [OrganizationsTeamsRoutingFormsResponsesController], +}) +export class OrganizationsTeamsRoutingFormsModule {} diff --git a/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts similarity index 54% rename from apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts rename to apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts index 3a0902dbc0254a..c32ebd9d0bb035 100644 --- a/apps/api/v2/src/modules/organizations/routing-forms/outputs/get-routing-form-responses.output.ts +++ b/apps/api/v2/src/modules/organizations/teams/routing-forms/outputs/get-routing-form-responses.output.ts @@ -2,18 +2,16 @@ import { ApiProperty } from "@nestjs/swagger"; import { Expose, Type } from "class-transformer"; import { IsEnum } from "class-validator"; -import { SUCCESS_STATUS } from "@calcom/platform-constants"; -import { ERROR_STATUS } from "@calcom/platform-constants"; - -import { RoutingFormResponseDto } from "./routing-form-response.output"; +import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants"; +import { RoutingFormResponseOutput } from "@calcom/platform-types"; export class GetRoutingFormResponsesOutput { @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] }) @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS; - @ApiProperty({ type: [RoutingFormResponseDto] }) + @ApiProperty({ type: [RoutingFormResponseOutput] }) @Expose() - @Type(() => RoutingFormResponseDto) - data!: RoutingFormResponseDto[]; + @Type(() => RoutingFormResponseOutput) + data!: RoutingFormResponseOutput[]; } diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts index b1d60aecb583f1..093cdada2944a1 100644 --- a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts +++ b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.module.ts @@ -1,11 +1,21 @@ +import { OrganizationsRepository } from "@/modules/organizations/organizations.repository"; import { PrismaModule } from "@/modules/prisma/prisma.module"; import { RoutingFormsResponsesRepository } from "@/modules/routing-forms-responses/routing-forms-responses.repository"; -import { RoutingFormsResponsesService } from "@/modules/routing-forms-responses/routing-forms-responses.service"; +import { RoutingFormsResponsesOutputService } from "@/modules/routing-forms-responses/services/routing-forms-responses-output.service"; +import { RoutingFormsResponsesService } from "@/modules/routing-forms-responses/services/routing-forms-responses.service"; import { Module } from "@nestjs/common"; @Module({ imports: [PrismaModule], - providers: [RoutingFormsResponsesService, RoutingFormsResponsesRepository], - exports: [RoutingFormsResponsesService, RoutingFormsResponsesRepository], + providers: [ + RoutingFormsResponsesService, + RoutingFormsResponsesRepository, + RoutingFormsResponsesOutputService, + ], + exports: [ + RoutingFormsResponsesService, + RoutingFormsResponsesRepository, + RoutingFormsResponsesOutputService, + ], }) export class RoutingFormsResponsesModule {} diff --git a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts b/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts deleted file mode 100644 index ab214d1dbc08c4..00000000000000 --- a/apps/api/v2/src/modules/routing-forms-responses/routing-forms-responses.service.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Injectable } from "@nestjs/common"; - -import { RoutingFormsResponsesRepository } from "./routing-forms-responses.repository"; - -@Injectable() -export class RoutingFormsResponsesService { - constructor(private readonly routingFormsRepository: RoutingFormsResponsesRepository) {} - - async getRoutingFormResponses(formId: string) { - return await this.routingFormsRepository.getRoutingFormResponses(formId); - } -} diff --git a/apps/api/v2/src/modules/routing-forms-responses/services/routing-forms-responses-output.service.ts b/apps/api/v2/src/modules/routing-forms-responses/services/routing-forms-responses-output.service.ts new file mode 100644 index 00000000000000..38c787ac36749a --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms-responses/services/routing-forms-responses-output.service.ts @@ -0,0 +1,31 @@ +import { Injectable } from "@nestjs/common"; +import { plainToClass } from "class-transformer"; + +import { RoutingFormResponseOutput, RoutingFormResponseResponseOutput } from "@calcom/platform-types"; +import { App_RoutingForms_FormResponse } from "@calcom/prisma/client"; + +@Injectable() +export class RoutingFormsResponsesOutputService { + getRoutingFormResponses( + dbRoutingFormResponses: App_RoutingForms_FormResponse[] + ): RoutingFormResponseOutput[] { + return dbRoutingFormResponses.map((response) => { + const parsed = plainToClass(RoutingFormResponseOutput, response, { strategy: "excludeAll" }); + + // note(Lauris): I don't know why plainToClass(RoutingFormResponseOutput) + // erases nested "response" object so parsing and attaching it manually + const parsedResponse: Record = {}; + const responseData = response.response || {}; + for (const [key, value] of Object.entries(responseData)) { + parsedResponse[key] = plainToClass(RoutingFormResponseResponseOutput, value, { + strategy: "excludeAll", + }); + } + + return { + ...parsed, + response: parsedResponse, + }; + }); + } +} diff --git a/apps/api/v2/src/modules/routing-forms-responses/services/routing-forms-responses.service.ts b/apps/api/v2/src/modules/routing-forms-responses/services/routing-forms-responses.service.ts new file mode 100644 index 00000000000000..c9c76f6603dd2e --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms-responses/services/routing-forms-responses.service.ts @@ -0,0 +1,17 @@ +import { RoutingFormsResponsesOutputService } from "@/modules/routing-forms-responses/services/routing-forms-responses-output.service"; +import { Injectable } from "@nestjs/common"; + +import { RoutingFormsResponsesRepository } from "../routing-forms-responses.repository"; + +@Injectable() +export class RoutingFormsResponsesService { + constructor( + private readonly routingFormsRepository: RoutingFormsResponsesRepository, + private readonly routingFormsResponsesOutputService: RoutingFormsResponsesOutputService + ) {} + + async getRoutingFormResponses(routingFormId: string) { + const responses = await this.routingFormsRepository.getRoutingFormResponses(routingFormId); + return this.routingFormsResponsesOutputService.getRoutingFormResponses(responses); + } +} diff --git a/apps/api/v2/src/modules/routing-forms/routing-forms.module.ts b/apps/api/v2/src/modules/routing-forms/routing-forms.module.ts new file mode 100644 index 00000000000000..579169067a8ded --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms/routing-forms.module.ts @@ -0,0 +1,10 @@ +import { PrismaModule } from "@/modules/prisma/prisma.module"; +import { RoutingFormsRepository } from "@/modules/routing-forms/routing-forms.repository"; +import { Module } from "@nestjs/common"; + +@Module({ + imports: [PrismaModule], + providers: [RoutingFormsRepository], + exports: [RoutingFormsRepository], +}) +export class RoutingFormsModule {} diff --git a/apps/api/v2/src/modules/routing-forms/routing-forms.repository.ts b/apps/api/v2/src/modules/routing-forms/routing-forms.repository.ts new file mode 100644 index 00000000000000..f648acff473594 --- /dev/null +++ b/apps/api/v2/src/modules/routing-forms/routing-forms.repository.ts @@ -0,0 +1,16 @@ +import { PrismaReadService } from "@/modules/prisma/prisma-read.service"; +import { Injectable } from "@nestjs/common"; + +@Injectable() +export class RoutingFormsRepository { + constructor(private readonly dbRead: PrismaReadService) {} + + async getTeamRoutingForm(teamId: number, routingFormId: string) { + return this.dbRead.prisma.app_RoutingForms_Form.findFirst({ + where: { + id: routingFormId, + teamId, + }, + }); + } +} diff --git a/apps/api/v2/swagger/documentation.json b/apps/api/v2/swagger/documentation.json index 2d3308022ab4d9..639e220a65d697 100644 --- a/apps/api/v2/swagger/documentation.json +++ b/apps/api/v2/swagger/documentation.json @@ -2557,6 +2557,37 @@ ] } }, + "/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routing}-formId/responses": { + "get": { + "operationId": "OrganizationsTeamsRoutingFormsResponsesController_getRoutingFormResponses", + "summary": "Get routing form responses", + "parameters": [ + { + "name": "routing-formId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRoutingFormResponsesOutput" + } + } + } + } + }, + "tags": [ + "Orgs / Teams / Routing forms / Responses" + ] + } + }, "/v2/organizations/{orgId}/teams/{teamId}/users/{userId}/schedules": { "get": { "operationId": "OrganizationsTeamsSchedulesController_getUserSchedules", @@ -5051,37 +5082,6 @@ ] } }, - "/v2/organizations/{orgId}/forms/{formId}/responses": { - "get": { - "operationId": "OrganizationsRoutingFormsResponsesController_getRoutingFormResponses", - "summary": "Get routing form responses", - "parameters": [ - { - "name": "formId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetRoutingFormResponsesOutput" - } - } - } - } - }, - "tags": [ - "Organizations Routing Forms" - ] - } - }, "/v2/schedules": { "post": { "operationId": "SchedulesController_2024_06_11_createSchedule", @@ -14354,7 +14354,7 @@ "data" ] }, - "RoutingFormResponseDto": { + "RoutingFormResponseOutput": { "type": "object", "properties": { "id": { @@ -14370,7 +14370,13 @@ "type": "string" }, "response": { - "type": "object" + "type": "object", + "example": { + "f00b26df-f54b-4985-8d98-17c5482c6a24": { + "label": "participant", + "value": "mamut" + } + } }, "createdAt": { "format": "date-time", @@ -14400,7 +14406,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/RoutingFormResponseDto" + "$ref": "#/components/schemas/RoutingFormResponseOutput" } } }, diff --git a/apps/api/v2/test/fixtures/repository/routing-forms.repository.fixture.ts b/apps/api/v2/test/fixtures/repository/routing-forms.repository.fixture.ts new file mode 100644 index 00000000000000..2c5da5584fe33e --- /dev/null +++ b/apps/api/v2/test/fixtures/repository/routing-forms.repository.fixture.ts @@ -0,0 +1,26 @@ +import { PrismaReadService } from "@/modules/prisma/prisma-read.service"; +import { PrismaWriteService } from "@/modules/prisma/prisma-write.service"; +import { TestingModule } from "@nestjs/testing"; +import { Prisma, App_RoutingForms_Form } from "@prisma/client"; + +export class RoutingFormsRepositoryFixture { + private prismaReadClient: PrismaReadService["prisma"]; + private prismaWriteClient: PrismaWriteService["prisma"]; + + constructor(private readonly module: TestingModule) { + this.prismaReadClient = module.get(PrismaReadService).prisma; + this.prismaWriteClient = module.get(PrismaWriteService).prisma; + } + + async get(routingFormId: App_RoutingForms_Form["id"]) { + return this.prismaReadClient.app_RoutingForms_Form.findUnique({ where: { id: routingFormId } }); + } + + async create(data: Prisma.App_RoutingForms_FormCreateInput) { + return this.prismaWriteClient.app_RoutingForms_Form.create({ data }); + } + + async delete(routingFormId: App_RoutingForms_Form["id"]) { + return this.prismaWriteClient.app_RoutingForms_Form.delete({ where: { id: routingFormId } }); + } +} diff --git a/docs/api-reference/v2/openapi.json b/docs/api-reference/v2/openapi.json index 12c66c1ea8189b..a7ce9b5bf87fea 100644 --- a/docs/api-reference/v2/openapi.json +++ b/docs/api-reference/v2/openapi.json @@ -2422,6 +2422,35 @@ "tags": ["Orgs / Teams / Memberships"] } }, + "/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routing}-formId/responses": { + "get": { + "operationId": "OrganizationsTeamsRoutingFormsResponsesController_getRoutingFormResponses", + "summary": "Get routing form responses", + "parameters": [ + { + "name": "routing-formId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRoutingFormResponsesOutput" + } + } + } + } + }, + "tags": ["Orgs / Teams / Routing forms / Responses"] + } + }, "/v2/organizations/{orgId}/teams/{teamId}/users/{userId}/schedules": { "get": { "operationId": "OrganizationsTeamsSchedulesController_getUserSchedules", @@ -4759,35 +4788,6 @@ "tags": ["Me"] } }, - "/v2/organizations/{orgId}/forms/{formId}/responses": { - "get": { - "operationId": "OrganizationsRoutingFormsResponsesController_getRoutingFormResponses", - "summary": "Get routing form responses", - "parameters": [ - { - "name": "formId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetRoutingFormResponsesOutput" - } - } - } - } - }, - "tags": ["Organizations Routing Forms"] - } - }, "/v2/schedules": { "post": { "operationId": "SchedulesController_2024_06_11_createSchedule", @@ -12946,7 +12946,7 @@ }, "required": ["status", "data"] }, - "RoutingFormResponseDto": { + "RoutingFormResponseOutput": { "type": "object", "properties": { "id": { @@ -12962,7 +12962,13 @@ "type": "string" }, "response": { - "type": "object" + "type": "object", + "example": { + "f00b26df-f54b-4985-8d98-17c5482c6a24": { + "label": "participant", + "value": "mamut" + } + } }, "createdAt": { "format": "date-time", @@ -12982,7 +12988,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/RoutingFormResponseDto" + "$ref": "#/components/schemas/RoutingFormResponseOutput" } } }, diff --git a/packages/platform/types/index.ts b/packages/platform/types/index.ts index 9b23abb356a81f..aa7b0290eb704a 100644 --- a/packages/platform/types/index.ts +++ b/packages/platform/types/index.ts @@ -10,3 +10,4 @@ export * from "./event-types"; export * from "./organizations"; export * from "./teams"; export * from "./embed"; +export * from "./routing-forms"; diff --git a/packages/platform/types/routing-forms/index.ts b/packages/platform/types/routing-forms/index.ts new file mode 100644 index 00000000000000..8818ea007ef808 --- /dev/null +++ b/packages/platform/types/routing-forms/index.ts @@ -0,0 +1 @@ +export * from "./responses"; diff --git a/packages/platform/types/routing-forms/responses/index.ts b/packages/platform/types/routing-forms/responses/index.ts new file mode 100644 index 00000000000000..93ffea5be0f203 --- /dev/null +++ b/packages/platform/types/routing-forms/responses/index.ts @@ -0,0 +1 @@ +export * from "./routing-form-response.output"; diff --git a/packages/platform/types/routing-forms/responses/routing-form-response.output.ts b/packages/platform/types/routing-forms/responses/routing-form-response.output.ts new file mode 100644 index 00000000000000..8434414e7ac614 --- /dev/null +++ b/packages/platform/types/routing-forms/responses/routing-form-response.output.ts @@ -0,0 +1,54 @@ +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; +import { Expose } from "class-transformer"; +import { IsDate, IsInt, IsString, IsObject } from "class-validator"; + +export class RoutingFormResponseResponseOutput { + @ApiProperty() + @IsString() + @Expose() + label!: string; + + @ApiPropertyOptional() + @IsString() + @Expose() + identifier?: string; + + @ApiProperty() + @IsString() + @Expose() + value!: string | number | string[]; +} + +export class RoutingFormResponseOutput { + @ApiProperty() + @IsInt() + @Expose() + id!: string; + + @ApiProperty() + @IsInt() + @Expose() + formId!: string; + + @ApiProperty() + @IsString() + @Expose() + formFillerId!: string; + + @ApiProperty() + @Expose() + @IsString() + routedToBookingUid!: string; + + @ApiProperty({ + example: { "f00b26df-f54b-4985-8d98-17c5482c6a24": { label: "participant", value: "mamut" } }, + }) + @IsObject() + @Expose() + response!: Record; + + @ApiProperty() + @Expose() + @IsDate() + createdAt!: Date; +} From 0aefad72aca7b349ecc67c00c5aa69a924cc7a2c Mon Sep 17 00:00:00 2001 From: supalarry Date: Tue, 18 Feb 2025 16:13:19 +0100 Subject: [PATCH 5/5] remove unused file --- ...ions-routing-forms-responses.controller.ts | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts diff --git a/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts b/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts deleted file mode 100644 index 50efe4b800813e..00000000000000 --- a/apps/api/v2/src/modules/organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { API_VERSIONS_VALUES } from "@/lib/api-versions"; -import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard"; -import { IsAdminAPIEnabledGuard } from "@/modules/auth/guards/organizations/is-admin-api-enabled.guard"; -import { IsOrgGuard } from "@/modules/auth/guards/organizations/is-org.guard"; -import { RoutingFormResponseOutput } from "@/modules/organizations/routing-forms/outputs/routing-form-response.output"; -import { Controller, Get, Param, UseGuards } from "@nestjs/common"; -import { ApiOperation, ApiTags } from "@nestjs/swagger"; -import { plainToClass } from "class-transformer"; - -import { SUCCESS_STATUS } from "@calcom/platform-constants"; - -import { RoutingFormsResponsesService } from "../../../routing-forms-responses/services/routing-forms-responses.service"; -import { GetRoutingFormResponsesOutput } from "../outputs/get-routing-form-responses.output"; - -@Controller({ - path: "/v2/organizations/:orgId/forms/:formId/responses", - version: API_VERSIONS_VALUES, -}) -@ApiTags("Organizations Routing Forms") -@UseGuards(ApiAuthGuard, IsOrgGuard, IsAdminAPIEnabledGuard) -export class OrganizationsRoutingFormsResponsesController { - constructor(private readonly routingFormsResponsesService: RoutingFormsResponsesService) {} - - @Get() - @ApiOperation({ summary: "Get routing form responses" }) - async getRoutingFormResponses(@Param("formId") formId: string): Promise { - const responses = await this.routingFormsResponsesService.getRoutingFormResponses(formId); - - return { - status: SUCCESS_STATUS, - data: responses.map((response) => - plainToClass(RoutingFormResponseOutput, response, { strategy: "excludeAll" }) - ), - }; - } -}