Skip to content

Commit ecda87e

Browse files
committed
feat(common): add referral_legacy grant type and update priorities
- Add referral_legacy to GrantType union and GrantTypeValues array - Update GRANT_PRIORITIES: referral_legacy=30 (consumed first, renews monthly), referral=50 (one-time, preserved longer) - Add consumption order comment for clarity
1 parent 5e7fbbf commit ecda87e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

common/src/constants/grant-priorities.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { GrantType } from '@codebuff/common/types/grant'
22

3+
// Lower = consumed first
34
export const GRANT_PRIORITIES: Record<GrantType, number> = {
45
free: 20,
5-
referral: 30,
6+
referral_legacy: 30, // Legacy recurring referrals (renews monthly, consumed first)
67
ad: 40,
8+
referral: 50, // One-time referrals (never expires, preserved longer)
79
admin: 60,
810
organization: 70,
911
purchase: 80,

common/src/types/grant.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export type GrantType =
22
| 'free'
33
| 'referral'
4+
| 'referral_legacy'
45
| 'purchase'
56
| 'admin'
67
| 'organization'
@@ -9,6 +10,7 @@ export type GrantType =
910
export const GrantTypeValues = [
1011
'free',
1112
'referral',
13+
'referral_legacy',
1214
'purchase',
1315
'admin',
1416
'organization',

0 commit comments

Comments
 (0)