Files
837349e3d3 feat: Organization onboarding improvement - Payment before creation of org but onboarding doesn't require payment (#18990)
* create seed for org upgrade

* migrate about/new pages

* pages refactor + use persistant zustand store

* invited members view + confirm button

* add check to org slug

* check reserved subdomain

* remove quotes from subdomain env var

* intro to creation + billing

* create price

* fix types

* createWithPaymentIntent + permission check on teams

* open stripe link in popup

* intro to tests

* organization price and seat override tests

* move permissions to a new permission service

* update env and permission check

* intro to paid invoice trigger

* dont use subId

* wip

* Get e2e working with migration of teams and members

* fix ts errors

* Get flow working again

* Fix various issues and refactor

* Some more fixes

* Fix wrong page route link

* Platform onboarding fix and moving members of team to org rix

* Platform onboarding fix and moving members of team to org rix

* Fix tests, found a bug

* Get custom price flow working

* Get admin impersonation flow working for a non-existent user

* Fix unit test

* Admin onboarding handover

* fix admin onboarding tests

* fix ts error

* Get updateQuantity working

* More fixes

* fix test

* fix schema name

* Add tests

* Add missing file

* More tests

* Add more tests

* fix mt-2 moving down input into overflow

* fix handover layout removing HOC

* Update PR_TODO.md

* fix ts error due to merge conflict

---------

Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Hariom <[email protected]>
Co-authored-by: Omar López <[email protected]>
2025-03-13 11:17:43 +00:00

52 lines
2.0 KiB
SQL

-- CreateEnum
CREATE TYPE "BillingPeriod" AS ENUM ('MONTHLY', 'ANNUALLY');
-- CreateTable
CREATE TABLE "OrganizationOnboarding" (
"id" TEXT NOT NULL,
"createdById" INTEGER NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"orgOwnerEmail" TEXT NOT NULL,
"error" TEXT,
"updatedAt" TIMESTAMP(3) NOT NULL,
"organizationId" INTEGER,
"billingPeriod" "BillingPeriod" NOT NULL,
"pricePerSeat" DOUBLE PRECISION NOT NULL,
"seats" INTEGER NOT NULL,
"isPlatform" BOOLEAN NOT NULL DEFAULT false,
"name" TEXT NOT NULL,
"slug" TEXT NOT NULL,
"logo" TEXT,
"bio" TEXT,
"isDomainConfigured" BOOLEAN NOT NULL DEFAULT false,
"stripeCustomerId" TEXT,
"stripeSubscriptionId" TEXT,
"stripeSubscriptionItemId" TEXT,
"invitedMembers" JSONB NOT NULL DEFAULT '[]',
"teams" JSONB NOT NULL DEFAULT '[]',
"isComplete" BOOLEAN NOT NULL DEFAULT false,
CONSTRAINT "OrganizationOnboarding_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "OrganizationOnboarding_orgOwnerEmail_key" ON "OrganizationOnboarding"("orgOwnerEmail");
-- CreateIndex
CREATE UNIQUE INDEX "OrganizationOnboarding_organizationId_key" ON "OrganizationOnboarding"("organizationId");
-- CreateIndex
CREATE UNIQUE INDEX "OrganizationOnboarding_stripeCustomerId_key" ON "OrganizationOnboarding"("stripeCustomerId");
-- CreateIndex
CREATE INDEX "OrganizationOnboarding_orgOwnerEmail_idx" ON "OrganizationOnboarding"("orgOwnerEmail");
-- CreateIndex
CREATE INDEX "OrganizationOnboarding_stripeCustomerId_idx" ON "OrganizationOnboarding"("stripeCustomerId");
-- AddForeignKey
ALTER TABLE "OrganizationOnboarding" ADD CONSTRAINT "OrganizationOnboarding_createdById_fkey" FOREIGN KEY ("createdById") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OrganizationOnboarding" ADD CONSTRAINT "OrganizationOnboarding_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;