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

Skip to content

Conversation

@TWilson023
Copy link
Collaborator

@TWilson023 TWilson023 commented Jul 28, 2025

Summary by CodeRabbit

  • New Features
    • Added the ability to exclude or include specific payouts from payout invoice calculations and display.
    • Users can now toggle individual payouts to be included or excluded, with visual indicators in the payout table.
  • Enhancements
    • The payout confirmation and splitting process now supports excluding selected payout IDs, improving flexibility in payout management.
    • Table cell styling can now dynamically reflect both column and row data for more granular visual feedback.

@vercel
Copy link
Contributor

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dub ✅ Ready (Inspect) Visit Preview Jul 28, 2025 4:34pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

This change introduces the ability to exclude specific payout IDs from payout confirmation and splitting processes. The exclusion logic is implemented across backend API handlers, action schemas, and UI components, allowing users to interactively include or exclude payouts from invoice calculations and confirmations. Supporting type and table rendering updates are also included.

Changes

Cohort / File(s) Change Summary
Backend Exclusion Logic
apps/web/app/(ee)/api/cron/payouts/confirm/confirm-payouts.ts,
apps/web/app/(ee)/api/cron/payouts/confirm/split-payouts.ts
Extended confirmPayouts and splitPayouts functions to accept an optional excludedPayoutIds parameter and filter out those payouts in database queries.
API Schema and Handler Update
apps/web/app/(ee)/api/cron/payouts/confirm/route.ts
Updated the API request schema and POST handler to accept and forward excludedPayoutIds for payout confirmation and splitting.
Action Schema and Qstash Payload
apps/web/lib/actions/partners/confirm-payouts.ts
Modified the action's input schema and handler to handle excludedPayoutIds, including it in the Qstash payload for downstream processing.
UI: Payout Invoice Sheet
apps/web/ui/partners/payout-invoice-sheet.tsx
Added UI state and controls to allow users to exclude or include payouts from invoice calculations, updated the payout table to reflect excluded payouts visually, and adjusted total calculations accordingly.
Table Component Invocation
packages/ui/src/table/table.tsx
Changed tdClassName function invocations to receive both column ID and row object, enabling cell class computation based on row data.
Table Props Type Update
packages/ui/src/table/types.ts
Updated the tdClassName property type in BaseTableProps to accept a function with both column ID and row as arguments, supporting more dynamic cell class assignment.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI (payout-invoice-sheet.tsx)
    participant Action (confirm-payouts.ts)
    participant API Route (route.ts)
    participant Backend (confirm-payouts.ts / split-payouts.ts)

    User->>UI (payout-invoice-sheet.tsx): Exclude/Include payout(s)
    UI->>Action (confirm-payouts.ts): Submit confirmation with excludedPayoutIds
    Action->>API Route (route.ts): POST request with excludedPayoutIds
    API Route->>Backend (split-payouts.ts): Call splitPayouts({..., excludedPayoutIds})
    API Route->>Backend (confirm-payouts.ts): Call confirmPayouts({..., excludedPayoutIds})
    Backend-->>API Route: Processed payouts (excluding specified IDs)
    API Route-->>Action: Response
    Action-->>UI: Confirmation result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Suggested reviewers

  • steven-tey

Poem

In a field of payouts, some bunnies must hide,
With a hop and a skip, exclusions applied.
The table now knows which rows to fade,
As totals recalculate, new invoices made.
A toggle, a click, and clarity grows—
Hooray for the code where exclusion now shows! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 11e564d and 1f668c0.

📒 Files selected for processing (1)
  • apps/web/ui/partners/payout-invoice-sheet.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/ui/partners/payout-invoice-sheet.tsx
⏰ 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
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch exclude-payouts

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🔭 Outside diff range comments (1)
apps/web/ui/partners/payout-invoice-sheet.tsx (1)

480-484: Missing integration: excludedPayoutIds not passed to backend action.

The UI tracks excluded payouts but doesn't pass the excludedPayoutIds to the executeAsync call, which means the exclusion feature won't work end-to-end.

Apply this diff to pass the excluded payout IDs to the backend:

            await executeAsync({
              workspaceId,
              paymentMethodId: selectedPaymentMethod.id,
              cutoffPeriod,
+              excludedPayoutIds,
            });

