Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@steven-tey
Copy link
Collaborator

@steven-tey steven-tey commented Aug 10, 2025

Summary by CodeRabbit

  • New Features

    • Added a "Conversions" column to the partner table, displaying the number of leads converted to paying customers.
    • The "Conversions" metric is now included and visible by default in the partner dashboard.
  • Documentation

    • Updated field descriptions to clarify that "sales" includes recurring sales and added details for the new "conversions" field.

@vercel
Copy link
Contributor

vercel bot commented Aug 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dub ✅ Ready (Inspect) Visit Preview Aug 10, 2025 7:11pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 10, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between bc07499 and 2e439b6.

📒 Files selected for processing (3)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/partner-table.tsx (3 hunks)
  • apps/web/lib/api/partners/get-partners.ts (7 hunks)
  • apps/web/lib/zod/schemas/partners.ts (4 hunks)

Walkthrough

A 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

Cohort / File(s) Change Summary
Partner Table UI Update
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/partner-table.tsx
Added a "Conversions" column to the partner table, formatting and displaying the conversions property for each partner.
Column Visibility Logic
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/use-column-visibility.ts
Included "conversions" in the columns list and set it as visible by default instead of "sales".
Partner Data API
apps/web/lib/api/partners/get-partners.ts
Modified the getPartners function to fetch, aggregate, and return the conversions metric for each partner, including SQL query and result mapping updates.
Partner Schema
apps/web/lib/zod/schemas/partners.ts
Extended EnrolledPartnerSchema with a numeric conversions field (default 0) and clarified the description of the sales field.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • devkiran

Poem

In the garden of code, a new metric appears,
"Conversions" now counted, to digital cheers.
Partners tracked closer, with data anew,
The schema grows richer, the table in view.
Hopping through columns, the rabbit delights—
More numbers to munch on, in dashboardy bytes!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch conversion-data

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 conversions

If you want the table sortable by conversions:

  • Add "conversions": "totalConversions" to sortColumnsMap (Lines 6–14).
  • Add a reasonable secondary in sortColumnExtraMap (Lines 17–25), e.g., "conversions": "totalSaleAmount".
  • Extend the sortBy enum in getPartnersQuerySchema to include "conversions".
  • Add "conversions" to the table’s sortableColumns in partner-table.tsx (Line 246).
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8fe261b and 96c6597.

📒 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 thus EnrolledPartnerProps) already defines conversions: z.number().default(0), so accessorFn(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 the sortableColumns array (around line 246 of partner-table.tsx) and wire it through the backend’s sort map.
apps/web/lib/zod/schemas/partners.ts (1)

301-302: Sales description update LGTM

Clarifies 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 Link model in packages/prisma/schema/link.prisma defines:
• conversions Int @default(0)

No further changes required.

@steven-tey
Copy link
Collaborator Author

@coderabbitai full review

@steven-tey steven-tey requested a review from Copilot August 10, 2025 19:09
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 10, 2025

✅ Actions performed

Full review triggered.

Copy link
Contributor

Copilot AI left a 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

@steven-tey steven-tey merged commit 9ee5cf7 into main Aug 10, 2025
8 checks passed
@steven-tey steven-tey deleted the conversion-data branch August 10, 2025 19:20
@coderabbitai coderabbitai bot mentioned this pull request Aug 14, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 27, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants