@levrbet/shared 0.1.188 → 0.1.190
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/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/prisma/schema.prisma +103 -1
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
// Main entry point - exports everything from core by default
|
|
18
18
|
__exportStar(require("./core"), exports);
|
|
19
19
|
//
|
|
20
|
-
// Note: Server and React modules should be imported via specific paths
|
|
20
|
+
// Note: Server and React modules should be imported via specific paths:..
|
|
21
21
|
// import { ... } from "@levrbet/shared/server"
|
|
22
22
|
// import { ... } from "@levrbet/shared/react"
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA6D;AAC7D,yCAAsB;AACtB,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA6D;AAC7D,yCAAsB;AACtB,EAAE;AACF,0EAA0E;AAE1E,+CAA+C;AAC/C,8CAA8C"}
|
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -147,7 +147,7 @@ model TeamData {
|
|
|
147
147
|
levrTeamLogoUrlAsHome String @unique
|
|
148
148
|
levrTeamLogoUrlAsAway String @unique
|
|
149
149
|
leagueObjectId String @db.ObjectId
|
|
150
|
-
|
|
150
|
+
levrLeagueId String
|
|
151
151
|
league League @relation(fields: [leagueObjectId], references: [objectId])
|
|
152
152
|
|
|
153
153
|
@@unique([levrTeamId, levrTeamName, leagueObjectId])
|
|
@@ -312,11 +312,113 @@ model User {
|
|
|
312
312
|
autoDetectTimeZone Boolean @default(true)
|
|
313
313
|
autoApproveTxs Boolean @default(false)
|
|
314
314
|
requireWithdrawalConfirmation Boolean @default(true)
|
|
315
|
+
referralCode String @unique
|
|
316
|
+
|
|
317
|
+
// Inverse relations (these fix your P1012 errors)
|
|
318
|
+
referralsMade Referral[] @relation("ReferrerRelations") // users they referred
|
|
319
|
+
referredBy Referral[] @relation("ReferredRelations") // who referred them
|
|
320
|
+
referralRewards ReferralReward[] @relation("UserRewards") // their reward entries
|
|
321
|
+
|
|
322
|
+
createdAt DateTime @default(now())
|
|
323
|
+
updatedAt DateTime @updatedAt
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
enum ReferralStatus {
|
|
327
|
+
Pending
|
|
328
|
+
Active
|
|
329
|
+
Suspended
|
|
330
|
+
Completed
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
model Referral {
|
|
334
|
+
objectId String @id @default(auto()) @map("_id") @db.ObjectId
|
|
335
|
+
referrerId String @db.ObjectId
|
|
336
|
+
referredId String @db.ObjectId
|
|
337
|
+
referralCode String
|
|
338
|
+
referralSource String? // e.g. campaign or link source
|
|
339
|
+
status ReferralStatus @default(Active)
|
|
340
|
+
|
|
341
|
+
// Relations
|
|
342
|
+
referrer User @relation("ReferrerRelations", fields: [referrerId], references: [objectId])
|
|
343
|
+
referred User @relation("ReferredRelations", fields: [referredId], references: [objectId])
|
|
344
|
+
|
|
345
|
+
createdAt DateTime @default(now())
|
|
346
|
+
updatedAt DateTime @updatedAt
|
|
347
|
+
|
|
348
|
+
@@index([referrerId])
|
|
349
|
+
@@index([referredId])
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
model ReferralEpoch {
|
|
353
|
+
objectId String @id @default(auto()) @map("_id") @db.ObjectId
|
|
354
|
+
periodId String @unique
|
|
355
|
+
periodStart DateTime
|
|
356
|
+
periodEnd DateTime
|
|
357
|
+
timezone String @default("America/Mexico_City")
|
|
358
|
+
status EpochStatus @default(Active)
|
|
359
|
+
|
|
360
|
+
// On-chain reward info (one root per epoch)
|
|
361
|
+
totalFeesUsd Float?
|
|
362
|
+
rewardPoolUsd Float?
|
|
363
|
+
merkleRoot String?
|
|
364
|
+
merkleTxHash String?
|
|
365
|
+
rootPublishedAt DateTime?
|
|
366
|
+
notes String?
|
|
367
|
+
|
|
368
|
+
ReferralRewards ReferralReward[]
|
|
315
369
|
|
|
316
370
|
createdAt DateTime @default(now())
|
|
317
371
|
updatedAt DateTime @updatedAt
|
|
318
372
|
}
|
|
319
373
|
|
|
374
|
+
enum EpochStatus {
|
|
375
|
+
Active
|
|
376
|
+
Processing
|
|
377
|
+
Completed
|
|
378
|
+
Failed
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
enum ReferralTier {
|
|
382
|
+
T1
|
|
383
|
+
T2
|
|
384
|
+
T3
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
model ReferralReward {
|
|
388
|
+
objectId String @id @default(auto()) @map("_id") @db.ObjectId
|
|
389
|
+
userId String @db.ObjectId
|
|
390
|
+
epochId String @db.ObjectId
|
|
391
|
+
periodId String // denormalized for readability (e.g. "2025W45")
|
|
392
|
+
|
|
393
|
+
// --- Aggregates ---
|
|
394
|
+
referredBetVolumeUsd Float @default(0.0)
|
|
395
|
+
referredFeeUsd Float @default(0.0)
|
|
396
|
+
tier ReferralTier @default(T1)
|
|
397
|
+
tierPercentage Float @default(0.025)
|
|
398
|
+
|
|
399
|
+
// --- Payouts ---
|
|
400
|
+
payoutBeforeScaleUsd Float @default(0.0)
|
|
401
|
+
payoutScaledUsd Float @default(0.0)
|
|
402
|
+
payoutTokenUnits String? // token base units (string for precision)
|
|
403
|
+
scaleFactor Float?
|
|
404
|
+
|
|
405
|
+
// --- Claim sync info ---
|
|
406
|
+
isClaimedOnChain Boolean @default(false)
|
|
407
|
+
claimedTxHash String?
|
|
408
|
+
lastSyncedFromChainAt DateTime?
|
|
409
|
+
|
|
410
|
+
createdAt DateTime @default(now())
|
|
411
|
+
updatedAt DateTime @updatedAt
|
|
412
|
+
|
|
413
|
+
// --- Relations ---
|
|
414
|
+
user User @relation("UserRewards", fields: [userId], references: [objectId])
|
|
415
|
+
epoch ReferralEpoch @relation(fields: [epochId], references: [objectId])
|
|
416
|
+
|
|
417
|
+
@@unique([userId, periodId])
|
|
418
|
+
@@index([epochId])
|
|
419
|
+
@@index([userId])
|
|
420
|
+
}
|
|
421
|
+
|
|
320
422
|
enum ApiKeyScope {
|
|
321
423
|
Read
|
|
322
424
|
Write
|