add free plan (#549)
- add new fields to support this - when free: - fade out all event types after first - hide events after first on booking page - make booking page after the first one 404 if accessed directly - add e2e tests
This commit is contained in:
1 parent
fa35af7bd8
commit
7e6e935ed3
29 files changed
+880
-261
No files matched your search
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[userId,slug]` on the table `EventType` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "EventType.userId_slug_unique" ON "EventType"("userId", "slug");
|
||||
@@ -0,0 +1,5 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "UserPlan" AS ENUM ('FREE', 'TRIAL', 'PRO');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "plan" "UserPlan" NOT NULL DEFAULT E'PRO';
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[username]` on the table `users` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "users.username_unique" ON "users"("username");
|
||||
+12
-2
@@ -33,6 +33,8 @@ model EventType {
|
||||
requiresConfirmation Boolean @default(false)
|
||||
minimumBookingNotice Int @default(120)
|
||||
Schedule Schedule[]
|
||||
|
||||
@@unique([userId, slug])
|
||||
}
|
||||
|
||||
model Credential {
|
||||
@@ -43,9 +45,15 @@ model Credential {
|
||||
userId Int?
|
||||
}
|
||||
|
||||
enum UserPlan {
|
||||
FREE
|
||||
TRIAL
|
||||
PRO
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String?
|
||||
username String? @unique
|
||||
name String?
|
||||
email String? @unique
|
||||
emailVerified DateTime?
|
||||
@@ -68,6 +76,8 @@ model User {
|
||||
selectedCalendars SelectedCalendar[]
|
||||
completedOnboarding Boolean? @default(false)
|
||||
|
||||
|
||||
plan UserPlan @default(PRO)
|
||||
Schedule Schedule[]
|
||||
@@map(name: "users")
|
||||
}
|
||||
@@ -195,7 +205,7 @@ model EventTypeCustomInput {
|
||||
label String
|
||||
type EventTypeCustomInputType
|
||||
required Boolean
|
||||
placeholder String @default("")
|
||||
placeholder String @default("")
|
||||
}
|
||||
|
||||
model ResetPasswordRequest {
|
||||
|
||||
Reference in new issue
Block a user