-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Include conversion data in partners table #2741
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Warning Rate limit exceeded@steven-tey has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 22 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughA new "conversions" metric was integrated into the partner management system. This includes updating the backend data retrieval, extending the partner schema, modifying column visibility logic, and adding a "Conversions" column to the partner table UI. No changes were made to function signatures or public APIs. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI (PartnerTable)
participant ColumnVisibility
participant API (getPartners)
participant DB
User->>UI (PartnerTable): Loads partner table
UI (PartnerTable)->>API (getPartners): Requests partner data
API (getPartners)->>DB: Query partners, including conversions
DB-->>API (getPartners): Returns partner data with conversions
API (getPartners)-->>UI (PartnerTable): Sends partner data with conversions
UI (PartnerTable)->>ColumnVisibility: Checks visible columns (now includes conversions)
UI (PartnerTable)-->>User: Renders table with "Conversions" column
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/web/lib/api/partners/get-partners.ts (1)
161-172: Optional: add sorting support for conversionsIf you want the table sortable by conversions:
- Add
"conversions": "totalConversions"tosortColumnsMap(Lines 6–14).- Add a reasonable secondary in
sortColumnExtraMap(Lines 17–25), e.g.,"conversions": "totalSaleAmount".- Extend the
sortByenum ingetPartnersQuerySchemato include"conversions".- Add
"conversions"to the table’ssortableColumnsinpartner-table.tsx(Line 246).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/partner-table.tsx(1 hunks)apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/use-column-visibility.ts(2 hunks)apps/web/lib/api/partners/get-partners.ts(5 hunks)apps/web/lib/zod/schemas/partners.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (4)
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/partner-table.tsx (1)
180-184: Conversions column confirmed – EnrolledPartnerProps includes conversions
- The new column definition looks good and matches existing formatting.
EnrolledPartnerSchema(and thusEnrolledPartnerProps) already definesconversions: z.number().default(0), soaccessorFn(d => nFormatter(d.conversions))is safe and will not cause TS errors.- No changes are required for type coverage.
- Optional: if you’d like this column to be sortable, add
"conversions"to thesortableColumnsarray (around line 246 ofpartner-table.tsx) and wire it through the backend’s sort map.apps/web/lib/zod/schemas/partners.ts (1)
301-302: Sales description update LGTMClarifies inclusion of recurring sales without changing behavior.
apps/web/lib/api/partners/get-partners.ts (2)
71-76: Conversions integration (query, aggregation, mapping) LGTM
COALESCE(metrics.totalConversions, 0)added with the rest of metrics: OK.- Link-level JSON includes
conversions: OK.- Metrics subquery
SUM(conversions) as totalConversions: OK.- Grouping and mapping to numeric
conversions: OK.Also applies to: 80-85, 98-101, 117-125, 157-158, 161-172
117-125: Link.conversions field verified in Prisma schema – no action needed.The
Linkmodel inpackages/prisma/schema/link.prismadefines:
• conversions Int @default(0)No further changes required.
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/use-column-visibility.ts
Outdated
Show resolved
Hide resolved
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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.
Pull Request Overview
This PR adds conversion tracking to the partners table by introducing a new "Conversions" metric that displays the number of leads that converted to paying customers. This provides better visibility into partner performance beyond just lead generation.
- Added "conversions" field to partner schemas and table configurations
- Updated partner API to include conversion data aggregation
- Modified the partner dashboard table to display the conversions column by default
- Updated documentation to clarify that sales includes recurring transactions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/web/lib/zod/schemas/partners.ts | Added conversions field to schema definitions and updated field descriptions |
| apps/web/lib/api/partners/get-partners.ts | Updated SQL queries to aggregate conversion data and include in partner results |
| apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/partner-table.tsx | Added conversions column to the partner table display with default visibility |
Summary by CodeRabbit
New Features
Documentation