diff --git a/lib/services/user.account.service.ts b/lib/services/user.account.service.ts index 4505eab..0302da2 100644 --- a/lib/services/user.account.service.ts +++ b/lib/services/user.account.service.ts @@ -1,7 +1,7 @@ import { ACCOUNT_ACCESS, PrismaClient, User, Membership, Account } from '@prisma/client'; import { UtilService } from './util.service'; +const config = useRuntimeConfig(); -const TRIAL_PLAN_NAME = '3 Month Trial'; // TODO - some sort of config.. this will change for every use of the boilerplate export type MembershipWithAccount = (Membership & {account: Account}); export type FullDBUser = (User & { memberships: MembershipWithAccount[]; }); @@ -69,7 +69,7 @@ export default class UserAccountService { } async createUser( supabase_uid: string, display_name: string ): Promise { - const trialPlan = await this.prisma.plan.findFirstOrThrow({ where: { name: TRIAL_PLAN_NAME}}); + const trialPlan = await this.prisma.plan.findFirstOrThrow({ where: { name: config.trialPlanName}}); return this.prisma.user.create({ data:{ supabase_uid: supabase_uid, diff --git a/nuxt.config.ts b/nuxt.config.ts index b414d2d..78a4bf0 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -15,6 +15,7 @@ export default defineNuxtConfig({ stripeSecretKey: process.env.STRIPE_SECRET_KEY, stripeEndpointSecret: process.env.STRIPE_ENDPOINT_SECRET, subscriptionGraceDays: 3, + trialPlanName: '3 Month Trial', public: { debugMode: true, }