Skip click/lead/sale commissions for non-active program enrollments#4018
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds COMMISSION_ELIGIBLE_ENROLLMENT_STATUSES and uses it to gate click aggregation, gate workflow commission creation (skip for ineligible enrollment statuses), and disable the “Create commission” UI when a partner is not eligible. ChangesCommission eligibility by enrollment status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 final review, any breaking changes? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Read the new constant definition
cat apps/web/lib/zod/schemas/partners.ts | grep -A 10 "COMMISSION_ELIGIBLE\|ACTIVE_ENROLLMENT"
echo "=== aggregate-clicks route ==="
cat "apps/web/app/(ee)/api/cron/aggregate-clicks/route.ts"
echo "=== create-partner-commission workflow ==="
cat "apps/web/app/(ee)/api/workflows/create-partner-commission/route.ts"
echo "=== partner layout ==="
cat "apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/layout.tsx"
echo "=== partners schema ==="
cat apps/web/lib/zod/schemas/partners.tsLength of output: 73103
✅ No breaking changes
Behavioral changes (intentional)
One minor inconsistency to be aware ofThe eligibility guard in the workflow only covers
This is likely intentional (custom commissions are a manual override path), but worth confirming with |
Summary by CodeRabbit
Bug Fixes
New Features