This ensures the excluded payouts are actually filtered out during the confirmation process.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43400f5 and 11e564d.

📒 Files selected for processing (7)
  • apps/web/app/(ee)/api/cron/payouts/confirm/confirm-payouts.ts (3 hunks)
  • apps/web/app/(ee)/api/cron/payouts/confirm/route.ts (4 hunks)
  • apps/web/app/(ee)/api/cron/payouts/confirm/split-payouts.ts (2 hunks)
  • apps/web/lib/actions/partners/confirm-payouts.ts (2 hunks)
  • apps/web/ui/partners/payout-invoice-sheet.tsx (3 hunks)
  • packages/ui/src/table/table.tsx (2 hunks)
  • packages/ui/src/table/types.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: steven-tey
PR: dubinc/dub#0
File: :0-0
Timestamp: 2025-06-25T21:20:59.837Z
Learning: In the Dub codebase, payout limit validation uses a two-stage pattern: server actions perform quick sanity checks (payoutsUsage > payoutsLimit) for immediate user feedback, while the cron job (/cron/payouts) performs authoritative validation (payoutsUsage + payoutAmount > payoutsLimit) with actual calculated amounts before processing. This design provides fast user feedback while ensuring accurate limit enforcement at transaction time.
Learnt from: devkiran
PR: dubinc/dub#2635
File: packages/prisma/schema/payout.prisma:24-25
Timestamp: 2025-07-11T16:28:55.693Z
Learning: In the Dub codebase, multiple payout records can now share the same stripeTransferId because payouts are grouped by partner and processed as single Stripe transfers. This is why the @unique constraint was removed from the stripeTransferId field in the Payout model - a single transfer can include multiple payouts for the same partner.
apps/web/lib/actions/partners/confirm-payouts.ts (2)

Learnt from: devkiran
PR: #2635
File: packages/prisma/schema/payout.prisma:24-25
Timestamp: 2025-07-11T16:28:55.693Z
Learning: In the Dub codebase, multiple payout records can now share the same stripeTransferId because payouts are grouped by partner and processed as single Stripe transfers. This is why the @unique constraint was removed from the stripeTransferId field in the Payout model - a single transfer can include multiple payouts for the same partner.

Learnt from: steven-tey
PR: dubinc/dub#0
File: :0-0
Timestamp: 2025-06-25T21:20:59.837Z
Learning: In the Dub codebase, payout limit validation uses a two-stage pattern: server actions perform quick sanity checks (payoutsUsage > payoutsLimit) for immediate user feedback, while the cron job (/cron/payouts) performs authoritative validation (payoutsUsage + payoutAmount > payoutsLimit) with actual calculated amounts before processing. This design provides fast user feedback while ensuring accurate limit enforcement at transaction time.

apps/web/ui/partners/payout-invoice-sheet.tsx (1)

Learnt from: devkiran
PR: #2635
File: packages/prisma/schema/payout.prisma:24-25
Timestamp: 2025-07-11T16:28:55.693Z
Learning: In the Dub codebase, multiple payout records can now share the same stripeTransferId because payouts are grouped by partner and processed as single Stripe transfers. This is why the @unique constraint was removed from the stripeTransferId field in the Payout model - a single transfer can include multiple payouts for the same partner.

apps/web/app/(ee)/api/cron/payouts/confirm/split-payouts.ts (2)

Learnt from: devkiran
PR: #2635
File: packages/prisma/schema/payout.prisma:24-25
Timestamp: 2025-07-11T16:28:55.693Z
Learning: In the Dub codebase, multiple payout records can now share the same stripeTransferId because payouts are grouped by partner and processed as single Stripe transfers. This is why the @unique constraint was removed from the stripeTransferId field in the Payout model - a single transfer can include multiple payouts for the same partner.

Learnt from: steven-tey
PR: dubinc/dub#0
File: :0-0
Timestamp: 2025-06-25T21:20:59.837Z
Learning: In the Dub codebase, payout limit validation uses a two-stage pattern: server actions perform quick sanity checks (payoutsUsage > payoutsLimit) for immediate user feedback, while the cron job (/cron/payouts) performs authoritative validation (payoutsUsage + payoutAmount > payoutsLimit) with actual calculated amounts before processing. This design provides fast user feedback while ensuring accurate limit enforcement at transaction time.

