-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(creators): added referrers, code redemption, campaign tracking, etc #3198
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
base: staging
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR implements a comprehensive referral and campaign tracking system with UTM attribution, manual code redemption, and bonus credit application. The implementation includes database schema changes, API endpoints, admin management tools, and frontend components. Additionally, it adds execution stream reconnection support and extends Confluence tool capabilities. Key Changes:
Previous Review Comments Addressed:
Outstanding Issue: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Proxy
participant Client as Client Hook
participant AttrAPI as /api/attribution
participant RedeemAPI as /api/referral-code/redeem
participant DB as Database
participant Bonus as applyBonusCredits
Note over User,Proxy: UTM Attribution Flow
User->>Proxy: Visit site with UTM params
Proxy->>Proxy: Capture UTM + timestamp
Proxy->>User: Set sim_utm cookie (1hr)
User->>Client: Login/signup
Client->>Client: Detect sim_utm cookie
Client->>AttrAPI: POST /api/attribution
AttrAPI->>DB: Verify user created after cookie
AttrAPI->>DB: Find matching campaign
AttrAPI->>DB: Start transaction
AttrAPI->>DB: Insert referral_attribution (conflict: userId)
AttrAPI->>Bonus: Apply bonus credits
Bonus->>DB: Update creditBalance + usageLimit
AttrAPI->>DB: Commit transaction
AttrAPI->>Client: Return success + bonus amount
Client->>Client: Delete sim_utm cookie
Note over User,RedeemAPI: Manual Code Redemption Flow
User->>RedeemAPI: POST /api/referral-code/redeem
RedeemAPI->>DB: Find campaign by code
RedeemAPI->>DB: Check existing user attribution
RedeemAPI->>DB: Check org attribution (if team)
RedeemAPI->>DB: Start transaction
RedeemAPI->>DB: Insert referral_attribution (conflict: userId or orgId)
RedeemAPI->>Bonus: Apply bonus credits
Bonus->>DB: Update user/org creditBalance + usageLimit
RedeemAPI->>DB: Commit transaction
RedeemAPI->>User: Return success + bonus amount
|
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.
17 files reviewed, 3 comments
…3202) * fix(confl): use recommended query param pattern for confluence route * use unused var
) * fix(terminal): reconnect to running executions after page refresh * fix(terminal): use ExecutionEvent type instead of any in reconnection stream * fix(execution): type event buffer with ExecutionEvent instead of Record<string, unknown> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(execution): validate fromEventId query param in reconnection endpoint Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix some bugs * fix(variables): fix tag dropdown and cursor alignment in variables block (#3199) * feat(confluence): added list space labels, delete label, delete page prop (#3201) * updated route * ack comments * fix(execution): reset execution state in reconnection cleanup to unblock re-entry Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(execution): restore running entries when reconnection is interrupted by navigation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * done * remove cast in ioredis types * ack PR comments --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Siddharth Ganesan <siddharthganesan@gmail.com>
|
@greptile |
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.
62 files reviewed, 2 comments
|
@greptile |
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.
62 files reviewed, 2 comments
|
@greptile |
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.
62 files reviewed, no comments
|
@cursor review |
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.
62 files reviewed, no comments
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.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
Type of Change
Testing
Tested manually
Checklist