Conversation
…h platform Result
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ 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). (29)
🧰 Additional context used📓 Path-based instructions (7)**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
{packages/core,apps/webapp}/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{js,ts,jsx,tsx,json,md,yaml,yml}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.ts{,x}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/webapp/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)
Files:
apps/webapp/**/*.{tsx,jsx}📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)
Files:
🧠 Learnings (10)📚 Learning: 2026-03-13T13:45:39.411ZApplied to files:
📚 Learning: 2025-11-27T16:26:37.432ZApplied to files:
📚 Learning: 2026-03-21T21:23:35.117ZApplied to files:
📚 Learning: 2026-04-16T14:21:11.115ZApplied to files:
📚 Learning: 2026-02-04T16:34:48.876ZApplied to files:
📚 Learning: 2026-03-29T19:16:38.123ZApplied to files:
📚 Learning: 2026-02-03T18:27:40.429ZApplied to files:
📚 Learning: 2026-02-11T16:37:32.429ZApplied to files:
📚 Learning: 2026-03-22T13:26:12.060ZApplied to files:
📚 Learning: 2026-03-22T19:24:14.403ZApplied to files:
🔇 Additional comments (7)
WalkthroughAdds a new admin "Coupon Deals" area: a route at /admin/back-office/coupons with a typed loader that lists coupon deals and optionally resolves organizations/customers by Stripe email, and a typed action that handles Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Summary
Adds a Coupon Deals tool to the Back office admin area. Admins can look up an org by Stripe customer email and apply any Stripe coupon tagged with
trigger_deal_key/trigger_deal_label/trigger_deal_categorymetadata to that org's subscription. The catalog is built dynamically from Stripe — no env vars per deal, no code change, no redeploy when a new deal is added; just tag a coupon in the Stripe dashboard.What's in here
Coupon Dealssub-tab under/admin/back-office.admin.back-office.coupons.tsx— search by Stripe customer email, multi-match banner, per-row apply buttons grouped by category, confirmation modal, disabled states for free-plan and already-applied orgs.ApplyCouponDialogconfirmation modal — re-states the org / Stripe customer / Stripe sub / coupon before submit.services/platform.v3.server.tsaroundBillingClient(listCouponDeals,refreshCouponDeals,resolveCouponCustomer,applyCouponDeal,getCouponDiagnostics) — modeled on thedeleteUserpattern from the admin user-delete PR.Merge-order gate (read before reviewing CI)
Depends on the matching cloud-side branch landing first:
cloud/billingadds the five/api/admin/coupons/*endpoints + Stripe-backed registry.@trigger.dev/platformminor releases with the newBillingClientmethods and Zod schemas.This PR's typecheck WILL fail in CI on
listCouponDeals,applyCouponDeal,ApplyCouponDealResult, etc. until that minor is published. The pin inapps/webapp/package.jsonis intentionally not bumped here — bumping is a follow-up after the platform release. Same shape as the recent admin user-delete PR.Test plan (after platform publish)
trigger_deal_key/trigger_deal_label/trigger_deal_category./admin/back-office/couponsas admin.Known gaps (intentional v1)
409 already_appliedresponse carriescodeandcurrentDealKeyon the wire, but the platform's genericErrorSchemastrips them, so the inline banner shows the generic error string rather than(currently has: <label>). Cloud-side fix is small (loosenErrorSchemato passthrough extras); the route is forward-compatible — once that lands, the precise UI starts rendering with no webapp change.Out of scope