@levrbet/shared 0.5.81 → 0.5.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levrbet/shared",
3
- "version": "0.5.81",
3
+ "version": "0.5.82",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -6,12 +6,14 @@ model FreeBetCampaign {
6
6
  name String
7
7
  description String
8
8
  txHash String?
9
+ sourceRef String? // generic upstream source identifier (e.g. "referrals:2026W28"), used for soft duplicate-spend warnings
9
10
 
10
11
  entries FreeBetCampaignEntry[]
11
12
 
12
13
  createdAt DateTime @default(now())
13
14
 
14
15
  @@unique([chainId, campaignId])
16
+ @@index([sourceRef])
15
17
  }
16
18
 
17
19
  model FreeBetCampaignEntry {
@@ -102,6 +102,18 @@ model ReferralReward {
102
102
  @@index([userId])
103
103
  }
104
104
 
105
+ model ReferralCreditCarryover {
106
+ objectId String @id @default(auto()) @map("_id") @db.ObjectId
107
+ userId String @unique @db.ObjectId
108
+ walletAddress String
109
+ balanceUsd Float
110
+ updatedAt DateTime @updatedAt
111
+
112
+ user User @relation("UserCreditCarryover", fields: [userId], references: [objectId])
113
+
114
+ @@index([walletAddress])
115
+ }
116
+
105
117
  model GreylistEntry {
106
118
  objectId String @id @default(auto()) @map("_id") @db.ObjectId
107
119
  walletAddress String // The greylisted wallet (referrer OR referee)
@@ -43,11 +43,12 @@ model User {
43
43
  requireWithdrawalConfirmation Boolean @default(true)
44
44
 
45
45
  // Inverse relations (these fix your P1012 errors)
46
- referralsMade Referral[] @relation("ReferrerRelations") // users they referred
47
- referredBy Referral[] @relation("ReferredRelations") // who referred them
48
- referralRewards ReferralReward[] @relation("UserRewards") // their reward entries
49
- transactionHistory TransactionHistory[] @relation("TransactionHistory") // transaction history
50
- notifications Notification[] @relation("UserNotifications") // in-app notifications
46
+ referralsMade Referral[] @relation("ReferrerRelations") // users they referred
47
+ referredBy Referral[] @relation("ReferredRelations") // who referred them
48
+ referralRewards ReferralReward[] @relation("UserRewards") // their reward entries
49
+ creditCarryover ReferralCreditCarryover? @relation("UserCreditCarryover") // carried-forward referral bet-credit balance
50
+ transactionHistory TransactionHistory[] @relation("TransactionHistory") // transaction history
51
+ notifications Notification[] @relation("UserNotifications") // in-app notifications
51
52
 
52
53
  createdAt DateTime @default(now())
53
54
  updatedAt DateTime @updatedAt