@bash-app/bash-common 29.19.19 → 29.19.21

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,1390 +1,1395 @@
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 Club {
15
- id String @id @default(cuid())
16
- name String
17
- street String
18
- userId String
19
- price Int?
20
- events BashEvent[]
21
- members ClubMember[]
22
- admin ClubAdmin[]
23
- }
24
-
25
- model ClubAdmin {
26
- id String @id @default(cuid())
27
- admin User @relation(fields: [userId], references: [id], onDelete: Cascade)
28
- userId String
29
- club Club @relation(fields: [clubId], references: [id], onDelete: Cascade)
30
- clubId String
31
- role ClubAdminRole
32
- }
33
-
34
- model ClubMember {
35
- id String @id @default(cuid())
36
- member User @relation(fields: [userId], references: [id], onDelete: Cascade)
37
- userId String
38
- club Club @relation(fields: [clubId], references: [id], onDelete: Cascade)
39
- clubId String
40
- status ClubMemberStatus
41
- statusHistory Json
42
- price Int?
43
- }
44
-
45
- enum ClubAdminRole {
46
- Owner
47
- Admin
48
- Staff
49
- }
50
-
51
- enum ClubMemberStatus {
52
- Active
53
- Inactive
54
- Canceled
55
- Paused
56
- Removed
57
- }
58
-
59
- model BashComment {
60
- id String @id @default(cuid())
61
- creatorId String
62
- creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
63
- content String
64
- reviewId String?
65
- review Review? @relation(fields: [reviewId], references: [id], onDelete: SetNull)
66
- bashEventId String?
67
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
68
- parentCommentId String?
69
- parentComment BashComment? @relation("CommentReplies", fields: [parentCommentId], references: [id], onDelete: Cascade)
70
- replies BashComment[] @relation("CommentReplies")
71
- }
72
-
73
- model Competition {
74
- id String @id @default(cuid())
75
- name String
76
- description String
77
- owner User @relation(fields: [userId], references: [id], onDelete: Cascade)
78
- prizes Prize[]
79
- userId String
80
- sponser CompetitionSponsor[]
81
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
82
- bashEventId String
83
- numberOfPrizes Int
84
- }
85
-
86
- model CompetitionSponsor {
87
- id String @id @default(cuid())
88
- competition Competition @relation(fields: [competitionId], references: [id], onDelete: Cascade)
89
- sponsor User @relation(fields: [userId], references: [id], onDelete: Cascade)
90
- competitionId String
91
- userId String
92
- description String
93
- paidOn String?
94
- }
95
-
96
- model EventTask {
97
- id String @id @default(cuid())
98
- creatorId String
99
- creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
100
- bashEventId String
101
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
102
- description String
103
- assignedToId String?
104
- assignedTo User? @relation("TasksAssignedToMe", fields: [assignedToId], references: [id], onDelete: Cascade)
105
- status TaskStatus?
106
- bashNotificationsReferencingMe BashNotification[]
107
- createdAt DateTime? @default(now())
108
- }
109
-
110
- enum TaskStatus {
111
- Accepted
112
- Rejected
113
- Completed
114
- }
115
-
116
- model Reminder {
117
- id String @id @default(cuid())
118
- creatorId String
119
- creator User @relation("RemindersCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
120
- remindWhoId String?
121
- remindWho User? @relation("RemindersAssignedToMe", fields: [remindWhoId], references: [id], onDelete: Cascade)
122
- remindDateTime DateTime
123
- notificationId String
124
- notification BashNotification @relation(fields: [notificationId], references: [id], onDelete: Cascade)
125
- }
126
-
127
- model BashEventPromoCode {
128
- id String @id @default(cuid())
129
- code String
130
- ticketTierId String
131
- ticketTier TicketTier @relation(fields: [ticketTierId], references: [id])
132
- stripeCouponId String?
133
- discountAmountInCents Int?
134
- discountAmountPercentage Int?
135
- maxRedemptions Int?
136
- redeemBy DateTime?
137
- usedBy User[]
138
-
139
- @@unique([ticketTierId, code])
140
- }
141
-
142
- model BashNotification {
143
- id String @id @default(cuid())
144
- creatorId String
145
- creator User @relation("NotificationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
146
- email String
147
- createdDateTime DateTime @default(now())
148
- message String
149
- image String?
150
- readDateTime DateTime?
151
- taskId String?
152
- eventTask EventTask? @relation(fields: [taskId], references: [id], onDelete: Cascade)
153
- invitationId String?
154
- invitation Invitation? @relation(fields: [invitationId], references: [id], onDelete: Cascade)
155
- bashEventId String?
156
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
157
- reminders Reminder[]
158
- redirectUrl String?
159
-
160
- @@unique([creatorId, email, bashEventId])
161
- @@unique([creatorId, email, invitationId])
162
- @@index([creatorId])
163
- }
164
-
165
- model Invitation {
166
- id String @id @default(cuid())
167
- creatorId String
168
- creator User @relation("InvitationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
169
- email String
170
- sentToId String?
171
- sentTo User? @relation("InvitationsSentToMe", fields: [sentToId], references: [id], onDelete: Cascade)
172
- bashEventId String?
173
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
174
- image String?
175
- phone String?
176
- name String?
177
- message String?
178
- inviteDate DateTime? @default(now())
179
- acceptedDate DateTime?
180
- rejectedDate DateTime?
181
- maybeDate DateTime?
182
- tickets Ticket[] @relation("TicketsForInvitation")
183
- bashNotifications BashNotification[]
184
- associatedBash AssociatedBash?
185
-
186
- @@index([email])
187
- }
188
-
189
- model BashEvent {
190
- id String @id @default(cuid())
191
- title String
192
- creatorId String
193
- creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
194
- description String?
195
- eventType String @default("Other")
196
- startDateTime DateTime? @default(now())
197
- endDateTime DateTime? @default(now())
198
- ticketTiers TicketTier[]
199
- targetAudienceId String? @unique
200
- targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
201
- amountOfGuestsId String? @unique
202
- amountOfGuests AmountOfGuests? @relation(fields: [amountOfGuestsId], references: [id], onDelete: Cascade)
203
- recurrence Recurrence?
204
- vibe String?
205
- occasion String?
206
- dress String?
207
- allowed String?
208
- notAllowed String?
209
- nonProfit Boolean?
210
- nonProfitId String?
211
- privacy Privacy @default(Public)
212
- tickets Ticket[]
213
- reviews Review[]
214
- sponsorships SponsoredEvent[]
215
- investments Investment[]
216
- capacity Int?
217
- location String?
218
- status BashStatus @default(Draft)
219
- tags String[]
220
- coverPhoto String?
221
- media Media[]
222
- club Club? @relation(fields: [clubId], references: [id], onDelete: SetNull)
223
- clubId String?
224
- links EventLink[]
225
- competitions Competition[]
226
- invitations Invitation[]
227
- dateTimePublished DateTime?
228
- comments BashComment[]
229
- includedItems String[]
230
- associatedBashesReferencingMe AssociatedBash[] // maybe rename later to AssociatedWithABash
231
- associatedServicesReferencingMe Service[] // maybe rename later to AssociatedWithAService
232
- bashNotificationsReferencingMe BashNotification[]
233
- checkouts Checkout[]
234
- eventTasks EventTask[]
235
- videoLink String?
236
- subtitle String?
237
- isFeatured Boolean?
238
- isTrending Boolean?
239
- coordinates Coordinates[] // A BashEvent can have multiple sets of coordinates
240
- // stripeAccount StripeAccount[]
241
- rate Rate[]
242
- venueId String? // Nullable, meaning it's optional
243
- venue Venue? @relation(fields: [venueId], references: [id])
244
- }
245
-
246
- model Coordinates {
247
- id Int @id @default(autoincrement())
248
- lat Float?
249
- lng Float?
250
- bashEventId String? // Foreign key to BashEvent, now of type String
251
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id])
252
- }
253
-
254
- model Checkout {
255
- id String @id @default(cuid())
256
- ownerId String
257
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
258
- bashEventId String
259
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
260
- checkoutDateTime DateTime? @default(now())
261
- tickets Ticket[]
262
- stripeCheckoutSessionId String? @unique
263
- bookings Booking[]
264
-
265
- @@index(bashEventId)
266
- }
267
-
268
- model TicketTier {
269
- id String @id @default(cuid())
270
- bashEventId String
271
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
272
- tickets Ticket[]
273
- waitList User[]
274
- price Int @default(0)
275
- title String @default("Free")
276
- sortOrder Int?
277
- description String?
278
- maximumNumberOfTickets Int @default(100)
279
- maximumTicketCount Int @default(100)
280
- isDonationTier Boolean?
281
- hidden Boolean?
282
- promoCodes BashEventPromoCode[]
283
-
284
- @@unique([bashEventId, title])
285
- }
286
-
287
- model Ticket {
288
- id String @id @default(cuid())
289
- ownerId String
290
- owner User @relation("TicketsIOwn", fields: [ownerId], references: [id])
291
- bashEventId String
292
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id])
293
- ticketTierId String?
294
- ticketTier TicketTier? @relation(fields: [ticketTierId], references: [id])
295
- validDate DateTime?
296
- forUserId String?
297
- forUser User? @relation("TicketsISent", fields: [forUserId], references: [id])
298
- fullName String?
299
- email String?
300
- paidOn DateTime?
301
- allowPromiseToPay Boolean?
302
- status TicketStatus?
303
- isFreeGuest Boolean?
304
- geoFenceCheckInUnnecessary Boolean?
305
- checkedInAt DateTime?
306
- checkedOutAt DateTime?
307
- invitationId String?
308
- invitation Invitation? @relation("TicketsForInvitation", fields: [invitationId], references: [id])
309
- checkoutId String?
310
- checkout Checkout? @relation(fields: [checkoutId], references: [id])
311
- ServiceCheckout ServiceCheckout? @relation(fields: [serviceCheckoutId], references: [id])
312
- serviceCheckoutId String?
313
-
314
- @@index([bashEventId])
315
- }
316
-
317
- enum TicketStatus {
318
- Cancelled
319
- Attended
320
- Missed
321
- }
322
-
323
- model ServiceCheckout {
324
- id String @id @default(cuid())
325
- ownerId String
326
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
327
- checkoutDateTime DateTime? @default(now())
328
- tickets Ticket[]
329
- stripeCheckoutSessionId String? @unique
330
- }
331
-
332
- model UserSubscription {
333
- id String @id @default(cuid())
334
- ownerId String @unique
335
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
336
- type UserSubscriptionType
337
- }
338
-
339
- enum UserSubscriptionType {
340
- Free
341
- Premium
342
- VIP
343
- }
344
-
345
- model ServiceSubscription {
346
- id String @id @default(cuid())
347
- ownerId String
348
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
349
- slots Int @default(0)
350
- stripeSubscriptionId String?
351
- }
352
-
353
- enum BookingStatus {
354
- Cancelled
355
- Completed
356
- Missed
357
- }
358
-
359
- model Rate {
360
- id String @id @default(cuid())
361
- serviceMultipleRatesId String?
362
- serviceMultipleRates Service? @relation("MultipleRates", fields: [serviceMultipleRatesId], references: [id], onDelete: Cascade)
363
- bashEventId String?
364
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
365
- waitList User[]
366
- price Int @default(0)
367
- title String @default("Free")
368
- sortOrder Int?
369
- description String?
370
- maximumNumberOfHours Int @default(24)
371
- maximumHourCount Int @default(24)
372
- isDonationTier Boolean?
373
- hidden Boolean?
374
-
375
- // promoCodes BashEventPromoCode[]
376
- @@unique([bashEventId, title])
377
- }
378
-
379
- model Booking {
380
- id String @id @default(cuid())
381
- serviceId String
382
- service Service @relation(fields: [serviceId], references: [id])
383
- validDate DateTime?
384
- forUserId String?
385
- forUser User? @relation(fields: [forUserId], references: [id])
386
- fullName String?
387
- email String?
388
- paidOn DateTime?
389
- requireDeposit Boolean?
390
- status BookingStatus?
391
- geoFenceCheckInUnnecessary Boolean?
392
- checkedInAt DateTime?
393
- checkedOutAt DateTime?
394
- checkoutId String?
395
- checkout Checkout? @relation(fields: [checkoutId], references: [id])
396
-
397
- @@index([serviceId])
398
- @@index([forUserId])
399
- @@index([checkoutId])
400
- }
401
-
402
- model unusedModelButNeededForSomeTypesToBeDefinedForTypescript {
403
- id String @id @default(cuid())
404
- doNotUseVibeEnum BashEventVibeTags @default(Wild)
405
- doNotUseDressEnum BashEventDressTags @default(Casual)
406
- doNotUseBashEventType BashEventType @default(Other)
407
- doNotUseDayOfWeek DayOfWeek @default(Sunday)
408
- }
409
-
410
- model Recurrence {
411
- id String @id @default(cuid())
412
- interval Int @default(1)
413
- bashEventId String @unique
414
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
415
- frequency RecurringFrequency @default(Never)
416
- ends DateTime @default(now())
417
- repeatOnDays DayOfWeek[]
418
- repeatOnDayOfMonth Int?
419
- repeatYearlyDate DateTime?
420
- }
421
-
422
- enum DayOfWeek {
423
- Sunday
424
- Monday
425
- Tuesday
426
- Wednesday
427
- Thursday
428
- Friday
429
- Saturday
430
- }
431
-
432
- enum RecurringFrequency {
433
- Never
434
- Daily
435
- Weekly
436
- Monthly
437
- Yearly
438
- }
439
-
440
- enum BashEventVibeTags {
441
- Wild
442
- Calm
443
- }
444
-
445
- enum BashEventDressTags {
446
- Casual
447
- BusinessCasual
448
- Formal
449
- }
450
-
451
- // enum ServicesTags {
452
- // Fast
453
- // Reliable
454
- // AwardRecipient
455
- // }
456
-
457
- enum BashEventType {
458
- AfterParty
459
- AnimeAndCosplayFestival
460
- AnniversaryCelebration
461
- ArtExhibitOpening
462
- ArtAndCraftNight
463
- BBQCookout
464
- BabyShower
465
- BachelorOrBacheloretteParty
466
- BeachParty
467
- Birthday
468
- BoatPartyOrCruise
469
- Bonfire
470
- BookClubMeeting
471
- BridalShower
472
- BrunchGathering
473
- CarShow
474
- CarnivalAndFair
475
- CasinoNight
476
- CasualMixer
477
- CharityBall
478
- CharityFundraiser
479
- ChristmasParty
480
- ChurchEvent
481
- CircusOrCarnivalParty
482
- CocktailParty
483
- CollegeParty_FraternityOrSorority
484
- ComedyShowOrStandUpComedyNight
485
- ComicConvention
486
- Competition
487
- Concert
488
- CookingCompetition
489
- CorporateEventOrOfficeParty
490
- CostumeParty_Theme_Based
491
- CulturalFestival
492
- DanceParty
493
- DesertRave
494
- DiscoNight
495
- EasterGathering
496
- EngagementParty
497
- ESportsGamingTournament
498
- ExclusiveLuxuryRetreat
499
- FantasyThemedParty
500
- FashionShow
501
- Fireside
502
- FitnessFestival
503
- FlashMob
504
- Festival
505
- FestivalFilm
506
- FestivalFood
507
- FundraisingEvent
508
- GalaDinner
509
- GameNight
510
- GamingEvent
511
- GardenParty
512
- GoingAwayPartyOrFarewell
513
- GraduationParty
514
- HalloweenCostumeParty
515
- HanukkahParty
516
- HistoricalEraParty
517
- HolidayParty
518
- HouseParty
519
- HousewarmingParty
520
- KaraokeNight
521
- KiteFlyingFestival
522
- LiveBandPerformanceInALocalVenue
523
- Luau
524
- MansionParty
525
- MardiGras
526
- MasqueradeBall
527
- MotorcycleRally
528
- MovieNight
529
- MoviePremiere
530
- MusicFestival
531
- NewYearsEveCelebration
532
- OpenMicNight
533
- OutdoorActivity
534
- OutdoorConcert
535
- OutdoorMovieNight_WithAProjector
536
- Parade
537
- Party
538
- PoolParty
539
- Potluck
540
- PotluckVegan
541
- PreParty
542
- ProductLaunch
543
- ProfessionalNetworkingEvent
544
- Rave_General
545
- RetirementCelebration
546
- Reunion_FamilyOrSchoolOrFriends
547
- SafariAdventureParty
548
- SchoolEvent_MiddleSchoolOrHighSchoolOrCollege
549
- ScienceFictionThemedParty
550
- SocialClubEvent
551
- SportsTournament
552
- SportsWatchParty
553
- SuperheroThemedParty
554
- SurfCompetition
555
- ThanksgivingDinner
556
- ThemedCostumeParty
557
- ThemedDinnerParty
558
- ThemedPubCrawl
559
- Tournament
560
- TravelAndTradeShow
561
- TriviaNight
562
- ValentinesDayParty
563
- WeddingReception
564
- WelcomeHomeParty
565
- WellnessFestival
566
- WineTastingEvent
567
- Other
568
- }
569
-
570
- model CustomBashEventType {
571
- id String @id @default(cuid())
572
- key String @unique
573
- displayName String
574
- }
575
-
576
- model AmountOfGuests {
577
- id String @id @default(cuid())
578
- bashEvent BashEvent?
579
- exhibitor Exhibitor?
580
- eventService EventService?
581
- entertainmentService EntertainmentService?
582
- vendor Vendor?
583
- sponsor Sponsor?
584
-
585
- minimum Int? @default(10)
586
- ideal Int? @default(35)
587
- showMinimumGuests Boolean @default(true)
588
- showIdealGuests Boolean @default(true)
589
- venueId String?
590
- organizationId String?
591
- }
592
-
593
- enum Privacy {
594
- Public
595
- ConnectionsOnly
596
- InviteOnly
597
- }
598
-
599
- model TargetAudience {
600
- id String @id @default(cuid())
601
- ageRange AgeRange[]
602
- secondaryAgeRange AgeRange[]
603
- gender Gender[]
604
- secondaryGender Gender[]
605
- occupation Occupation[]
606
- secondaryOccupation Occupation[]
607
- education Education[]
608
- secondaryEducation Education[]
609
- showOnDetailPage Boolean @default(true)
610
- bashEvent BashEvent?
611
- service Service?
612
- }
613
-
614
- enum AgeRange {
615
- Sixteen_17
616
- Eighteen_20
617
- TwentyOne_25
618
- TwentySix_34
619
- ThirtyFive_49
620
- Fifty_64
621
- SixtyFivePlus
622
- NoPreference
623
- }
624
-
625
- enum Occupation {
626
- Students
627
- Entrepreneurs
628
- SmallBusinesses
629
- Corporations
630
- Professionals
631
- Creatives
632
- AngelInvestors
633
- FamilyOffices
634
- Retirees
635
- Academics
636
- Government
637
- NonProfits
638
- NoPreference
639
- }
640
-
641
- enum Education {
642
- HighSchool
643
- SomeCollege
644
- InCollege
645
- Bachelors
646
- GraduateStudent
647
- Masters
648
- Doctorate
649
- NoPreference
650
- }
651
-
652
- enum BashStatus {
653
- Draft
654
- PreSale
655
- Published
656
- }
657
-
658
- enum ServiceStatus {
659
- Draft
660
- Created
661
- }
662
-
663
- enum ServiceCondition {
664
- Pending
665
- Published
666
- Suspended
667
- Deactivated
668
- }
669
-
670
- enum VolunteerServiceStatus {
671
- Draft
672
- Pending
673
- Created
674
- }
675
-
676
- model DocumentID {
677
- id String @id @default(cuid())
678
- givenName String?
679
- familyName String?
680
- middleName String?
681
- suffix String?
682
- street String?
683
- city String?
684
- state String?
685
- stateName String?
686
- zipCode String?
687
- idNumber String?
688
- expires String?
689
- dob String?
690
- issueDate String?
691
- idType String?
692
- userId String? @unique
693
- user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
694
- }
695
-
696
- model EventLink {
697
- id String @id @default(cuid())
698
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
699
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
700
- linkId String
701
- bashEventId String
702
- }
703
-
704
- enum Gender {
705
- Male
706
- Female
707
- Other
708
- NoPreference
709
- }
710
-
711
- model Investment {
712
- id String @id @default(cuid())
713
- investorId String
714
- bashEventId String
715
- investor User @relation(fields: [investorId], references: [id], onDelete: Cascade)
716
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
717
- amount Float
718
- type InvestmentType
719
- paidOn String?
720
- }
721
-
722
- enum InvestmentType {
723
- Equity
724
- Event
725
- }
726
-
727
- model Link {
728
- id String @id @default(cuid())
729
- url String
730
- type String?
731
- icon String?
732
- eventLinks EventLink[]
733
- userLinks UserLink[]
734
- serviceLinks ServiceLink[]
735
- volunteerServiceId String?
736
- volunteerService VolunteerService? @relation("VolunteerServiceLinks", fields: [volunteerServiceId], references: [id])
737
- }
738
-
739
- model Media {
740
- id String @id @default(cuid())
741
- url String @unique
742
- type MediaType
743
- mimetype String?
744
- bashEventsReferencingMe BashEvent[]
745
- sponsoredEventsReferencingMe SponsoredEvent[]
746
- serviceReferencingMe Service[]
747
- volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
748
- volunteerServiceId String?
749
- }
750
-
751
- enum MediaType {
752
- Unknown
753
- Empty
754
- Image
755
- Video
756
- }
757
-
758
- model Prize {
759
- id String @id @default(cuid())
760
- prizeWorth Float?
761
- prizeType PrizeType
762
- name String
763
- prizeLevel Int
764
- description String
765
- competition Competition? @relation(fields: [competitionId], references: [id], onDelete: SetNull)
766
- competitionId String?
767
- paidOn String?
768
- winner User? @relation(fields: [winnerUserId], references: [id], onDelete: Cascade)
769
- winnerUserId String?
770
- }
771
-
772
- enum PrizeType {
773
- Monetary
774
- Merchandise
775
- Service
776
- Combo
777
- }
778
-
779
- model Review {
780
- id String @id @default(cuid())
781
- rating Int
782
- creatorId String
783
- creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
784
- bashEventId String
785
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
786
- comments BashComment[]
787
- }
788
-
789
- model GoogleReview {
790
- id String @id @default(cuid())
791
- author_name String?
792
- rating Float
793
- text String?
794
- createdAt DateTime @default(now())
795
- serviceId String
796
- // service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
797
- }
798
-
799
- model Session {
800
- id String @id @default(cuid())
801
- sessionToken String @unique
802
- userId String
803
- expires DateTime
804
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
805
-
806
- @@index([userId])
807
- }
808
-
809
- enum Sex {
810
- Male
811
- Female
812
- Other
813
- }
814
-
815
- model SponsoredEvent {
816
- id String @id @default(cuid())
817
- amount Float?
818
- paidOn String?
819
- sponsorType SponsorType
820
- sponsorId String
821
- bashEventId String
822
- sponsor User @relation(fields: [sponsorId], references: [id], onDelete: Cascade)
823
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
824
- media Media[]
825
- }
826
-
827
- enum SponsorType {
828
- Marketing
829
- Giveaway
830
- Awareness
831
- Trade
832
- CompetitionPrizeProvider
833
- }
834
-
835
- model User {
836
- id String @id @default(cuid())
837
- email String @unique
838
- createdOn DateTime @default(now())
839
- stripeCustomerId String? @unique
840
- stripeAccountId String? @unique
841
- isSuperUser Boolean @default(false)
842
- googleCalendarAccess String?
843
- givenName String?
844
- familyName String?
845
- hash String?
846
- emailVerified DateTime?
847
- image String?
848
- uploadedImage String?
849
- dob DateTime?
850
- gender Gender?
851
- sex Sex?
852
- roles UserRole[] @default([User])
853
- ownedServices Service[] @relation("OwnedService")
854
- createdServices Service[] @relation("CreatedService")
855
- createdEvents BashEvent[] @relation("CreatedEvent")
856
- ticketsISent Ticket[] @relation("TicketsISent")
857
- ticketsIOwn Ticket[] @relation("TicketsIOwn")
858
- reviews Review[]
859
- sponsorships SponsoredEvent[]
860
- investments Investment[]
861
- sessions Session[]
862
- eventTasks EventTask[]
863
- clubMembers ClubMember[]
864
- clubAdmins ClubAdmin[]
865
- links UserLink[]
866
- status UserStatus
867
- competitions Competition[]
868
- competitionSponsorships CompetitionSponsor[]
869
- competitionPrizes Prize[]
870
- userRatingGiven UserRatingGiven[]
871
- userRating UserRating[]
872
- magicLink String?
873
- magicLinkExpiration DateTime?
874
- magicLinkUsed DateTime?
875
- idVerified DateTime?
876
- street String?
877
- city String?
878
- state String?
879
- zipCode String?
880
- country String? @default("US")
881
- phone String?
882
- documentIDId String? @unique
883
- documentID DocumentID?
884
- comment BashComment[]
885
- associatedBashes AssociatedBash[]
886
- associatedServices AssociatedService[]
887
- invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
888
- invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
889
- notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
890
- remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
891
- remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
892
- eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
893
- checkouts Checkout[]
894
- ticketTiersWaitListsIveJoined TicketTier[]
895
- contacts Contact[]
896
- bashEventPromoCodesIUsed BashEventPromoCode[]
897
- serviceCheckouts ServiceCheckout[]
898
- bookingForMe Booking[]
899
- userSubscription UserSubscription?
900
- serviceSubcriptions ServiceSubscription[]
901
- volunteerService VolunteerService[]
902
- rate Rate[]
903
- stripeAccounts StripeAccount[]
904
- }
905
-
906
- model Contact {
907
- id String @id @default(cuid())
908
- contactOwnerId String
909
- contactOwner User @relation(fields: [contactOwnerId], references: [id], onDelete: Cascade)
910
- contactEmail String?
911
- fullName String?
912
- phone String?
913
- requestToConnectSent DateTime?
914
- requestToConnectAccepted DateTime?
915
-
916
- @@unique([contactOwnerId, contactEmail])
917
- @@index([contactEmail])
918
- }
919
-
920
- // anyone that is invited to the bash, is an organizer of a bash, and or the creator/owner of the bash...for having others (including services) edit or post about a bash in the bashfeed
921
- model AssociatedBash {
922
- id String @id @default(cuid())
923
- bashEventId String
924
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
925
- invitationId String? @unique
926
- invitation Invitation? @relation(fields: [invitationId], references: [id])
927
- ownerEmail String?
928
- ownerUserId String?
929
- owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
930
- isOrganizer Boolean?
931
- isFavorite Boolean?
932
- service Service[]
933
-
934
- @@unique([ownerEmail, bashEventId])
935
- }
936
-
937
- // anyone that is invited to be an organizer of a service profile or is the creator/owner...for having others edit or post about a service in the bashfeed (but the service must be associated with a bash to post)
938
- model AssociatedService {
939
- id String @id @default(cuid())
940
- serviceId String
941
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
942
- // referralId String? @unique
943
- // referral Referral? @relation(fields: [referralId], references: [id])
944
- ownerEmail String?
945
- ownerUserId String?
946
- owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
947
- isOrganizer Boolean?
948
- isFavorite Boolean?
949
-
950
- @@unique([ownerEmail, serviceId])
951
- }
952
-
953
- // Common data for all services; 1-1 relation between each individual service model such as Venue
954
- model Service {
955
- id String @id @default(cuid())
956
-
957
- serviceType ServiceTypes
958
- serviceStatus ServiceStatus @default(Draft)
959
- serviceCondition ServiceCondition @default(Pending)
960
-
961
- // current owner
962
- ownerId String?
963
- owner User? @relation("OwnedService", fields: [ownerId], references: [id])
964
-
965
- // original creator
966
- creatorId String?
967
- creator User? @relation("CreatedService", fields: [creatorId], references: [id])
968
-
969
- createdAt DateTime @default(now())
970
- updatedAt DateTime @updatedAt
971
-
972
- associatedBashesReferencingMe AssociatedBash[]
973
- associatedServicesReferencingMe AssociatedService[]
974
-
975
- serviceName String?
976
- tagline String?
977
-
978
- // this is not the business info but that which is associated with the service
979
- place String?
980
- googlePlaceId String?
981
- street String?
982
- city String?
983
- state String?
984
- zipCode String?
985
- country String?
986
- description String?
987
- // email String?
988
- // phone String?
989
-
990
- pocName String?
991
- pocPhoneNumber String?
992
- pocBusinessEmail String?
993
-
994
- additionalInfo String?
995
- coverPhoto String?
996
-
997
- mission String?
998
- communityInvolvement String?
999
- emergencyContact String?
1000
- contactDetails String?
1001
- rates Rate[] @relation("MultipleRates")
1002
- cancellationPolicy String?
1003
- refundPolicy String?
1004
- insurancePolicy String?
1005
- // hoursOfOperation Json? @default("{}")
1006
-
1007
- stripeAccountId String?
1008
- stripeAccount StripeAccount? @relation(fields: [stripeAccountId], references: [id], onDelete: Restrict)
1009
-
1010
- targetAudienceId String? @unique
1011
- targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
1012
-
1013
- visibility VisibilityPreference @default(Public)
1014
- availableDateTimes Availability[] @relation("AvailableDateTimes")
1015
-
1016
- bashesInterestedIn BashEventType[]
1017
- bookings Booking[]
1018
- media Media[]
1019
- serviceLinks ServiceLink[]
1020
-
1021
- volunteerServiceId String?
1022
- volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
1023
- eventService EventService?
1024
- entertainmentService EntertainmentService?
1025
- vendor Vendor?
1026
- exhibitor Exhibitor?
1027
- sponsor Sponsor?
1028
- venue Venue?
1029
- organization Organization?
1030
-
1031
- // googleReviews GoogleReview[]
1032
-
1033
- bashEvent BashEvent[] // because a service needs to be associated with a bash to post to the bashfeed
1034
- }
1035
-
1036
- model StripeAccount {
1037
- id String @id @default(cuid())
1038
-
1039
- ownerId String
1040
- owner User @relation(fields: [ownerId], references: [id])
1041
-
1042
- stripeAccountId String
1043
-
1044
- createdAt DateTime @default(now())
1045
- updatedAt DateTime @updatedAt
1046
-
1047
- service Service[]
1048
-
1049
- @@index([ownerId])
1050
- }
1051
-
1052
- model VolunteerService {
1053
- id String @id @default(cuid())
1054
- // service Service
1055
- userId String?
1056
- user User? @relation(fields: [userId], references: [id])
1057
- serviceRangeId String?
1058
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1059
- links Link[] @relation("VolunteerServiceLinks")
1060
- availableDateTimes Availability[] @relation("AvailableDateTimes")
1061
- fullName String?
1062
- address String?
1063
- email String?
1064
- phone String?
1065
- agreedToAgreement Boolean? @default(false)
1066
- description String?
1067
- status VolunteerServiceStatus?
1068
- media Media[]
1069
- Service Service[]
1070
- }
1071
-
1072
- model EventService {
1073
- id String @id @default(cuid())
1074
- serviceId String @unique
1075
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1076
- serviceRangeId String?
1077
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1078
- eventServiceTypes EventServiceType[]
1079
- eventServiceSubType String?
1080
- yearsOfExperience YearsOfExperience
1081
- crowdSizeId String? @unique
1082
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1083
- goodsOrServices String[]
1084
- menuItems String?
1085
- venueTypes String[]
1086
- secondaryVenueTypes String[] @default([])
1087
- }
1088
-
1089
- model EntertainmentService {
1090
- id String @id @default(cuid())
1091
- serviceId String @unique
1092
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1093
- serviceRangeId String?
1094
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1095
- entertainmentServiceTypes EntertainmentServiceType[]
1096
- entertainmentServiceSubType String?
1097
- genre MusicGenreType?
1098
- yearsOfExperience YearsOfExperience
1099
- crowdSizeId String? @unique
1100
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1101
- goodsOrServices String[]
1102
- venueTypes String[]
1103
- secondaryVenueTypes String[] @default([])
1104
- }
1105
-
1106
- model Vendor {
1107
- id String @id @default(cuid())
1108
- serviceId String @unique
1109
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1110
- serviceRangeId String?
1111
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1112
- yearsOfExperience YearsOfExperience
1113
- crowdSizeId String? @unique
1114
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1115
- goodsOrServices String[]
1116
- menuItems String?
1117
- venueTypes String[]
1118
- secondaryVenueTypes String[] @default([])
1119
- }
1120
-
1121
- model Exhibitor {
1122
- id String @id @default(cuid())
1123
- serviceId String @unique
1124
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1125
- serviceRangeId String?
1126
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1127
- yearsOfExperience YearsOfExperience
1128
- crowdSizeId String? @unique
1129
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1130
- goodsOrServices String[]
1131
- venueTypes String[]
1132
- secondaryVenueTypes String[] @default([])
1133
- }
1134
-
1135
- model Sponsor {
1136
- id String @id @default(cuid())
1137
- serviceId String @unique
1138
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1139
- serviceRangeId String?
1140
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1141
- yearsOfExperience YearsOfExperience
1142
- crowdSizeId String? @unique
1143
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1144
- goodsOrServices String[]
1145
- menuItems String?
1146
- }
1147
-
1148
- model Venue {
1149
- id String @id @default(cuid())
1150
- serviceId String @unique
1151
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1152
- // serviceConnectionId String? //Check: ?
1153
- // serviceConnection String?
1154
- yearsInBusiness YearsOfExperience @default(LessThanOneYear)
1155
- amenities String[]
1156
- menuItems String?
1157
- features String[]
1158
- venueTypes String[]
1159
- secondaryVenueTypes String[] @default([])
1160
- pitch String?
1161
- capacity Int?
1162
- trademark Boolean?
1163
- manager Boolean?
1164
- allowed String?
1165
- notAllowed String?
1166
- vibe String?
1167
- dress String?
1168
-
1169
- pricingPlan PricingPlan? @default(Percentage)
1170
- percentageRate Float? @default(0.15)
1171
- subscriptionStatus SubscriptionStatus?
1172
- subscriptionStartDate DateTime?
1173
-
1174
- bashEvents BashEvent[]
1175
- }
1176
-
1177
- enum PricingPlan {
1178
- Percentage
1179
- Subscription
1180
- }
1181
-
1182
- enum SubscriptionStatus {
1183
- Active
1184
- Canceled
1185
- Suspended
1186
- Expired
1187
- }
1188
-
1189
- model Organization {
1190
- id String @id @default(cuid())
1191
- serviceId String @unique
1192
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1193
- organizationType OrganizationType[]
1194
- goodsOrServices String[]
1195
- venueTypes String[]
1196
- secondaryVenueTypes String[] @default([])
1197
- }
1198
-
1199
- enum EventServiceType {
1200
- Investor
1201
- LongTermLoan
1202
- ShortTermLoan
1203
- EventPlanning
1204
- Caterer
1205
- Cleaner
1206
- Decorator
1207
- InteriorDesigner
1208
- RentalEquipmentProvider
1209
- FoodAndBeverageProvider
1210
- MediaCapture
1211
- AVTechnician
1212
- GraphicDesigner
1213
- Influencer
1214
- Promoter
1215
- CelebrityAppearance
1216
- CrewHand
1217
- EventManager
1218
- VirtualAssistant
1219
- Consulting
1220
- Transportation
1221
- }
1222
-
1223
- enum EntertainmentServiceType {
1224
- Emcees
1225
- DJs
1226
- Bands
1227
- SoloMusicians
1228
- Comedy
1229
- VarietyActs
1230
- PerformanceArtists
1231
- Magic
1232
- Dancers
1233
- Aerialists
1234
- Impersonators
1235
- Speakers
1236
- Auctioneers
1237
- }
1238
-
1239
- enum OrganizationType {
1240
- Church
1241
- GreekLife
1242
- SocialClub
1243
- Nonprofit
1244
- Corporation
1245
- EducationalInstitution
1246
- Sports
1247
- Government
1248
- Cultural
1249
- Lifestyle
1250
- Political
1251
- Tourism
1252
- Youth
1253
- Senior
1254
- Tradeshow
1255
- Conference
1256
- FoodAndBeverage
1257
- TechAndStartups
1258
- }
1259
-
1260
- enum YearsOfExperience {
1261
- LessThanOneYear
1262
- OneToThreeYears
1263
- ThreeToFiveYears
1264
- FivePlusYears
1265
- }
1266
-
1267
- model ServiceRange {
1268
- id String @id @default(cuid())
1269
- min Int @default(0)
1270
- max Int @default(50)
1271
- volunteerServices VolunteerService[]
1272
- entertainmentServices EntertainmentService[]
1273
- EventService EventService[]
1274
- Vendor Vendor[]
1275
- Exhibitor Exhibitor[]
1276
- Sponsor Sponsor[]
1277
- }
1278
-
1279
- // different days of the week have different rates
1280
- // can block of certain dates of the year and days of the week as being closed
1281
- // can have special rates on different days of the year (single or range)
1282
- model Availability {
1283
- id String @id @default(cuid())
1284
- dayOfWeek Int
1285
- startDateTime DateTime @db.Time
1286
- endDateTime DateTime @db.Time
1287
- serviceId String?
1288
- service Service? @relation("AvailableDateTimes", fields: [serviceId], references: [id])
1289
- volunteerServiceId String?
1290
- volunteerService VolunteerService? @relation("AvailableDateTimes", fields: [volunteerServiceId], references: [id])
1291
- }
1292
-
1293
- enum VisibilityPreference {
1294
- Public
1295
- Private
1296
- }
1297
-
1298
- enum MusicGenreType {
1299
- Classical
1300
- Rock
1301
- HipHop
1302
- Country
1303
- Pop
1304
- EDM
1305
- Indie
1306
- Acoustic
1307
- }
1308
-
1309
- enum UserRole {
1310
- User
1311
- Vendor
1312
- Sponsor
1313
- Investor
1314
- LoanProvider
1315
- VenueProvider
1316
- ServiceProvider
1317
- SuperAdmin
1318
- Exhibitor
1319
- }
1320
-
1321
- model UserLink {
1322
- id String @id @default(cuid())
1323
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1324
- linkId String
1325
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1326
- userId String
1327
- }
1328
-
1329
- model UserRating {
1330
- id String @id @default(cuid())
1331
- rating Int
1332
- comment String?
1333
- givenBy UserRatingGiven @relation(fields: [userRatingGivenId], references: [id], onDelete: Cascade)
1334
- userRatingGivenId String
1335
- givenTo User @relation(fields: [userId], references: [id], onDelete: Cascade)
1336
- userId String
1337
- }
1338
-
1339
- model UserRatingGiven {
1340
- id String @id @default(cuid())
1341
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1342
- userId String
1343
- UserRating UserRating[]
1344
- }
1345
-
1346
- enum UserStatus {
1347
- Active
1348
- Inactive
1349
- Suspended
1350
- Deactivated
1351
- }
1352
-
1353
- model VerificationToken {
1354
- identifier String
1355
- token String @unique
1356
- expires DateTime
1357
-
1358
- @@unique([identifier, token])
1359
- }
1360
-
1361
- model ServiceLink {
1362
- id String @id @default(cuid())
1363
- serviceId String
1364
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1365
- linkId String
1366
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1367
-
1368
- @@index([serviceId])
1369
- }
1370
-
1371
- enum ServiceTypes {
1372
- EventServices
1373
- EntertainmentServices
1374
- Vendors
1375
- Exhibitors
1376
- Sponsors
1377
- Venues
1378
- Organizations
1379
- }
1380
-
1381
- enum EntityType {
1382
- EVENT_SERVICE
1383
- ENTERTAINMENT_SERVICE
1384
- VENDOR
1385
- EXHIBITOR
1386
- SPONSOR
1387
- VENUE
1388
- ORGANIZATION
1389
- BASH_EVENT // For BashEvents
1390
- }
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 Club {
15
+ id String @id @default(cuid())
16
+ name String
17
+ street String
18
+ userId String
19
+ price Int?
20
+ events BashEvent[]
21
+ members ClubMember[]
22
+ admin ClubAdmin[]
23
+ }
24
+
25
+ model ClubAdmin {
26
+ id String @id @default(cuid())
27
+ admin User @relation(fields: [userId], references: [id], onDelete: Cascade)
28
+ userId String
29
+ club Club @relation(fields: [clubId], references: [id], onDelete: Cascade)
30
+ clubId String
31
+ role ClubAdminRole
32
+ }
33
+
34
+ model ClubMember {
35
+ id String @id @default(cuid())
36
+ member User @relation(fields: [userId], references: [id], onDelete: Cascade)
37
+ userId String
38
+ club Club @relation(fields: [clubId], references: [id], onDelete: Cascade)
39
+ clubId String
40
+ status ClubMemberStatus
41
+ statusHistory Json
42
+ price Int?
43
+ }
44
+
45
+ enum ClubAdminRole {
46
+ Owner
47
+ Admin
48
+ Staff
49
+ }
50
+
51
+ enum ClubMemberStatus {
52
+ Active
53
+ Inactive
54
+ Canceled
55
+ Paused
56
+ Removed
57
+ }
58
+
59
+ model BashComment {
60
+ id String @id @default(cuid())
61
+ creatorId String
62
+ creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
63
+ content String
64
+ reviewId String?
65
+ review Review? @relation(fields: [reviewId], references: [id], onDelete: SetNull)
66
+ bashEventId String?
67
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
68
+ parentCommentId String?
69
+ parentComment BashComment? @relation("CommentReplies", fields: [parentCommentId], references: [id], onDelete: Cascade)
70
+ replies BashComment[] @relation("CommentReplies")
71
+ }
72
+
73
+ model Competition {
74
+ id String @id @default(cuid())
75
+ name String
76
+ description String
77
+ owner User @relation(fields: [userId], references: [id], onDelete: Cascade)
78
+ prizes Prize[]
79
+ userId String
80
+ sponser CompetitionSponsor[]
81
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
82
+ bashEventId String
83
+ numberOfPrizes Int
84
+ }
85
+
86
+ model CompetitionSponsor {
87
+ id String @id @default(cuid())
88
+ competition Competition @relation(fields: [competitionId], references: [id], onDelete: Cascade)
89
+ sponsor User @relation(fields: [userId], references: [id], onDelete: Cascade)
90
+ competitionId String
91
+ userId String
92
+ description String
93
+ paidOn String?
94
+ }
95
+
96
+ model EventTask {
97
+ id String @id @default(cuid())
98
+ creatorId String
99
+ creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
100
+ bashEventId String
101
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
102
+ description String
103
+ assignedToId String?
104
+ assignedTo User? @relation("TasksAssignedToMe", fields: [assignedToId], references: [id], onDelete: Cascade)
105
+ status TaskStatus?
106
+ bashNotificationsReferencingMe BashNotification[]
107
+ createdAt DateTime? @default(now())
108
+ }
109
+
110
+ enum TaskStatus {
111
+ Accepted
112
+ Rejected
113
+ Completed
114
+ }
115
+
116
+ model Reminder {
117
+ id String @id @default(cuid())
118
+ creatorId String
119
+ creator User @relation("RemindersCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
120
+ remindWhoId String?
121
+ remindWho User? @relation("RemindersAssignedToMe", fields: [remindWhoId], references: [id], onDelete: Cascade)
122
+ remindDateTime DateTime
123
+ notificationId String
124
+ notification BashNotification @relation(fields: [notificationId], references: [id], onDelete: Cascade)
125
+ }
126
+
127
+ model BashEventPromoCode {
128
+ id String @id @default(cuid())
129
+ code String
130
+ ticketTierId String
131
+ ticketTier TicketTier @relation(fields: [ticketTierId], references: [id])
132
+ stripeCouponId String?
133
+ discountAmountInCents Int?
134
+ discountAmountPercentage Int?
135
+ maxRedemptions Int?
136
+ redeemBy DateTime?
137
+ usedBy User[]
138
+
139
+ @@unique([ticketTierId, code])
140
+ }
141
+
142
+ model BashNotification {
143
+ id String @id @default(cuid())
144
+ creatorId String
145
+ creator User @relation("NotificationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
146
+ email String
147
+ createdDateTime DateTime @default(now())
148
+ message String
149
+ image String?
150
+ readDateTime DateTime?
151
+ taskId String?
152
+ eventTask EventTask? @relation(fields: [taskId], references: [id], onDelete: Cascade)
153
+ invitationId String?
154
+ invitation Invitation? @relation(fields: [invitationId], references: [id], onDelete: Cascade)
155
+ bashEventId String?
156
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
157
+ reminders Reminder[]
158
+ redirectUrl String?
159
+
160
+ @@unique([creatorId, email, bashEventId])
161
+ @@unique([creatorId, email, invitationId])
162
+ @@index([creatorId])
163
+ }
164
+
165
+ model Invitation {
166
+ id String @id @default(cuid())
167
+ creatorId String
168
+ creator User @relation("InvitationsCreatedByMe", fields: [creatorId], references: [id], onDelete: Cascade)
169
+ email String
170
+ sentToId String?
171
+ sentTo User? @relation("InvitationsSentToMe", fields: [sentToId], references: [id], onDelete: Cascade)
172
+ bashEventId String?
173
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
174
+ image String?
175
+ phone String?
176
+ name String?
177
+ message String?
178
+ inviteDate DateTime? @default(now())
179
+ acceptedDate DateTime?
180
+ rejectedDate DateTime?
181
+ maybeDate DateTime?
182
+ tickets Ticket[] @relation("TicketsForInvitation")
183
+ bashNotifications BashNotification[]
184
+ associatedBash AssociatedBash?
185
+
186
+ @@index([email])
187
+ }
188
+
189
+ model BashEvent {
190
+ id String @id @default(cuid())
191
+ title String
192
+ creatorId String
193
+ creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
194
+ description String?
195
+ eventType String @default("Other")
196
+ startDateTime DateTime? @default(now())
197
+ endDateTime DateTime? @default(now())
198
+ ticketTiers TicketTier[]
199
+ targetAudienceId String? @unique
200
+ targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
201
+ amountOfGuestsId String? @unique
202
+ amountOfGuests AmountOfGuests? @relation(fields: [amountOfGuestsId], references: [id], onDelete: Cascade)
203
+ recurrence Recurrence?
204
+ vibe String?
205
+ occasion String?
206
+ dress String?
207
+ allowed String?
208
+ notAllowed String?
209
+ nonProfit Boolean?
210
+ nonProfitId String?
211
+ privacy Privacy @default(Public)
212
+ tickets Ticket[]
213
+ reviews Review[]
214
+ sponsorships SponsoredEvent[]
215
+ investments Investment[]
216
+ capacity Int?
217
+ location String?
218
+ status BashStatus @default(Draft)
219
+ tags String[]
220
+ coverPhoto String?
221
+ media Media[]
222
+ club Club? @relation(fields: [clubId], references: [id], onDelete: SetNull)
223
+ clubId String?
224
+ links EventLink[]
225
+ competitions Competition[]
226
+ invitations Invitation[]
227
+ dateTimePublished DateTime?
228
+ comments BashComment[]
229
+ includedItems String[]
230
+ associatedBashesReferencingMe AssociatedBash[] // maybe rename later to AssociatedWithABash
231
+ associatedServicesReferencingMe Service[] // maybe rename later to AssociatedWithAService
232
+ bashNotificationsReferencingMe BashNotification[]
233
+ checkouts Checkout[]
234
+ eventTasks EventTask[]
235
+ videoLink String?
236
+ subtitle String?
237
+ isFeatured Boolean?
238
+ isTrending Boolean?
239
+ coordinates Coordinates[] // A BashEvent can have multiple sets of coordinates
240
+ // stripeAccount StripeAccount[]
241
+ rate Rate[]
242
+ venueId String? // Nullable, meaning it's optional
243
+ venue Venue? @relation(fields: [venueId], references: [id])
244
+ }
245
+
246
+ model Coordinates {
247
+ id Int @id @default(autoincrement())
248
+ lat Float?
249
+ lng Float?
250
+ bashEventId String? // Foreign key to BashEvent, now of type String
251
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id])
252
+ }
253
+
254
+ model Checkout {
255
+ id String @id @default(cuid())
256
+ ownerId String
257
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
258
+ bashEventId String
259
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
260
+ checkoutDateTime DateTime? @default(now())
261
+ tickets Ticket[]
262
+ stripeCheckoutSessionId String? @unique
263
+ bookings Booking[]
264
+
265
+ @@index(bashEventId)
266
+ }
267
+
268
+ model TicketTier {
269
+ id String @id @default(cuid())
270
+ bashEventId String
271
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
272
+ tickets Ticket[]
273
+ waitList User[]
274
+ price Int @default(0)
275
+ title String @default("Free")
276
+ sortOrder Int?
277
+ description String?
278
+ maximumNumberOfTickets Int @default(100)
279
+ maximumTicketCount Int @default(100)
280
+ isDonationTier Boolean?
281
+ hidden Boolean?
282
+ promoCodes BashEventPromoCode[]
283
+
284
+ @@unique([bashEventId, title])
285
+ }
286
+
287
+ model Ticket {
288
+ id String @id @default(cuid())
289
+ ownerId String
290
+ owner User @relation("TicketsIOwn", fields: [ownerId], references: [id])
291
+ bashEventId String
292
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id])
293
+ ticketTierId String?
294
+ ticketTier TicketTier? @relation(fields: [ticketTierId], references: [id])
295
+ validDate DateTime?
296
+ forUserId String?
297
+ forUser User? @relation("TicketsISent", fields: [forUserId], references: [id])
298
+ fullName String?
299
+ email String?
300
+ paidOn DateTime?
301
+ allowPromiseToPay Boolean?
302
+ status TicketStatus?
303
+ isFreeGuest Boolean?
304
+ geoFenceCheckInUnnecessary Boolean?
305
+ checkedInAt DateTime?
306
+ checkedOutAt DateTime?
307
+ invitationId String?
308
+ invitation Invitation? @relation("TicketsForInvitation", fields: [invitationId], references: [id])
309
+ checkoutId String?
310
+ checkout Checkout? @relation(fields: [checkoutId], references: [id])
311
+ ServiceCheckout ServiceCheckout? @relation(fields: [serviceCheckoutId], references: [id])
312
+ serviceCheckoutId String?
313
+
314
+ @@index([bashEventId])
315
+ }
316
+
317
+ enum TicketStatus {
318
+ Cancelled
319
+ Attended
320
+ Missed
321
+ }
322
+
323
+ model ServiceCheckout {
324
+ id String @id @default(cuid())
325
+ ownerId String
326
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
327
+ checkoutDateTime DateTime? @default(now())
328
+ tickets Ticket[]
329
+ stripeCheckoutSessionId String? @unique
330
+ }
331
+
332
+ model UserSubscription {
333
+ id String @id @default(cuid())
334
+ ownerId String @unique
335
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
336
+ type UserSubscriptionType
337
+ }
338
+
339
+ enum UserSubscriptionType {
340
+ Free
341
+ Premium
342
+ VIP
343
+ }
344
+
345
+ model ServiceSubscription {
346
+ id String @id @default(cuid())
347
+ ownerId String
348
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
349
+ slots Int @default(0)
350
+ stripeSubscriptionId String?
351
+ }
352
+
353
+ enum BookingStatus {
354
+ Cancelled
355
+ Completed
356
+ Missed
357
+ }
358
+
359
+ model Rate {
360
+ id String @id @default(cuid())
361
+ serviceMultipleRatesId String?
362
+ serviceMultipleRates Service? @relation("MultipleRates", fields: [serviceMultipleRatesId], references: [id], onDelete: Cascade)
363
+ bashEventId String?
364
+ bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
365
+ waitList User[]
366
+ price Int @default(0)
367
+ title String @default("Free")
368
+ sortOrder Int?
369
+ description String?
370
+ maximumNumberOfHours Int @default(24)
371
+ maximumHourCount Int @default(24)
372
+ isDonationTier Boolean?
373
+ hidden Boolean?
374
+
375
+ // promoCodes BashEventPromoCode[]
376
+ @@unique([bashEventId, title])
377
+ }
378
+
379
+ model Booking {
380
+ id String @id @default(cuid())
381
+ serviceId String
382
+ service Service @relation(fields: [serviceId], references: [id])
383
+ validDate DateTime?
384
+ forUserId String?
385
+ forUser User? @relation(fields: [forUserId], references: [id])
386
+ fullName String?
387
+ email String?
388
+ paidOn DateTime?
389
+ requireDeposit Boolean?
390
+ status BookingStatus?
391
+ geoFenceCheckInUnnecessary Boolean?
392
+ checkedInAt DateTime?
393
+ checkedOutAt DateTime?
394
+ checkoutId String?
395
+ checkout Checkout? @relation(fields: [checkoutId], references: [id])
396
+
397
+ @@index([serviceId])
398
+ @@index([forUserId])
399
+ @@index([checkoutId])
400
+ }
401
+
402
+ model unusedModelButNeededForSomeTypesToBeDefinedForTypescript {
403
+ id String @id @default(cuid())
404
+ doNotUseVibeEnum BashEventVibeTags @default(Wild)
405
+ doNotUseDressEnum BashEventDressTags @default(Casual)
406
+ doNotUseBashEventType BashEventType @default(Other)
407
+ doNotUseDayOfWeek DayOfWeek @default(Sunday)
408
+ }
409
+
410
+ model Recurrence {
411
+ id String @id @default(cuid())
412
+ interval Int @default(1)
413
+ bashEventId String @unique
414
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
415
+ frequency RecurringFrequency @default(Never)
416
+ ends DateTime @default(now())
417
+ repeatOnDays DayOfWeek[]
418
+ repeatOnDayOfMonth Int?
419
+ repeatYearlyDate DateTime?
420
+ }
421
+
422
+ enum DayOfWeek {
423
+ Sunday
424
+ Monday
425
+ Tuesday
426
+ Wednesday
427
+ Thursday
428
+ Friday
429
+ Saturday
430
+ }
431
+
432
+ enum RecurringFrequency {
433
+ Never
434
+ Daily
435
+ Weekly
436
+ Monthly
437
+ Yearly
438
+ }
439
+
440
+ enum BashEventVibeTags {
441
+ Wild
442
+ Calm
443
+ }
444
+
445
+ enum BashEventDressTags {
446
+ Casual
447
+ BusinessCasual
448
+ Formal
449
+ }
450
+
451
+ // enum ServicesTags {
452
+ // Fast
453
+ // Reliable
454
+ // AwardRecipient
455
+ // }
456
+
457
+ enum BashEventType {
458
+ AfterParty
459
+ AnimeAndCosplayFestival
460
+ AnniversaryCelebration
461
+ ArtExhibitOpening
462
+ ArtAndCraftNight
463
+ BBQCookout
464
+ BabyShower
465
+ BachelorOrBacheloretteParty
466
+ BeachParty
467
+ Birthday
468
+ BoatPartyOrCruise
469
+ Bonfire
470
+ BookClubMeeting
471
+ BridalShower
472
+ BrunchGathering
473
+ CarShow
474
+ CarnivalAndFair
475
+ CasinoNight
476
+ CasualMixer
477
+ CharityBall
478
+ CharityFundraiser
479
+ ChristmasParty
480
+ ChurchEvent
481
+ CircusOrCarnivalParty
482
+ CocktailParty
483
+ CollegeParty_FraternityOrSorority
484
+ ComedyShowOrStandUpComedyNight
485
+ ComicConvention
486
+ Competition
487
+ Concert
488
+ CookingCompetition
489
+ CorporateEventOrOfficeParty
490
+ CostumeParty_Theme_Based
491
+ CulturalFestival
492
+ DanceParty
493
+ DesertRave
494
+ DiscoNight
495
+ EasterGathering
496
+ EngagementParty
497
+ ESportsGamingTournament
498
+ ExclusiveLuxuryRetreat
499
+ FantasyThemedParty
500
+ FashionShow
501
+ Fireside
502
+ FitnessFestival
503
+ FlashMob
504
+ Festival
505
+ FestivalFilm
506
+ FestivalFood
507
+ FundraisingEvent
508
+ GalaDinner
509
+ GameNight
510
+ GamingEvent
511
+ GardenParty
512
+ GoingAwayPartyOrFarewell
513
+ GraduationParty
514
+ HalloweenCostumeParty
515
+ HanukkahParty
516
+ HistoricalEraParty
517
+ HolidayParty
518
+ HouseParty
519
+ HousewarmingParty
520
+ KaraokeNight
521
+ KiteFlyingFestival
522
+ LiveBandPerformanceInALocalVenue
523
+ Luau
524
+ MansionParty
525
+ MardiGras
526
+ MasqueradeBall
527
+ MotorcycleRally
528
+ MovieNight
529
+ MoviePremiere
530
+ MusicFestival
531
+ NewYearsEveCelebration
532
+ OpenMicNight
533
+ OutdoorActivity
534
+ OutdoorConcert
535
+ OutdoorMovieNight_WithAProjector
536
+ Parade
537
+ Party
538
+ PoolParty
539
+ Potluck
540
+ PotluckVegan
541
+ PreParty
542
+ ProductLaunch
543
+ ProfessionalNetworkingEvent
544
+ Rave_General
545
+ RetirementCelebration
546
+ Reunion_FamilyOrSchoolOrFriends
547
+ SafariAdventureParty
548
+ SchoolEvent_MiddleSchoolOrHighSchoolOrCollege
549
+ ScienceFictionThemedParty
550
+ SocialClubEvent
551
+ SportsTournament
552
+ SportsWatchParty
553
+ SuperheroThemedParty
554
+ SurfCompetition
555
+ ThanksgivingDinner
556
+ ThemedCostumeParty
557
+ ThemedDinnerParty
558
+ ThemedPubCrawl
559
+ Tournament
560
+ TravelAndTradeShow
561
+ TriviaNight
562
+ ValentinesDayParty
563
+ WeddingReception
564
+ WelcomeHomeParty
565
+ WellnessFestival
566
+ WineTastingEvent
567
+ Other
568
+ }
569
+
570
+ model CustomBashEventType {
571
+ id String @id @default(cuid())
572
+ key String @unique
573
+ displayName String
574
+ }
575
+
576
+ model AmountOfGuests {
577
+ id String @id @default(cuid())
578
+ bashEvent BashEvent?
579
+ exhibitor Exhibitor?
580
+ eventService EventService?
581
+ entertainmentService EntertainmentService?
582
+ vendor Vendor?
583
+ sponsor Sponsor?
584
+
585
+ minimum Int? @default(10)
586
+ ideal Int? @default(35)
587
+ showMinimumGuests Boolean @default(true)
588
+ showIdealGuests Boolean @default(true)
589
+ venueId String?
590
+ organizationId String?
591
+ }
592
+
593
+ enum Privacy {
594
+ Public
595
+ ConnectionsOnly
596
+ InviteOnly
597
+ }
598
+
599
+ model TargetAudience {
600
+ id String @id @default(cuid())
601
+ ageRange AgeRange[]
602
+ secondaryAgeRange AgeRange[]
603
+ gender Gender[]
604
+ secondaryGender Gender[]
605
+ occupation Occupation[]
606
+ secondaryOccupation Occupation[]
607
+ education Education[]
608
+ secondaryEducation Education[]
609
+ showOnDetailPage Boolean @default(true)
610
+ bashEvent BashEvent?
611
+ service Service?
612
+ }
613
+
614
+ enum AgeRange {
615
+ Sixteen_17
616
+ Eighteen_20
617
+ TwentyOne_25
618
+ TwentySix_34
619
+ ThirtyFive_49
620
+ Fifty_64
621
+ SixtyFivePlus
622
+ NoPreference
623
+ }
624
+
625
+ enum Occupation {
626
+ Students
627
+ Entrepreneurs
628
+ SmallBusinesses
629
+ Corporations
630
+ Professionals
631
+ Creatives
632
+ AngelInvestors
633
+ FamilyOffices
634
+ Retirees
635
+ Academics
636
+ Government
637
+ NonProfits
638
+ NoPreference
639
+ }
640
+
641
+ enum Education {
642
+ HighSchool
643
+ SomeCollege
644
+ InCollege
645
+ Bachelors
646
+ GraduateStudent
647
+ Masters
648
+ Doctorate
649
+ NoPreference
650
+ }
651
+
652
+ enum BashStatus {
653
+ Draft
654
+ PreSale
655
+ Published
656
+ }
657
+
658
+ enum ServiceStatus {
659
+ Draft
660
+ Created
661
+ }
662
+
663
+ enum ServiceCondition {
664
+ Pending
665
+ Published
666
+ Suspended
667
+ Deactivated
668
+ }
669
+
670
+ enum VolunteerServiceStatus {
671
+ Draft
672
+ Pending
673
+ Created
674
+ }
675
+
676
+ model DocumentID {
677
+ id String @id @default(cuid())
678
+ givenName String?
679
+ familyName String?
680
+ middleName String?
681
+ suffix String?
682
+ street String?
683
+ city String?
684
+ state String?
685
+ stateName String?
686
+ zipCode String?
687
+ idNumber String?
688
+ expires String?
689
+ dob String?
690
+ issueDate String?
691
+ idType String?
692
+ userId String? @unique
693
+ user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
694
+ }
695
+
696
+ model EventLink {
697
+ id String @id @default(cuid())
698
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
699
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
700
+ linkId String
701
+ bashEventId String
702
+ }
703
+
704
+ enum Gender {
705
+ Male
706
+ Female
707
+ Other
708
+ NoPreference
709
+ }
710
+
711
+ model Investment {
712
+ id String @id @default(cuid())
713
+ investorId String
714
+ bashEventId String
715
+ investor User @relation(fields: [investorId], references: [id], onDelete: Cascade)
716
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
717
+ amount Float
718
+ type InvestmentType
719
+ paidOn String?
720
+ }
721
+
722
+ enum InvestmentType {
723
+ Equity
724
+ Event
725
+ }
726
+
727
+ model Link {
728
+ id String @id @default(cuid())
729
+ url String
730
+ type String?
731
+ icon String?
732
+ eventLinks EventLink[]
733
+ userLinks UserLink[]
734
+ serviceLinks ServiceLink[]
735
+ volunteerServiceId String?
736
+ volunteerService VolunteerService? @relation("VolunteerServiceLinks", fields: [volunteerServiceId], references: [id])
737
+ }
738
+
739
+ model Media {
740
+ id String @id @default(cuid())
741
+ url String @unique
742
+ type MediaType
743
+ mimetype String?
744
+ bashEventsReferencingMe BashEvent[]
745
+ sponsoredEventsReferencingMe SponsoredEvent[]
746
+ serviceReferencingMe Service[]
747
+ volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
748
+ volunteerServiceId String?
749
+ }
750
+
751
+ enum MediaType {
752
+ Unknown
753
+ Empty
754
+ Image
755
+ Video
756
+ }
757
+
758
+ model Prize {
759
+ id String @id @default(cuid())
760
+ prizeWorth Float?
761
+ prizeType PrizeType
762
+ name String
763
+ prizeLevel Int
764
+ description String
765
+ competition Competition? @relation(fields: [competitionId], references: [id], onDelete: SetNull)
766
+ competitionId String?
767
+ paidOn String?
768
+ winner User? @relation(fields: [winnerUserId], references: [id], onDelete: Cascade)
769
+ winnerUserId String?
770
+ }
771
+
772
+ enum PrizeType {
773
+ Monetary
774
+ Merchandise
775
+ Service
776
+ Combo
777
+ }
778
+
779
+ model Review {
780
+ id String @id @default(cuid())
781
+ rating Int
782
+ creatorId String
783
+ creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
784
+ bashEventId String
785
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
786
+ comments BashComment[]
787
+ }
788
+
789
+ model GoogleReview {
790
+ id String @id @default(cuid())
791
+ author_name String?
792
+ rating Float
793
+ text String?
794
+ createdAt DateTime @default(now())
795
+ serviceId String
796
+ // service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
797
+ }
798
+
799
+ model Session {
800
+ id String @id @default(cuid())
801
+ sessionToken String @unique
802
+ userId String
803
+ expires DateTime
804
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
805
+
806
+ @@index([userId])
807
+ }
808
+
809
+ enum Sex {
810
+ Male
811
+ Female
812
+ Other
813
+ }
814
+
815
+ model SponsoredEvent {
816
+ id String @id @default(cuid())
817
+ amount Float?
818
+ paidOn String?
819
+ sponsorType SponsorType
820
+ sponsorId String
821
+ bashEventId String
822
+ sponsor User @relation(fields: [sponsorId], references: [id], onDelete: Cascade)
823
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
824
+ media Media[]
825
+ }
826
+
827
+ enum SponsorType {
828
+ Marketing
829
+ Giveaway
830
+ Awareness
831
+ Trade
832
+ CompetitionPrizeProvider
833
+ }
834
+
835
+ model User {
836
+ id String @id @default(cuid())
837
+ email String @unique
838
+ createdOn DateTime @default(now())
839
+ stripeCustomerId String? @unique
840
+ stripeAccountId String? @unique
841
+ isSuperUser Boolean @default(false)
842
+ googleCalendarAccess String?
843
+ givenName String?
844
+ familyName String?
845
+ hash String?
846
+ emailVerified DateTime?
847
+ image String?
848
+ uploadedImage String?
849
+ dob DateTime?
850
+ gender Gender?
851
+ sex Sex?
852
+ roles UserRole[] @default([User])
853
+ ownedServices Service[] @relation("OwnedService")
854
+ createdServices Service[] @relation("CreatedService")
855
+ createdEvents BashEvent[] @relation("CreatedEvent")
856
+ ticketsISent Ticket[] @relation("TicketsISent")
857
+ ticketsIOwn Ticket[] @relation("TicketsIOwn")
858
+ reviews Review[]
859
+ sponsorships SponsoredEvent[]
860
+ investments Investment[]
861
+ sessions Session[]
862
+ eventTasks EventTask[]
863
+ clubMembers ClubMember[]
864
+ clubAdmins ClubAdmin[]
865
+ links UserLink[]
866
+ status UserStatus
867
+ competitions Competition[]
868
+ competitionSponsorships CompetitionSponsor[]
869
+ competitionPrizes Prize[]
870
+ userRatingGiven UserRatingGiven[]
871
+ userRating UserRating[]
872
+ magicLink String?
873
+ magicLinkExpiration DateTime?
874
+ magicLinkUsed DateTime?
875
+ idVerified DateTime?
876
+ street String?
877
+ city String?
878
+ state String?
879
+ zipCode String?
880
+ country String? @default("US")
881
+ phone String?
882
+ documentIDId String? @unique
883
+ documentID DocumentID?
884
+ comment BashComment[]
885
+ associatedBashes AssociatedBash[]
886
+ associatedServices AssociatedService[]
887
+ invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
888
+ invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
889
+ notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
890
+ remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
891
+ remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
892
+ eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
893
+ checkouts Checkout[]
894
+ ticketTiersWaitListsIveJoined TicketTier[]
895
+ contacts Contact[]
896
+ bashEventPromoCodesIUsed BashEventPromoCode[]
897
+ serviceCheckouts ServiceCheckout[]
898
+ bookingForMe Booking[]
899
+ userSubscription UserSubscription?
900
+ serviceSubcriptions ServiceSubscription[]
901
+ volunteerService VolunteerService[]
902
+ rate Rate[]
903
+ stripeAccounts StripeAccount[]
904
+ }
905
+
906
+ model Contact {
907
+ id String @id @default(cuid())
908
+ contactOwnerId String
909
+ contactOwner User @relation(fields: [contactOwnerId], references: [id], onDelete: Cascade)
910
+ contactEmail String?
911
+ fullName String?
912
+ phone String?
913
+ requestToConnectSent DateTime?
914
+ requestToConnectAccepted DateTime?
915
+
916
+ @@unique([contactOwnerId, contactEmail])
917
+ @@index([contactEmail])
918
+ }
919
+
920
+ // anyone that is invited to the bash, is an organizer of a bash, and or the creator/owner of the bash...for having others (including services) edit or post about a bash in the bashfeed
921
+ model AssociatedBash {
922
+ id String @id @default(cuid())
923
+ bashEventId String
924
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
925
+ invitationId String? @unique
926
+ invitation Invitation? @relation(fields: [invitationId], references: [id])
927
+ ownerEmail String?
928
+ ownerUserId String?
929
+ owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
930
+ isOrganizer Boolean?
931
+ isFavorite Boolean?
932
+ service Service[]
933
+
934
+ @@unique([ownerEmail, bashEventId])
935
+ }
936
+
937
+ // anyone that is invited to be an organizer of a service profile or is the creator/owner...for having others edit or post about a service in the bashfeed (but the service must be associated with a bash to post)
938
+ model AssociatedService {
939
+ id String @id @default(cuid())
940
+ serviceId String
941
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
942
+ // referralId String? @unique
943
+ // referral Referral? @relation(fields: [referralId], references: [id])
944
+ ownerEmail String?
945
+ ownerUserId String?
946
+ owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
947
+ isOrganizer Boolean?
948
+ isFavorite Boolean?
949
+
950
+ @@unique([ownerEmail, serviceId])
951
+ }
952
+
953
+ // Common data for all services; 1-1 relation between each individual service model such as Venue
954
+ model Service {
955
+ id String @id @default(cuid())
956
+
957
+ serviceType ServiceTypes
958
+ serviceStatus ServiceStatus @default(Draft)
959
+ serviceCondition ServiceCondition @default(Pending)
960
+
961
+ // current owner
962
+ ownerId String?
963
+ owner User? @relation("OwnedService", fields: [ownerId], references: [id])
964
+
965
+ // original creator
966
+ creatorId String?
967
+ creator User? @relation("CreatedService", fields: [creatorId], references: [id])
968
+
969
+ createdAt DateTime @default(now())
970
+ updatedAt DateTime @updatedAt
971
+
972
+ associatedBashesReferencingMe AssociatedBash[]
973
+ associatedServicesReferencingMe AssociatedService[]
974
+
975
+ serviceName String?
976
+ tagline String?
977
+
978
+ // this is not the business info but that which is associated with the service
979
+ place String?
980
+ googlePlaceId String?
981
+ street String?
982
+ city String?
983
+ state String?
984
+ zipCode String?
985
+ country String?
986
+ description String?
987
+ // email String?
988
+ // phone String?
989
+
990
+ pocName String?
991
+ pocPhoneNumber String?
992
+ pocBusinessEmail String?
993
+
994
+ additionalInfo String?
995
+ coverPhoto String?
996
+
997
+ mission String?
998
+ communityInvolvement String?
999
+ emergencyContact String?
1000
+ contactDetails String?
1001
+ rates Rate[] @relation("MultipleRates")
1002
+ cancellationPolicy String?
1003
+ refundPolicy String?
1004
+ insurancePolicy String?
1005
+ // hoursOfOperation Json? @default("{}")
1006
+
1007
+ stripeAccountId String?
1008
+ stripeAccount StripeAccount? @relation(fields: [stripeAccountId], references: [id], onDelete: Restrict)
1009
+
1010
+ targetAudienceId String? @unique
1011
+ targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
1012
+
1013
+ visibility VisibilityPreference @default(Public)
1014
+ availableDateTimes Availability[] @relation("AvailableDateTimes")
1015
+
1016
+ bashesInterestedIn BashEventType[]
1017
+ bookings Booking[]
1018
+ media Media[]
1019
+ serviceLinks ServiceLink[]
1020
+
1021
+ volunteerServiceId String?
1022
+ volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
1023
+ eventService EventService?
1024
+ entertainmentService EntertainmentService?
1025
+ vendor Vendor?
1026
+ exhibitor Exhibitor?
1027
+ sponsor Sponsor?
1028
+ venue Venue?
1029
+ organization Organization?
1030
+
1031
+ // googleReviews GoogleReview[]
1032
+
1033
+ bashEvent BashEvent[] // because a service needs to be associated with a bash to post to the bashfeed
1034
+ }
1035
+
1036
+ model StripeAccount {
1037
+ id String @id @default(cuid())
1038
+
1039
+ ownerId String
1040
+ owner User @relation(fields: [ownerId], references: [id])
1041
+
1042
+ stripeAccountId String
1043
+
1044
+ createdAt DateTime @default(now())
1045
+ updatedAt DateTime @updatedAt
1046
+
1047
+ service Service[]
1048
+
1049
+ @@index([ownerId])
1050
+ }
1051
+
1052
+ model VolunteerService {
1053
+ id String @id @default(cuid())
1054
+ // service Service
1055
+ userId String?
1056
+ user User? @relation(fields: [userId], references: [id])
1057
+ serviceRangeId String?
1058
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1059
+ links Link[] @relation("VolunteerServiceLinks")
1060
+ availableDateTimes Availability[] @relation("AvailableDateTimes")
1061
+ fullName String?
1062
+ address String?
1063
+ email String?
1064
+ phone String?
1065
+ agreedToAgreement Boolean? @default(false)
1066
+ description String?
1067
+ status VolunteerServiceStatus?
1068
+ media Media[]
1069
+ Service Service[]
1070
+ }
1071
+
1072
+ model EventService {
1073
+ id String @id @default(cuid())
1074
+ serviceId String @unique
1075
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1076
+ serviceRangeId String?
1077
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1078
+ eventServiceTypes EventServiceType[]
1079
+ eventServiceSubType String?
1080
+ yearsOfExperience YearsOfExperience
1081
+ crowdSizeId String? @unique
1082
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1083
+ goodsOrServices String[]
1084
+ menuItems String?
1085
+ venueTypes String[]
1086
+ secondaryVenueTypes String[] @default([])
1087
+ }
1088
+
1089
+ model EntertainmentService {
1090
+ id String @id @default(cuid())
1091
+ serviceId String @unique
1092
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1093
+ serviceRangeId String?
1094
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1095
+ entertainmentServiceTypes EntertainmentServiceType[]
1096
+ entertainmentServiceSubType String?
1097
+ genre MusicGenreType?
1098
+ yearsOfExperience YearsOfExperience
1099
+ crowdSizeId String? @unique
1100
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1101
+ goodsOrServices String[]
1102
+ venueTypes String[]
1103
+ secondaryVenueTypes String[] @default([])
1104
+ }
1105
+
1106
+ model Vendor {
1107
+ id String @id @default(cuid())
1108
+ serviceId String @unique
1109
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1110
+ serviceRangeId String?
1111
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1112
+ yearsOfExperience YearsOfExperience
1113
+ crowdSizeId String? @unique
1114
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1115
+ goodsOrServices String[]
1116
+ menuItems String?
1117
+ venueTypes String[]
1118
+ secondaryVenueTypes String[] @default([])
1119
+ }
1120
+
1121
+ model Exhibitor {
1122
+ id String @id @default(cuid())
1123
+ serviceId String @unique
1124
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1125
+ serviceRangeId String?
1126
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1127
+ yearsOfExperience YearsOfExperience
1128
+ crowdSizeId String? @unique
1129
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1130
+ goodsOrServices String[]
1131
+ venueTypes String[]
1132
+ secondaryVenueTypes String[] @default([])
1133
+ }
1134
+
1135
+ model Sponsor {
1136
+ id String @id @default(cuid())
1137
+ serviceId String @unique
1138
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1139
+ serviceRangeId String?
1140
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1141
+ yearsOfExperience YearsOfExperience
1142
+ crowdSizeId String? @unique
1143
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1144
+ goodsOrServices String[]
1145
+ menuItems String?
1146
+ }
1147
+
1148
+ model Venue {
1149
+ id String @id @default(cuid())
1150
+ serviceId String @unique
1151
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1152
+ // serviceConnectionId String? //Check: ?
1153
+ // serviceConnection String?
1154
+ yearsInBusiness YearsOfExperience @default(LessThanOneYear)
1155
+ amenities String[]
1156
+ menuItems String?
1157
+ features String[]
1158
+ venueTypes String[]
1159
+ secondaryVenueTypes String[] @default([])
1160
+ pitch String?
1161
+ capacity Int?
1162
+ trademark Boolean?
1163
+ manager Boolean?
1164
+ allowed String?
1165
+ notAllowed String?
1166
+ vibe String?
1167
+ dress String?
1168
+
1169
+ pricingPlan VenuePricingPlan? @default(Percentage)
1170
+ subscriptionStatus SubscriptionStatus?
1171
+ subscriptionStartDate DateTime?
1172
+
1173
+ bashEvents BashEvent[]
1174
+ }
1175
+
1176
+ // model VenuePricing {
1177
+ // id String @id @default(cuid())
1178
+ // venuePricingPlan VenuePricingPlan
1179
+ // percentageRate Float? @default(0.15)
1180
+ // }
1181
+
1182
+ enum VenuePricingPlan {
1183
+ Percentage
1184
+ Subscription
1185
+ }
1186
+
1187
+ enum SubscriptionStatus {
1188
+ Active
1189
+ Canceled
1190
+ Suspended
1191
+ Expired
1192
+ }
1193
+
1194
+ model Organization {
1195
+ id String @id @default(cuid())
1196
+ serviceId String @unique
1197
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1198
+ organizationType OrganizationType[]
1199
+ goodsOrServices String[]
1200
+ venueTypes String[]
1201
+ secondaryVenueTypes String[] @default([])
1202
+ }
1203
+
1204
+ enum EventServiceType {
1205
+ Investor
1206
+ LongTermLoan
1207
+ ShortTermLoan
1208
+ EventPlanning
1209
+ Caterer
1210
+ Cleaner
1211
+ Decorator
1212
+ InteriorDesigner
1213
+ RentalEquipmentProvider
1214
+ FoodAndBeverageProvider
1215
+ MediaCapture
1216
+ AVTechnician
1217
+ GraphicDesigner
1218
+ Influencer
1219
+ Promoter
1220
+ CelebrityAppearance
1221
+ CrewHand
1222
+ EventManager
1223
+ VirtualAssistant
1224
+ Consulting
1225
+ Transportation
1226
+ }
1227
+
1228
+ enum EntertainmentServiceType {
1229
+ Emcees
1230
+ DJs
1231
+ Bands
1232
+ SoloMusicians
1233
+ Comedy
1234
+ VarietyActs
1235
+ PerformanceArtists
1236
+ Magic
1237
+ Dancers
1238
+ Aerialists
1239
+ Impersonators
1240
+ Speakers
1241
+ Auctioneers
1242
+ }
1243
+
1244
+ enum OrganizationType {
1245
+ Church
1246
+ GreekLife
1247
+ SocialClub
1248
+ Nonprofit
1249
+ Corporation
1250
+ EducationalInstitution
1251
+ Sports
1252
+ Government
1253
+ Cultural
1254
+ Lifestyle
1255
+ Political
1256
+ Tourism
1257
+ Youth
1258
+ Senior
1259
+ Tradeshow
1260
+ Conference
1261
+ FoodAndBeverage
1262
+ TechAndStartups
1263
+ }
1264
+
1265
+ enum YearsOfExperience {
1266
+ LessThanOneYear
1267
+ OneToThreeYears
1268
+ ThreeToFiveYears
1269
+ FivePlusYears
1270
+ }
1271
+
1272
+ model ServiceRange {
1273
+ id String @id @default(cuid())
1274
+ min Int @default(0)
1275
+ max Int @default(50)
1276
+ volunteerServices VolunteerService[]
1277
+ entertainmentServices EntertainmentService[]
1278
+ EventService EventService[]
1279
+ Vendor Vendor[]
1280
+ Exhibitor Exhibitor[]
1281
+ Sponsor Sponsor[]
1282
+ }
1283
+
1284
+ // different days of the week have different rates
1285
+ // can block of certain dates of the year and days of the week as being closed
1286
+ // can have special rates on different days of the year (single or range)
1287
+ model Availability {
1288
+ id String @id @default(cuid())
1289
+ dayOfWeek Int
1290
+ startDateTime DateTime @db.Time
1291
+ endDateTime DateTime @db.Time
1292
+ serviceId String?
1293
+ service Service? @relation("AvailableDateTimes", fields: [serviceId], references: [id])
1294
+ volunteerServiceId String?
1295
+ volunteerService VolunteerService? @relation("AvailableDateTimes", fields: [volunteerServiceId], references: [id])
1296
+ }
1297
+
1298
+ enum VisibilityPreference {
1299
+ Public
1300
+ Private
1301
+ }
1302
+
1303
+ enum MusicGenreType {
1304
+ Classical
1305
+ Rock
1306
+ HipHop
1307
+ Country
1308
+ Pop
1309
+ EDM
1310
+ Indie
1311
+ Acoustic
1312
+ }
1313
+
1314
+ enum UserRole {
1315
+ User
1316
+ Vendor
1317
+ Sponsor
1318
+ Investor
1319
+ LoanProvider
1320
+ VenueProvider
1321
+ ServiceProvider
1322
+ SuperAdmin
1323
+ Exhibitor
1324
+ }
1325
+
1326
+ model UserLink {
1327
+ id String @id @default(cuid())
1328
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1329
+ linkId String
1330
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1331
+ userId String
1332
+ }
1333
+
1334
+ model UserRating {
1335
+ id String @id @default(cuid())
1336
+ rating Int
1337
+ comment String?
1338
+ givenBy UserRatingGiven @relation(fields: [userRatingGivenId], references: [id], onDelete: Cascade)
1339
+ userRatingGivenId String
1340
+ givenTo User @relation(fields: [userId], references: [id], onDelete: Cascade)
1341
+ userId String
1342
+ }
1343
+
1344
+ model UserRatingGiven {
1345
+ id String @id @default(cuid())
1346
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1347
+ userId String
1348
+ UserRating UserRating[]
1349
+ }
1350
+
1351
+ enum UserStatus {
1352
+ Active
1353
+ Inactive
1354
+ Suspended
1355
+ Deactivated
1356
+ }
1357
+
1358
+ model VerificationToken {
1359
+ identifier String
1360
+ token String @unique
1361
+ expires DateTime
1362
+
1363
+ @@unique([identifier, token])
1364
+ }
1365
+
1366
+ model ServiceLink {
1367
+ id String @id @default(cuid())
1368
+ serviceId String
1369
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1370
+ linkId String
1371
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1372
+
1373
+ @@index([serviceId])
1374
+ }
1375
+
1376
+ enum ServiceTypes {
1377
+ EventServices
1378
+ EntertainmentServices
1379
+ Vendors
1380
+ Exhibitors
1381
+ Sponsors
1382
+ Venues
1383
+ Organizations
1384
+ }
1385
+
1386
+ enum EntityType {
1387
+ EVENT_SERVICE
1388
+ ENTERTAINMENT_SERVICE
1389
+ VENDOR
1390
+ EXHIBITOR
1391
+ SPONSOR
1392
+ VENUE
1393
+ ORGANIZATION
1394
+ BASH_EVENT // For BashEvents
1395
+ }