@@ -10,7 +10,7 @@ import { prisma } from "@/prisma";
1010import { render } from "@react-email/components" ;
1111import * as Sentry from '@sentry/nextjs' ;
1212import { 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" ;
1414import { createLogger } from "@sourcebot/shared" ;
1515import { GiteaConnectionConfig } from "@sourcebot/schemas/v3/gitea.type" ;
1616import { GithubConnectionConfig } from "@sourcebot/schemas/v3/github.type" ;
@@ -22,8 +22,6 @@ import { createTransport } from "nodemailer";
2222import { Octokit } from "octokit" ;
2323import { auth } from "./auth" ;
2424import { getOrgFromDomain } from "./data/org" ;
25- import { getSubscriptionForOrg } from "./ee/features/billing/serverUtils" ;
26- import { IS_BILLING_ENABLED } from "./ee/features/billing/stripe" ;
2725import InviteUserEmail from "./emails/inviteUserEmail" ;
2826import JoinRequestApprovedEmail from "./emails/joinRequestApprovedEmail" ;
2927import JoinRequestSubmittedEmail from "./emails/joinRequestSubmittedEmail" ;
@@ -188,31 +186,12 @@ export const withTenancyModeEnforcement = async<T>(mode: TenancyMode, fn: () =>
188186export 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 ,
0 commit comments