-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix PS commissions sync #3234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PS commissions sync #3234
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded@devkiran has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 47 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughAdded optional status filtering to PartnerStack API calls, extended commission schema to accept "scheduled", updated import flow to map "scheduled" -> "pending", and added a separate scheduled-commissions import step that runs after the main fetch completes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/web/lib/partnerstack/api.ts(1 hunks)apps/web/lib/partnerstack/import-commissions.ts(2 hunks)apps/web/lib/partnerstack/schemas.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-30T15:25:13.936Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2673
File: apps/web/ui/partners/rewards/add-edit-reward-sheet.tsx:56-66
Timestamp: 2025-07-30T15:25:13.936Z
Learning: In apps/web/ui/partners/rewards/add-edit-reward-sheet.tsx, the form schema uses partial condition objects to allow users to add empty/unconfigured condition fields without type errors, while submission validation uses strict schemas to ensure data integrity. This two-stage validation pattern improves UX by allowing progressive completion of complex forms.
Applied to files:
apps/web/lib/partnerstack/schemas.ts
📚 Learning: 2025-07-30T15:29:54.131Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2673
File: apps/web/ui/partners/rewards/rewards-logic.tsx:268-275
Timestamp: 2025-07-30T15:29:54.131Z
Learning: In apps/web/ui/partners/rewards/rewards-logic.tsx, when setting the entity field in a reward condition, dependent fields (attribute, operator, value) should be reset rather than preserved because different entities (customer vs sale) have different available attributes. Maintaining existing fields when the entity changes would create invalid state combinations and confusing UX.
Applied to files:
apps/web/lib/partnerstack/schemas.ts
🔇 Additional comments (3)
apps/web/lib/partnerstack/schemas.ts (1)
97-104: LGTM!The enum extension correctly adds "scheduled" as a valid reward status, aligning with the API filtering capability and the status mapping in import-commissions.ts.
apps/web/lib/partnerstack/import-commissions.ts (1)
29-29: LGTM!Mapping "scheduled" to "pending" is appropriate since scheduled commissions haven't been finalized yet.
apps/web/lib/partnerstack/api.ts (1)
122-138: LGTM!The optional
statusparameter is cleanly integrated, follows the existing pattern of other list methods, and maintains type safety by usingPartnerStackCommission["reward_status"].
…c/dub into investigate-ps-commissions
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.