@levrbet/shared 0.5.73 → 0.5.75
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 +1 -1
- package/prisma/schema.prisma +38 -0
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -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,40 @@ model FreeBetCampaignEntry {
|
|
|
621
622
|
@@unique([merkleRoot, ethAddress, nonce])
|
|
622
623
|
@@index([ethAddress])
|
|
623
624
|
}
|
|
625
|
+
|
|
626
|
+
enum NotificationType {
|
|
627
|
+
BetPlaced
|
|
628
|
+
BetSettled
|
|
629
|
+
BetCredit
|
|
630
|
+
Deposit
|
|
631
|
+
Withdrawal
|
|
632
|
+
ReferralSignup
|
|
633
|
+
ReferralRewardEarned
|
|
634
|
+
ReferralPayoutPublished
|
|
635
|
+
MarketSettled
|
|
636
|
+
GameLive
|
|
637
|
+
ApiKeyCreated
|
|
638
|
+
SecurityAlert
|
|
639
|
+
GreylistFlagged
|
|
640
|
+
Promo
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
model Notification {
|
|
644
|
+
objectId String @id @default(auto()) @map("_id") @db.ObjectId
|
|
645
|
+
userId String @db.ObjectId
|
|
646
|
+
user User @relation("UserNotifications", fields: [userId], references: [objectId])
|
|
647
|
+
type NotificationType
|
|
648
|
+
title String
|
|
649
|
+
message String
|
|
650
|
+
metadata Json @default("{}") // arbitrary event payload (e.g. amount, txHash, gameMarketId)
|
|
651
|
+
actionUrl String? // optional deep link for the client to route to on click
|
|
652
|
+
readAt DateTime?
|
|
653
|
+
|
|
654
|
+
createdAt DateTime @default(now())
|
|
655
|
+
updatedAt DateTime @updatedAt
|
|
656
|
+
|
|
657
|
+
@@index([userId])
|
|
658
|
+
@@index([userId, readAt])
|
|
659
|
+
@@index([type])
|
|
660
|
+
@@index([createdAt])
|
|
661
|
+
}
|