Scheduling infrastructure for absolutely everyone.
chore: add successRedirectUrl to event-types api v2 (#18136)
Morgan2ace1d10173a
diff --git a/apps/api/v2/src/modules/organizations/controllers/event-types/organizations-event-types.e2e-spec.ts b/apps/api/v2/src/modules/organizations/controllers/event-types/organizations-event-types.e2e-spec.tsindex 8b3188fa5a5..72071a999f1 100644--- a/apps/api/v2/src/modules/organizations/controllers/event-types/organizations-event-types.e2e-spec.ts+++ b/apps/api/v2/src/modules/organizations/controllers/event-types/organizations-event-types.e2e-spec.ts@@ -235,6 +235,7 @@ describe("Organizations Event Types Endpoints", () => {it("should create a collective team event-type", async () => {const body: CreateTeamEventTypeInput_2024_06_14 = {+ successRedirectUrl: "https://masterchief.com/argentina/flan/video/1234",title: "Coding consultation collective",slug: "coding-consultation collective",description: "Our team will review your codebase.",@@ -334,7 +335,7 @@ describe("Organizations Event Types Endpoints", () => {expect(data.hideCalendarEventDetails).toEqual(body.hideCalendarEventDetails);expect(data.lockTimeZoneToggleOnBookingPage).toEqual(body.lockTimeZoneToggleOnBookingPage);expect(data.color).toEqual(body.color);-+ expect(data.successRedirectUrl).toEqual("https://masterchief.com/argentina/flan/video/1234");collectiveEventType = responseBody.data;});});@@ -496,6 +497,7 @@ describe("Organizations Event Types Endpoints", () => {const body: UpdateTeamEventTypeInput_2024_06_14 = {hosts: newHosts,+ successRedirectUrl: "https://new-url-success.com",};return request(app.getHttpServer())@@ -507,6 +509,7 @@ describe("Organizations Event Types Endpoints", () => {expect(responseBody.status).toEqual(SUCCESS_STATUS);const eventType = responseBody.data;+ expect(eventType.successRedirectUrl).toEqual("https://new-url-success.com");expect(eventType.title).toEqual(collectiveEventType.title);expect(eventType.hosts.length).toEqual(1);evaluateHost(eventType.hosts[0], newHosts[0]);@@ -526,6 +529,7 @@ describe("Organizations Event Types Endpoints", () => {const body: UpdateTeamEventTypeInput_2024_06_14 = {title: newTitle,hosts: newHosts,+ successRedirectUrl: "https://new-url-success-managed.com",};return request(app.getHttpServer())@@ -569,6 +573,7 @@ describe("Organizations Event Types Endpoints", () => {expect(responseTeammate1Event?.title).toEqual(newTitle);managedEventType = responseBody.data[0];+ expect(managedEventType.successRedirectUrl).toEqual("https://new-url-success-managed.com");});});diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.tsindex 29c3fc30db8..e1d754290c9 100644--- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts+++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts@@ -11,6 +11,7 @@ import {IsBoolean,IsOptional,Min,+ IsUrl,IsEnum,IsArray,ValidateNested,@@ -381,6 +382,14 @@ export class CreateEventTypeInput_2024_06_14 {@IsBoolean()@DocsPropertyOptional()hideCalendarEventDetails?: boolean;++ @IsOptional()+ @IsUrl()+ @DocsPropertyOptional({+ description: "A valid URL where the booker will redirect to, once the booking is completed successfully",+ example: "https://masterchief.com/argentina/flan/video/9129412",+ })+ successRedirectUrl?: string;}export enum HostPriority {diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.tsindex a42a550c8dd..ba11751b3fb 100644--- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts+++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts@@ -15,6 +15,7 @@ import {IsArray,ArrayNotEmpty,ArrayUnique,+ IsUrl,} from "class-validator";import { BookerLayouts_2024_06_14 } from "./booker-layouts.input";@@ -382,6 +383,14 @@ export class UpdateEventTypeInput_2024_06_14 {@IsBoolean()@DocsPropertyOptional()hideCalendarEventDetails?: boolean;++ @IsOptional()+ @IsUrl()+ @DocsPropertyOptional({+ description: "A valid URL where the booker will redirect to, once the booking is completed successfully",+ example: "https://masterchief.com/argentina/flan/video/9129412",+ })+ successRedirectUrl?: string;}export class UpdateTeamEventTypeInput_2024_06_14 extends UpdateEventTypeInput_2024_06_14 {