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

Skip to content

Conversation

@steven-tey
Copy link
Collaborator

@steven-tey steven-tey commented Oct 9, 2025

Summary by CodeRabbit

  • New Features
    • Partner-related webhook payloads now include an optional groupId (when available), enabling integrations to group or segment partners by enrollment. Existing fields and totals are unchanged.
    • The new field is nullable and additive, so existing integrations continue to work without changes. Consumers can start reading groupId to enhance routing, reporting, or analytics.

@vercel
Copy link
Contributor

vercel bot commented Oct 9, 2025

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

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Oct 9, 2025 6:26pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Walkthrough

Adds programEnrollment.groupId to the webhook partner payload. Updates constructWebhookPartner to include groupId and extends the Zod WebhookPartnerSchema with an optional string|null groupId. No control-flow changes; function signatures and totalCommissions behavior remain unchanged.

Changes

Cohort / File(s) Summary
Webhook partner payload and schema
apps/web/lib/partners/create-partner-commission.ts, apps/web/lib/zod/schemas/partners.ts
Include groupId from programEnrollment in constructed webhook partner payload and add optional groupId to WebhookPartnerSchema (string or null). No other logic changes.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • devkiran
  • TWilson023

Poem

A hop and a bop through schema fields bright,
I tucked in a groupId—snug, clean, and light.
Webhooks now whisper a little bit more,
Payloads aligned from burrow to door.
Thump-thump, ship it—ears up, delight! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely and accurately reflects the primary change introduced by the pull request, which is adding the partner’s groupId to webhook events, and it clearly conveys the main enhancement without extraneous detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch webhook-partner-groupid

📜 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 31ce622 and 426ae33.

📒 Files selected for processing (2)
  • apps/web/lib/partners/create-partner-commission.ts (1 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 (2)
apps/web/lib/zod/schemas/partners.ts (1)

444-444: LGTM! Appropriate schema extension for webhook payloads.

The addition of the optional groupId field to WebhookPartnerSchema is well-typed using .nullish() to handle nullable database values. This change aligns with the corresponding implementation in create-partner-commission.ts that sources this field from programEnrollment.groupId.

apps/web/lib/partners/create-partner-commission.ts (1)

52-52: LGTM! Correct implementation of groupId in webhook payload.

The groupId is appropriately sourced from programEnrollment.groupId rather than the partner object, which correctly reflects the database relationship where groupId belongs to the enrollment, not the partner directly. The placement in the object construction is logical, and the change is consistently applied across all code paths that use constructWebhookPartner.


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 39e472f into main Oct 9, 2025
10 checks passed
@steven-tey steven-tey deleted the webhook-partner-groupid branch October 9, 2025 18:33
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