@bash-app/bash-common 3.1.1 → 3.3.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.
@@ -1,934 +1,934 @@
1
- // This is your Prisma schema file,
2
- // learn more about it in the docs: https://pris.ly/d/prisma-schema
3
-
4
- generator client {
5
- provider = "prisma-client-js"
6
- }
7
-
8
- datasource db {
9
- provider = "postgresql"
10
- url = env("POSTGRES_PRISMA_URL") // uses connection pooling
11
- directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
12
- }
13
-
14
- model Account {
15
- id String @id @default(cuid())
16
- userId String @unique
17
- type String
18
- provider String
19
- providerAccountId String
20
- refresh_token String? @db.Text
21
- access_token String? @db.Text
22
- expires_at Int?
23
- token_type String?
24
- scope String?
25
- id_token String? @db.Text
26
- session_state String?
27
- image String?
28
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
29
-
30
- @@unique([provider, providerAccountId])
31
- }
32
-
33
- model Business {
34
- id String @id @default(cuid())
35
- name String
36
- ein String?
37
- dba String?
38
- address String?
39
- media Media[]
40
- }
41
-
42
- model Club {
43
- id String @id @default(cuid())
44
- name String
45
- address String
46
- userId String
47
- price Int?
48
- events BashEvent[]
49
- members ClubMember[]
50
- admin ClubAdmin[]
51
- }
52
-
53
- model ClubAdmin {
54
- id String @id @default(cuid())
55
- admin User @relation(fields: [userId], references: [id], onDelete: Cascade)
56
- userId String
57
- club Club @relation(fields: [clubId], references: [id], onDelete: Cascade)
58
- clubId String
59
- role ClubAdminRole
60
- }
61
-
62
- model ClubMember {
63
- id String @id @default(cuid())
64
- member User @relation(fields: [userId], references: [id], onDelete: Cascade)
65
- userId String
66
- club Club @relation(fields: [clubId], references: [id], onDelete: Cascade)
67
- clubId String
68
- status ClubMemberStatus
69
- statusHistory Json
70
- price Int?
71
- }
72
-
73
- enum ClubAdminRole {
74
- Owner
75
- Admin
76
- Staff
77
- }
78
-
79
- enum ClubMemberStatus {
80
- Active
81
- Inactive
82
- Cancelled
83
- Paused
84
- Removed
85
- }
86
-
87
- model BashComment {
88
- id String @id @default(cuid())
89
- creatorId String
90
- creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
91
- content String
92
- reviewId String?
93
- review Review? @relation(fields: [reviewId], references: [id], onDelete: SetNull)
94
- bashEventId String?
95
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
96
- parentCommentId String?
97
- parentComment BashComment? @relation("CommentReplies", fields: [parentCommentId], references: [id], onDelete: Cascade)
98
- replies BashComment[] @relation("CommentReplies")
99
- }
100
-
101
- model Competition {
102
- id String @id @default(cuid())
103
- name String
104
- description String
105
- owner User @relation(fields: [userId], references: [id], onDelete: Cascade)
106
- prizes Prize[]
107
- userId String
108
- sponser CompetitionSponsor[]
109
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
110
- bashEventId String
111
- numberOfPrizes Int
112
- }
113
-
114
- model CompetitionSponsor {
115
- id String @id @default(cuid())
116
- competition Competition @relation(fields: [competitionId], references: [id], onDelete: Cascade)
117
- sponsor User @relation(fields: [userId], references: [id], onDelete: Cascade)
118
- competitionId String
119
- userId String
120
- description String
121
- paidOn String?
122
- }
123
-
124
- model EventTask {
125
- id String @id @default(cuid())
126
- creatorId String
127
- creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
128
- bashEventId String
129
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
130
- description String
131
- assignedToId String?
132
- assignedTo User? @relation("TasksAssignedToMe", fields: [assignedToId], references: [id], onDelete: Cascade)
133
- status TaskStatus?
134
- bashNotificationsReferencingMe BashNotification[]
135
- createdAt DateTime? @default(now())
136
- }
137
-
138
- enum TaskStatus {
139
- Accepted
140
- Rejected
141
- Completed
142
- }
143
-
144
- model Reminder {
145
- id String @id @default(cuid())
146
- creatorId String
147
- creator User @relation("RemindersCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
148
- remindWhoId String?
149
- remindWho User? @relation("RemindersAssignedToMe", fields: [remindWhoId], references: [id], onDelete: Cascade)
150
- remindDateTime DateTime
151
- notificationId String
152
- notification BashNotification @relation(fields: [notificationId], references: [id], onDelete: Cascade)
153
- }
154
-
155
- model BashEventPromoCode {
156
- id String @id @default(cuid())
157
- bashEventId String
158
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
159
- code String
160
- stripeCouponId String?
161
- discountAmountInCents Int?
162
- discountAmountPercentage Int?
163
- maxRedemptions Int?
164
- redeemBy DateTime?
165
- usedBy User[]
166
-
167
- @@unique([bashEventId, code])
168
- }
169
-
170
- model BashNotification {
171
- id String @id @default(cuid())
172
- creatorId String
173
- creator User @relation("NotificationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
174
- email String
175
- createdDateTime DateTime @default(now())
176
- message String
177
- image String?
178
- readDateTime DateTime?
179
- taskId String?
180
- eventTask EventTask? @relation(fields: [taskId], references: [id], onDelete: Cascade)
181
- invitationId String?
182
- invitation Invitation? @relation(fields: [invitationId], references: [id], onDelete: Cascade)
183
- bashEventId String?
184
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
185
- reminders Reminder[]
186
-
187
- @@unique([creatorId, email, bashEventId])
188
- @@unique([creatorId, email, invitationId])
189
- }
190
-
191
- model Invitation {
192
- id String @id @default(cuid())
193
- creatorId String
194
- creator User @relation("InvitationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
195
- email String
196
- sentToId String?
197
- sentTo User? @relation("InvitationsSentToMe", fields: [sentToId], references: [id], onDelete: Cascade)
198
- bashEventId String?
199
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
200
- image String?
201
- phone String?
202
- name String?
203
- message String?
204
- inviteDate DateTime? @default(now())
205
- acceptedDate DateTime?
206
- rejectedDate DateTime?
207
- maybeDate DateTime?
208
- tickets Ticket[] @relation("TicketsForInvitation")
209
- bashNotificationsReferencingMe BashNotification[]
210
- associatedBashReferencingMe AssociatedBash?
211
-
212
- @@index([email])
213
- }
214
-
215
- model BashEvent {
216
- id String @id @default(cuid())
217
- title String
218
- creatorId String
219
- creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
220
- description String?
221
- eventType String @default("Other")
222
- startDateTime DateTime? @default(now())
223
- endDateTime DateTime? @default(now())
224
- ticketTiers TicketTier[]
225
- targetAudience TargetAudience?
226
- amountOfGuests AmountOfGuests?
227
- recurrence Recurrence?
228
- vibe String?
229
- occasion String?
230
- dress String?
231
- allowed String?
232
- notAllowed String?
233
- nonProfit Boolean?
234
- nonProfitId String?
235
- privacy Privacy @default(Public)
236
- tickets Ticket[]
237
- reviews Review[]
238
- sponsorships SponsoredEvent[]
239
- investments Investment[]
240
- capacity Int?
241
- location String?
242
- status BashStatus @default(Draft)
243
- tags String[]
244
- coverPhoto String?
245
- media Media[]
246
- club Club? @relation(fields: [clubId], references: [id], onDelete: SetNull)
247
- clubId String?
248
- links EventLink[]
249
- competitions Competition[]
250
- invitations Invitation[]
251
- dateTimePublished DateTime?
252
- comments BashComment[]
253
- includedItems String[]
254
- associatedBashesReferencingMe AssociatedBash[]
255
- bashNotificationsReferencingMe BashNotification[]
256
- checkouts Checkout[]
257
- eventTasks EventTask[]
258
- videoLink String?
259
- subtitle String?
260
- promoCodes BashEventPromoCode[]
261
- }
262
-
263
- model Checkout {
264
- id String @id @default(cuid())
265
- ownerId String
266
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
267
- bashEventId String
268
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
269
- tickets Ticket[]
270
- checkoutSessionId String? @unique
271
- }
272
-
273
- model TicketTier {
274
- id String @id @default(cuid())
275
- bashEventId String
276
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
277
- tickets Ticket[]
278
- waitList User[]
279
- price Int @default(0)
280
- title String @default("Free")
281
- maximumNumberOfTickets Int @default(100)
282
- isDonationTier Boolean?
283
- hidden Boolean?
284
-
285
- @@unique([bashEventId, title])
286
- }
287
-
288
- model Ticket {
289
- id String @id @default(cuid())
290
- ownerId String
291
- owner User @relation("TicketsIOwn", fields: [ownerId], references: [id], onDelete: Cascade)
292
- bashEventId String
293
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
294
- ticketTierId String?
295
- ticketTier TicketTier? @relation(fields: [ticketTierId], references: [id], onDelete: Cascade)
296
- validDate DateTime?
297
- forUserId String?
298
- forUser User? @relation("TicketsISent", fields: [forUserId], references: [id], onDelete: Cascade)
299
- fullName String?
300
- email String?
301
- paidOn DateTime?
302
- allowPromiseToPay Boolean?
303
- status TicketStatus?
304
- isFreeGuest Boolean?
305
- geoFenceCheckInUnnecessary Boolean?
306
- checkedInAt DateTime?
307
- checkedOutAt DateTime?
308
- invitationId String?
309
- invitation Invitation? @relation("TicketsForInvitation", fields: [invitationId], references: [id], onDelete: SetNull)
310
- checkoutId String?
311
- checkout Checkout? @relation(fields: [checkoutId], references: [id], onDelete: SetNull)
312
-
313
- @@index([bashEventId])
314
- }
315
-
316
- enum TicketStatus {
317
- Cancelled
318
- Attended
319
- Missed
320
- }
321
-
322
- model unusedModelButNeededForSomeTypesToBeDefinedForTypescript {
323
- id String @id @default(cuid())
324
- doNotUseVibeEnum BashEventVibeTags @default(Wild)
325
- doNotUseDressEnum BashEventDressTags @default(Casual)
326
- doNotUseBashEventType BashEventType @default(Other)
327
- doNotUseDayOfWeek DayOfWeek @default(Sunday)
328
- }
329
-
330
- model Recurrence {
331
- id String @id @default(cuid())
332
- interval Int @default(1)
333
- bashEventId String @unique
334
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
335
- frequency RecurringFrequency @default(Never)
336
- ends DateTime @default(now())
337
- repeatOnDays DayOfWeek[]
338
- repeatOnDayOfMonth Int?
339
- repeatYearlyDate DateTime?
340
- }
341
-
342
- enum DayOfWeek {
343
- Sunday
344
- Monday
345
- Tuesday
346
- Wednesday
347
- Thursday
348
- Friday
349
- Saturday
350
- }
351
-
352
- enum RecurringFrequency {
353
- Never
354
- Daily
355
- Weekly
356
- Monthly
357
- Yearly
358
- }
359
-
360
- enum BashEventVibeTags {
361
- Wild
362
- Calm
363
- SomewhereInBetween
364
- }
365
-
366
- enum BashEventDressTags {
367
- Casual
368
- BusinessCasual
369
- Formal
370
- }
371
-
372
- enum BashEventType {
373
- AfterParty
374
- AnimeAndCosplayFestival
375
- AnniversaryCelebration
376
- ArtExhibitOpening
377
- ArtAndCraftNight
378
- BBQCookout
379
- BabyShower
380
- BachelorOrBacheloretteParty
381
- BeachParty
382
- Birthday
383
- BoatPartyOrCruise
384
- Bonfire
385
- BookClubMeeting
386
- BridalShower
387
- BrunchGathering
388
- CarShow
389
- CarnivalAndFair
390
- CasinoNight
391
- CasualMixer
392
- CharityBall
393
- CharityFundraiser
394
- ChristmasParty
395
- ChurchEvent
396
- CircusOrCarnivalParty
397
- CocktailParty
398
- CollegeParty_FraternityOrSorority
399
- ComedyShowOrStandUpComedyNight
400
- ComicConvention
401
- Competition
402
- Concert
403
- CookingCompetition
404
- CorporateEventOrOfficeParty
405
- CostumeParty_Theme_Based
406
- CulturalFestival
407
- DanceParty
408
- DesertRave
409
- DiscoNight
410
- EasterGathering
411
- EngagementParty
412
- ESportsGamingTournament
413
- ExclusiveLuxuryRetreat
414
- FantasyThemedParty
415
- FashionShow
416
- Fireside
417
- FitnessFestival
418
- FlashMob
419
- Festival
420
- FestivalFilm
421
- FestivalFood
422
- FundraisingEvent
423
- GalaDinner
424
- GameNight
425
- GamingEvent
426
- GardenParty
427
- GoingAwayPartyOrFarewell
428
- GraduationParty
429
- HalloweenCostumeParty
430
- HanukkahParty
431
- HistoricalEraParty
432
- HolidayParty
433
- HouseParty
434
- HousewarmingParty
435
- KaraokeNight
436
- KiteFlyingFestival
437
- LiveBandPerformanceInALocalVenue
438
- Luau
439
- MansionParty
440
- MardiGras
441
- MasqueradeBall
442
- MotorcycleRally
443
- MovieNight
444
- MoviePremiere
445
- MusicFestival
446
- NewYearsEveCelebration
447
- OpenMicNight
448
- OutdoorActivity
449
- OutdoorConcert
450
- OutdoorMovieNight_WithAProjector
451
- Parade
452
- Party
453
- PoolParty
454
- Potluck
455
- PotluckVegan
456
- PreParty
457
- ProductLaunch
458
- ProfessionalNetworkingEvent
459
- Rave_General
460
- RetirementCelebration
461
- Reunion_FamilyOrSchoolOrFriends
462
- SafariAdventureParty
463
- SchoolEvent_MiddleSchoolOrHighSchoolOrCollege
464
- ScienceFictionThemedParty
465
- SocialClubEvent
466
- SportsTournament
467
- SportsWatchParty
468
- SuperheroThemedParty
469
- SurfCompetition
470
- ThanksgivingDinner
471
- ThemedCostumeParty
472
- ThemedDinnerParty
473
- ThemedPubCrawl
474
- Tournament
475
- TravelAndTradeShow
476
- TriviaNight
477
- ValentinesDayParty
478
- WeddingReception
479
- WelcomeHomeParty
480
- WellnessFestival
481
- WineTastingEvent
482
- Other
483
- }
484
-
485
- model CustomBashEventType {
486
- id String @id @default(cuid())
487
- key String @unique
488
- displayName String
489
- }
490
-
491
- model AmountOfGuests {
492
- id String @id @default(cuid())
493
- bashEventId String @unique
494
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
495
- minimum Int? @default(10)
496
- ideal Int? @default(35)
497
- showMinimumGuests Boolean @default(true)
498
- showIdealGuests Boolean @default(true)
499
- }
500
-
501
- enum Privacy {
502
- Public
503
- ConnectionsOnly
504
- InviteOnly
505
- }
506
-
507
- model TargetAudience {
508
- id String @id @default(cuid())
509
- bashEventId String @unique
510
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
511
- ageRange AgeRange @default(NoPreference)
512
- gender Gender @default(NoPreference)
513
- occupation Occupation @default(NoPreference)
514
- education Education @default(NoPreference)
515
- showOnDetailPage Boolean @default(true)
516
- }
517
-
518
- enum AgeRange {
519
- Eighteen_24
520
- TwentyFive_34
521
- ThirtyFive_49
522
- FiftyPlus
523
- NoPreference
524
- }
525
-
526
- enum Occupation {
527
- Student
528
- Startups
529
- SMBs
530
- Corporations
531
- Professional
532
- AngelInvestors
533
- FamilyOffice
534
- Retired
535
- NoPreference
536
- }
537
-
538
- enum Education {
539
- HighSchool
540
- InCollege
541
- Bachelors
542
- Masters
543
- Doctorate
544
- NoPreference
545
- }
546
-
547
- enum BashStatus {
548
- Draft
549
- PreSale
550
- Published
551
- }
552
-
553
- model DocumentID {
554
- id String @id @default(cuid())
555
- givenName String?
556
- familyName String?
557
- middleName String?
558
- suffix String?
559
- streetAddress String?
560
- city String?
561
- state String?
562
- stateName String?
563
- postalCode String?
564
- idNumber String?
565
- expires String?
566
- dob String?
567
- issueDate String?
568
- idType String?
569
- userId String? @unique
570
- user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
571
- }
572
-
573
- model EventLink {
574
- id String @id @default(cuid())
575
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
576
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
577
- linkId String
578
- bashEventId String
579
- }
580
-
581
- enum Gender {
582
- Male
583
- Female
584
- Other
585
- NoPreference
586
- }
587
-
588
- model Investment {
589
- id String @id @default(cuid())
590
- investorId String
591
- bashEventId String
592
- investor User @relation(fields: [investorId], references: [id], onDelete: Cascade)
593
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
594
- amount Float
595
- type InvestmentType
596
- paidOn String?
597
- }
598
-
599
- enum InvestmentType {
600
- Equity
601
- Event
602
- }
603
-
604
- model Link {
605
- id String @id @default(cuid())
606
- url String
607
- type String
608
- icon String?
609
- vendorLinks VendorLink[]
610
- eventLinks EventLink[]
611
- userLinks UserLink[]
612
- serviceLinks ServiceLink[]
613
- }
614
-
615
- model Media {
616
- id String @id @default(cuid())
617
- url String @unique
618
- type MediaType
619
- mimetype String?
620
- bashEventsReferencingMe BashEvent[]
621
- businessesReferencingMe Business[]
622
- sponsoredEventsReferencingMe SponsoredEvent[]
623
- servicesReferencingMe Service[]
624
- }
625
-
626
- enum MediaType {
627
- Unknown
628
- Empty
629
- Image
630
- Video
631
- }
632
-
633
- model Prize {
634
- id String @id @default(cuid())
635
- prizeWorth Float?
636
- prizeType PrizeType
637
- name String
638
- prizeLevel Int
639
- description String
640
- competition Competition? @relation(fields: [competitionId], references: [id], onDelete: SetNull)
641
- competitionId String?
642
- paidOn String?
643
- winner User? @relation(fields: [winnerUserId], references: [id], onDelete: Cascade)
644
- winnerUserId String?
645
- }
646
-
647
- enum PrizeType {
648
- Monetary
649
- Merchandise
650
- Service
651
- Combo
652
- }
653
-
654
- model Review {
655
- id String @id @default(cuid())
656
- rating Int
657
- creatorId String
658
- creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
659
- bashEventId String
660
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
661
- comments BashComment[]
662
- }
663
-
664
- model Session {
665
- id String @id @default(cuid())
666
- sessionToken String @unique
667
- userId String
668
- expires DateTime
669
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
670
-
671
- @@index([userId])
672
- }
673
-
674
- enum Sex {
675
- Male
676
- Female
677
- Other
678
- }
679
-
680
- model SponsoredEvent {
681
- id String @id @default(cuid())
682
- amount Float?
683
- paidOn String?
684
- sponsorType SponsorType
685
- sponsorId String
686
- bashEventId String
687
- sponsor User @relation(fields: [sponsorId], references: [id], onDelete: Cascade)
688
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
689
- media Media[]
690
- }
691
-
692
- enum SponsorType {
693
- Marketing
694
- Giveaway
695
- Awareness
696
- Trade
697
- CompetitionPrizeProvider
698
- }
699
-
700
- model User {
701
- id String @id @default(cuid())
702
- email String @unique
703
- createdOn DateTime @default(now())
704
- stripeCustomerId String? @unique
705
- stripeAccountId String? @unique
706
- googleCalendarAccess String?
707
- username String?
708
- fullName String?
709
- givenName String?
710
- familyName String?
711
- hash String?
712
- emailVerified DateTime?
713
- image String?
714
- uploadedImage String?
715
- dob DateTime?
716
- gender Gender?
717
- sex Sex?
718
- roles UserRole[] @default([User])
719
- services Service[]
720
- createdEvents BashEvent[] @relation("CreatedEvent")
721
- ticketsISent Ticket[] @relation("TicketsISent")
722
- ticketsIOwn Ticket[] @relation("TicketsIOwn")
723
- reviews Review[]
724
- sponsorships SponsoredEvent[]
725
- investments Investment[]
726
- accounts Account[]
727
- sessions Session[]
728
- eventTasks EventTask[]
729
- vendors Vendor[]
730
- clubMembers ClubMember[]
731
- clubAdmins ClubAdmin[]
732
- links UserLink[]
733
- status UserStatus
734
- competitions Competition[]
735
- competitionSponsorships CompetitionSponsor[]
736
- competitionPrizes Prize[]
737
- userRatingGiven UserRatingGiven[]
738
- userRating UserRating[]
739
- magicLink String?
740
- magicLinkExpiration DateTime?
741
- magicLinkUsed DateTime?
742
- idVerified DateTime?
743
- streetAddress String?
744
- city String?
745
- state String?
746
- postalCode String?
747
- country String? @default("US")
748
- phone String?
749
- documentIDId String? @unique
750
- documentID DocumentID?
751
- comment BashComment[]
752
- associatedBashes AssociatedBash[]
753
- invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
754
- invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
755
- notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
756
- remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
757
- remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
758
- eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
759
- checkouts Checkout[]
760
- ticketTiersWaitListsIveJoined TicketTier[]
761
- contacts Contact[]
762
- contactsReferencingMe Contact[] @relation("ContactsReferencingMe")
763
- bashEventPromoCodesIUsed BashEventPromoCode[]
764
- }
765
-
766
- model Contact {
767
- id String @id @default(cuid())
768
- contactOwnerId String
769
- contactOwner User @relation(fields: [contactOwnerId], references: [id], onDelete: Cascade)
770
- email String?
771
- fullName String?
772
- phone String?
773
- contactUserId String?
774
- contactUser User? @relation("ContactsReferencingMe", fields: [contactUserId], references: [id], onDelete: Cascade)
775
- requestToConnectSent DateTime?
776
- requestToConnectAccepted DateTime?
777
-
778
- @@unique([contactOwnerId, email])
779
- @@index([email])
780
- }
781
-
782
- model AssociatedBash {
783
- id String @id @default(cuid())
784
- bashEventId String
785
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
786
- invitationId String? @unique
787
- invitation Invitation? @relation(fields: [invitationId], references: [id])
788
- ownerEmail String?
789
- ownerUserId String?
790
- owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
791
- isOrganizer Boolean?
792
- isFavorite Boolean?
793
-
794
- @@unique([ownerEmail, bashEventId])
795
- }
796
-
797
- model Service {
798
- id String @id @default(cuid())
799
- ownerId String
800
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
801
- name String?
802
- coverPhoto String?
803
- media Media[]
804
- serviceType ServiceType[]
805
- subServiceType String?
806
- serviceLinks ServiceLink[]
807
- address String
808
- description String?
809
- canContact Boolean?
810
- musicGenre MusicGenreType?
811
- visibility VisibilityPreference @default(Public)
812
- bashesInterestedIn BashEventType[]
813
- crowdSizeId String @unique
814
- crowdSize ServiceRange @relation("CrowdSize", fields: [crowdSizeId], references: [id], onDelete: Cascade)
815
- serviceRangeId String @unique
816
- serviceRange ServiceRange @relation("ServiceRange", fields: [serviceRangeId], references: [id], onDelete: Cascade)
817
- availableDateTimes DateTime?
818
- }
819
-
820
- model ServiceRange {
821
- id String @id @default(cuid())
822
- minimum Int?
823
- maximum Int?
824
- crowdSize Service? @relation("CrowdSize")
825
- serviceRange Service? @relation("ServiceRange")
826
- }
827
-
828
- model Availability {
829
- id String @id @default(cuid())
830
- startDateTime String
831
- endDateTime String
832
- }
833
-
834
- enum VisibilityPreference {
835
- Public
836
- Private
837
- }
838
-
839
- enum MusicGenreType {
840
- Classical
841
- Rock
842
- HipHop
843
- Country
844
- Pop
845
- EDM
846
- Indie
847
- Acoustic
848
- }
849
-
850
- enum ServiceType {
851
- EventService
852
- EntertainmentService
853
- Volunteer
854
- PartnerService
855
- Venue
856
- }
857
-
858
- enum UserRole {
859
- User
860
- Vendor
861
- Sponsor
862
- Investor
863
- LoanProvider
864
- VenueProvider
865
- ServiceProvider
866
- SuperAdmin
867
- Exhibitor
868
- }
869
-
870
- model UserLink {
871
- id String @id @default(cuid())
872
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
873
- linkId String
874
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
875
- userId String
876
- }
877
-
878
- model UserRating {
879
- id String @id @default(cuid())
880
- rating Int
881
- comment String?
882
- givenBy UserRatingGiven @relation(fields: [userRatingGivenId], references: [id], onDelete: Cascade)
883
- userRatingGivenId String
884
- givenTo User @relation(fields: [userId], references: [id], onDelete: Cascade)
885
- userId String
886
- }
887
-
888
- model UserRatingGiven {
889
- id String @id @default(cuid())
890
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
891
- userId String
892
- UserRating UserRating[]
893
- }
894
-
895
- enum UserStatus {
896
- Active
897
- Inactive
898
- Suspended
899
- Deactivated
900
- }
901
-
902
- model VerificationToken {
903
- identifier String
904
- token String @unique
905
- expires DateTime
906
-
907
- @@unique([identifier, token])
908
- }
909
-
910
- model Vendor {
911
- id String @id @default(cuid())
912
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
913
- ownerId String
914
- type String
915
- amount Float?
916
- paidOn String?
917
- links VendorLink[]
918
- }
919
-
920
- model VendorLink {
921
- id String @id @default(cuid())
922
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
923
- vendor Vendor @relation(fields: [vendorId], references: [id], onDelete: Cascade)
924
- linkId String
925
- vendorId String
926
- }
927
-
928
- model ServiceLink {
929
- id String @id @default(cuid())
930
- servicesId String
931
- service Service @relation(fields: [servicesId], references: [id], onDelete: Cascade)
932
- linkId String
933
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
934
- }
1
+ // This is your Prisma schema file,
2
+ // learn more about it in the docs: https://pris.ly/d/prisma-schema
3
+
4
+ generator client {
5
+ provider = "prisma-client-js"
6
+ }
7
+
8
+ datasource db {
9
+ provider = "postgresql"
10
+ url = env("POSTGRES_PRISMA_URL") // uses connection pooling
11
+ directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
12
+ }
13
+
14
+ model Account {
15
+ id String @id @default(cuid())
16
+ userId String @unique
17
+ type String
18
+ provider String
19
+ providerAccountId String
20
+ refresh_token String? @db.Text
21
+ access_token String? @db.Text
22
+ expires_at Int?
23
+ token_type String?
24
+ scope String?
25
+ id_token String? @db.Text
26
+ session_state String?
27
+ image String?
28
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
29
+
30
+ @@unique([provider, providerAccountId])
31
+ }
32
+
33
+ model Business {
34
+ id String @id @default(cuid())
35
+ name String
36
+ ein String?
37
+ dba String?
38
+ address String?
39
+ media Media[]
40
+ }
41
+
42
+ model Club {
43
+ id String @id @default(cuid())
44
+ name String
45
+ address String
46
+ userId String
47
+ price Int?
48
+ events BashEvent[]
49
+ members ClubMember[]
50
+ admin ClubAdmin[]
51
+ }
52
+
53
+ model ClubAdmin {
54
+ id String @id @default(cuid())
55
+ admin User @relation(fields: [userId], references: [id], onDelete: Cascade)
56
+ userId String
57
+ club Club @relation(fields: [clubId], references: [id], onDelete: Cascade)
58
+ clubId String
59
+ role ClubAdminRole
60
+ }
61
+
62
+ model ClubMember {
63
+ id String @id @default(cuid())
64
+ member User @relation(fields: [userId], references: [id], onDelete: Cascade)
65
+ userId String
66
+ club Club @relation(fields: [clubId], references: [id], onDelete: Cascade)
67
+ clubId String
68
+ status ClubMemberStatus
69
+ statusHistory Json
70
+ price Int?
71
+ }
72
+
73
+ enum ClubAdminRole {
74
+ Owner
75
+ Admin
76
+ Staff
77
+ }
78
+
79
+ enum ClubMemberStatus {
80
+ Active
81
+ Inactive
82
+ Cancelled
83
+ Paused
84
+ Removed
85
+ }
86
+
87
+ model BashComment {
88
+ id String @id @default(cuid())
89
+ creatorId String
90
+ creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
91
+ content String
92
+ reviewId String?
93
+ review Review? @relation(fields: [reviewId], references: [id], onDelete: SetNull)
94
+ bashEventId String?
95
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
96
+ parentCommentId String?
97
+ parentComment BashComment? @relation("CommentReplies", fields: [parentCommentId], references: [id], onDelete: Cascade)
98
+ replies BashComment[] @relation("CommentReplies")
99
+ }
100
+
101
+ model Competition {
102
+ id String @id @default(cuid())
103
+ name String
104
+ description String
105
+ owner User @relation(fields: [userId], references: [id], onDelete: Cascade)
106
+ prizes Prize[]
107
+ userId String
108
+ sponser CompetitionSponsor[]
109
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
110
+ bashEventId String
111
+ numberOfPrizes Int
112
+ }
113
+
114
+ model CompetitionSponsor {
115
+ id String @id @default(cuid())
116
+ competition Competition @relation(fields: [competitionId], references: [id], onDelete: Cascade)
117
+ sponsor User @relation(fields: [userId], references: [id], onDelete: Cascade)
118
+ competitionId String
119
+ userId String
120
+ description String
121
+ paidOn String?
122
+ }
123
+
124
+ model EventTask {
125
+ id String @id @default(cuid())
126
+ creatorId String
127
+ creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
128
+ bashEventId String
129
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
130
+ description String
131
+ assignedToId String?
132
+ assignedTo User? @relation("TasksAssignedToMe", fields: [assignedToId], references: [id], onDelete: Cascade)
133
+ status TaskStatus?
134
+ bashNotificationsReferencingMe BashNotification[]
135
+ createdAt DateTime? @default(now())
136
+ }
137
+
138
+ enum TaskStatus {
139
+ Accepted
140
+ Rejected
141
+ Completed
142
+ }
143
+
144
+ model Reminder {
145
+ id String @id @default(cuid())
146
+ creatorId String
147
+ creator User @relation("RemindersCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
148
+ remindWhoId String?
149
+ remindWho User? @relation("RemindersAssignedToMe", fields: [remindWhoId], references: [id], onDelete: Cascade)
150
+ remindDateTime DateTime
151
+ notificationId String
152
+ notification BashNotification @relation(fields: [notificationId], references: [id], onDelete: Cascade)
153
+ }
154
+
155
+ model BashEventPromoCode {
156
+ id String @id @default(cuid())
157
+ bashEventId String
158
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
159
+ code String
160
+ stripeCouponId String?
161
+ discountAmountInCents Int?
162
+ discountAmountPercentage Int?
163
+ maxRedemptions Int?
164
+ redeemBy DateTime?
165
+ usedBy User[]
166
+
167
+ @@unique([bashEventId, code])
168
+ }
169
+
170
+ model BashNotification {
171
+ id String @id @default(cuid())
172
+ creatorId String
173
+ creator User @relation("NotificationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
174
+ email String
175
+ createdDateTime DateTime @default(now())
176
+ message String
177
+ image String?
178
+ readDateTime DateTime?
179
+ taskId String?
180
+ eventTask EventTask? @relation(fields: [taskId], references: [id], onDelete: Cascade)
181
+ invitationId String?
182
+ invitation Invitation? @relation(fields: [invitationId], references: [id], onDelete: Cascade)
183
+ bashEventId String?
184
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
185
+ reminders Reminder[]
186
+
187
+ @@unique([creatorId, email, bashEventId])
188
+ @@unique([creatorId, email, invitationId])
189
+ }
190
+
191
+ model Invitation {
192
+ id String @id @default(cuid())
193
+ creatorId String
194
+ creator User @relation("InvitationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
195
+ email String
196
+ sentToId String?
197
+ sentTo User? @relation("InvitationsSentToMe", fields: [sentToId], references: [id], onDelete: Cascade)
198
+ bashEventId String?
199
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
200
+ image String?
201
+ phone String?
202
+ name String?
203
+ message String?
204
+ inviteDate DateTime? @default(now())
205
+ acceptedDate DateTime?
206
+ rejectedDate DateTime?
207
+ maybeDate DateTime?
208
+ tickets Ticket[] @relation("TicketsForInvitation")
209
+ bashNotificationsReferencingMe BashNotification[]
210
+ associatedBashReferencingMe AssociatedBash?
211
+
212
+ @@index([email])
213
+ }
214
+
215
+ model BashEvent {
216
+ id String @id @default(cuid())
217
+ title String
218
+ creatorId String
219
+ creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
220
+ description String?
221
+ eventType String @default("Other")
222
+ startDateTime DateTime? @default(now())
223
+ endDateTime DateTime? @default(now())
224
+ ticketTiers TicketTier[]
225
+ targetAudience TargetAudience?
226
+ amountOfGuests AmountOfGuests?
227
+ recurrence Recurrence?
228
+ vibe String?
229
+ occasion String?
230
+ dress String?
231
+ allowed String?
232
+ notAllowed String?
233
+ nonProfit Boolean?
234
+ nonProfitId String?
235
+ privacy Privacy @default(Public)
236
+ tickets Ticket[]
237
+ reviews Review[]
238
+ sponsorships SponsoredEvent[]
239
+ investments Investment[]
240
+ capacity Int?
241
+ location String?
242
+ status BashStatus @default(Draft)
243
+ tags String[]
244
+ coverPhoto String?
245
+ media Media[]
246
+ club Club? @relation(fields: [clubId], references: [id], onDelete: SetNull)
247
+ clubId String?
248
+ links EventLink[]
249
+ competitions Competition[]
250
+ invitations Invitation[]
251
+ dateTimePublished DateTime?
252
+ comments BashComment[]
253
+ includedItems String[]
254
+ associatedBashesReferencingMe AssociatedBash[]
255
+ bashNotificationsReferencingMe BashNotification[]
256
+ checkouts Checkout[]
257
+ eventTasks EventTask[]
258
+ videoLink String?
259
+ subtitle String?
260
+ promoCodes BashEventPromoCode[]
261
+ }
262
+
263
+ model Checkout {
264
+ id String @id @default(cuid())
265
+ ownerId String
266
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
267
+ bashEventId String
268
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
269
+ tickets Ticket[]
270
+ checkoutSessionId String? @unique
271
+ }
272
+
273
+ model TicketTier {
274
+ id String @id @default(cuid())
275
+ bashEventId String
276
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
277
+ tickets Ticket[]
278
+ waitList User[]
279
+ price Int @default(0)
280
+ title String @default("Free")
281
+ maximumNumberOfTickets Int @default(100)
282
+ isDonationTier Boolean?
283
+ hidden Boolean?
284
+
285
+ @@unique([bashEventId, title])
286
+ }
287
+
288
+ model Ticket {
289
+ id String @id @default(cuid())
290
+ ownerId String
291
+ owner User @relation("TicketsIOwn", fields: [ownerId], references: [id], onDelete: Cascade)
292
+ bashEventId String
293
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
294
+ ticketTierId String?
295
+ ticketTier TicketTier? @relation(fields: [ticketTierId], references: [id], onDelete: Cascade)
296
+ validDate DateTime?
297
+ forUserId String?
298
+ forUser User? @relation("TicketsISent", fields: [forUserId], references: [id], onDelete: Cascade)
299
+ fullName String?
300
+ email String?
301
+ paidOn DateTime?
302
+ allowPromiseToPay Boolean?
303
+ status TicketStatus?
304
+ isFreeGuest Boolean?
305
+ geoFenceCheckInUnnecessary Boolean?
306
+ checkedInAt DateTime?
307
+ checkedOutAt DateTime?
308
+ invitationId String?
309
+ invitation Invitation? @relation("TicketsForInvitation", fields: [invitationId], references: [id], onDelete: SetNull)
310
+ checkoutId String?
311
+ checkout Checkout? @relation(fields: [checkoutId], references: [id], onDelete: SetNull)
312
+
313
+ @@index([bashEventId])
314
+ }
315
+
316
+ enum TicketStatus {
317
+ Cancelled
318
+ Attended
319
+ Missed
320
+ }
321
+
322
+ model unusedModelButNeededForSomeTypesToBeDefinedForTypescript {
323
+ id String @id @default(cuid())
324
+ doNotUseVibeEnum BashEventVibeTags @default(Wild)
325
+ doNotUseDressEnum BashEventDressTags @default(Casual)
326
+ doNotUseBashEventType BashEventType @default(Other)
327
+ doNotUseDayOfWeek DayOfWeek @default(Sunday)
328
+ }
329
+
330
+ model Recurrence {
331
+ id String @id @default(cuid())
332
+ interval Int @default(1)
333
+ bashEventId String @unique
334
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
335
+ frequency RecurringFrequency @default(Never)
336
+ ends DateTime @default(now())
337
+ repeatOnDays DayOfWeek[]
338
+ repeatOnDayOfMonth Int?
339
+ repeatYearlyDate DateTime?
340
+ }
341
+
342
+ enum DayOfWeek {
343
+ Sunday
344
+ Monday
345
+ Tuesday
346
+ Wednesday
347
+ Thursday
348
+ Friday
349
+ Saturday
350
+ }
351
+
352
+ enum RecurringFrequency {
353
+ Never
354
+ Daily
355
+ Weekly
356
+ Monthly
357
+ Yearly
358
+ }
359
+
360
+ enum BashEventVibeTags {
361
+ Wild
362
+ Calm
363
+ SomewhereInBetween
364
+ }
365
+
366
+ enum BashEventDressTags {
367
+ Casual
368
+ BusinessCasual
369
+ Formal
370
+ }
371
+
372
+ enum BashEventType {
373
+ AfterParty
374
+ AnimeAndCosplayFestival
375
+ AnniversaryCelebration
376
+ ArtExhibitOpening
377
+ ArtAndCraftNight
378
+ BBQCookout
379
+ BabyShower
380
+ BachelorOrBacheloretteParty
381
+ BeachParty
382
+ Birthday
383
+ BoatPartyOrCruise
384
+ Bonfire
385
+ BookClubMeeting
386
+ BridalShower
387
+ BrunchGathering
388
+ CarShow
389
+ CarnivalAndFair
390
+ CasinoNight
391
+ CasualMixer
392
+ CharityBall
393
+ CharityFundraiser
394
+ ChristmasParty
395
+ ChurchEvent
396
+ CircusOrCarnivalParty
397
+ CocktailParty
398
+ CollegeParty_FraternityOrSorority
399
+ ComedyShowOrStandUpComedyNight
400
+ ComicConvention
401
+ Competition
402
+ Concert
403
+ CookingCompetition
404
+ CorporateEventOrOfficeParty
405
+ CostumeParty_Theme_Based
406
+ CulturalFestival
407
+ DanceParty
408
+ DesertRave
409
+ DiscoNight
410
+ EasterGathering
411
+ EngagementParty
412
+ ESportsGamingTournament
413
+ ExclusiveLuxuryRetreat
414
+ FantasyThemedParty
415
+ FashionShow
416
+ Fireside
417
+ FitnessFestival
418
+ FlashMob
419
+ Festival
420
+ FestivalFilm
421
+ FestivalFood
422
+ FundraisingEvent
423
+ GalaDinner
424
+ GameNight
425
+ GamingEvent
426
+ GardenParty
427
+ GoingAwayPartyOrFarewell
428
+ GraduationParty
429
+ HalloweenCostumeParty
430
+ HanukkahParty
431
+ HistoricalEraParty
432
+ HolidayParty
433
+ HouseParty
434
+ HousewarmingParty
435
+ KaraokeNight
436
+ KiteFlyingFestival
437
+ LiveBandPerformanceInALocalVenue
438
+ Luau
439
+ MansionParty
440
+ MardiGras
441
+ MasqueradeBall
442
+ MotorcycleRally
443
+ MovieNight
444
+ MoviePremiere
445
+ MusicFestival
446
+ NewYearsEveCelebration
447
+ OpenMicNight
448
+ OutdoorActivity
449
+ OutdoorConcert
450
+ OutdoorMovieNight_WithAProjector
451
+ Parade
452
+ Party
453
+ PoolParty
454
+ Potluck
455
+ PotluckVegan
456
+ PreParty
457
+ ProductLaunch
458
+ ProfessionalNetworkingEvent
459
+ Rave_General
460
+ RetirementCelebration
461
+ Reunion_FamilyOrSchoolOrFriends
462
+ SafariAdventureParty
463
+ SchoolEvent_MiddleSchoolOrHighSchoolOrCollege
464
+ ScienceFictionThemedParty
465
+ SocialClubEvent
466
+ SportsTournament
467
+ SportsWatchParty
468
+ SuperheroThemedParty
469
+ SurfCompetition
470
+ ThanksgivingDinner
471
+ ThemedCostumeParty
472
+ ThemedDinnerParty
473
+ ThemedPubCrawl
474
+ Tournament
475
+ TravelAndTradeShow
476
+ TriviaNight
477
+ ValentinesDayParty
478
+ WeddingReception
479
+ WelcomeHomeParty
480
+ WellnessFestival
481
+ WineTastingEvent
482
+ Other
483
+ }
484
+
485
+ model CustomBashEventType {
486
+ id String @id @default(cuid())
487
+ key String @unique
488
+ displayName String
489
+ }
490
+
491
+ model AmountOfGuests {
492
+ id String @id @default(cuid())
493
+ bashEventId String @unique
494
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
495
+ minimum Int? @default(10)
496
+ ideal Int? @default(35)
497
+ showMinimumGuests Boolean @default(true)
498
+ showIdealGuests Boolean @default(true)
499
+ }
500
+
501
+ enum Privacy {
502
+ Public
503
+ ConnectionsOnly
504
+ InviteOnly
505
+ }
506
+
507
+ model TargetAudience {
508
+ id String @id @default(cuid())
509
+ bashEventId String @unique
510
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
511
+ ageRange AgeRange @default(NoPreference)
512
+ gender Gender @default(NoPreference)
513
+ occupation Occupation @default(NoPreference)
514
+ education Education @default(NoPreference)
515
+ showOnDetailPage Boolean @default(true)
516
+ }
517
+
518
+ enum AgeRange {
519
+ Eighteen_24
520
+ TwentyFive_34
521
+ ThirtyFive_49
522
+ FiftyPlus
523
+ NoPreference
524
+ }
525
+
526
+ enum Occupation {
527
+ Student
528
+ Startups
529
+ SMBs
530
+ Corporations
531
+ Professional
532
+ AngelInvestors
533
+ FamilyOffice
534
+ Retired
535
+ NoPreference
536
+ }
537
+
538
+ enum Education {
539
+ HighSchool
540
+ InCollege
541
+ Bachelors
542
+ Masters
543
+ Doctorate
544
+ NoPreference
545
+ }
546
+
547
+ enum BashStatus {
548
+ Draft
549
+ PreSale
550
+ Published
551
+ }
552
+
553
+ model DocumentID {
554
+ id String @id @default(cuid())
555
+ givenName String?
556
+ familyName String?
557
+ middleName String?
558
+ suffix String?
559
+ streetAddress String?
560
+ city String?
561
+ state String?
562
+ stateName String?
563
+ postalCode String?
564
+ idNumber String?
565
+ expires String?
566
+ dob String?
567
+ issueDate String?
568
+ idType String?
569
+ userId String? @unique
570
+ user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
571
+ }
572
+
573
+ model EventLink {
574
+ id String @id @default(cuid())
575
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
576
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
577
+ linkId String
578
+ bashEventId String
579
+ }
580
+
581
+ enum Gender {
582
+ Male
583
+ Female
584
+ Other
585
+ NoPreference
586
+ }
587
+
588
+ model Investment {
589
+ id String @id @default(cuid())
590
+ investorId String
591
+ bashEventId String
592
+ investor User @relation(fields: [investorId], references: [id], onDelete: Cascade)
593
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
594
+ amount Float
595
+ type InvestmentType
596
+ paidOn String?
597
+ }
598
+
599
+ enum InvestmentType {
600
+ Equity
601
+ Event
602
+ }
603
+
604
+ model Link {
605
+ id String @id @default(cuid())
606
+ url String
607
+ type String
608
+ icon String?
609
+ vendorLinks VendorLink[]
610
+ eventLinks EventLink[]
611
+ userLinks UserLink[]
612
+ serviceLinks ServiceLink[]
613
+ }
614
+
615
+ model Media {
616
+ id String @id @default(cuid())
617
+ url String @unique
618
+ type MediaType
619
+ mimetype String?
620
+ bashEventsReferencingMe BashEvent[]
621
+ businessesReferencingMe Business[]
622
+ sponsoredEventsReferencingMe SponsoredEvent[]
623
+ servicesReferencingMe Service[]
624
+ }
625
+
626
+ enum MediaType {
627
+ Unknown
628
+ Empty
629
+ Image
630
+ Video
631
+ }
632
+
633
+ model Prize {
634
+ id String @id @default(cuid())
635
+ prizeWorth Float?
636
+ prizeType PrizeType
637
+ name String
638
+ prizeLevel Int
639
+ description String
640
+ competition Competition? @relation(fields: [competitionId], references: [id], onDelete: SetNull)
641
+ competitionId String?
642
+ paidOn String?
643
+ winner User? @relation(fields: [winnerUserId], references: [id], onDelete: Cascade)
644
+ winnerUserId String?
645
+ }
646
+
647
+ enum PrizeType {
648
+ Monetary
649
+ Merchandise
650
+ Service
651
+ Combo
652
+ }
653
+
654
+ model Review {
655
+ id String @id @default(cuid())
656
+ rating Int
657
+ creatorId String
658
+ creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
659
+ bashEventId String
660
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
661
+ comments BashComment[]
662
+ }
663
+
664
+ model Session {
665
+ id String @id @default(cuid())
666
+ sessionToken String @unique
667
+ userId String
668
+ expires DateTime
669
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
670
+
671
+ @@index([userId])
672
+ }
673
+
674
+ enum Sex {
675
+ Male
676
+ Female
677
+ Other
678
+ }
679
+
680
+ model SponsoredEvent {
681
+ id String @id @default(cuid())
682
+ amount Float?
683
+ paidOn String?
684
+ sponsorType SponsorType
685
+ sponsorId String
686
+ bashEventId String
687
+ sponsor User @relation(fields: [sponsorId], references: [id], onDelete: Cascade)
688
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
689
+ media Media[]
690
+ }
691
+
692
+ enum SponsorType {
693
+ Marketing
694
+ Giveaway
695
+ Awareness
696
+ Trade
697
+ CompetitionPrizeProvider
698
+ }
699
+
700
+ model User {
701
+ id String @id @default(cuid())
702
+ email String @unique
703
+ createdOn DateTime @default(now())
704
+ stripeCustomerId String? @unique
705
+ stripeAccountId String? @unique
706
+ googleCalendarAccess String?
707
+ username String?
708
+ fullName String?
709
+ givenName String?
710
+ familyName String?
711
+ hash String?
712
+ emailVerified DateTime?
713
+ image String?
714
+ uploadedImage String?
715
+ dob DateTime?
716
+ gender Gender?
717
+ sex Sex?
718
+ roles UserRole[] @default([User])
719
+ services Service[]
720
+ createdEvents BashEvent[] @relation("CreatedEvent")
721
+ ticketsISent Ticket[] @relation("TicketsISent")
722
+ ticketsIOwn Ticket[] @relation("TicketsIOwn")
723
+ reviews Review[]
724
+ sponsorships SponsoredEvent[]
725
+ investments Investment[]
726
+ accounts Account[]
727
+ sessions Session[]
728
+ eventTasks EventTask[]
729
+ vendors Vendor[]
730
+ clubMembers ClubMember[]
731
+ clubAdmins ClubAdmin[]
732
+ links UserLink[]
733
+ status UserStatus
734
+ competitions Competition[]
735
+ competitionSponsorships CompetitionSponsor[]
736
+ competitionPrizes Prize[]
737
+ userRatingGiven UserRatingGiven[]
738
+ userRating UserRating[]
739
+ magicLink String?
740
+ magicLinkExpiration DateTime?
741
+ magicLinkUsed DateTime?
742
+ idVerified DateTime?
743
+ streetAddress String?
744
+ city String?
745
+ state String?
746
+ postalCode String?
747
+ country String? @default("US")
748
+ phone String?
749
+ documentIDId String? @unique
750
+ documentID DocumentID?
751
+ comment BashComment[]
752
+ associatedBashes AssociatedBash[]
753
+ invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
754
+ invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
755
+ notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
756
+ remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
757
+ remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
758
+ eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
759
+ checkouts Checkout[]
760
+ ticketTiersWaitListsIveJoined TicketTier[]
761
+ contacts Contact[]
762
+ contactsReferencingMe Contact[] @relation("ContactsReferencingMe")
763
+ bashEventPromoCodesIUsed BashEventPromoCode[]
764
+ }
765
+
766
+ model Contact {
767
+ id String @id @default(cuid())
768
+ contactOwnerId String
769
+ contactOwner User @relation(fields: [contactOwnerId], references: [id], onDelete: Cascade)
770
+ email String?
771
+ fullName String?
772
+ phone String?
773
+ contactUserId String?
774
+ contactUser User? @relation("ContactsReferencingMe", fields: [contactUserId], references: [id], onDelete: Cascade)
775
+ requestToConnectSent DateTime?
776
+ requestToConnectAccepted DateTime?
777
+
778
+ @@unique([contactOwnerId, email])
779
+ @@index([email])
780
+ }
781
+
782
+ model AssociatedBash {
783
+ id String @id @default(cuid())
784
+ bashEventId String
785
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
786
+ invitationId String? @unique
787
+ invitation Invitation? @relation(fields: [invitationId], references: [id])
788
+ ownerEmail String?
789
+ ownerUserId String?
790
+ owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
791
+ isOrganizer Boolean?
792
+ isFavorite Boolean?
793
+
794
+ @@unique([ownerEmail, bashEventId])
795
+ }
796
+
797
+ model Service {
798
+ id String @id @default(cuid())
799
+ ownerId String
800
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
801
+ name String?
802
+ coverPhoto String?
803
+ media Media[]
804
+ serviceType ServiceType[]
805
+ subServiceType String?
806
+ serviceLinks ServiceLink[]
807
+ address String
808
+ description String?
809
+ canContact Boolean?
810
+ musicGenre MusicGenreType?
811
+ visibility VisibilityPreference @default(Public)
812
+ bashesInterestedIn BashEventType[]
813
+ crowdSizeId String @unique
814
+ crowdSize ServiceRange @relation("CrowdSize", fields: [crowdSizeId], references: [id], onDelete: Cascade)
815
+ serviceRangeId String @unique
816
+ serviceRange ServiceRange @relation("ServiceRange", fields: [serviceRangeId], references: [id], onDelete: Cascade)
817
+ availableDateTimes DateTime?
818
+ }
819
+
820
+ model ServiceRange {
821
+ id String @id @default(cuid())
822
+ minimum Int?
823
+ maximum Int?
824
+ crowdSize Service? @relation("CrowdSize")
825
+ serviceRange Service? @relation("ServiceRange")
826
+ }
827
+
828
+ model Availability {
829
+ id String @id @default(cuid())
830
+ startDateTime String
831
+ endDateTime String
832
+ }
833
+
834
+ enum VisibilityPreference {
835
+ Public
836
+ Private
837
+ }
838
+
839
+ enum MusicGenreType {
840
+ Classical
841
+ Rock
842
+ HipHop
843
+ Country
844
+ Pop
845
+ EDM
846
+ Indie
847
+ Acoustic
848
+ }
849
+
850
+ enum ServiceType {
851
+ EventService
852
+ EntertainmentService
853
+ Volunteer
854
+ PartnerService
855
+ Venue
856
+ }
857
+
858
+ enum UserRole {
859
+ User
860
+ Vendor
861
+ Sponsor
862
+ Investor
863
+ LoanProvider
864
+ VenueProvider
865
+ ServiceProvider
866
+ SuperAdmin
867
+ Exhibitor
868
+ }
869
+
870
+ model UserLink {
871
+ id String @id @default(cuid())
872
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
873
+ linkId String
874
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
875
+ userId String
876
+ }
877
+
878
+ model UserRating {
879
+ id String @id @default(cuid())
880
+ rating Int
881
+ comment String?
882
+ givenBy UserRatingGiven @relation(fields: [userRatingGivenId], references: [id], onDelete: Cascade)
883
+ userRatingGivenId String
884
+ givenTo User @relation(fields: [userId], references: [id], onDelete: Cascade)
885
+ userId String
886
+ }
887
+
888
+ model UserRatingGiven {
889
+ id String @id @default(cuid())
890
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
891
+ userId String
892
+ UserRating UserRating[]
893
+ }
894
+
895
+ enum UserStatus {
896
+ Active
897
+ Inactive
898
+ Suspended
899
+ Deactivated
900
+ }
901
+
902
+ model VerificationToken {
903
+ identifier String
904
+ token String @unique
905
+ expires DateTime
906
+
907
+ @@unique([identifier, token])
908
+ }
909
+
910
+ model Vendor {
911
+ id String @id @default(cuid())
912
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
913
+ ownerId String
914
+ type String
915
+ amount Float?
916
+ paidOn String?
917
+ links VendorLink[]
918
+ }
919
+
920
+ model VendorLink {
921
+ id String @id @default(cuid())
922
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
923
+ vendor Vendor @relation(fields: [vendorId], references: [id], onDelete: Cascade)
924
+ linkId String
925
+ vendorId String
926
+ }
927
+
928
+ model ServiceLink {
929
+ id String @id @default(cuid())
930
+ servicesId String
931
+ service Service @relation(fields: [servicesId], references: [id], onDelete: Cascade)
932
+ linkId String
933
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
934
+ }