@bash-app/bash-common 30.108.0 → 30.110.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/dist/definitions.js +3 -3
- package/dist/definitions.js.map +1 -1
- package/dist/extendedSchemas.d.ts +247 -1
- package/dist/extendedSchemas.d.ts.map +1 -1
- package/dist/extendedSchemas.js +9 -0
- package/dist/extendedSchemas.js.map +1 -1
- package/dist/utils/apiUtils.d.ts.map +1 -1
- package/dist/utils/apiUtils.js +16 -0
- package/dist/utils/apiUtils.js.map +1 -1
- package/package.json +1 -1
- package/prisma/schema.prisma +397 -21
- package/src/definitions.ts +3 -3
- package/src/extendedSchemas.ts +13 -0
- package/src/utils/apiUtils.ts +18 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extendedSchemas.js","sourceRoot":"","sources":["../src/extendedSchemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extendedSchemas.js","sourceRoot":"","sources":["../src/extendedSchemas.ts"],"names":[],"mappings":"AA0EA,OAAO,EAAc,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAQzE,gIAAgI;AAChI,MAAM,CAAC,MAAM,uCAAuC,GAAG;IACrD,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,iBAAiB,EAAE,IAAI;IACvB,WAAW,EAAE,IAAI;CACsB,CAAC;AAE1C,MAAM,CAAC,MAAM,wCAAwC,GAAG;IACtD,GAAG,uCAAuC;IAC1C,eAAe,EAAE,IAAI;IACrB,uBAAuB,EAAE,IAAI;CACU,CAAC;AAE1C,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,WAAW,EAAE,IAAI;CACuB,CAAC;AAO3C,iIAAiI;AAEjI,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,EAAE,EAAE,IAAI;IACR,QAAQ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iC,GAAG;IAC/C,MAAM,EAAE;QACN,MAAM,EAAE,6BAA6B;KACtC;IACD,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,MAAM,EAAE;QACN,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,KAAK,EAAE;oBACL,MAAM,EAAE,WAAW;iBACpB;aACF;SACF;KACF;CAC+B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiUtils.d.ts","sourceRoot":"","sources":["../../src/utils/apiUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE9C,KAAK,YAAY,GAAG,IAAI,GAAG,UAAU,CAAC;AACtC,KAAK,qBAAqB,GAAG,YAAY,GAAG,OAAO,CAAC;AAEpD,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,IAAI,OAAO,CAEnG;AAED,wBAAgB,WAAW,CAAC,aAAa,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,GAAG,MAAM,CAU7F;AAED,wBAAgB,YAAY,CAAC,aAAa,EAAE,qBAAqB,GAAG,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"apiUtils.d.ts","sourceRoot":"","sources":["../../src/utils/apiUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE9C,KAAK,YAAY,GAAG,IAAI,GAAG,UAAU,CAAC;AACtC,KAAK,qBAAqB,GAAG,YAAY,GAAG,OAAO,CAAC;AAEpD,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,IAAI,OAAO,CAEnG;AAED,wBAAgB,WAAW,CAAC,aAAa,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,GAAG,MAAM,CAU7F;AAED,wBAAgB,YAAY,CAAC,aAAa,EAAE,qBAAqB,GAAG,SAAS,GAAG,MAAM,CA4BrF;AAED,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CAInF;AAED,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,GAAG,IAAI,CAI7F;AAED,wBAAgB,wCAAwC,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAKtH;AAqBD,wBAAgB,YAAY,IAAI,OAAO,CActC"}
|
package/dist/utils/apiUtils.js
CHANGED
|
@@ -21,6 +21,22 @@ export function getUserImage(contactOrUser) {
|
|
|
21
21
|
return noProfilePicture;
|
|
22
22
|
}
|
|
23
23
|
const user = contactOrUser;
|
|
24
|
+
// Prioritize the most recently updated image for best UX
|
|
25
|
+
// If both images exist, compare timestamps
|
|
26
|
+
if (user.uploadedImage && user.image) {
|
|
27
|
+
const uploadedTime = user.uploadedImageUpdatedAt ? new Date(user.uploadedImageUpdatedAt).getTime() : 0;
|
|
28
|
+
const googleTime = user.imageUpdatedAt ? new Date(user.imageUpdatedAt).getTime() : 0;
|
|
29
|
+
// Return the most recently updated image
|
|
30
|
+
if (uploadedTime > googleTime) {
|
|
31
|
+
return user.uploadedImage;
|
|
32
|
+
}
|
|
33
|
+
else if (googleTime > 0) {
|
|
34
|
+
return user.image;
|
|
35
|
+
}
|
|
36
|
+
// If no timestamps, fall back to uploadedImage (existing behavior for backward compatibility)
|
|
37
|
+
return user.uploadedImage;
|
|
38
|
+
}
|
|
39
|
+
// If only one image exists, return it
|
|
24
40
|
return user.uploadedImage ?? user.image ?? noProfilePicture;
|
|
25
41
|
}
|
|
26
42
|
export function getContactOrUserEmail(contactOrUser) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiUtils.js","sourceRoot":"","sources":["../../src/utils/apiUtils.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,mBAAmB,CAAC,aAAqC;IACvE,OAAO,CAAC,CAAE,aAAyB,CAAC,cAAc,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,aAAyD;IACnF,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,mBAAmB,CAAC,aAAa,CAAC,EAAE,CAAC;QACvC,OAAO,aAAa,CAAC,QAAQ,IAAK,aAAyB,CAAC,YAAY,IAAI,EAAE,CAAC;IACjF,CAAC;IACD,MAAM,IAAI,GAAG,aAA6B,CAAC;IAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACvG,OAAO,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,aAAgD;IAC3E,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;IACjD,IAAI,mBAAmB,CAAC,aAAa,CAAC,EAAE,CAAC;QACvC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IACD,MAAM,IAAI,GAAG,aAA6B,CAAC;IAC3C,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,IAAI,gBAAgB,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,qBAAqB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AQ,KAAK,YAAY;QACrC,CAAC,WAAW,KAAK,YAAY,IAAI,OAAO,KAAK,YAAY,CAAC,CAAC;AACpE,CAAC"}
|
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -52,26 +52,144 @@ model BashComment {
|
|
|
52
52
|
review Review? @relation(fields: [reviewId], references: [id])
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
// BashFeed Models - Event-Centric Social Discovery Feed
|
|
56
|
+
model BashFeedPost {
|
|
57
|
+
id String @id @default(cuid())
|
|
58
|
+
userId String
|
|
59
|
+
bashId String
|
|
60
|
+
content String? @db.Text
|
|
61
|
+
mediaIds String[] // Array of Media IDs
|
|
62
|
+
isAnonymous Boolean @default(false) // User can choose to post anonymously
|
|
63
|
+
createdAt DateTime @default(now())
|
|
64
|
+
updatedAt DateTime @updatedAt
|
|
65
|
+
editedAt DateTime?
|
|
66
|
+
|
|
67
|
+
// Relationships
|
|
68
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
69
|
+
bash BashEvent @relation(fields: [bashId], references: [id], onDelete: Cascade)
|
|
70
|
+
likes BashFeedLike[]
|
|
71
|
+
comments BashFeedComment[]
|
|
72
|
+
ratings BashFeedRating[]
|
|
73
|
+
reports BashFeedReport[]
|
|
74
|
+
|
|
75
|
+
@@index([bashId])
|
|
76
|
+
@@index([userId])
|
|
77
|
+
@@index([createdAt])
|
|
78
|
+
@@index([isAnonymous])
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
model BashFeedLike {
|
|
82
|
+
id String @id @default(cuid())
|
|
83
|
+
userId String
|
|
84
|
+
postId String
|
|
85
|
+
createdAt DateTime @default(now())
|
|
86
|
+
|
|
87
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
88
|
+
post BashFeedPost @relation(fields: [postId], references: [id], onDelete: Cascade)
|
|
89
|
+
|
|
90
|
+
@@unique([userId, postId])
|
|
91
|
+
@@index([postId])
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
model BashFeedComment {
|
|
95
|
+
id String @id @default(cuid())
|
|
96
|
+
userId String
|
|
97
|
+
postId String
|
|
98
|
+
content String @db.Text
|
|
99
|
+
parentId String? // For nested replies
|
|
100
|
+
createdAt DateTime @default(now())
|
|
101
|
+
updatedAt DateTime @updatedAt
|
|
102
|
+
|
|
103
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
104
|
+
post BashFeedPost @relation(fields: [postId], references: [id], onDelete: Cascade)
|
|
105
|
+
parent BashFeedComment? @relation("FeedCommentReplies", fields: [parentId], references: [id], onDelete: Cascade)
|
|
106
|
+
replies BashFeedComment[] @relation("FeedCommentReplies")
|
|
107
|
+
likes BashFeedCommentLike[]
|
|
108
|
+
|
|
109
|
+
@@index([postId])
|
|
110
|
+
@@index([parentId])
|
|
111
|
+
@@index([userId])
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
model BashFeedCommentLike {
|
|
115
|
+
id String @id @default(cuid())
|
|
116
|
+
userId String
|
|
117
|
+
commentId String
|
|
118
|
+
createdAt DateTime @default(now())
|
|
119
|
+
|
|
120
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
121
|
+
comment BashFeedComment @relation(fields: [commentId], references: [id], onDelete: Cascade)
|
|
122
|
+
|
|
123
|
+
@@unique([userId, commentId])
|
|
124
|
+
@@index([commentId])
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
model BashFeedRating {
|
|
128
|
+
id String @id @default(cuid())
|
|
129
|
+
userId String
|
|
130
|
+
postId String
|
|
131
|
+
bashId String
|
|
132
|
+
rating Int // 1-5 for Past events, 1=meh 2=fire for Live events
|
|
133
|
+
createdAt DateTime @default(now())
|
|
134
|
+
|
|
135
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
136
|
+
post BashFeedPost @relation(fields: [postId], references: [id], onDelete: Cascade)
|
|
137
|
+
bash BashEvent @relation(fields: [bashId], references: [id], onDelete: Cascade)
|
|
138
|
+
|
|
139
|
+
@@unique([userId, postId])
|
|
140
|
+
@@index([bashId])
|
|
141
|
+
@@index([userId])
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
model BashFeedReport {
|
|
145
|
+
id String @id @default(cuid())
|
|
146
|
+
userId String
|
|
147
|
+
postId String
|
|
148
|
+
reason BashFeedReportReason
|
|
149
|
+
description String? @db.Text
|
|
150
|
+
status ReportStatus @default(PENDING)
|
|
151
|
+
reviewedBy String?
|
|
152
|
+
reviewedAt DateTime?
|
|
153
|
+
createdAt DateTime @default(now())
|
|
154
|
+
|
|
155
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
156
|
+
post BashFeedPost @relation(fields: [postId], references: [id], onDelete: Cascade)
|
|
157
|
+
reviewer User? @relation("ReviewedReports", fields: [reviewedBy], references: [id])
|
|
158
|
+
|
|
159
|
+
@@index([postId])
|
|
160
|
+
@@index([status])
|
|
161
|
+
@@index([userId])
|
|
162
|
+
}
|
|
163
|
+
|
|
55
164
|
model Competition {
|
|
56
|
-
id
|
|
57
|
-
name
|
|
58
|
-
description
|
|
59
|
-
userId
|
|
60
|
-
bashEventId
|
|
61
|
-
numberOfPrizes
|
|
62
|
-
competitionType
|
|
63
|
-
subtype
|
|
64
|
-
rules
|
|
65
|
-
judgingType
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
165
|
+
id String @id @default(cuid())
|
|
166
|
+
name String
|
|
167
|
+
description String @db.Text
|
|
168
|
+
userId String
|
|
169
|
+
bashEventId String
|
|
170
|
+
numberOfPrizes Int
|
|
171
|
+
competitionType CompetitionType? // Main category
|
|
172
|
+
subtype String? // Subcategory
|
|
173
|
+
rules String? @db.Text // Detailed rules/disclaimers
|
|
174
|
+
judgingType JudgingType? // How winner is determined
|
|
175
|
+
startTime DateTime? // Competition start time (for voting)
|
|
176
|
+
endTime DateTime? // Competition end time (for voting)
|
|
177
|
+
allowSelfRegistration Boolean @default(false)
|
|
178
|
+
maxParticipants Int? // Optional cap on participants
|
|
179
|
+
createdAt DateTime @default(now())
|
|
180
|
+
updatedAt DateTime @updatedAt
|
|
181
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
182
|
+
owner User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
183
|
+
sponsor CompetitionSponsor[]
|
|
184
|
+
prizes Prize[]
|
|
185
|
+
participants CompetitionParticipant[]
|
|
186
|
+
votes CompetitionVote[]
|
|
187
|
+
notifications Notification[]
|
|
72
188
|
|
|
73
189
|
@@index([bashEventId])
|
|
74
190
|
@@index([competitionType])
|
|
191
|
+
@@index([startTime])
|
|
192
|
+
@@index([endTime])
|
|
75
193
|
}
|
|
76
194
|
|
|
77
195
|
model CompetitionSponsor {
|
|
@@ -84,6 +202,42 @@ model CompetitionSponsor {
|
|
|
84
202
|
sponsor User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
85
203
|
}
|
|
86
204
|
|
|
205
|
+
model CompetitionParticipant {
|
|
206
|
+
id String @id @default(cuid())
|
|
207
|
+
competitionId String
|
|
208
|
+
userId String? // Optional: links to user if registered
|
|
209
|
+
name String // Display name
|
|
210
|
+
description String? @db.Text // Why they should win
|
|
211
|
+
imageUrl String? // Photo/avatar
|
|
212
|
+
order Int @default(0) // Display order
|
|
213
|
+
voteCount Int @default(0) // Denormalized for performance
|
|
214
|
+
addedBy String @default("host") // 'host' or 'self'
|
|
215
|
+
createdAt DateTime @default(now())
|
|
216
|
+
competition Competition @relation(fields: [competitionId], references: [id], onDelete: Cascade)
|
|
217
|
+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
218
|
+
votes CompetitionVote[]
|
|
219
|
+
|
|
220
|
+
@@index([competitionId])
|
|
221
|
+
@@index([userId])
|
|
222
|
+
@@index([voteCount])
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
model CompetitionVote {
|
|
226
|
+
id String @id @default(cuid())
|
|
227
|
+
competitionId String
|
|
228
|
+
participantId String
|
|
229
|
+
voterId String // User who voted
|
|
230
|
+
createdAt DateTime @default(now())
|
|
231
|
+
competition Competition @relation(fields: [competitionId], references: [id], onDelete: Cascade)
|
|
232
|
+
participant CompetitionParticipant @relation(fields: [participantId], references: [id], onDelete: Cascade)
|
|
233
|
+
voter User @relation(fields: [voterId], references: [id], onDelete: Cascade)
|
|
234
|
+
|
|
235
|
+
@@unique([competitionId, voterId]) // One vote per user per competition
|
|
236
|
+
@@index([competitionId])
|
|
237
|
+
@@index([participantId])
|
|
238
|
+
@@index([voterId])
|
|
239
|
+
}
|
|
240
|
+
|
|
87
241
|
model EventTask {
|
|
88
242
|
id String @id @default(cuid())
|
|
89
243
|
creatorId String
|
|
@@ -92,6 +246,8 @@ model EventTask {
|
|
|
92
246
|
description String?
|
|
93
247
|
assignedToId String?
|
|
94
248
|
status TaskStatus?
|
|
249
|
+
neededCount Int? // Number of volunteers needed
|
|
250
|
+
estimatedDuration Int? // Estimated duration in minutes
|
|
95
251
|
createdAt DateTime? @default(now())
|
|
96
252
|
assignedTo User? @relation("TasksAssignedToMe", fields: [assignedToId], references: [id], onDelete: Cascade)
|
|
97
253
|
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
@@ -224,6 +380,7 @@ model Notification {
|
|
|
224
380
|
taskId String?
|
|
225
381
|
invitationId String?
|
|
226
382
|
bashEventId String?
|
|
383
|
+
competitionId String?
|
|
227
384
|
serviceId String?
|
|
228
385
|
serviceBookingId String?
|
|
229
386
|
redirectUrl String?
|
|
@@ -234,6 +391,7 @@ model Notification {
|
|
|
234
391
|
createdAt DateTime @default(now())
|
|
235
392
|
isRead Boolean @default(false)
|
|
236
393
|
bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
394
|
+
competition Competition? @relation(fields: [competitionId], references: [id], onDelete: Cascade)
|
|
237
395
|
creator User @relation("NotificationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
|
|
238
396
|
invitation Invitation? @relation(fields: [invitationId], references: [id], onDelete: Cascade)
|
|
239
397
|
serviceBooking ServiceBooking? @relation(fields: [serviceBookingId], references: [id], onDelete: Cascade)
|
|
@@ -321,6 +479,9 @@ model BashEvent {
|
|
|
321
479
|
isTrending Boolean?
|
|
322
480
|
venueId String?
|
|
323
481
|
averageRating Float? @default(0)
|
|
482
|
+
totalRatings Int? @default(0) // Total count of all ratings (Review + BashFeedRating)
|
|
483
|
+
totalReviews Int? @default(0) // Count of Review records (anonymous quick ratings)
|
|
484
|
+
totalFeedRatings Int? @default(0) // Count of BashFeedRating records (from posts)
|
|
324
485
|
allowDonations Boolean? @default(true)
|
|
325
486
|
suggestedDonationAmount Int?
|
|
326
487
|
donationDetails String?
|
|
@@ -393,6 +554,11 @@ model BashEvent {
|
|
|
393
554
|
childEvents BashEvent[] @relation("RecurringEventChildren")
|
|
394
555
|
occurrenceIndex Int? // 1, 2, 3... for child events
|
|
395
556
|
|
|
557
|
+
// BashFeed Relations
|
|
558
|
+
bashFeedPosts BashFeedPost[]
|
|
559
|
+
bashFeedRatings BashFeedRating[]
|
|
560
|
+
eventRankings EventRankings?
|
|
561
|
+
|
|
396
562
|
@@index([templateId])
|
|
397
563
|
@@index([parentEventId])
|
|
398
564
|
}
|
|
@@ -458,6 +624,9 @@ model BashCreditTransaction {
|
|
|
458
624
|
createdAt DateTime @default(now())
|
|
459
625
|
updatedAt DateTime @updatedAt
|
|
460
626
|
|
|
627
|
+
// Relations
|
|
628
|
+
prizes Prize[] // Prizes paid with this transaction
|
|
629
|
+
|
|
461
630
|
@@index([userId, status])
|
|
462
631
|
@@index([userId, expiresAt])
|
|
463
632
|
@@index([userId, taxYear])
|
|
@@ -789,7 +958,7 @@ model Media {
|
|
|
789
958
|
}
|
|
790
959
|
|
|
791
960
|
model Prize {
|
|
792
|
-
id String
|
|
961
|
+
id String @id @default(cuid())
|
|
793
962
|
prizeWorth Float?
|
|
794
963
|
prizeType PrizeType
|
|
795
964
|
name String // Prize name (e.g., "$100 Cash", "Backpack")
|
|
@@ -801,11 +970,31 @@ model Prize {
|
|
|
801
970
|
winnerUserId String?
|
|
802
971
|
wonAt DateTime? // When the prize was awarded
|
|
803
972
|
claimedAt DateTime? // When the prize was claimed
|
|
804
|
-
|
|
805
|
-
|
|
973
|
+
|
|
974
|
+
// Automatic payment fields
|
|
975
|
+
autoPayEnabled Boolean @default(false)
|
|
976
|
+
paymentMethod PrizePaymentMethod?
|
|
977
|
+
paymentStatus PrizePaymentStatus @default(Pending)
|
|
978
|
+
bashCashTransactionId String?
|
|
979
|
+
venmoTransactionId String?
|
|
980
|
+
zelleTransactionId String?
|
|
981
|
+
paidAmount Float?
|
|
982
|
+
paidAt DateTime?
|
|
983
|
+
paymentError String? @db.Text
|
|
984
|
+
paymentNotes String? @db.Text
|
|
985
|
+
|
|
986
|
+
// Winner payment info (for P2P)
|
|
987
|
+
winnerVenmoUsername String?
|
|
988
|
+
winnerZelleEmail String?
|
|
989
|
+
winnerZellePhone String?
|
|
990
|
+
|
|
991
|
+
competition Competition? @relation(fields: [competitionId], references: [id], onDelete: Cascade)
|
|
992
|
+
winner User? @relation(fields: [winnerUserId], references: [id], onDelete: Cascade)
|
|
993
|
+
bashCashTransaction BashCreditTransaction? @relation(fields: [bashCashTransactionId], references: [id], onDelete: SetNull)
|
|
806
994
|
|
|
807
995
|
@@index([competitionId])
|
|
808
996
|
@@index([winnerUserId]) // For fetching user's wins
|
|
997
|
+
@@index([bashCashTransactionId])
|
|
809
998
|
}
|
|
810
999
|
|
|
811
1000
|
model Review {
|
|
@@ -895,7 +1084,9 @@ model User {
|
|
|
895
1084
|
hash String?
|
|
896
1085
|
emailVerified DateTime?
|
|
897
1086
|
image String?
|
|
1087
|
+
imageUpdatedAt DateTime? // When Google/OAuth image was last updated
|
|
898
1088
|
uploadedImage String?
|
|
1089
|
+
uploadedImageUpdatedAt DateTime? // When manually uploaded image was last updated
|
|
899
1090
|
dob DateTime?
|
|
900
1091
|
gender Gender?
|
|
901
1092
|
sex Sex?
|
|
@@ -908,6 +1099,10 @@ model User {
|
|
|
908
1099
|
status UserStatus
|
|
909
1100
|
hostRating Float?
|
|
910
1101
|
totalRatings Int?
|
|
1102
|
+
totalEventsHosted Int? @default(0) // Total published/completed events hosted
|
|
1103
|
+
totalAttendeesHosted Int? @default(0) // Total checked-in attendees across all events
|
|
1104
|
+
totalBookingsAccepted Int? @default(0) // Service provider stat
|
|
1105
|
+
totalBookingsCompleted Int? @default(0) // Service provider stat
|
|
911
1106
|
magicLink String?
|
|
912
1107
|
magicLinkExpiration DateTime?
|
|
913
1108
|
hostNumber Int?
|
|
@@ -962,6 +1157,7 @@ model User {
|
|
|
962
1157
|
scoutAwardedAt DateTime?
|
|
963
1158
|
agentAwardedAt DateTime?
|
|
964
1159
|
totalServiceReferrals Int @default(0)
|
|
1160
|
+
fcmTokens String[] @default([]) // Firebase Cloud Messaging tokens for push notifications
|
|
965
1161
|
|
|
966
1162
|
// BashCash System Fields
|
|
967
1163
|
bashCreditsBalance Int @default(0)
|
|
@@ -999,6 +1195,8 @@ model User {
|
|
|
999
1195
|
clubMembers ClubMember[]
|
|
1000
1196
|
competitions Competition[]
|
|
1001
1197
|
competitionSponsorships CompetitionSponsor[]
|
|
1198
|
+
competitionParticipations CompetitionParticipant[]
|
|
1199
|
+
competitionVotes CompetitionVote[]
|
|
1002
1200
|
contacts Contact[]
|
|
1003
1201
|
contactLists ContactList[] @relation("UserContactLists")
|
|
1004
1202
|
contactlist ContactList[]
|
|
@@ -1085,6 +1283,21 @@ model User {
|
|
|
1085
1283
|
// BashCash Referral Relations
|
|
1086
1284
|
referredBy User? @relation("Referrals", fields: [referredById], references: [id])
|
|
1087
1285
|
referrals User[] @relation("Referrals")
|
|
1286
|
+
|
|
1287
|
+
// BashFeed Relations
|
|
1288
|
+
bashFeedPosts BashFeedPost[]
|
|
1289
|
+
bashFeedLikes BashFeedLike[]
|
|
1290
|
+
bashFeedComments BashFeedComment[]
|
|
1291
|
+
bashFeedCommentLikes BashFeedCommentLike[]
|
|
1292
|
+
bashFeedRatings BashFeedRating[]
|
|
1293
|
+
bashFeedReports BashFeedReport[]
|
|
1294
|
+
reviewedFeedReports BashFeedReport[] @relation("ReviewedReports")
|
|
1295
|
+
|
|
1296
|
+
// Nomination Relations
|
|
1297
|
+
nominationsReceived Nomination[] @relation("NominatedUser")
|
|
1298
|
+
nominationsGiven Nomination[] @relation("NominatingUser")
|
|
1299
|
+
votesGiven NominationVote[]
|
|
1300
|
+
categoriesCreated NominationCategory[]
|
|
1088
1301
|
}
|
|
1089
1302
|
|
|
1090
1303
|
model UserPreferences {
|
|
@@ -1206,6 +1419,9 @@ model UserRankings {
|
|
|
1206
1419
|
attendeeScore Int @default(0) // Number of events attended
|
|
1207
1420
|
hostScore Int @default(0) // Number of events hosted
|
|
1208
1421
|
totalAttendeesScore Int @default(0) // Total attendees across all hosted events
|
|
1422
|
+
totalBookingsAccepted Int @default(0) // Service provider bookings accepted
|
|
1423
|
+
totalBookingsCompleted Int @default(0) // Service provider bookings completed
|
|
1424
|
+
bookingCompletionRate Float @default(0) // Percentage of bookings completed
|
|
1209
1425
|
attendeeRankGlobal Int? // Global rank as attendee
|
|
1210
1426
|
attendeeRankNational Int? // National rank as attendee
|
|
1211
1427
|
attendeeRankCity Int? // City rank as attendee
|
|
@@ -1215,6 +1431,9 @@ model UserRankings {
|
|
|
1215
1431
|
totalAttendeesRankGlobal Int? // Global rank by total attendees
|
|
1216
1432
|
totalAttendeesRankNational Int? // National rank by total attendees
|
|
1217
1433
|
totalAttendeesRankCity Int? // City rank by total attendees
|
|
1434
|
+
bookingsRankGlobal Int? // Global rank by bookings
|
|
1435
|
+
bookingsRankNational Int? // National rank by bookings
|
|
1436
|
+
bookingsRankCity Int? // City rank by bookings
|
|
1218
1437
|
attendeePercentile Float? // Percentile rank as attendee (0-100)
|
|
1219
1438
|
hostPercentile Float? // Percentile rank as host (0-100)
|
|
1220
1439
|
totalAttendeesPercentile Float? // Percentile rank by total attendees (0-100)
|
|
@@ -1230,10 +1449,65 @@ model UserRankings {
|
|
|
1230
1449
|
@@index([attendeeScore])
|
|
1231
1450
|
@@index([hostScore])
|
|
1232
1451
|
@@index([totalAttendeesScore])
|
|
1452
|
+
@@index([totalBookingsAccepted])
|
|
1233
1453
|
@@index([city])
|
|
1234
1454
|
@@index([country])
|
|
1235
1455
|
@@index([attendeeRankGlobal])
|
|
1236
1456
|
@@index([hostRankGlobal])
|
|
1457
|
+
@@index([bookingsRankGlobal])
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
model EventRankings {
|
|
1461
|
+
id String @id @default(cuid())
|
|
1462
|
+
bashEventId String @unique
|
|
1463
|
+
|
|
1464
|
+
// Rating Quality Score
|
|
1465
|
+
averageRating Float @default(0)
|
|
1466
|
+
totalRatings Int @default(0)
|
|
1467
|
+
ratingScore Float @default(0) // Bayesian weighted score considering volume
|
|
1468
|
+
|
|
1469
|
+
// Attendance Score
|
|
1470
|
+
totalAttendees Int @default(0)
|
|
1471
|
+
attendanceScore Float @default(0)
|
|
1472
|
+
|
|
1473
|
+
// Composite Score
|
|
1474
|
+
overallScore Float @default(0) // Weighted composite (60% rating + 20% attendance + 20% volume)
|
|
1475
|
+
|
|
1476
|
+
// Rankings (Global)
|
|
1477
|
+
rankByRating Int?
|
|
1478
|
+
rankByAttendance Int?
|
|
1479
|
+
rankByOverall Int?
|
|
1480
|
+
|
|
1481
|
+
// Location-based rankings
|
|
1482
|
+
city String?
|
|
1483
|
+
state String?
|
|
1484
|
+
country String @default("US")
|
|
1485
|
+
rankCityByRating Int?
|
|
1486
|
+
rankCityByOverall Int?
|
|
1487
|
+
rankStateByRating Int?
|
|
1488
|
+
rankStateByOverall Int?
|
|
1489
|
+
|
|
1490
|
+
// Time-based tracking (for filters)
|
|
1491
|
+
lastMonthScore Float @default(0)
|
|
1492
|
+
lastYearScore Float @default(0)
|
|
1493
|
+
allTimeScore Float @default(0)
|
|
1494
|
+
|
|
1495
|
+
// Timestamps
|
|
1496
|
+
lastCalculated DateTime @default(now())
|
|
1497
|
+
createdAt DateTime @default(now())
|
|
1498
|
+
updatedAt DateTime @updatedAt
|
|
1499
|
+
|
|
1500
|
+
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
1501
|
+
|
|
1502
|
+
@@index([bashEventId])
|
|
1503
|
+
@@index([rankByRating])
|
|
1504
|
+
@@index([rankByOverall])
|
|
1505
|
+
@@index([rankByAttendance])
|
|
1506
|
+
@@index([city, rankCityByRating])
|
|
1507
|
+
@@index([state, rankStateByRating])
|
|
1508
|
+
@@index([overallScore])
|
|
1509
|
+
@@index([averageRating])
|
|
1510
|
+
@@index([totalAttendees])
|
|
1237
1511
|
}
|
|
1238
1512
|
|
|
1239
1513
|
model UserConnection {
|
|
@@ -2581,12 +2855,13 @@ enum ClubMemberStatus {
|
|
|
2581
2855
|
}
|
|
2582
2856
|
|
|
2583
2857
|
enum TaskStatus {
|
|
2858
|
+
Open
|
|
2584
2859
|
Accepted
|
|
2585
|
-
|
|
2860
|
+
InProgress
|
|
2586
2861
|
Completed
|
|
2862
|
+
Rejected
|
|
2587
2863
|
Assigned
|
|
2588
2864
|
Pending
|
|
2589
|
-
Open
|
|
2590
2865
|
}
|
|
2591
2866
|
|
|
2592
2867
|
enum NotificationType {
|
|
@@ -2612,6 +2887,14 @@ enum NotificationType {
|
|
|
2612
2887
|
Message
|
|
2613
2888
|
ConnectionRequest
|
|
2614
2889
|
ConnectionAccepted
|
|
2890
|
+
CompetitionStarting
|
|
2891
|
+
CompetitionEnding
|
|
2892
|
+
CompetitionWon
|
|
2893
|
+
CompetitionResults
|
|
2894
|
+
BashRating
|
|
2895
|
+
BashRatingMilestone
|
|
2896
|
+
BashFeedPost
|
|
2897
|
+
EventMilestone
|
|
2615
2898
|
}
|
|
2616
2899
|
|
|
2617
2900
|
enum NotificationPriority {
|
|
@@ -2960,6 +3243,26 @@ enum PrizeType {
|
|
|
2960
3243
|
Combo
|
|
2961
3244
|
}
|
|
2962
3245
|
|
|
3246
|
+
enum PrizePaymentMethod {
|
|
3247
|
+
BashCash
|
|
3248
|
+
Venmo
|
|
3249
|
+
ZelleEmail
|
|
3250
|
+
ZellePhone
|
|
3251
|
+
StripeCard
|
|
3252
|
+
StripeBusiness
|
|
3253
|
+
Manual
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3256
|
+
enum PrizePaymentStatus {
|
|
3257
|
+
Pending
|
|
3258
|
+
AwaitingPayment
|
|
3259
|
+
AwaitingWinner
|
|
3260
|
+
Processing
|
|
3261
|
+
Paid
|
|
3262
|
+
Failed
|
|
3263
|
+
Cancelled
|
|
3264
|
+
}
|
|
3265
|
+
|
|
2963
3266
|
enum CompetitionType {
|
|
2964
3267
|
RAFFLE // Raffles & Drawings
|
|
2965
3268
|
SKILL // Skill-Based Contests
|
|
@@ -4379,6 +4682,18 @@ enum ReportStatus {
|
|
|
4379
4682
|
Approved
|
|
4380
4683
|
Rejected
|
|
4381
4684
|
Resolved
|
|
4685
|
+
PENDING
|
|
4686
|
+
REVIEWING
|
|
4687
|
+
RESOLVED
|
|
4688
|
+
DISMISSED
|
|
4689
|
+
}
|
|
4690
|
+
|
|
4691
|
+
enum BashFeedReportReason {
|
|
4692
|
+
SPAM
|
|
4693
|
+
INAPPROPRIATE
|
|
4694
|
+
MISLEADING
|
|
4695
|
+
HARASSMENT
|
|
4696
|
+
OTHER
|
|
4382
4697
|
}
|
|
4383
4698
|
|
|
4384
4699
|
enum BlogStatus {
|
|
@@ -4812,3 +5127,64 @@ enum ServiceCategoryRequestStatus {
|
|
|
4812
5127
|
Rejected // Rejected (doesn't fit or use "Other")
|
|
4813
5128
|
Duplicate // Already exists or similar request pending
|
|
4814
5129
|
}
|
|
5130
|
+
|
|
5131
|
+
// ============================================
|
|
5132
|
+
// Community Nomination System
|
|
5133
|
+
// ============================================
|
|
5134
|
+
|
|
5135
|
+
// Nomination Categories - User-created or predefined
|
|
5136
|
+
model NominationCategory {
|
|
5137
|
+
id String @id @default(cuid())
|
|
5138
|
+
name String @unique // "Best Car Show Host"
|
|
5139
|
+
slug String @unique // "best-car-show-host" for URLs
|
|
5140
|
+
description String?
|
|
5141
|
+
icon String? // emoji or icon name
|
|
5142
|
+
eventType String? // Optional link to BashEventType
|
|
5143
|
+
createdBy String? // User who created custom category
|
|
5144
|
+
isOfficial Boolean @default(false) // Admin-curated categories
|
|
5145
|
+
createdAt DateTime @default(now())
|
|
5146
|
+
updatedAt DateTime @updatedAt
|
|
5147
|
+
|
|
5148
|
+
creator User? @relation(fields: [createdBy], references: [id])
|
|
5149
|
+
nominations Nomination[]
|
|
5150
|
+
|
|
5151
|
+
@@index([name])
|
|
5152
|
+
@@index([slug])
|
|
5153
|
+
@@index([isOfficial])
|
|
5154
|
+
}
|
|
5155
|
+
|
|
5156
|
+
// Individual nominations linking nominee to category
|
|
5157
|
+
model Nomination {
|
|
5158
|
+
id String @id @default(cuid())
|
|
5159
|
+
nomineeId String // Person being nominated
|
|
5160
|
+
nominatorId String // Person who nominated
|
|
5161
|
+
categoryId String
|
|
5162
|
+
reason String? @db.Text // Optional: "John's car shows are always amazing!"
|
|
5163
|
+
createdAt DateTime @default(now())
|
|
5164
|
+
|
|
5165
|
+
nominee User @relation("NominatedUser", fields: [nomineeId], references: [id], onDelete: Cascade)
|
|
5166
|
+
nominator User @relation("NominatingUser", fields: [nominatorId], references: [id])
|
|
5167
|
+
category NominationCategory @relation(fields: [categoryId], references: [id], onDelete: Cascade)
|
|
5168
|
+
votes NominationVote[]
|
|
5169
|
+
|
|
5170
|
+
@@unique([nomineeId, nominatorId, categoryId])
|
|
5171
|
+
@@index([nomineeId])
|
|
5172
|
+
@@index([categoryId])
|
|
5173
|
+
@@index([nominatorId])
|
|
5174
|
+
@@index([createdAt])
|
|
5175
|
+
}
|
|
5176
|
+
|
|
5177
|
+
// Votes supporting nominations
|
|
5178
|
+
model NominationVote {
|
|
5179
|
+
id String @id @default(cuid())
|
|
5180
|
+
nominationId String
|
|
5181
|
+
voterId String
|
|
5182
|
+
createdAt DateTime @default(now())
|
|
5183
|
+
|
|
5184
|
+
nomination Nomination @relation(fields: [nominationId], references: [id], onDelete: Cascade)
|
|
5185
|
+
voter User @relation(fields: [voterId], references: [id])
|
|
5186
|
+
|
|
5187
|
+
@@unique([nominationId, voterId])
|
|
5188
|
+
@@index([nominationId])
|
|
5189
|
+
@@index([voterId])
|
|
5190
|
+
}
|