Skip to content

Commit

Permalink
update sales limits
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Jan 18, 2025
1 parent ac7321d commit 5a6d116
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export async function checkoutSessionCompleted(event: Stripe.Event) {
aiLimit: plan.limits.ai!,
tagsLimit: plan.limits.tags!,
usersLimit: plan.limits.users!,
salesLimit: plan.limits.sales!,
},
select: {
users: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export async function customerSubscriptionDeleted(event: Stripe.Event) {
aiLimit: FREE_PLAN.limits.ai!,
tagsLimit: FREE_PLAN.limits.tags!,
usersLimit: FREE_PLAN.limits.users!,
salesLimit: FREE_PLAN.limits.sales!,
paymentFailedAt: null,
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export async function customerSubscriptionUpdated(event: Stripe.Event) {
aiLimit: plan.limits.ai!,
tagsLimit: plan.limits.tags!,
usersLimit: plan.limits.users!,
salesLimit: plan.limits.sales!,
paymentFailedAt: null,
},
}),
Expand Down
18 changes: 18 additions & 0 deletions apps/web/scripts/update-sales-limits.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { prisma } from "@dub/prisma";
import "dotenv-flow/config";

async function main() {
const workspaces = await prisma.project.updateMany({
where: {
plan: "business",
salesLimit: 0,
},
data: {
salesLimit: 5000_00,
},
});

console.table(workspaces);
}

main();
3 changes: 3 additions & 0 deletions packages/utils/src/constants/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const PLANS = [
limits: {
links: 25,
clicks: 1000,
sales: 0,
domains: 3,
tags: 5,
users: 1,
Expand Down Expand Up @@ -194,6 +195,7 @@ export const PLANS = [
limits: {
links: 1000,
clicks: 50000,
sales: 0,
domains: 10,
tags: 25,
users: 5,
Expand Down Expand Up @@ -333,6 +335,7 @@ export const PLANS = [
limits: {
links: 250000,
clicks: 5000000,
sales: 1000000_00,
domains: 1000,
tags: 1000,
users: 500,
Expand Down

0 comments on commit 5a6d116

Please sign in to comment.