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

Skip to content

Conversation

@steven-tey
Copy link
Collaborator

@steven-tey steven-tey commented Sep 27, 2025

Summary by CodeRabbit

  • New Features

    • Partner info cards now show "Last lead" and "Last conversion" as relative timestamps for approved partners.
    • Partner data now includes lastLead and lastConversion metrics for richer activity insights.
    • Partner profiles expose additional profile and presence details via an extended partner shape.
  • Chores

    • Removed outdated commented scaffolding related to bulk-approve flow.

@vercel
Copy link
Contributor

vercel bot commented Sep 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Sep 28, 2025 1:51am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 27, 2025

Walkthrough

Replaces EnrolledPartnerSchema with EnrolledPartnerSchemaExtended across API, types, SWR hook, and UI; backend query now returns aggregated lastLeadAt and lastConversionAt timestamps which are validated and surfaced to UI components (PartnerInfoCards, OnlinePresenceSummary, PartnerAbout).

Changes

Cohort / File(s) Summary of Changes
Zod Schemas
apps/web/lib/zod/schemas/partners.ts
Introduced EnrolledPartnerSchemaExtended; narrowed base EnrolledPartnerSchema presence fields and moved profile/presence fields into the extended schema; added lastLeadAt and lastConversionAt to the extended schema.
Types
apps/web/lib/types.ts
Added EnrolledPartnerExtendedProps = z.infer<typeof EnrolledPartnerSchemaExtended> and imported the extended schema.
DB / Data Access
apps/web/lib/api/partners/get-partner-for-program.ts
Added MAX(...) aggregates for lastLeadAt and lastConversionAt, included them in SELECT/GROUP BY, and mapped results to `Date
API Route
apps/web/app/(ee)/api/partners/[partnerId]/route.ts
Switched validation/response parsing from EnrolledPartnerSchema to EnrolledPartnerSchemaExtended.
SWR Hook
apps/web/lib/swr/use-partner.ts
Updated SWR generic/type and import to EnrolledPartnerExtendedProps.
UI Components
apps/web/ui/partners/partner-info-cards.tsx, apps/web/ui/partners/online-presence-summary.tsx, apps/web/ui/partners/partner-about.tsx
Updated component prop types to EnrolledPartnerExtendedProps; removed unused eventsData fetch in PartnerInfoCards; PartnerInfoCards now shows lastLeadAt and lastConversionAt for approved partners.
Client Page (comment cleanup)
apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx
Removed large commented-out bulk-approve scaffolding (no runtime behavior changes).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Partner UI
  participant SWR as usePartner (SWR)
  participant API as /api/partners/[partnerId]
  participant DB as get-partner-for-program

  User->>UI: open partner page
  UI->>SWR: fetch partner (partnerId, workspaceId)
  SWR->>API: GET /api/partners/[partnerId]
  API->>DB: query partner + metrics (includes MAX(lastLeadAt,lastConversionAt))
  DB-->>API: row with lastLeadAt, lastConversionAt
  API->>API: validate with EnrolledPartnerSchemaExtended
  API-->>SWR: JSON (extended shape)
  SWR-->>UI: deliver extended partner data
  UI->>UI: render partner details (show lastLeadAt / lastConversionAt when approved)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • TWilson023
  • devkiran

Poem

A rabbit taps keys in the midnight glow,
New timestamps sprout where partner data grow.
Leads hop in first, conversions follow through,
Schemas extend, SWR fetches anew.
Carrots for data — nibble, render, woo! 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly identifies the primary change—introducing an extended partner schema—and clearly ties it to its usage context on individual partner pages without including extraneous details. It directly reflects the main purpose of the changeset and is concise enough for easy scanning in the pull request history.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch extended-partner-props

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a695241 and c77ab02.

📒 Files selected for processing (3)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx (0 hunks)
  • apps/web/ui/partners/online-presence-summary.tsx (3 hunks)
  • apps/web/ui/partners/partner-about.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx
🧰 Additional context used
🧬 Code graph analysis (2)
apps/web/ui/partners/partner-about.tsx (1)
apps/web/lib/types.ts (1)
  • EnrolledPartnerExtendedProps (441-443)
apps/web/ui/partners/online-presence-summary.tsx (1)
apps/web/lib/types.ts (1)
  • EnrolledPartnerExtendedProps (441-443)
⏰ 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

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@steven-tey steven-tey merged commit cee92a7 into main Sep 28, 2025
8 checks passed
@steven-tey steven-tey deleted the extended-partner-props branch September 28, 2025 02:06
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