@bash-app/bash-common 30.37.0 → 30.39.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 +39 -0
- package/src/extendedSchemas.ts +61 -57
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -265,6 +265,9 @@ model BashEvent {
|
|
|
265
265
|
eventType String @default("Other")
|
|
266
266
|
startDateTime DateTime? @default(now())
|
|
267
267
|
endDateTime DateTime? @default(now())
|
|
268
|
+
waiverUrl String?
|
|
269
|
+
waiverRequired Boolean @default(false)
|
|
270
|
+
waiverDisplayType String? @default("inline")
|
|
268
271
|
ticketTiers TicketTier[]
|
|
269
272
|
targetAudienceId String? @unique
|
|
270
273
|
targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
|
|
@@ -980,6 +983,7 @@ enum SocialMediaPlatform {
|
|
|
980
983
|
|
|
981
984
|
model User {
|
|
982
985
|
id String @id @default(cuid())
|
|
986
|
+
username String? @unique
|
|
983
987
|
email String @unique
|
|
984
988
|
createdOn DateTime @default(now())
|
|
985
989
|
stripeCustomerId String? @unique
|
|
@@ -1075,6 +1079,7 @@ model User {
|
|
|
1075
1079
|
unblocksReceived UnblockedUserHistory[] @relation("UserUnblocksReceived")
|
|
1076
1080
|
|
|
1077
1081
|
preferences UserPreferences?
|
|
1082
|
+
userStats UserStats?
|
|
1078
1083
|
|
|
1079
1084
|
// Add fields for user suspension
|
|
1080
1085
|
suspendedUntil DateTime?
|
|
@@ -2211,3 +2216,37 @@ enum ReportStatus {
|
|
|
2211
2216
|
Rejected
|
|
2212
2217
|
Resolved
|
|
2213
2218
|
}
|
|
2219
|
+
|
|
2220
|
+
// Add UserStats model for tracking statistics and rankings
|
|
2221
|
+
model UserStats {
|
|
2222
|
+
id String @id @default(cuid())
|
|
2223
|
+
userId String @unique
|
|
2224
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
2225
|
+
|
|
2226
|
+
// Event Statistics
|
|
2227
|
+
bashesHostedCount Int @default(0)
|
|
2228
|
+
bashesAttendedCount Int @default(0)
|
|
2229
|
+
totalAttendeesCount Int @default(0)
|
|
2230
|
+
totalEarnings Float @default(0)
|
|
2231
|
+
servicesBookedCount Int @default(0)
|
|
2232
|
+
followersCount Int @default(0)
|
|
2233
|
+
|
|
2234
|
+
// Rankings
|
|
2235
|
+
hostRank Int? // Rank based on number of events hosted
|
|
2236
|
+
attendeeRank Int? // Rank based on number of events attended
|
|
2237
|
+
audienceRank Int? // Rank based on total attendees
|
|
2238
|
+
earningsRank Int? // Rank based on total earnings
|
|
2239
|
+
serviceRank Int? // Rank based on services booked
|
|
2240
|
+
followerRank Int? // Rank based on number of followers
|
|
2241
|
+
|
|
2242
|
+
// Tracking for when stats were last calculated
|
|
2243
|
+
lastUpdated DateTime @default(now())
|
|
2244
|
+
lastRankingUpdate DateTime @default(now())
|
|
2245
|
+
|
|
2246
|
+
@@index([bashesHostedCount])
|
|
2247
|
+
@@index([bashesAttendedCount])
|
|
2248
|
+
@@index([totalAttendeesCount])
|
|
2249
|
+
@@index([totalEarnings])
|
|
2250
|
+
@@index([servicesBookedCount])
|
|
2251
|
+
@@index([followersCount])
|
|
2252
|
+
}
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -1,64 +1,66 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
2
|
+
AmountOfGuests,
|
|
3
|
+
AssociatedBash,
|
|
4
|
+
AssociatedService,
|
|
5
|
+
BashComment,
|
|
6
|
+
BashEvent,
|
|
7
|
+
BashEventPromoCode,
|
|
8
|
+
BashNotification,
|
|
9
|
+
Checkout,
|
|
10
|
+
Contact,
|
|
11
|
+
Coordinates,
|
|
12
|
+
Demerit,
|
|
13
|
+
EntertainmentService,
|
|
14
|
+
EventService,
|
|
15
|
+
EventTask,
|
|
16
|
+
Exhibitor,
|
|
17
|
+
Invitation,
|
|
18
|
+
Link,
|
|
19
|
+
Media,
|
|
20
|
+
Organization,
|
|
21
|
+
Prisma,
|
|
22
|
+
Recurrence,
|
|
23
|
+
Reminder,
|
|
24
|
+
Review,
|
|
25
|
+
Service,
|
|
26
|
+
ServiceAddon,
|
|
27
|
+
ServiceBooking,
|
|
28
|
+
ServiceBookingAddOn,
|
|
29
|
+
ServiceBookingCheckout,
|
|
30
|
+
ServiceBookingDay,
|
|
31
|
+
ServiceBookingFee,
|
|
32
|
+
ServiceBookingPackage,
|
|
33
|
+
ServiceBookingPriceBreakdown,
|
|
34
|
+
ServiceDailyRates,
|
|
35
|
+
ServiceLink,
|
|
36
|
+
ServicePackage,
|
|
37
|
+
ServiceRange,
|
|
38
|
+
ServiceRate,
|
|
39
|
+
ServiceRatesAssociation,
|
|
40
|
+
ServiceSpecialRates,
|
|
41
|
+
ServiceSubscriptionCounts,
|
|
42
|
+
SocialMediaPlatform,
|
|
43
|
+
SocialMediaProfile,
|
|
44
|
+
Sponsor,
|
|
45
|
+
SponsoredEvent,
|
|
46
|
+
StripeAccount,
|
|
47
|
+
TargetAudience,
|
|
48
|
+
Ticket,
|
|
49
|
+
TicketMetadata,
|
|
50
|
+
TicketTier,
|
|
51
|
+
TicketTransfer,
|
|
52
|
+
User,
|
|
53
|
+
UserPreferences,
|
|
54
|
+
UserStats,
|
|
55
|
+
UserSubscription,
|
|
56
|
+
Vendor,
|
|
57
|
+
Venue,
|
|
58
|
+
VolunteerService,
|
|
57
59
|
} from "@prisma/client";
|
|
58
60
|
import { SERVICE_LINK_DATA_TO_INCLUDE } from "./definitions";
|
|
59
61
|
import {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
RemoveCommonProperties,
|
|
63
|
+
UnionFromArray
|
|
62
64
|
} from "./utils/typeUtils";
|
|
63
65
|
|
|
64
66
|
//------------------------------------------------------user subscriptions------------------------------------------------------
|
|
@@ -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;
|