← Back to Pull requests

Add the All programs Overview page for partners #4649

Closed
unknown closed this pull request without merging on Oct 09, 2026 05:38 UTC
View on GitHub
unknown unknown commented on Oct 08, 2026 18:48 UTC
Author

Changes

Fixes https://linear.app/dubinc/issue/ENG-1749/make-the-partner-earnings-endpoints-work-across-all-programs
Fixes https://linear.app/dubinc/issue/ENG-1746/add-the-all-programs-navigation-to-the-partner-sidebar
Fixes https://linear.app/dubinc/issue/ENG-1748/build-the-all-programs-overview-page-for-partners

  • Add /api/partner-profile/earnings, /count, /timeseries and /top for all programs, or one program with programIdOrSlug. The per-program routes share the same code.

  • Add the /overview page and an Overview item in the sidebar.

  • Land partners on /overview, or on /programs if they have no approved program.

  • Reserve the overview slug and match whole path segments in the partners middleware.

  • Add a Commission index on [partnerId, createdAt].

  • Fix the earnings count ignoring the type filter.
  • Motivation

    A partner in several programs has no single place to see their earnings across programs.

    UI/Screenshot

    <img width="2880" height="2000" alt="overview" src="https://github.com/user-attachments/assets/f42cafb2-8cc9-451c-b8d3-fb0dbfd5fd73" />

    <img width="2880" height="2000" alt="overview-tooltip" src="https://github.com/user-attachments/assets/f93623c4-ef3c-476b-b56b-1ad3a9ddd395" />

    <img width="880" height="720" alt="sidebar" src="https://github.com/user-attachments/assets/f7ad3d15-5d1c-4379-8c8b-fe8da619b9a8" />

    <img width="880" height="1040" alt="sidebar-dropdown" src="https://github.com/user-attachments/assets/70659e1c-54df-413d-9ca5-d5ebad177ad2" />

    Deployment Steps

    1. Before merging, push the schema to the PlanetScale staging branch, then open and deploy a deploy request into main.

    How to test

    1. Add the index to your local database, then run pnpm dev in apps/web:

       CREATE INDEX `Commission_partnerId_createdAt_idx` ON `Commission`(`partnerId`, `createdAt`);
       

    2. Log in at http://partners.localhost:8888 as a partner in two or more programs, with commissions in the last 30 days. You land on /overview. A partner without an approved program lands on /programs.
    3. Check that the earnings total and the cards match the partner's commissions, that the chart tooltip lists earnings per program, and that changing the date range updates the cards.
    4. Open a program's Overview and Earnings pages. They work as before.
    5. Log out and open /overviewai (a slug that does not exist). It shows the program page, not the login page.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

  • New Features

  • - Added a partner dashboard overview with an earnings chart, recent payouts and earnings, tasks, and top-performing programs and links.
    - Added partner earnings reports with date-range and program filters, totals, trends, counts, and top results.
    - Partners with an approved program now land on the overview; partners without one continue to land on Programs.
  • Improvements

  • - Updated partner navigation to include Overview and renamed “Your programs” to “All programs.”
    - Updated payout cards to present recent payouts and program details more clearly.
    - Customer email visibility in earnings now reflects each program’s data-sharing settings.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 412 lines (+309 / -103) across 5 files Reviewer: Joker666 Review duration: 650m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 412 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.360
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4649"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44.9% (MEDIUM) · Higher = larger blast radius
    44.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.7% · Safe to merge
    17.7%
    Repository