@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "30.37.0",
3
+ "version": "30.39.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -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
+ }
@@ -1,64 +1,66 @@
1
1
  import {
2
- AmountOfGuests,
3
- AssociatedBash,
4
- AssociatedService,
5
- BashComment,
6
- BashEvent,
7
- BashEventPromoCode,
8
- BashNotification,
9
- Checkout,
10
- Contact,
11
- Coordinates,
12
- EntertainmentService,
13
- EventService,
14
- EventTask,
15
- Exhibitor,
16
- Invitation,
17
- Link,
18
- Media,
19
- Organization,
20
- Prisma,
21
- Recurrence,
22
- Reminder,
23
- Review,
24
- Service,
25
- ServiceAddon,
26
- ServiceBooking,
27
- ServiceBookingAddOn,
28
- ServiceBookingCheckout,
29
- ServiceBookingDay,
30
- ServiceBookingFee,
31
- ServiceBookingPackage,
32
- ServiceBookingPriceBreakdown,
33
- ServiceDailyRates,
34
- ServiceLink,
35
- ServicePackage,
36
- ServiceRange,
37
- ServiceRate,
38
- ServiceRatesAssociation,
39
- ServiceSpecialRates,
40
- ServiceSubscriptionCounts,
41
- SocialMediaPlatform,
42
- SocialMediaProfile,
43
- Sponsor,
44
- SponsoredEvent,
45
- StripeAccount,
46
- TargetAudience,
47
- Ticket,
48
- TicketMetadata,
49
- TicketTier,
50
- TicketTransfer,
51
- User,
52
- UserPreferences,
53
- UserSubscription,
54
- Vendor,
55
- Venue,
56
- VolunteerService,
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
- RemoveCommonProperties,
61
- UnionFromArray
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;