Add social verification fields to EnrolledPartnerSchema
Summary by CodeRabbit
-
New Features
- Expanded verification metadata for partner online presence, now including verification timestamps for websites, YouTube, Twitter, LinkedIn, Instagram, and TikTok profiles.
βοΈ Tip: You can customize this high-level summary in your review settings.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Review | Updated (UTC) |
|---|---|---|---|
| dub | Preview | Dec 30, 2025 7:46pm |
π Walkthrough
Walkthrough
Adds an optional boolean query flag includeOnlinePresenceVerification to partners query schema, threads it through the partners GET route to conditionally include online-presence verification timestamp fields in the response, and sets that flag from two client pages when fetching partners.
Changes
| Cohort / File(s) | Summary |
|---|---|
Zod schema apps/web/lib/zod/schemas/partners.ts |
Import booleanQuerySchema and extend getPartnersQuerySchemaExtended to accept optional includeOnlinePresenceVerification?: booleanQuerySchema. |
API route (server) apps/web/app/(ee)/api/partners/route.ts |
Extract includeOnlinePresenceVerification from merged query; compute a conditional responseSchema that always includes deprecated metrics (clicks, leads, conversions, sales, saleAmount) and, when flag=true, also includes presence verification timestamps (websiteVerifiedAt, youtubeVerifiedAt, twitterVerifiedAt, linkedinVerifiedAt, instagramVerifiedAt, tiktokVerifiedAt); validate and return array shaped by that schema while preserving existing field mappings. |
Client pages apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/page-client.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/applications/rejected/page-client.tsx |
Add includeOnlinePresenceVerification: true to the partners API query parameters for those fetches. |
Sequence Diagram(s)
sequenceDiagram
actor Client
participant API as Partners API Route
participant Service as PartnerService/DB
note over API,Service `#eef3ff`: API computes conditional response schema based on flag
Client->>API: GET /api/partners?includeOnlinePresenceVerification=true
API->>Service: fetch partners (filters, pagination, sortBy, metrics)
Service-->>API: partners data (records + aggregated metrics)
alt includeOnlinePresenceVerification = true
API->>API: extend/validate each partner with presenceVerifiedAt timestamps
else
API->>API: validate partners with base metrics-only schema
end
API-->>Client: JSON array validated against computed responseSchema
Estimated code review effort
π― 3 (Moderate) | β±οΈ ~20 minutes
Possibly related PRs
- dubinc/dub#2677 β Modifies partners route and Zod partner query/response schemas with a boolean-driven conditional inclusion; touches same files and logic.
- dubinc/dub#2897 β Alters partners Zod schemas and extends partner response shape with presence/profile fields; overlaps with presence-field exposure.
Suggested reviewers
- steven-tey
Poem
π° I hopped from query to route with a cheer,
A tiny flag called out, "Bring timestamps here!"
Clients asked kindly, the server complied,
Verified traces now walk by our side. β¨
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 PR title accurately reflects the main objective of adding social verification fields to the partners schema and response structure. |
β¨ Finishing touches
- [ ] π Generate docstrings
π Recent review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
π₯ Commits
Reviewing files that changed from the base of the PR and between 1eaa976a47d89babe7e5daa3c31039d0e05fa7b4 and 864488fd759b736f6acf504e13f6e4fadb549bd8.
π Files selected for processing (1)
-
apps/web/lib/zod/schemas/partners.ts
π§ Files skipped from review as they are similar to previous changes (1)
- apps/web/lib/zod/schemas/partners.ts
β° 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.
Comment @coderabbitai help to get the list of available commands and usage tips.