✨ (billing) Implement custom plan
This commit is contained in:
committed by
Baptiste Arnaud
parent
3f7dc79918
commit
385853ca3c
@ -0,0 +1,30 @@
|
||||
-- AlterEnum
|
||||
ALTER TYPE "Plan" ADD VALUE 'CUSTOM';
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Workspace" ADD COLUMN "customChatsLimit" INTEGER,
|
||||
ADD COLUMN "customSeatsLimit" INTEGER,
|
||||
ADD COLUMN "customStorageLimit" INTEGER;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "ClaimableCustomPlan" (
|
||||
"id" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"claimedAt" TIMESTAMP(3),
|
||||
"name" TEXT NOT NULL,
|
||||
"description" TEXT,
|
||||
"price" INTEGER NOT NULL,
|
||||
"currency" TEXT NOT NULL,
|
||||
"workspaceId" TEXT NOT NULL,
|
||||
"chatsLimit" INTEGER NOT NULL,
|
||||
"storageLimit" INTEGER NOT NULL,
|
||||
"seatsLimit" INTEGER NOT NULL,
|
||||
|
||||
CONSTRAINT "ClaimableCustomPlan_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ClaimableCustomPlan_workspaceId_key" ON "ClaimableCustomPlan"("workspaceId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "ClaimableCustomPlan" ADD CONSTRAINT "ClaimableCustomPlan_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "Workspace"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
@ -84,6 +84,10 @@ model Workspace {
|
||||
storageLimitFirstEmailSentAt DateTime?
|
||||
chatsLimitSecondEmailSentAt DateTime?
|
||||
storageLimitSecondEmailSentAt DateTime?
|
||||
claimableCustomPlan ClaimableCustomPlan?
|
||||
customChatsLimit Int?
|
||||
customStorageLimit Int?
|
||||
customSeatsLimit Int?
|
||||
}
|
||||
|
||||
model MemberInWorkspace {
|
||||
@ -263,6 +267,21 @@ model Webhook {
|
||||
typebot Typebot @relation(fields: [typebotId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model ClaimableCustomPlan {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
claimedAt DateTime?
|
||||
name String
|
||||
description String?
|
||||
price Int
|
||||
currency String
|
||||
workspaceId String @unique
|
||||
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
||||
chatsLimit Int
|
||||
storageLimit Int
|
||||
seatsLimit Int
|
||||
}
|
||||
|
||||
enum WorkspaceRole {
|
||||
ADMIN
|
||||
MEMBER
|
||||
@ -280,6 +299,7 @@ enum Plan {
|
||||
PRO
|
||||
LIFETIME
|
||||
OFFERED
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
enum CollaborationType {
|
||||
|
Reference in New Issue
Block a user