feat(billing): add service fee domain library - #5262
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous Review Summaries (3 snapshots, latest commit 1e58993)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 1e58993)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe double-failure fallback in Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit ce00251)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe double-failure fallback in Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (10 files)
Fix these issues in Kilo Cloud Previous review (commit 842d6ec)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe inert service-fee domain library is carefully built (minor-unit BigInt rounding, idempotent upserts, optimistic-concurrency guards, fail-open misses), but the double-failure fallback in Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (28 files)
Custom-instruction checks: no Reviewed by grok-4.6 · Input: 68.8K · Output: 16.7K · Cached: 506.5K Review guidance: REVIEW.md from base branch |
ce00251 to
1e58993
Compare
Land the fee math, durable assessments, Checkout/invoice attach helpers, and refund/dispute observers without wiring them into payment paths. Pin the Stripe API version so line-shape assumptions stay stable.
e996029 to
f5731b3
Compare
1e58993 to
68aaf4a
Compare
Summary
Adds the service-fee domain library without connecting it to live payment paths.
Why this change is needed
The fee lifecycle has more states than a Stripe line item: eligibility, exemption, expected versus charged fee, settlement, fail-open misses, refunds, and disputes. Landing these rules as an unused library isolates the financial model from the later wiring changes and makes its behavior reviewable before any customer can be charged.
How this is addressed
Stack: #5236 → #5262 (this PR) → #5263 → #5264 → #5265 → #5266.
Human Verification
No new product or browser verification was performed while publishing this PR. This slice is intentionally unused; its behavior is covered by focused automated tests in the diff.
Reviewer Notes
Human Reviewer Flags
Code Reviewer Agent
Code Reviewer Notes