Skip to content

Commit c875d7b

Browse files
chore: remove all Stripe billing code and database schema (#1069)
* chore: remove all Stripe billing code and database schema Billing was an enterprise entitlement that is no longer needed. This removes the Stripe integration, billing UI, subscription management, and related database fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: add CHANGELOG entry for billing removal Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * update lock file * remove changelog --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 17f1b7f commit c875d7b

File tree

33 files changed

+25
-1290
lines changed

33 files changed

+25
-1290
lines changed

.env.development

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ CONFIG_PATH=${PWD}/config.json # Path to the sourcebot config file (if one exist
4040
# Redis
4141
REDIS_URL="redis://localhost:6379"
4242

43-
# Stripe
44-
# STRIPE_SECRET_KEY: z.string().optional(),
45-
# STRIPE_PRODUCT_ID: z.string().optional(),
46-
# STRIPE_WEBHOOK_SECRET: z.string().optional(),
47-
# STRIPE_ENABLE_TEST_CLOCKS=false
48-
4943
# Agents
5044

5145
# GITHUB_APP_ID=
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `stripeCustomerId` on the `Org` table. All the data in the column will be lost.
5+
- You are about to drop the column `stripeLastUpdatedAt` on the `Org` table. All the data in the column will be lost.
6+
- You are about to drop the column `stripeSubscriptionStatus` on the `Org` table. All the data in the column will be lost.
7+
8+
*/
9+
-- AlterTable
10+
ALTER TABLE "Org" DROP COLUMN "stripeCustomerId",
11+
DROP COLUMN "stripeLastUpdatedAt",
12+
DROP COLUMN "stripeSubscriptionStatus";
13+
14+
-- DropEnum
15+
DROP TYPE "StripeSubscriptionStatus";

packages/db/prisma/schema.prisma

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ enum ConnectionSyncStatus {
1919
FAILED
2020
}
2121

22-
enum StripeSubscriptionStatus {
23-
ACTIVE
24-
INACTIVE
25-
}
26-
2722
enum ChatVisibility {
2823
PRIVATE
2924
PUBLIC
@@ -283,10 +278,6 @@ model Org {
283278
284279
memberApprovalRequired Boolean @default(true)
285280
286-
stripeCustomerId String?
287-
stripeSubscriptionStatus StripeSubscriptionStatus?
288-
stripeLastUpdatedAt DateTime?
289-
290281
/// List of pending invites to this organization
291282
invites Invite[]
292283

packages/shared/src/entitlements.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export type Plan = keyof typeof planLabels;
3030
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3131
const entitlements = [
3232
"search-contexts",
33-
"billing",
3433
"anonymous-access",
3534
"multi-tenancy",
3635
"sso",

packages/shared/src/env.server.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@ const options = {
163163
SMTP_PASSWORD: z.string().optional(),
164164
EMAIL_FROM_ADDRESS: z.string().email().optional(),
165165

166-
// Stripe
167-
STRIPE_SECRET_KEY: z.string().optional(),
168-
STRIPE_PRODUCT_ID: z.string().optional(),
169-
STRIPE_WEBHOOK_SECRET: z.string().optional(),
170-
STRIPE_ENABLE_TEST_CLOCKS: booleanSchema.default('false'),
171-
172166
LOGTAIL_TOKEN: z.string().optional(),
173167
LOGTAIL_HOST: z.string().url().optional(),
174168

packages/web/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"openapi:generate": "tsx tools/generateOpenApi.ts",
1212
"generate:protos": "proto-loader-gen-types --includeComments --longs=Number --enums=String --defaults --oneofs --grpcLib=@grpc/grpc-js --keepCase --includeDirs=../../vendor/zoekt/grpc/protos --outDir=src/proto zoekt/webserver/v1/webserver.proto zoekt/webserver/v1/query.proto",
1313
"dev:emails": "email dev --dir ./src/emails",
14-
"stripe:listen": "stripe listen --forward-to http://localhost:3000/api/stripe",
1514
"tool:decrypt-jwe": "tsx tools/decryptJWE.ts"
1615
},
1716
"dependencies": {
@@ -102,8 +101,6 @@
102101
"@sourcebot/schemas": "workspace:*",
103102
"@sourcebot/shared": "workspace:*",
104103
"@ssddanbrown/codemirror-lang-twig": "^1.0.0",
105-
"@stripe/react-stripe-js": "^3.1.1",
106-
"@stripe/stripe-js": "^5.6.0",
107104
"@tailwindcss/typography": "^0.5.16",
108105
"@tanstack/react-query": "^5.53.3",
109106
"@tanstack/react-table": "^8.20.5",
@@ -187,7 +184,6 @@
187184
"slate-history": "^0.113.1",
188185
"slate-react": "^0.117.1",
189186
"strip-json-comments": "^5.0.1",
190-
"stripe": "^17.6.0",
191187
"tailwind-merge": "^2.5.2",
192188
"tailwindcss-animate": "^1.0.7",
193189
"use-stick-to-bottom": "^1.1.3",

packages/web/src/__mocks__/prisma.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ export const MOCK_ORG: Org = {
1919
imageUrl: null,
2020
metadata: null,
2121
memberApprovalRequired: false,
22-
stripeCustomerId: null,
23-
stripeSubscriptionStatus: null,
24-
stripeLastUpdatedAt: null,
2522
inviteLinkEnabled: false,
2623
inviteLinkId: null
2724
}

packages/web/src/actions.ts

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { prisma } from "@/prisma";
1010
import { render } from "@react-email/components";
1111
import * as Sentry from '@sentry/nextjs';
1212
import { generateApiKey, getTokenFromConfig, hashSecret } from "@sourcebot/shared";
13-
import { ApiKey, ConnectionSyncJobStatus, Org, OrgRole, Prisma, RepoIndexingJobStatus, RepoIndexingJobType, StripeSubscriptionStatus } from "@sourcebot/db";
13+
import { ApiKey, ConnectionSyncJobStatus, Org, OrgRole, Prisma, RepoIndexingJobStatus, RepoIndexingJobType } from "@sourcebot/db";
1414
import { createLogger } from "@sourcebot/shared";
1515
import { GiteaConnectionConfig } from "@sourcebot/schemas/v3/gitea.type";
1616
import { GithubConnectionConfig } from "@sourcebot/schemas/v3/github.type";
@@ -22,8 +22,6 @@ import { createTransport } from "nodemailer";
2222
import { Octokit } from "octokit";
2323
import { auth } from "./auth";
2424
import { getOrgFromDomain } from "./data/org";
25-
import { getSubscriptionForOrg } from "./ee/features/billing/serverUtils";
26-
import { IS_BILLING_ENABLED } from "./ee/features/billing/stripe";
2725
import InviteUserEmail from "./emails/inviteUserEmail";
2826
import JoinRequestApprovedEmail from "./emails/joinRequestApprovedEmail";
2927
import JoinRequestSubmittedEmail from "./emails/joinRequestSubmittedEmail";
@@ -188,31 +186,12 @@ export const withTenancyModeEnforcement = async<T>(mode: TenancyMode, fn: () =>
188186
export const completeOnboarding = async (domain: string): Promise<{ success: boolean } | ServiceError> => sew(() =>
189187
withAuth((userId) =>
190188
withOrgMembership(userId, domain, async ({ org }) => {
191-
// If billing is not enabled, we can just mark the org as onboarded.
192-
if (!IS_BILLING_ENABLED) {
193-
await prisma.org.update({
194-
where: { id: org.id },
195-
data: {
196-
isOnboarded: true,
197-
}
198-
});
199-
200-
// Else, validate that the org has an active subscription.
201-
} else {
202-
const subscriptionOrError = await getSubscriptionForOrg(org.id, prisma);
203-
if (isServiceError(subscriptionOrError)) {
204-
return subscriptionOrError;
189+
await prisma.org.update({
190+
where: { id: org.id },
191+
data: {
192+
isOnboarded: true,
205193
}
206-
207-
await prisma.org.update({
208-
where: { id: org.id },
209-
data: {
210-
isOnboarded: true,
211-
stripeSubscriptionStatus: StripeSubscriptionStatus.ACTIVE,
212-
stripeLastUpdatedAt: new Date(),
213-
}
214-
});
215-
}
194+
});
216195

217196
return {
218197
success: true,

packages/web/src/app/[domain]/components/navigationMenu/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { auth } from "@/auth";
44
import { Button } from "@/components/ui/button";
55
import { NavigationMenu as NavigationMenuBase } from "@/components/ui/navigation-menu";
66
import { Separator } from "@/components/ui/separator";
7-
import { getSubscriptionInfo } from "@/ee/features/billing/actions";
8-
import { IS_BILLING_ENABLED } from "@/ee/features/billing/stripe";
97
import { env } from "@sourcebot/shared";
108
import { ServiceErrorException } from "@/lib/serviceError";
119
import { isServiceError } from "@/lib/utils";
@@ -16,7 +14,6 @@ import { MeControlDropdownMenu } from "../meControlDropdownMenu";
1614
import WhatsNewIndicator from "../whatsNewIndicator";
1715
import { NavigationItems } from "./navigationItems";
1816
import { ProgressIndicator } from "./progressIndicator";
19-
import { TrialIndicator } from "./trialIndicator";
2017
import { redirect } from "next/navigation";
2118
import { AppearanceDropdownMenu } from "../appearanceDropdownMenu";
2219

@@ -28,7 +25,6 @@ interface NavigationMenuProps {
2825
export const NavigationMenu = async ({
2926
domain,
3027
}: NavigationMenuProps) => {
31-
const subscription = IS_BILLING_ENABLED ? await getSubscriptionInfo(domain) : null;
3228
const session = await auth();
3329
const isAuthenticated = session?.user !== undefined;
3430

@@ -134,7 +130,6 @@ export const NavigationMenu = async ({
134130
numberOfReposWithFirstTimeIndexingJobsInProgress={numberOfReposWithFirstTimeIndexingJobsInProgress}
135131
sampleRepos={sampleRepos}
136132
/>
137-
<TrialIndicator subscription={subscription} />
138133
<WhatsNewIndicator />
139134
{session ? (
140135
<MeControlDropdownMenu

packages/web/src/app/[domain]/components/navigationMenu/trialIndicator.tsx

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)