feat: add redirect uris for booking success, cancel and reschedule for a platform user (#14518)

* update typings

* update prisma to include redirect uris for booking success, cancel and reschedule

* update migrations

* add input for uris and send them back in custom hook

* display new uris

* add type for enabling emails

* update prisma schema and add migrations

* chores

* fixup

* chore: fix style, remove console log, rewrite migration

---------

Co-authored-by: Morgan Vernay <[email protected]>
Co-authored-by: Morgan <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-04-11 17:46:57 +00:00
1 parent af0cc5c899
commit 7836aeacc6
7 files changed
+129 -4

No files matched your search

+17 -1
View File
@@ -1,4 +1,4 @@
import { IsArray, IsNumber, IsOptional, IsString } from "class-validator";
import { IsArray, IsNumber, IsOptional, IsBoolean, IsString } from "class-validator";
import { z } from "zod";
export class CreateOAuthClientInput {
@@ -15,6 +15,22 @@ export class CreateOAuthClientInput {
@IsNumber()
permissions!: number;
@IsOptional()
@IsString()
bookingRedirectUri?: string;
@IsOptional()
@IsString()
bookingCancelRedirectUri?: string;
@IsOptional()
@IsString()
bookingRescheduleRedirectUri?: string;
@IsOptional()
@IsBoolean()
areEmailsEnabled?: boolean;
}
export class DeleteOAuthClientInput {
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "PlatformOAuthClient" ADD COLUMN "areEmailsEnabled" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "bookingCancelRedirectUri" TEXT,
ADD COLUMN "bookingRedirectUri" TEXT,
ADD COLUMN "bookingRescheduleRedirectUri" TEXT;
+5
View File
@@ -1228,6 +1228,11 @@ model PlatformOAuthClient {
refreshToken RefreshToken[]
authorizationTokens PlatformAuthorizationToken[]
bookingRedirectUri String?
bookingCancelRedirectUri String?
bookingRescheduleRedirectUri String?
areEmailsEnabled Boolean @default(false)
createdAt DateTime @default(now())
}