Skip to content

go - #312

Merged
aamoghS merged 2 commits into
mainfrom
chore/monorepo-quality-gates
Aug 5, 2026
Merged

go#312
aamoghS merged 2 commits into
mainfrom
chore/monorepo-quality-gates

Conversation

@aamoghS

@aamoghS aamoghS commented Aug 5, 2026

Copy link
Copy Markdown
Member

Note

High Risk
Changes authentication-adjacent payment flows, webhook verification, and who gets paid memberships—including mock-mode behavior in production—plus a schema field for bootcamp access.

Overview
This PR aligns membership pricing across hosted Checkout, Payment Intents, and portal copy via a shared pricing module ($25/year membership, optional $10 bootcamp add-on), and adds an optional bootcamp flag on checkout/intent APIs that flows through payment metadata into membership grants.

Stripe mock mode no longer keys off invented mk_ secret keys (which could ship to production and grant free memberships). It now requires STRIPE_MOCK_MODE=true and is ignored when NODE_ENV is production; the webhook’s unsigned-body path follows the same rule.

Membership writes are centralized in @query/db/services/membership (removed duplicate logic from the Stripe router and webhook), with a sticky bootcampMember field on members, shared splitName (fixes a webhook bug that mangled names containing “s”), and paidForBootcamp when linking older payments. Portal UI adds a bootcamp checkbox and dynamic pay amounts in the payment modal.

Reviewed by Cursor Bugbot for commit 868e29b. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added the chore label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8189f48. Configure here.

Comment thread sites/mainweb/app/(portal)/api/webhooks/stripe/route.ts Outdated
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit 868e29b):

https://hacklytics2027--pr-312-stee4103.web.app

(expires Wed, 12 Aug 2026 12:33:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c48ba34db61581e25fe2978355160b5eefe0e83f

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR centralizes membership pricing, adds an optional paid bootcamp membership flag across Stripe and database flows, and replaces environment-key-based mock detection with an explicit development-only flag. It also completes the prior webhook name-parsing fix by routing every webhook membership write through the shared whitespace-aware parser.

  • Exposes shared membership and bootcamp pricing through @query/api/pricing.
  • Persists sticky bootcamp access from Stripe metadata through the shared membership service.
  • Consolidates webhook and router membership writes around shared database helpers.
  • Updates portal payment controls and displayed totals for the bootcamp add-on.
  • Prevents Stripe mock mode from operating when NODE_ENV is production.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported webhook name corruption is fixed because all webhook membership writes now use the shared whitespace-aware parser.

Important Files Changed

Filename Overview
packages/api/src/routers/stripe.ts Adds centralized pricing, explicit development mock mode, bootcamp metadata propagation, and shared membership writes across payment and recovery paths.
packages/db/src/services/membership.ts Adds shared name parsing and payment-metadata parsing while making paid bootcamp access sticky across membership renewals.
sites/mainweb/app/(portal)/api/webhooks/stripe/route.ts Completes the prior name-parsing fix by using the shared whitespace parser in all webhook membership-writing branches and propagates bootcamp entitlement.
packages/db/src/schemas/members.ts Adds the non-null bootcamp_member membership entitlement field with a false default.
sites/mainweb/components/portal/LinkStripeAccount.tsx Adds bootcamp selection and derives displayed and requested payment totals from shared pricing.
sites/mainweb/components/portal/StripePaymentModal.tsx Displays the selected server-aligned payment amount throughout the embedded payment modal.

Sequence Diagram

sequenceDiagram
    participant U as Portal User
    participant API as Stripe tRPC Router
    participant S as Stripe
    participant W as Stripe Webhook
    participant M as Membership Service
    participant DB as Database

    U->>API: Request payment (bootcamp optional)
    API->>S: Create PaymentIntent/Checkout with price and metadata
    S-->>W: Successful payment event
    W->>W: Parse customer name with shared splitName
    W->>M: createOrUpdateMembership(bootcampMember)
    M->>DB: Insert or renew membership
    M->>DB: Preserve existing bootcamp access or upgrade it
Loading

Reviews (2): Last reviewed commit: "another one" | Re-trigger Greptile

Comment thread sites/mainweb/app/(portal)/api/webhooks/stripe/route.ts Outdated
@aamoghS
aamoghS merged commit 16dac0c into main Aug 5, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant