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

Skip to content

Conversation

@steven-tey
Copy link
Collaborator

@steven-tey steven-tey commented Dec 2, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Restored processing of manual payouts that were previously excluded from payout-splitting operations.
    • Broadened payout selection and eligibility so payouts previously filtered out during processing are now included, ensuring more eligible payouts are updated and billed.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Contributor

vercel bot commented Dec 2, 2025

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

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Dec 2, 2025 4:34pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

Walkthrough

Removed cutoff/period-based filters from payout selection queries across cron processors and the eligibility fetch, reintroducing payouts that previously were excluded (e.g., manual payouts with null periodStart). No exported/public signatures changed.

Changes

Cohort / File(s) Summary
Cron payout processors
apps/web/app/(ee)/api/cron/payouts/process/split-payouts.ts, apps/web/app/(ee)/api/cron/payouts/process/process-payouts.ts
Removed WHERE-clause conditions that excluded payouts by periodStart/periodEnd/cutoff-period logic. Split/process flows otherwise unchanged; selection now includes payouts previously filtered out (e.g., null periodStart).
Eligibility query
apps/web/lib/api/payouts/get-eligible-payouts.ts
Removed the cutoffPeriodValue-based OR condition from the initial eligibility WHERE clause; cutoff usage remains in includes/post-processing. Initial query is now less restrictive regarding period fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus areas:
    • split-payouts.ts — verify handling of payouts with null periodStart through the split logic.
    • process-payouts.ts — confirm updated update/query scope doesn't mark unintended payouts as processing/billed.
    • get-eligible-payouts.ts — ensure post-filtering and commission includes still enforce intended eligibility rules.

Possibly related PRs

Suggested reviewers

  • devkiran

Poem

🐰
In burrows where the ledger sleeps, I hop and softly peep,
Freed the quiet payouts from their patch of muted sleep.
No more gates of dates to scare them — let them gather, spring!
I nibble carrots, hum a tune, and celebrate this thing. 🥕✨

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 'Fix cutoffPeriod bug' directly references the specific bug being addressed across all three modified files, which collectively remove cutoffPeriod-based filtering logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 fix-cutoff-period

📜 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 b76acc6 and 78cdb59.

📒 Files selected for processing (1)
  • apps/web/app/(ee)/api/cron/payouts/process/process-payouts.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/app/(ee)/api/cron/payouts/process/process-payouts.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.

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.

3 participants