dub icon indicating copy to clipboard operation
dub copied to clipboard

Add social verification fields to EnrolledPartnerSchema

Open devkiran opened this issue 2 months ago β€’ 2 comments

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.

devkiran avatar Dec 19 '25 10:12 devkiran

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

Project Deployment Review Updated (UTC)
dub Ready Ready Preview Dec 30, 2025 7:46pm

vercel[bot] avatar Dec 19 '25 10:12 vercel[bot]

πŸ“ 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.

❀️ Share

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

coderabbitai[bot] avatar Dec 19 '25 10:12 coderabbitai[bot]