-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow purchasing additional seats in workspace #169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 6d16274 in 1 minute and 5 seconds
More details
- Looked at
872
lines of code in14
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. frontend/app/webhook/route.ts:10
- Draft comment:
Thestripe
import should be corrected toimport Stripe from 'stripe';
and instantiated asconst stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
. - Reason this comment was not posted:
Marked as duplicate.
2. frontend/app/webhook/route.ts:1
- Draft comment:
Thestripe
import should be corrected toimport Stripe from 'stripe';
and instantiated asconst stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_PNLmUXehmoCKHtJ7
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
req: NextRequest, | ||
{ params }: { params: { workspaceId: string } } | ||
): Promise<Response> { | ||
if (!isCurrentUserMemberOfWorkspace(params.workspaceId)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function isCurrentUserMemberOfWorkspace
should be awaited if it returns a promise. This ensures proper authorization checks.
if (!isCurrentUserMemberOfWorkspace(params.workspaceId)) { | |
if (!(await isCurrentUserMemberOfWorkspace(params.workspaceId))) { |
import { isCurrentUserMemberOfWorkspace } from '@/lib/db/utils'; | ||
import { eq } from 'drizzle-orm'; | ||
import { NextRequest } from 'next/server'; | ||
import stripe from 'stripe'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stripe
import should be corrected to import Stripe from 'stripe';
and instantiated as const s = new Stripe(process.env.STRIPE_SECRET_KEY!);
.
import stripe from 'stripe'; | |
import Stripe from 'stripe'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 4d4d4b9 in 30 seconds
More details
- Looked at
73
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. frontend/app/api/workspaces/[workspaceId]/update-seats/route.ts:18
- Draft comment:
Consider adding a check to ensureprocess.env.STRIPE_SECRET_KEY
is defined before using it. This will prevent potential runtime errors if the environment variable is not set. - Reason this comment was not posted:
Comment was on unchanged code.
2. frontend/app/checkout/page.tsx:37
- Draft comment:
Consider adding a check to ensureprocess.env.STRIPE_SECRET_KEY
is defined before using it. This will prevent potential runtime errors if the environment variable is not set. - Reason this comment was not posted:
Marked as duplicate.
3. frontend/app/checkout/portal/page.tsx:17
- Draft comment:
Consider adding a check to ensureprocess.env.STRIPE_SECRET_KEY
is defined before using it. This will prevent potential runtime errors if the environment variable is not set. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_TnyOznOcxwyWZ4eu
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Add functionality to purchase additional workspace seats, integrating Stripe for payments and updating backend and frontend components.
seats_included_in_tier
toWorkspaceStats
instats.rs
.add_seats
toset_seats
insubscriptions.rs
and update logic to set seats directly.update_subscription
insubscriptions.rs
to handlesubscription_id
.get_user_from_stripe_customer_id
route.update-seats
API route inroute.ts
to handle seat purchases via Stripe.PurchaseSeatsDialog
inpurchase-seats-dialog.tsx
for UI interaction.workspace-usage.tsx
to include seat purchase functionality.subscription-updated-email.tsx
andutils.ts
to include item descriptions.LOOKUP_KEY_TO_TIER_NAME
inutils.ts
to include additional seat pricing.webhook/route.ts
to process subscription changes.This description was created by for 4d4d4b9. It will automatically update as commits are pushed.