@levrbet/shared 0.5.73 → 0.5.74

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.73",
3
+ "version": "0.5.74",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -336,6 +336,7 @@ model User {
336
336
  referredBy Referral[] @relation("ReferredRelations") // who referred them
337
337
  referralRewards ReferralReward[] @relation("UserRewards") // their reward entries
338
338
  transactionHistory TransactionHistory[] @relation("TransactionHistory") // transaction history
339
+ notifications Notification[] @relation("UserNotifications") // in-app notifications
339
340
 
340
341
  createdAt DateTime @default(now())
341
342
  updatedAt DateTime @updatedAt
@@ -621,3 +622,39 @@ model FreeBetCampaignEntry {
621
622
  @@unique([merkleRoot, ethAddress, nonce])
622
623
  @@index([ethAddress])
623
624
  }
625
+
626
+ enum NotificationType {
627
+ BetPlaced
628
+ BetSettled
629
+ Deposit
630
+ Withdrawal
631
+ ReferralSignup
632
+ ReferralRewardEarned
633
+ ReferralPayoutPublished
634
+ MarketSettled
635
+ GameLive
636
+ ApiKeyCreated
637
+ SecurityAlert
638
+ GreylistFlagged
639
+ Promo
640
+ }
641
+
642
+ model Notification {
643
+ objectId String @id @default(auto()) @map("_id") @db.ObjectId
644
+ userId String @db.ObjectId
645
+ user User @relation("UserNotifications", fields: [userId], references: [objectId])
646
+ type NotificationType
647
+ title String
648
+ message String
649
+ metadata Json @default("{}") // arbitrary event payload (e.g. amount, txHash, gameMarketId)
650
+ actionUrl String? // optional deep link for the client to route to on click
651
+ readAt DateTime?
652
+
653
+ createdAt DateTime @default(now())
654
+ updatedAt DateTime @updatedAt
655
+
656
+ @@index([userId])
657
+ @@index([userId, readAt])
658
+ @@index([type])
659
+ @@index([createdAt])
660
+ }