diff --git a/opensaas-sh/app_diff/schema.prisma.diff b/opensaas-sh/app_diff/schema.prisma.diff index 1e9959bd..f56a673d 100644 --- a/opensaas-sh/app_diff/schema.prisma.diff +++ b/opensaas-sh/app_diff/schema.prisma.diff @@ -13,6 +13,6 @@ - paymentProcessorUserId String? @unique - lemonSqueezyCustomerPortalUrl String? // You can delete this if you're not using Lemon Squeezy as your payments processor. + stripeId String? @unique - checkoutSessionId String? - subscriptionStatus String? // 'active', 'canceled', 'past_due', 'deleted' + subscriptionStatus String? // 'active', 'cancel_at_period_end', 'past_due', 'deleted' subscriptionPlan String? // 'hobby', 'pro' + sendNewsletter Boolean @default(false) diff --git a/opensaas-sh/app_diff/src/server/scripts/dbSeeds.ts.diff b/opensaas-sh/app_diff/src/server/scripts/dbSeeds.ts.diff index 469fc950..daf65ec7 100644 --- a/opensaas-sh/app_diff/src/server/scripts/dbSeeds.ts.diff +++ b/opensaas-sh/app_diff/src/server/scripts/dbSeeds.ts.diff @@ -1,6 +1,6 @@ --- template/app/src/server/scripts/dbSeeds.ts +++ opensaas-sh/app/src/server/scripts/dbSeeds.ts -@@ -38,10 +38,12 @@ +@@ -38,9 +38,11 @@ sendNewsletter: false, credits, subscriptionStatus, @@ -8,7 +8,6 @@ - paymentProcessorUserId: hasUserPaidOnStripe ? `cus_test_${faker.string.uuid()}` : null, + stripeId: hasUserPaidOnStripe ? `cus_test_${faker.string.uuid()}` : null, datePaid: hasUserPaidOnStripe ? faker.date.between({ from: createdAt, to: lastActiveTimestamp }) : null, - checkoutSessionId: hasUserPaidOnStripe ? `cs_test_${faker.string.uuid()}` : null, subscriptionPlan: subscriptionStatus ? faker.helpers.arrayElement(getSubscriptionPaymentPlanIds()) : null, + // For the demo app, we want to default isMockUser to true so that our admin dash only shows mock users + // and not real users signing up to test the app diff --git a/opensaas-sh/blog/src/content/docs/general/user-overview.md b/opensaas-sh/blog/src/content/docs/general/user-overview.md index ae029340..b5730d3e 100644 --- a/opensaas-sh/blog/src/content/docs/general/user-overview.md +++ b/opensaas-sh/blog/src/content/docs/general/user-overview.md @@ -22,7 +22,6 @@ entity User {=psl isAdmin Boolean @default(false) paymentProcessorUserId String? @unique lemonSqueezyCustomerPortalUrl String? // You can delete this if you're not using Lemon Squeezy as your payments processor. - checkoutSessionId String? subscriptionPlan String? subscriptionStatus String? sendEmail Boolean @default(false) @@ -46,7 +45,6 @@ entity User {=psl id Int @id @default(autoincrement()) //... paymentProcessorUserId String? @unique - checkoutSessionId String? subscriptionPlan String? subscriptionStatus String? datePaid DateTime? @@ -56,7 +54,6 @@ psl=} ``` - `paymentProcessorUserId`: The payment processor customer ID. This is created on checkout and used to identify the customer. -- `checkoutSessionId`: The payment processor checkout session ID. This is created by Stripe on checkout and used to identify the checkout session. - `subscriptionPlan`: The subscription plan the user is on. This is set by the app and is used to determine what features the user has access to. By default, we have three plans: `hobby` and `pro` subscription plans, as well as a `credits10` one-time purchase plan. - `subscriptionStatus`: The subscription status of the user. This is set by the payment processor and is used to determine whether the user has access to the app or not. By default, we have four statuses: `active`, `past_due`, `cancel_at_period_end`, and `deleted`. - `credits` (optional): By default, a user is given 3 credits to trial your product before they have to pay. You can create a one-time purchase product in Stripe to allow users to purchase more credits if they run out, e.g. the `credits10` plan in the template. diff --git a/template/app/schema.prisma b/template/app/schema.prisma index ba52b1ca..fc3f5d39 100644 --- a/template/app/schema.prisma +++ b/template/app/schema.prisma @@ -18,7 +18,6 @@ model User { paymentProcessorUserId String? @unique lemonSqueezyCustomerPortalUrl String? // You can delete this if you're not using Lemon Squeezy as your payments processor. - checkoutSessionId String? subscriptionStatus String? // 'active', 'cancel_at_period_end', 'past_due', 'deleted' subscriptionPlan String? // 'hobby', 'pro' sendNewsletter Boolean @default(false) diff --git a/template/app/src/server/scripts/dbSeeds.ts b/template/app/src/server/scripts/dbSeeds.ts index b411a844..c6f06f90 100644 --- a/template/app/src/server/scripts/dbSeeds.ts +++ b/template/app/src/server/scripts/dbSeeds.ts @@ -41,7 +41,6 @@ function generateMockUserData(): MockUserData { lemonSqueezyCustomerPortalUrl: null, paymentProcessorUserId: hasUserPaidOnStripe ? `cus_test_${faker.string.uuid()}` : null, datePaid: hasUserPaidOnStripe ? faker.date.between({ from: createdAt, to: lastActiveTimestamp }) : null, - checkoutSessionId: hasUserPaidOnStripe ? `cs_test_${faker.string.uuid()}` : null, subscriptionPlan: subscriptionStatus ? faker.helpers.arrayElement(getSubscriptionPaymentPlanIds()) : null, }; }