-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Support sale amount in the reward condition #2927
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
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 3 minutes and 38 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)
WalkthroughAdds sale.amount to reward schemas and threads it through partner commission contexts across Stripe checkout, Stripe invoice, generic sale tracking, and Shopify integration. Updates Zod schema, attribute types, labels, and context validation to include amount. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant SC as Stripe Checkout
participant SI as Stripe Invoice
participant SH as Shopify
participant CT as Conversions API
participant BH as Backend Handler
participant CPC as createPartnerCommission
participant RE as Rewards Engine
rect rgba(230,245,255,0.6)
note over SC,BH: Checkout-session-completed webhook
SC->>BH: webhook payload (saleData)
BH->>CPC: context { sale: { productId, amount } }
end
rect rgba(230,255,230,0.6)
note over SI,BH: Invoice-paid webhook
SI->>BH: webhook payload (saleData)
BH->>CPC: context { sale: { productId, amount } }
end
rect rgba(255,245,230,0.6)
note over SH,BH: Shopify create-sale
SH->>BH: create-sale event
BH->>CPC: context { sale: { amount }, customer: { country } }
end
rect rgba(245,230,255,0.6)
note over CT,BH: Generic track-sale
CT->>BH: track-sale request
BH->>CPC: context { sale: { amount } }
end
CPC->>RE: Evaluate rewards using sale.amount
RE-->>CPC: Commission decision/results
Estimated code review effortπ― 3 (Moderate) | β±οΈ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touchesβ Passed checks (3 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 (2)
apps/web/tests/tracks/track-sale.test.ts(1 hunks)apps/web/tests/utils/resource.ts(1 hunks)
π§° Additional context used
𧬠Code graph analysis (1)
apps/web/tests/tracks/track-sale.test.ts (3)
apps/web/tests/utils/helpers.ts (1)
randomId(4-4)apps/web/lib/types.ts (1)
TrackSaleResponse(411-411)apps/web/tests/utils/resource.ts (2)
E2E_CUSTOMER_EXTERNAL_ID_2(40-40)E2E_REWARD(41-71)
β° 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 (1)
apps/web/tests/utils/resource.ts (1)
58-69: LGTM!The new modifier correctly extends the reward fixture to test sale amount conditions. The structure is consistent with existing modifiers, and the threshold-based logic (amount > 15000 β 5000 reward) aligns with the PR's goal to support sale.amount in reward conditions.
Summary by CodeRabbit
New Features
Integrations
Tests
Chores