@bash-app/bash-common 30.37.0 → 30.38.0
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 +35 -0
- package/src/extendedSchemas.ts +4 -0
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -1075,6 +1075,7 @@ model User {
|
|
|
1075
1075
|
unblocksReceived UnblockedUserHistory[] @relation("UserUnblocksReceived")
|
|
1076
1076
|
|
|
1077
1077
|
preferences UserPreferences?
|
|
1078
|
+
userStats UserStats?
|
|
1078
1079
|
|
|
1079
1080
|
// Add fields for user suspension
|
|
1080
1081
|
suspendedUntil DateTime?
|
|
@@ -2211,3 +2212,37 @@ enum ReportStatus {
|
|
|
2211
2212
|
Rejected
|
|
2212
2213
|
Resolved
|
|
2213
2214
|
}
|
|
2215
|
+
|
|
2216
|
+
// Add UserStats model for tracking statistics and rankings
|
|
2217
|
+
model UserStats {
|
|
2218
|
+
id String @id @default(cuid())
|
|
2219
|
+
userId String @unique
|
|
2220
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
2221
|
+
|
|
2222
|
+
// Event Statistics
|
|
2223
|
+
bashesHostedCount Int @default(0)
|
|
2224
|
+
bashesAttendedCount Int @default(0)
|
|
2225
|
+
totalAttendeesCount Int @default(0)
|
|
2226
|
+
totalEarnings Float @default(0)
|
|
2227
|
+
servicesBookedCount Int @default(0)
|
|
2228
|
+
followersCount Int @default(0)
|
|
2229
|
+
|
|
2230
|
+
// Rankings
|
|
2231
|
+
hostRank Int? // Rank based on number of events hosted
|
|
2232
|
+
attendeeRank Int? // Rank based on number of events attended
|
|
2233
|
+
audienceRank Int? // Rank based on total attendees
|
|
2234
|
+
earningsRank Int? // Rank based on total earnings
|
|
2235
|
+
serviceRank Int? // Rank based on services booked
|
|
2236
|
+
followerRank Int? // Rank based on number of followers
|
|
2237
|
+
|
|
2238
|
+
// Tracking for when stats were last calculated
|
|
2239
|
+
lastUpdated DateTime @default(now())
|
|
2240
|
+
lastRankingUpdate DateTime @default(now())
|
|
2241
|
+
|
|
2242
|
+
@@index([bashesHostedCount])
|
|
2243
|
+
@@index([bashesAttendedCount])
|
|
2244
|
+
@@index([totalAttendeesCount])
|
|
2245
|
+
@@index([totalEarnings])
|
|
2246
|
+
@@index([servicesBookedCount])
|
|
2247
|
+
@@index([followersCount])
|
|
2248
|
+
}
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Checkout,
|
|
10
10
|
Contact,
|
|
11
11
|
Coordinates,
|
|
12
|
+
Demerit,
|
|
12
13
|
EntertainmentService,
|
|
13
14
|
EventService,
|
|
14
15
|
EventTask,
|
|
@@ -50,6 +51,7 @@ import {
|
|
|
50
51
|
TicketTransfer,
|
|
51
52
|
User,
|
|
52
53
|
UserPreferences,
|
|
54
|
+
UserStats,
|
|
53
55
|
UserSubscription,
|
|
54
56
|
Vendor,
|
|
55
57
|
Venue,
|
|
@@ -783,6 +785,8 @@ export const CONTACT_DATA_TO_INCLUDE = {
|
|
|
783
785
|
export interface UserExt extends User {
|
|
784
786
|
services?: Service[] | null;
|
|
785
787
|
preferences?: UserPreferences | null;
|
|
788
|
+
stats?: UserStats | null;
|
|
789
|
+
demerits?: Demerit[] | null;
|
|
786
790
|
|
|
787
791
|
// Do not include in fetch as there could be thousands of these
|
|
788
792
|
userSubscription?: UserSubscriptionExt | null;
|