apps/web/app/(ee)/api/cron/payouts/confirm/route.ts (3)

Learnt from: devkiran
PR: #2635
File: packages/prisma/schema/payout.prisma:24-25
Timestamp: 2025-07-11T16:28:55.693Z
Learning: In the Dub codebase, multiple payout records can now share the same stripeTransferId because payouts are grouped by partner and processed as single Stripe transfers. This is why the @unique constraint was removed from the stripeTransferId field in the Payout model - a single transfer can include multiple payouts for the same partner.

Learnt from: steven-tey
PR: dubinc/dub#0
File: :0-0
Timestamp: 2025-06-25T21:20:59.837Z
Learning: In the Dub codebase, payout limit validation uses a two-stage pattern: server actions perform quick sanity checks (payoutsUsage > payoutsLimit) for immediate user feedback, while the cron job (/cron/payouts) performs authoritative validation (payoutsUsage + payoutAmount > payoutsLimit) with actual calculated amounts before processing. This design provides fast user feedback while ensuring accurate limit enforcement at transaction time.

Learnt from: steven-tey
PR: dubinc/dub#0
File: :0-0
Timestamp: 2025-06-19T01:46:45.723Z
Learning: PayPal webhook verification in the Dub codebase is handled at the route level in apps/web/app/(ee)/api/paypal/webhook/route.ts using the verifySignature function. Individual webhook handlers like payoutsItemFailed don't need to re-verify signatures since they're only called after successful verification.

apps/web/app/(ee)/api/cron/payouts/confirm/confirm-payouts.ts (2)

Learnt from: devkiran
PR: #2635
File: packages/prisma/schema/payout.prisma:24-25
Timestamp: 2025-07-11T16:28:55.693Z
Learning: In the Dub codebase, multiple payout records can now share the same stripeTransferId because payouts are grouped by partner and processed as single Stripe transfers. This is why the @unique constraint was removed from the stripeTransferId field in the Payout model - a single transfer can include multiple payouts for the same partner.

Learnt from: steven-tey
PR: dubinc/dub#0
File: :0-0
Timestamp: 2025-06-25T21:20:59.837Z
Learning: In the Dub codebase, payout limit validation uses a two-stage pattern: server actions perform quick sanity checks (payoutsUsage > payoutsLimit) for immediate user feedback, while the cron job (/cron/payouts) performs authoritative validation (payoutsUsage + payoutAmount > payoutsLimit) with actual calculated amounts before processing. This design provides fast user feedback while ensuring accurate limit enforcement at transaction time.

⏰ 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 (18)
packages/ui/src/table/types.ts (1)

67-67: LGTM! Enhanced tdClassName function signature enables row-based styling.

The updated signature allows the tdClassName function to access both column ID and row data, enabling more dynamic cell styling based on row state. This is essential for features like styling excluded payouts differently.

packages/ui/src/table/table.tsx (2)

247-249: LGTM! Correctly implements the enhanced tdClassName signature.

The function call now passes both cell.column.id and row parameters, matching the updated type definition. The implementation maintains backward compatibility with string-based tdClassName.


489-491: LGTM! Consistent implementation across both rendering paths.

Both the resizable and non-resizable table row rendering paths now correctly call tdClassName with the enhanced signature, ensuring consistent behavior.

apps/web/lib/actions/partners/confirm-payouts.ts (3)

16-16: LGTM! Properly extends schema for payout exclusion.

The optional excludedPayoutIds parameter allows selective exclusion of payouts while maintaining backward compatibility with existing code that doesn't provide this parameter.


24-24: LGTM! Correctly extracts the exclusion parameter.

The destructuring properly extracts the excludedPayoutIds from the validated input, following the established pattern in the codebase.


65-65: LGTM! Forwards exclusion parameter to background job.

The excludedPayoutIds is correctly included in the qstash payload, ensuring the exclusion list propagates to the background processing job.

apps/web/app/(ee)/api/cron/payouts/confirm/route.ts (4)

18-18: LGTM! Extends API schema for payout exclusion.

The optional excludedPayoutIds parameter maintains backward compatibility while enabling the new exclusion functionality.


