Commit b2b663e
committed
feat(billing): convert referral bonuses from monthly recurring to one-time
- Add is_recurring column to referral table with migration and backfill
- Update calculateTotalReferralBonus to filter by is_recurring=true AND status=completed
- Update redeemReferralCode to grant one-time credits with expiresAt: null
- Add CreditExpirationBucket type and breakdownByExpiration/principalsByExpiration to CreditBalance
- Extract createInitialCreditBalance helper to eliminate DRY violation
- Update UsageDisplay to use data-driven expiration buckets
- Update UI messaging to remove per month references
- Add expiration-buckets tests including edge cases for zero/negative balances1 parent f6c3e7b commit b2b663e
File tree
15 files changed
+3458
-124
lines changed- cli/src/commands
- packages
- billing/src
- __tests__
- internal/src/db
- migrations
- meta
- web/src/app
- affiliates
- api/referrals
- profile/components
- referrals/[code]
15 files changed
+3458
-124
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
0 commit comments