30-36: LGTM! Clean parameter extraction from request body.

The destructuring cleanly extracts all parameters including the new excludedPayoutIds from the validated request payload.


54-54: LGTM! Forwards exclusion parameter to splitPayouts.

The excludedPayoutIds is correctly passed to the splitPayouts function, enabling exclusion during the payout splitting process.


64-64: LGTM! Forwards exclusion parameter to confirmPayouts.

The excludedPayoutIds is correctly passed to the confirmPayouts function, ensuring excluded payouts are not processed during confirmation.

apps/web/app/(ee)/api/cron/payouts/confirm/split-payouts.ts (2)

13-13: LGTM! Properly extends function signature for exclusion.

The optional excludedPayoutIds parameter enables selective exclusion of payouts while maintaining backward compatibility for existing callers.

Also applies to: 17-17


35-35: LGTM! Correctly implements exclusion filter in database query.

The conditional spread operator with notIn filter properly excludes specified payout IDs from processing. The implementation only applies the filter when excludedPayoutIds is provided, maintaining efficient queries when exclusion is not needed.

apps/web/app/(ee)/api/cron/payouts/confirm/confirm-payouts.ts (2)

35-51: LGTM! Function signature properly updated for exclusion feature.

The addition of the optional excludedPayoutIds parameter is well-typed and maintains backward compatibility.


83-83: LGTM! Exclusion logic correctly implemented.

The conditional filtering using notIn is the appropriate approach for excluding multiple payout IDs from the query. The pattern matches the cutoff period filtering above and maintains consistency.

apps/web/ui/partners/payout-invoice-sheet.tsx (4)

117-125: LGTM! State management for exclusion feature is well-implemented.

The excludedPayoutIds state and derived includedPayouts calculation are properly structured with appropriate memoization and dependencies.


188-194: LGTM! Amount calculation correctly updated to use included payouts.

The change from eligiblePayouts to includedPayouts ensures the amount calculation excludes payouts that the user has chosen to exclude, which is the correct behavior.


321-341: LGTM! Good refactoring to extract partner column definition.

Extracting the partner column into a memoized constant improves code readability while preserving the exact same functionality.


390-399: LGTM! Table styling appropriately updated for exclusion feature.

The conditional styling provides clear visual feedback for excluded payouts with appropriate opacity changes and hover effects. The updated tdClassName function signature correctly accepts both id and row parameters for conditional styling.

@steven-tey
Copy link
Collaborator

@CodeRabbit final review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Tip

For best results, initiate chat on the files or code changes.

@steven-tey I'll perform a final review of the changes that add the ability to exclude specific payouts from confirmation.

[review]


🧠 Learnings used
Learnt from: steven-tey
PR: dubinc/dub#0
File: :0-0
Timestamp: 2025-06-25T21:20:59.837Z
Learning: In the Dub codebase, payout limit validation uses a two-stage pattern: server actions perform quick sanity checks (payoutsUsage > payoutsLimit) for immediate user feedback, while the cron job (/cron/payouts) performs authoritative validation (payoutsUsage + payoutAmount > payoutsLimit) with actual calculated amounts before processing. This design provides fast user feedback while ensuring accurate limit enforcement at transaction time.

Learnt from: devkiran
PR: dubinc/dub#2635
File: packages/prisma/schema/payout.prisma:24-25
Timestamp: 2025-07-11T16:28:55.693Z
Learning: In the Dub codebase, multiple payout records can now share the same stripeTransferId because payouts are grouped by partner and processed as single Stripe transfers. This is why the @unique constraint was removed from the stripeTransferId field in the Payout model - a single transfer can include multiple payouts for the same partner.

@steven-tey
Copy link
Collaborator

@CodeRabbit you didn't leave a review – can you do it again please?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@steven-tey I'll perform a detailed review of the payout exclusion feature. Let me examine the implementation across all modified files.


🏁 Script executed:

#!/bin/bash
# Examine the key files to understand the implementation
echo "=== Confirm Payouts Function ==="
cat apps/web/app/\(ee\)/api/cron/payouts/confirm/confirm-payouts.ts

echo -e "\n=== Route Handler ==="
cat apps/web/app/\(ee\)/api/cron/payouts/confirm/route.ts

echo -e "\n=== Split Payouts Function ==="
cat apps/web/app/\(ee\)/api/cron/payouts/confirm/split-payouts.ts

Length of output: 13844


🏁 Script executed:

#!/bin/bash
# Examine the server action and UI components
echo "=== Server Action ==="
cat apps/web/lib/actions/partners/confirm-payouts.ts

echo -e "\n=== UI Component (first 100 lines) ==="
head -100 apps/web/ui/partners/payout-invoice-sheet.tsx

echo -e "\n=== Table Types ==="
cat packages/ui/src/table/types.ts

Length of output: 7223


🏁 Script executed:

#!/bin/bash
# Get the full UI component to see the complete implementation
echo "=== Full UI Component Implementation ==="
cat apps/web/ui/partners/payout-invoice-sheet.tsx

echo -e "\n=== Table Component Changes ==="
cat packages/ui/src/table/table.tsx | grep -A 10 -B 5 "tdClassName"

Length of output: 19598


@steven-tey I've completed a thorough review of the payout exclusion feature. Here's my assessment:

Excellent Implementation

This PR successfully adds the ability to exclude specific payouts from confirmation with a clean, consistent implementation across the entire stack.

Key Strengths:

  1. Type Safety & Consistency

    • excludedPayoutIds?: string[] parameter used consistently across all layers
    • Proper Zod schema validation in both API route and server action
    • TypeScript types correctly propagated throughout
  2. Database Query Efficiency

    ...(excludedPayoutIds && { id: { notIn: excludedPayoutIds } }),
    • Clean conditional filtering using Prisma's notIn operator
    • Maintains existing query structure and performance
  3. Robust UI/UX Design

    • Clear visual feedback with line-through styling for excluded payouts
    • Intuitive hover-based toggle buttons (Exclude/Include)
    • Proper opacity transitions and row styling
    • Real-time amount recalculation based on included payouts
  4. Seamless Integration

    • Leverages the existing two-stage payout validation pattern from our learnings
    • Maintains all existing error handling and limit checks
    • Preserves audit logging and email notification flows

Technical Excellence:

  • Table Enhancement: The tdClassName function signature extension to accept row data enables context-aware styling - well-designed improvement
  • State Management: Clean React state management with excludedPayoutIds and derived includedPayouts
  • Memoization: Proper use of useMemo for expensive calculations and component optimization

Code Quality:

  • Follows established patterns and naming conventions
  • No breaking changes to existing functionality
  • Clean separation of concerns between UI state and business logic
  • Appropriate use of conditional rendering and styling

🎯 Minor Observations:

The implementation is production-ready. The feature integrates perfectly with the existing payout limit validation system and maintains all security and business logic constraints.

Overall Assessment: This is a well-architected feature that enhances user control over payout processing while maintaining system integrity. The code is clean, type-safe, and follows Dub's established patterns.

🐰
(\ /)
( .. )
o
(")(") impressed by the clean implementation


🧠 Learnings used
Learnt from: steven-tey
PR: dubinc/dub#0
File: :0-0
Timestamp: 2025-06-25T21:20:59.837Z
Learning: In the Dub codebase, payout limit validation uses a two-stage pattern: server actions perform quick sanity checks (payoutsUsage > payoutsLimit) for immediate user feedback, while the cron job (/cron/payouts) performs authoritative validation (payoutsUsage + payoutAmount > payoutsLimit) with actual calculated amounts before processing. This design provides fast user feedback while ensuring accurate limit enforcement at transaction time.

Learnt from: devkiran
PR: dubinc/dub#2635
File: packages/prisma/schema/payout.prisma:24-25
Timestamp: 2025-07-11T16:28:55.693Z
Learning: In the Dub codebase, multiple payout records can now share the same stripeTransferId because payouts are grouped by partner and processed as single Stripe transfers. This is why the @unique constraint was removed from the stripeTransferId field in the Payout model - a single transfer can include multiple payouts for the same partner.

@steven-tey steven-tey merged commit 520fec8 into main Jul 28, 2025
8 checks passed
@steven-tey steven-tey deleted the exclude-payouts branch July 28, 2025 17:38
@coderabbitai coderabbitai bot mentioned this pull request Nov 5, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 3, 2025
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