@bash-app/bash-common 29.22.4 → 29.23.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,1524 +1,1525 @@
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) //stored multipled by 100 to allow for decimals
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 Booking {
360
- id String @id @default(cuid())
361
- serviceId String
362
- service Service @relation(fields: [serviceId], references: [id])
363
- validDate DateTime?
364
- forUserId String?
365
- forUser User? @relation(fields: [forUserId], references: [id])
366
- fullName String?
367
- email String?
368
- paidOn DateTime?
369
- requireDeposit Boolean?
370
- status BookingStatus?
371
- geoFenceCheckInUnnecessary Boolean?
372
- checkedInAt DateTime?
373
- checkedOutAt DateTime?
374
- checkoutId String?
375
- checkout Checkout? @relation(fields: [checkoutId], references: [id])
376
-
377
- @@index([serviceId])
378
- @@index([forUserId])
379
- @@index([checkoutId])
380
- }
381
-
382
- model unusedModelButNeededForSomeTypesToBeDefinedForTypescript {
383
- id String @id @default(cuid())
384
- doNotUseVibeEnum BashEventVibeTags @default(Wild)
385
- doNotUseDressEnum BashEventDressTags @default(Casual)
386
- doNotUseBashEventType BashEventType @default(Other)
387
- doNotUseDayOfWeek DayOfWeek @default(Sunday)
388
- }
389
-
390
- model Recurrence {
391
- id String @id @default(cuid())
392
- interval Int @default(1)
393
- bashEventId String @unique
394
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
395
- frequency RecurringFrequency @default(Never)
396
- ends DateTime @default(now())
397
- repeatOnDays DayOfWeek[]
398
- repeatOnDayOfMonth Int?
399
- repeatYearlyDate DateTime?
400
- }
401
-
402
- enum DayOfWeek {
403
- Sunday
404
- Monday
405
- Tuesday
406
- Wednesday
407
- Thursday
408
- Friday
409
- Saturday
410
- }
411
-
412
- enum RecurringFrequency {
413
- Never
414
- Daily
415
- Weekly
416
- Monthly
417
- Yearly
418
- }
419
-
420
- enum BashEventVibeTags {
421
- Wild
422
- Calm
423
- }
424
-
425
- enum BashEventDressTags {
426
- Casual
427
- BusinessCasual
428
- Formal
429
- }
430
-
431
- // enum ServicesTags {
432
- // Fast
433
- // Reliable
434
- // AwardRecipient
435
- // }
436
-
437
- enum BashEventType {
438
- AfterParty
439
- AnimeAndCosplayFestival
440
- AnniversaryCelebration
441
- ArtExhibitOpening
442
- ArtAndCraftNight
443
- BBQCookout
444
- BabyShower
445
- BachelorOrBacheloretteParty
446
- BeachParty
447
- Birthday
448
- BoatPartyOrCruise
449
- Bonfire
450
- BookClubMeeting
451
- BridalShower
452
- BrunchGathering
453
- CarShow
454
- CarnivalAndFair
455
- CasinoNight
456
- CasualMixer
457
- CharityBall
458
- CharityFundraiser
459
- ChristmasParty
460
- ChurchEvent
461
- CircusOrCarnivalParty
462
- CocktailParty
463
- CollegeParty_FraternityOrSorority
464
- ComedyShowOrStandUpComedyNight
465
- ComicConvention
466
- Competition
467
- Concert
468
- CookingCompetition
469
- CorporateEventOrOfficeParty
470
- CostumeParty_Theme_Based
471
- CulturalFestival
472
- DanceParty
473
- DesertRave
474
- DiscoNight
475
- EasterGathering
476
- EngagementParty
477
- ESportsGamingTournament
478
- ExclusiveLuxuryRetreat
479
- FantasyThemedParty
480
- FashionShow
481
- Fireside
482
- FitnessFestival
483
- FlashMob
484
- Festival
485
- FestivalFilm
486
- FestivalFood
487
- FundraisingEvent
488
- GalaDinner
489
- GameNight
490
- GamingEvent
491
- GardenParty
492
- GoingAwayPartyOrFarewell
493
- GraduationParty
494
- HalloweenCostumeParty
495
- HanukkahParty
496
- HistoricalEraParty
497
- HolidayParty
498
- HouseParty
499
- HousewarmingParty
500
- KaraokeNight
501
- KiteFlyingFestival
502
- LiveBandPerformanceInALocalVenue
503
- Luau
504
- MansionParty
505
- MardiGras
506
- MasqueradeBall
507
- MotorcycleRally
508
- MovieNight
509
- MoviePremiere
510
- MusicFestival
511
- NewYearsEveCelebration
512
- OpenMicNight
513
- OutdoorActivity
514
- OutdoorConcert
515
- OutdoorMovieNight_WithAProjector
516
- Parade
517
- Party
518
- PoolParty
519
- Potluck
520
- PotluckVegan
521
- PreParty
522
- ProductLaunch
523
- ProfessionalNetworkingEvent
524
- Rave_General
525
- RetirementCelebration
526
- Reunion_FamilyOrSchoolOrFriends
527
- SafariAdventureParty
528
- SchoolEvent_MiddleSchoolOrHighSchoolOrCollege
529
- ScienceFictionThemedParty
530
- SocialClubEvent
531
- SportsTournament
532
- SportsWatchParty
533
- SuperheroThemedParty
534
- SurfCompetition
535
- ThanksgivingDinner
536
- ThemedCostumeParty
537
- ThemedDinnerParty
538
- ThemedPubCrawl
539
- Tournament
540
- TravelAndTradeShow
541
- TriviaNight
542
- ValentinesDayParty
543
- WeddingReception
544
- WelcomeHomeParty
545
- WellnessFestival
546
- WineTastingEvent
547
- Other
548
- }
549
-
550
- model CustomBashEventType {
551
- id String @id @default(cuid())
552
- key String @unique
553
- displayName String
554
- }
555
-
556
- model AmountOfGuests {
557
- id String @id @default(cuid())
558
- bashEvent BashEvent?
559
- exhibitor Exhibitor?
560
- eventService EventService?
561
- entertainmentService EntertainmentService?
562
- vendor Vendor?
563
- sponsor Sponsor?
564
-
565
- minimum Int? @default(10)
566
- ideal Int? @default(35)
567
- showMinimumGuests Boolean @default(true)
568
- showIdealGuests Boolean @default(true)
569
- venueId String?
570
- organizationId String?
571
- }
572
-
573
- enum Privacy {
574
- Public
575
- ConnectionsOnly
576
- InviteOnly
577
- }
578
-
579
- model TargetAudience {
580
- id String @id @default(cuid())
581
- ageRange AgeRange[]
582
- secondaryAgeRange AgeRange[]
583
- gender Gender[]
584
- secondaryGender Gender[]
585
- occupation Occupation[]
586
- secondaryOccupation Occupation[]
587
- education Education[]
588
- secondaryEducation Education[]
589
- showOnDetailPage Boolean @default(true)
590
- bashEvent BashEvent?
591
- service Service?
592
- }
593
-
594
- enum AgeRange {
595
- Sixteen_17
596
- Eighteen_20
597
- TwentyOne_25
598
- TwentySix_34
599
- ThirtyFive_49
600
- Fifty_64
601
- SixtyFivePlus
602
- NoPreference
603
- }
604
-
605
- enum Occupation {
606
- Students
607
- Entrepreneurs
608
- SmallBusinesses
609
- Corporations
610
- Professionals
611
- Creatives
612
- AngelInvestors
613
- FamilyOffices
614
- Retirees
615
- Academics
616
- Government
617
- NonProfits
618
- NoPreference
619
- }
620
-
621
- enum Education {
622
- HighSchool
623
- SomeCollege
624
- InCollege
625
- Bachelors
626
- GraduateStudent
627
- Masters
628
- Doctorate
629
- NoPreference
630
- }
631
-
632
- enum BashStatus {
633
- Draft
634
- PreSale
635
- Published
636
- }
637
-
638
- enum ServiceStatus {
639
- Draft
640
- Created
641
- }
642
-
643
- enum ServiceCondition {
644
- Pending
645
- Published
646
- Suspended
647
- Deactivated
648
- }
649
-
650
- enum VolunteerServiceStatus {
651
- Draft
652
- Pending
653
- Created
654
- }
655
-
656
- model DocumentID {
657
- id String @id @default(cuid())
658
- givenName String?
659
- familyName String?
660
- middleName String?
661
- suffix String?
662
- street String?
663
- city String?
664
- state String?
665
- stateName String?
666
- zipCode String?
667
- idNumber String?
668
- expires String?
669
- dob String?
670
- issueDate String?
671
- idType String?
672
- userId String? @unique
673
- user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
674
- }
675
-
676
- model EventLink {
677
- id String @id @default(cuid())
678
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
679
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
680
- linkId String
681
- bashEventId String
682
- }
683
-
684
- enum Gender {
685
- Male
686
- Female
687
- Other
688
- NoPreference
689
- }
690
-
691
- model Investment {
692
- id String @id @default(cuid())
693
- investorId String
694
- bashEventId String
695
- investor User @relation(fields: [investorId], references: [id], onDelete: Cascade)
696
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
697
- amount Float
698
- type InvestmentType
699
- paidOn String?
700
- }
701
-
702
- enum InvestmentType {
703
- Equity
704
- Event
705
- }
706
-
707
- model Link {
708
- id String @id @default(cuid())
709
- url String
710
- type String?
711
- icon String?
712
- eventLinks EventLink[]
713
- userLinks UserLink[]
714
- serviceLinks ServiceLink[]
715
- volunteerServiceId String?
716
- volunteerService VolunteerService? @relation("VolunteerServiceLinks", fields: [volunteerServiceId], references: [id])
717
- }
718
-
719
- model Media {
720
- id String @id @default(cuid())
721
- url String @unique
722
- type MediaType
723
- mimetype String?
724
- bashEventsReferencingMe BashEvent[]
725
- sponsoredEventsReferencingMe SponsoredEvent[]
726
- serviceReferencingMe Service[]
727
- volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
728
- volunteerServiceId String?
729
-
730
- stripeAccount StripeAccount[]
731
- }
732
-
733
- enum MediaType {
734
- Unknown
735
- Empty
736
- Image
737
- Video
738
- }
739
-
740
- model Prize {
741
- id String @id @default(cuid())
742
- prizeWorth Float?
743
- prizeType PrizeType
744
- name String
745
- prizeLevel Int
746
- description String
747
- competition Competition? @relation(fields: [competitionId], references: [id], onDelete: SetNull)
748
- competitionId String?
749
- paidOn String?
750
- winner User? @relation(fields: [winnerUserId], references: [id], onDelete: Cascade)
751
- winnerUserId String?
752
- }
753
-
754
- enum PrizeType {
755
- Monetary
756
- Merchandise
757
- Service
758
- Combo
759
- }
760
-
761
- model Review {
762
- id String @id @default(cuid())
763
- rating Int
764
- creatorId String
765
- creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
766
- bashEventId String
767
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
768
- comments BashComment[]
769
- }
770
-
771
- model GoogleReview {
772
- id String @id @default(cuid())
773
- author_name String?
774
- rating Float
775
- text String?
776
- createdAt DateTime @default(now())
777
- serviceId String
778
- // service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
779
- }
780
-
781
- model Session {
782
- id String @id @default(cuid())
783
- sessionToken String @unique
784
- userId String
785
- expires DateTime
786
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
787
-
788
- @@index([userId])
789
- }
790
-
791
- enum Sex {
792
- Male
793
- Female
794
- Other
795
- }
796
-
797
- model SponsoredEvent {
798
- id String @id @default(cuid())
799
- amount Float?
800
- paidOn String?
801
- sponsorType SponsorType
802
- sponsorId String
803
- bashEventId String
804
- sponsor User @relation(fields: [sponsorId], references: [id], onDelete: Cascade)
805
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
806
- media Media[]
807
- }
808
-
809
- enum SponsorType {
810
- Marketing
811
- Giveaway
812
- Awareness
813
- Trade
814
- CompetitionPrizeProvider
815
- }
816
-
817
- model User {
818
- id String @id @default(cuid())
819
- email String @unique
820
- createdOn DateTime @default(now())
821
- stripeCustomerId String? @unique
822
- stripeAccountId String? @unique
823
- isSuperUser Boolean @default(false)
824
- googleCalendarAccess String?
825
- givenName String?
826
- familyName String?
827
- hash String?
828
- emailVerified DateTime?
829
- image String?
830
- uploadedImage String?
831
- dob DateTime?
832
- gender Gender?
833
- sex Sex?
834
- roles UserRole[] @default([User])
835
- ownedServices Service[] @relation("OwnedService")
836
- createdServices Service[] @relation("CreatedService")
837
- createdEvents BashEvent[] @relation("CreatedEvent")
838
- ticketsISent Ticket[] @relation("TicketsISent")
839
- ticketsIOwn Ticket[] @relation("TicketsIOwn")
840
- reviews Review[]
841
- sponsorships SponsoredEvent[]
842
- investments Investment[]
843
- sessions Session[]
844
- eventTasks EventTask[]
845
- clubMembers ClubMember[]
846
- clubAdmins ClubAdmin[]
847
- links UserLink[]
848
- status UserStatus
849
- competitions Competition[]
850
- competitionSponsorships CompetitionSponsor[]
851
- competitionPrizes Prize[]
852
- userRatingGiven UserRatingGiven[]
853
- userRating UserRating[]
854
- magicLink String?
855
- magicLinkExpiration DateTime?
856
- magicLinkUsed DateTime?
857
- idVerified DateTime?
858
- street String?
859
- city String?
860
- state String?
861
- zipCode String?
862
- country String? @default("US")
863
- phone String?
864
- documentIDId String? @unique
865
- documentID DocumentID?
866
- comment BashComment[]
867
- associatedBashes AssociatedBash[]
868
- associatedServices AssociatedService[]
869
- invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
870
- invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
871
- notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
872
- remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
873
- remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
874
- eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
875
- checkouts Checkout[]
876
- ticketTiersWaitListsIveJoined TicketTier[]
877
- contacts Contact[]
878
- bashEventPromoCodesIUsed BashEventPromoCode[]
879
- serviceCheckouts ServiceCheckout[]
880
- bookingForMe Booking[]
881
- userSubscription UserSubscription?
882
- serviceSubcriptions ServiceSubscription[]
883
- volunteerService VolunteerService[]
884
- stripeAccounts StripeAccount[]
885
- }
886
-
887
- model Contact {
888
- id String @id @default(cuid())
889
- contactOwnerId String
890
- contactOwner User @relation(fields: [contactOwnerId], references: [id], onDelete: Cascade)
891
- contactEmail String?
892
- fullName String?
893
- phone String?
894
- requestToConnectSent DateTime?
895
- requestToConnectAccepted DateTime?
896
-
897
- @@unique([contactOwnerId, contactEmail])
898
- @@index([contactEmail])
899
- }
900
-
901
- // 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
902
- model AssociatedBash {
903
- id String @id @default(cuid())
904
- bashEventId String
905
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
906
- invitationId String? @unique
907
- invitation Invitation? @relation(fields: [invitationId], references: [id])
908
- ownerEmail String?
909
- ownerUserId String?
910
- owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
911
- isOrganizer Boolean?
912
- isFavorite Boolean?
913
- service Service[]
914
-
915
- @@unique([ownerEmail, bashEventId])
916
- }
917
-
918
- // 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)
919
- model AssociatedService {
920
- id String @id @default(cuid())
921
- serviceId String
922
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
923
- // referralId String? @unique
924
- // referral Referral? @relation(fields: [referralId], references: [id])
925
- ownerEmail String?
926
- ownerUserId String?
927
- owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
928
- isOrganizer Boolean?
929
- isFavorite Boolean?
930
-
931
- @@unique([ownerEmail, serviceId])
932
- }
933
-
934
- // Common data for all services; 1-1 relation between each individual service model such as Venue
935
- model Service {
936
- id String @id @default(cuid())
937
-
938
- serviceType ServiceTypes?
939
- serviceStatus ServiceStatus @default(Draft)
940
- serviceCondition ServiceCondition @default(Pending)
941
-
942
- // current owner
943
- ownerId String?
944
- owner User? @relation("OwnedService", fields: [ownerId], references: [id])
945
-
946
- // original creator
947
- creatorId String?
948
- creator User? @relation("CreatedService", fields: [creatorId], references: [id])
949
-
950
- createdAt DateTime @default(now())
951
- updatedAt DateTime? @updatedAt
952
-
953
- associatedBashesReferencingMe AssociatedBash[]
954
- associatedServicesReferencingMe AssociatedService[]
955
-
956
- serviceName String?
957
- tagline String?
958
-
959
- // this is not the business info but that which is associated with the service
960
- place String?
961
- googlePlaceId String?
962
- street String?
963
- city String?
964
- state String?
965
- zipCode String?
966
- country String?
967
- description String?
968
- // email String?
969
- // phone String?
970
-
971
- pocName String?
972
- pocPhoneNumber String?
973
- pocBusinessEmail String?
974
-
975
- additionalInfo String?
976
- coverPhoto String?
977
-
978
- mission String?
979
- communityInvolvement String?
980
- emergencyContact String?
981
- contactDetails String?
982
- // rates Rate[] @relation("MultipleRates")
983
- cancellationPolicy String?
984
- refundPolicy String?
985
- insurancePolicy String?
986
- // hoursOfOperation Json? @default("{}")
987
-
988
- stripeAccountId String?
989
- stripeAccount StripeAccount? @relation(fields: [stripeAccountId], references: [id], onDelete: Restrict)
990
-
991
- targetAudienceId String? @unique
992
- targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
993
-
994
- visibility VisibilityPreference @default(Public)
995
-
996
- bashesInterestedIn BashEventType[]
997
- bookings Booking[]
998
- media Media[]
999
- serviceLinks ServiceLink[]
1000
-
1001
- volunteerServiceId String?
1002
- volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
1003
- eventService EventService?
1004
- entertainmentService EntertainmentService?
1005
- vendor Vendor?
1006
- exhibitor Exhibitor?
1007
- sponsor Sponsor?
1008
- venue Venue?
1009
- organization Organization?
1010
-
1011
- serviceRatesAssociation ServiceRatesAssociation?
1012
-
1013
- // googleReviews GoogleReview[]
1014
-
1015
- bashEvent BashEvent[] // because a service needs to be associated with a bash to post to the bashfeed
1016
- }
1017
-
1018
- model StripeAccount {
1019
- id String @id @default(cuid())
1020
-
1021
- ownerId String
1022
- owner User @relation(fields: [ownerId], references: [id], onDelete: Restrict)
1023
-
1024
- stripeAccountId String
1025
-
1026
- logoId String?
1027
- logo Media? @relation(fields: [logoId], references: [id], onDelete: SetNull)
1028
-
1029
- createdAt DateTime @default(now())
1030
- updatedAt DateTime @updatedAt
1031
-
1032
- service Service[]
1033
-
1034
- @@index([ownerId])
1035
- }
1036
-
1037
- model VolunteerService {
1038
- id String @id @default(cuid())
1039
- // service Service
1040
- userId String?
1041
- user User? @relation(fields: [userId], references: [id])
1042
- serviceRangeId String?
1043
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1044
- links Link[] @relation("VolunteerServiceLinks")
1045
- // availableDateTimes ServiceAvailability[] @relation("AvailableDateTimes")
1046
- fullName String?
1047
- address String?
1048
- email String?
1049
- phone String?
1050
- agreedToAgreement Boolean? @default(false)
1051
- description String?
1052
- status VolunteerServiceStatus?
1053
- media Media[]
1054
-
1055
- serviceRatesAssociation ServiceRatesAssociation?
1056
-
1057
- service Service[]
1058
- }
1059
-
1060
- model EventService {
1061
- id String @id @default(cuid())
1062
- serviceId String @unique
1063
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1064
- serviceRangeId String?
1065
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1066
- eventServiceTypes EventServiceType[]
1067
- eventServiceSubType String?
1068
- yearsOfExperience YearsOfExperience
1069
- crowdSizeId String? @unique
1070
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1071
- goodsOrServices String[]
1072
- menuItems String?
1073
- venueTypes String[]
1074
- secondaryVenueTypes String[] @default([])
1075
- }
1076
-
1077
- model EntertainmentService {
1078
- id String @id @default(cuid())
1079
- serviceId String @unique
1080
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1081
- serviceRangeId String?
1082
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1083
- entertainmentServiceTypes EntertainmentServiceType[]
1084
- entertainmentServiceSubType String?
1085
- genre MusicGenreType?
1086
- yearsOfExperience YearsOfExperience
1087
- crowdSizeId String? @unique
1088
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1089
- goodsOrServices String[]
1090
- venueTypes String[]
1091
- secondaryVenueTypes String[] @default([])
1092
- }
1093
-
1094
- model Vendor {
1095
- id String @id @default(cuid())
1096
- serviceId String @unique
1097
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1098
- serviceRangeId String?
1099
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1100
- yearsOfExperience YearsOfExperience
1101
- crowdSizeId String? @unique
1102
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1103
- goodsOrServices String[]
1104
- menuItems String?
1105
- venueTypes String[]
1106
- secondaryVenueTypes String[] @default([])
1107
- }
1108
-
1109
- model Exhibitor {
1110
- id String @id @default(cuid())
1111
- serviceId String @unique
1112
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1113
- serviceRangeId String?
1114
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1115
- yearsOfExperience YearsOfExperience
1116
- crowdSizeId String? @unique
1117
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1118
- goodsOrServices String[]
1119
- venueTypes String[]
1120
- secondaryVenueTypes String[] @default([])
1121
- }
1122
-
1123
- model Sponsor {
1124
- id String @id @default(cuid())
1125
- serviceId String @unique
1126
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1127
- serviceRangeId String?
1128
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1129
- yearsOfExperience YearsOfExperience
1130
- crowdSizeId String? @unique
1131
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1132
- goodsOrServices String[]
1133
- menuItems String?
1134
- }
1135
-
1136
- model Venue {
1137
- id String @id @default(cuid())
1138
- serviceId String @unique
1139
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1140
- // serviceConnectionId String? //Check: ?
1141
- // serviceConnection String?
1142
- yearsInBusiness YearsOfExperience @default(LessThanOneYear)
1143
- amenities String[]
1144
- menuItems String?
1145
- features String[]
1146
- venueTypes String[]
1147
- secondaryVenueTypes String[] @default([])
1148
- pitch String?
1149
- capacity Int?
1150
- trademark Boolean?
1151
- manager Boolean?
1152
- allowed String?
1153
- notAllowed String?
1154
- vibe String?
1155
- dress String?
1156
-
1157
- pricingPlan VenuePricingPlan? @default(Percentage)
1158
- subscriptionStatus SubscriptionStatus?
1159
- subscriptionStartDate DateTime?
1160
-
1161
- bashEvents BashEvent[]
1162
- }
1163
-
1164
- // model VenuePricing {
1165
- // id String @id @default(cuid())
1166
- // venuePricingPlan VenuePricingPlan
1167
- // percentageRate Float? @default(0.15)
1168
- // }
1169
-
1170
- enum VenuePricingPlan {
1171
- Percentage
1172
- Subscription
1173
- }
1174
-
1175
- enum SubscriptionStatus {
1176
- Active
1177
- Canceled
1178
- Suspended
1179
- Expired
1180
- }
1181
-
1182
- model Organization {
1183
- id String @id @default(cuid())
1184
- serviceId String @unique
1185
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1186
- organizationType OrganizationType[]
1187
- goodsOrServices String[]
1188
- venueTypes String[]
1189
- secondaryVenueTypes String[] @default([])
1190
- }
1191
-
1192
- enum EventServiceType {
1193
- Investor
1194
- LongTermLoan
1195
- ShortTermLoan
1196
- EventPlanning
1197
- Caterer
1198
- Cleaner
1199
- Decorator
1200
- InteriorDesigner
1201
- RentalEquipmentProvider
1202
- FoodAndBeverageProvider
1203
- MediaCapture
1204
- AVTechnician
1205
- GraphicDesigner
1206
- Influencer
1207
- Promoter
1208
- CelebrityAppearance
1209
- CrewHand
1210
- EventManager
1211
- VirtualAssistant
1212
- Consulting
1213
- Transportation
1214
- }
1215
-
1216
- enum EntertainmentServiceType {
1217
- Emcees
1218
- DJs
1219
- Bands
1220
- SoloMusicians
1221
- Comedy
1222
- VarietyActs
1223
- PerformanceArtists
1224
- Magic
1225
- Dancers
1226
- Aerialists
1227
- Impersonators
1228
- Speakers
1229
- Auctioneers
1230
- }
1231
-
1232
- enum OrganizationType {
1233
- Church
1234
- GreekLife
1235
- SocialClub
1236
- Nonprofit
1237
- Corporation
1238
- EducationalInstitution
1239
- Sports
1240
- Government
1241
- Cultural
1242
- Lifestyle
1243
- Political
1244
- Tourism
1245
- Youth
1246
- Senior
1247
- Tradeshow
1248
- Conference
1249
- FoodAndBeverage
1250
- TechAndStartups
1251
- }
1252
-
1253
- enum YearsOfExperience {
1254
- LessThanOneYear
1255
- OneToThreeYears
1256
- ThreeToFiveYears
1257
- FivePlusYears
1258
- }
1259
-
1260
- model ServiceRange {
1261
- id String @id @default(cuid())
1262
- min Int @default(0)
1263
- max Int @default(50)
1264
- volunteerServices VolunteerService[]
1265
- entertainmentServices EntertainmentService[]
1266
- EventService EventService[]
1267
- Vendor Vendor[]
1268
- Exhibitor Exhibitor[]
1269
- Sponsor Sponsor[]
1270
- }
1271
-
1272
- // model Availability {
1273
- // id String @id @default(cuid())
1274
- // dayOfWeek Int
1275
- // startDateTime DateTime @db.Time
1276
- // endDateTime DateTime @db.Time
1277
- // // Rate Rate? @relation(fields: [rateId], references: [id])
1278
- // rateId String?
1279
- // }
1280
-
1281
- // model Rate {
1282
- // id String @id @default(cuid())
1283
- // serviceMultipleRatesId String?
1284
- // serviceMultipleRates Service? @relation("MultipleRates", fields: [serviceMultipleRatesId], references: [id], onDelete: Cascade)
1285
- // bashEventId String?
1286
- // bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
1287
- // waitList User[]
1288
- // price Int @default(0)
1289
- // title String @default("Free")
1290
- // sortOrder Int?
1291
- // description String?
1292
- // maximumNumberOfHours Int @default(24)
1293
- // maximumHourCount Int @default(24)
1294
- // isDonationTier Boolean?
1295
- // hidden Boolean?
1296
- // Availability Availability[]
1297
-
1298
- // // promoCodes BashEventPromoCode[]
1299
- // @@unique([bashEventId, title])
1300
- // }
1301
-
1302
- // model ServiceRate {
1303
- // id String @id @default(cuid())
1304
- // rateType ServiceRateType
1305
- // rate Int?
1306
- // ServiceSpecialRates ServiceSpecialRates[]
1307
- // }
1308
-
1309
- // model ServiceGeneralRates {
1310
- // id String @id @default(cuid())
1311
-
1312
- // serviceRateId String?
1313
- // serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1314
-
1315
- // // generalHourlyRate Int
1316
- // // generalDailyRate Int
1317
- // // generalWeeklyRate Int
1318
- // // generalMonthlyRate Int
1319
- // }
1320
-
1321
- enum ServiceRateType {
1322
- General
1323
- Weekday
1324
- Special
1325
- // CLOSED
1326
- // HOURLY
1327
- // DAILY
1328
- // WEEKLY
1329
- }
1330
-
1331
- //can optionally be associated with a package
1332
- model ServiceAddon {
1333
- id String @id @default(cuid())
1334
- name String
1335
- description String
1336
- price Int?
1337
- quantity Int
1338
-
1339
- servicePackage ServicePackage? @relation(fields: [servicePackageId], references: [id], onDelete: Cascade)
1340
- servicePackageId String?
1341
-
1342
- serviceRatesAssociation ServiceRatesAssociation? @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1343
- serviceRatesAssociationId String?
1344
- }
1345
-
1346
- model ServicePackage {
1347
- id String @id @default(cuid())
1348
- name String
1349
- description String
1350
- price Int
1351
-
1352
- serviceAddons ServiceAddon[]
1353
-
1354
- serviceRatesAssociation ServiceRatesAssociation? @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1355
- serviceRatesAssociationId String?
1356
- }
1357
-
1358
- model ServiceRate {
1359
- id String @id @default(cuid())
1360
- rateType ServiceRateType
1361
- hourlyRate Int?
1362
- dailyRate Int?
1363
- serviceSpecialRates ServiceSpecialRates?
1364
- serviceDailyRates ServiceDailyRates?
1365
- serviceRatesAssociation ServiceRatesAssociation?
1366
-
1367
- @@index([rateType])
1368
- }
1369
-
1370
- // if isAvailable is false it is closed
1371
- model ServiceSpecialRates {
1372
- id String @id @default(cuid())
1373
- startDate DateTime @db.Date
1374
- endDate DateTime @db.Date
1375
-
1376
- serviceRateId String?
1377
- serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1378
- isAvailable Boolean
1379
-
1380
- serviceRatesAssociationId String
1381
- serviceRatesAssociation ServiceRatesAssociation @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1382
-
1383
- @@unique([serviceRateId])
1384
- }
1385
-
1386
- // different days of the week have different rates
1387
- // can block of certain dates of the year and days of the week as being closed
1388
- // can have special rates on different days of the year (single or range)
1389
- // free trial period with promo code (1 or 2 months of listing for free)
1390
- model ServiceDailyRates {
1391
- id String @id @default(cuid())
1392
- dayOfWeek DayOfWeek
1393
- startTime DateTime @db.Time
1394
- endTime DateTime @db.Time
1395
-
1396
- serviceRateId String?
1397
- serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1398
-
1399
- serviceRatesAssociationId String
1400
- serviceRatesAssociation ServiceRatesAssociation @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1401
-
1402
- @@unique([serviceRateId])
1403
- }
1404
-
1405
- model ServiceRatesAssociation {
1406
- id String @id @default(cuid())
1407
-
1408
- serviceId String?
1409
- service Service? @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1410
- volunteerServiceId String?
1411
- volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id], onDelete: Cascade)
1412
-
1413
- serviceGeneralRatesId String?
1414
- serviceGeneralRates ServiceRate? @relation(fields: [serviceGeneralRatesId], references: [id], onDelete: Cascade)
1415
-
1416
- serviceDailyRates ServiceDailyRates[]
1417
- serviceSpecialRates ServiceSpecialRates[]
1418
-
1419
- addons ServiceAddon[]
1420
- packages ServicePackage[]
1421
-
1422
- @@unique([serviceId])
1423
- @@unique([volunteerServiceId])
1424
- @@unique([serviceGeneralRatesId])
1425
- }
1426
-
1427
- enum VisibilityPreference {
1428
- Public
1429
- Private
1430
- }
1431
-
1432
- enum MusicGenreType {
1433
- Classical
1434
- Rock
1435
- HipHop
1436
- Country
1437
- Pop
1438
- EDM
1439
- Indie
1440
- Acoustic
1441
- }
1442
-
1443
- enum UserRole {
1444
- User
1445
- Vendor
1446
- Sponsor
1447
- Investor
1448
- LoanProvider
1449
- VenueProvider
1450
- ServiceProvider
1451
- SuperAdmin
1452
- Exhibitor
1453
- }
1454
-
1455
- model UserLink {
1456
- id String @id @default(cuid())
1457
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1458
- linkId String
1459
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1460
- userId String
1461
- }
1462
-
1463
- model UserRating {
1464
- id String @id @default(cuid())
1465
- rating Int
1466
- comment String?
1467
- givenBy UserRatingGiven @relation(fields: [userRatingGivenId], references: [id], onDelete: Cascade)
1468
- userRatingGivenId String
1469
- givenTo User @relation(fields: [userId], references: [id], onDelete: Cascade)
1470
- userId String
1471
- }
1472
-
1473
- model UserRatingGiven {
1474
- id String @id @default(cuid())
1475
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1476
- userId String
1477
- UserRating UserRating[]
1478
- }
1479
-
1480
- enum UserStatus {
1481
- Active
1482
- Inactive
1483
- Suspended
1484
- Deactivated
1485
- }
1486
-
1487
- model VerificationToken {
1488
- identifier String
1489
- token String @unique
1490
- expires DateTime
1491
-
1492
- @@unique([identifier, token])
1493
- }
1494
-
1495
- model ServiceLink {
1496
- id String @id @default(cuid())
1497
- serviceId String
1498
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1499
- linkId String
1500
- link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1501
-
1502
- @@index([serviceId])
1503
- }
1504
-
1505
- enum ServiceTypes {
1506
- EventServices
1507
- EntertainmentServices
1508
- Vendors
1509
- Exhibitors
1510
- Sponsors
1511
- Venues
1512
- Organizations
1513
- }
1514
-
1515
- enum EntityType {
1516
- EVENT_SERVICE
1517
- ENTERTAINMENT_SERVICE
1518
- VENDOR
1519
- EXHIBITOR
1520
- SPONSOR
1521
- VENUE
1522
- ORGANIZATION
1523
- BASH_EVENT // For BashEvents
1524
- }
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) //stored multipled by 100 to allow for decimals
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 Booking {
360
+ id String @id @default(cuid())
361
+ serviceId String
362
+ service Service @relation(fields: [serviceId], references: [id])
363
+ validDate DateTime?
364
+ forUserId String?
365
+ forUser User? @relation(fields: [forUserId], references: [id])
366
+ fullName String?
367
+ email String?
368
+ paidOn DateTime?
369
+ requireDeposit Boolean?
370
+ status BookingStatus?
371
+ geoFenceCheckInUnnecessary Boolean?
372
+ checkedInAt DateTime?
373
+ checkedOutAt DateTime?
374
+ checkoutId String?
375
+ checkout Checkout? @relation(fields: [checkoutId], references: [id])
376
+
377
+ @@index([serviceId])
378
+ @@index([forUserId])
379
+ @@index([checkoutId])
380
+ }
381
+
382
+ model unusedModelButNeededForSomeTypesToBeDefinedForTypescript {
383
+ id String @id @default(cuid())
384
+ doNotUseVibeEnum BashEventVibeTags @default(Wild)
385
+ doNotUseDressEnum BashEventDressTags @default(Casual)
386
+ doNotUseBashEventType BashEventType @default(Other)
387
+ doNotUseDayOfWeek DayOfWeek @default(Sunday)
388
+ }
389
+
390
+ model Recurrence {
391
+ id String @id @default(cuid())
392
+ interval Int @default(1)
393
+ bashEventId String @unique
394
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
395
+ frequency RecurringFrequency @default(Never)
396
+ ends DateTime @default(now())
397
+ repeatOnDays DayOfWeek[]
398
+ repeatOnDayOfMonth Int?
399
+ repeatYearlyDate DateTime?
400
+ }
401
+
402
+ enum DayOfWeek {
403
+ Sunday
404
+ Monday
405
+ Tuesday
406
+ Wednesday
407
+ Thursday
408
+ Friday
409
+ Saturday
410
+ }
411
+
412
+ enum RecurringFrequency {
413
+ Never
414
+ Daily
415
+ Weekly
416
+ Monthly
417
+ Yearly
418
+ }
419
+
420
+ enum BashEventVibeTags {
421
+ Wild
422
+ Calm
423
+ }
424
+
425
+ enum BashEventDressTags {
426
+ Casual
427
+ BusinessCasual
428
+ Formal
429
+ }
430
+
431
+ // enum ServicesTags {
432
+ // Fast
433
+ // Reliable
434
+ // AwardRecipient
435
+ // }
436
+
437
+ enum BashEventType {
438
+ AfterParty
439
+ AnimeAndCosplayFestival
440
+ AnniversaryCelebration
441
+ ArtExhibitOpening
442
+ ArtAndCraftNight
443
+ BBQCookout
444
+ BabyShower
445
+ BachelorOrBacheloretteParty
446
+ BeachParty
447
+ Birthday
448
+ BoatPartyOrCruise
449
+ Bonfire
450
+ BookClubMeeting
451
+ BridalShower
452
+ BrunchGathering
453
+ CarShow
454
+ CarnivalAndFair
455
+ CasinoNight
456
+ CasualMixer
457
+ CharityBall
458
+ CharityFundraiser
459
+ ChristmasParty
460
+ ChurchEvent
461
+ CircusOrCarnivalParty
462
+ CocktailParty
463
+ CollegeParty_FraternityOrSorority
464
+ ComedyShowOrStandUpComedyNight
465
+ ComicConvention
466
+ Competition
467
+ Concert
468
+ CookingCompetition
469
+ CorporateEventOrOfficeParty
470
+ CostumeParty_Theme_Based
471
+ CulturalFestival
472
+ DanceParty
473
+ DesertRave
474
+ DiscoNight
475
+ EasterGathering
476
+ EngagementParty
477
+ ESportsGamingTournament
478
+ ExclusiveLuxuryRetreat
479
+ FantasyThemedParty
480
+ FashionShow
481
+ Fireside
482
+ FitnessFestival
483
+ FlashMob
484
+ Festival
485
+ FestivalFilm
486
+ FestivalFood
487
+ FundraisingEvent
488
+ GalaDinner
489
+ GameNight
490
+ GamingEvent
491
+ GardenParty
492
+ GoingAwayPartyOrFarewell
493
+ GraduationParty
494
+ HalloweenCostumeParty
495
+ HanukkahParty
496
+ HistoricalEraParty
497
+ HolidayParty
498
+ HouseParty
499
+ HousewarmingParty
500
+ KaraokeNight
501
+ KiteFlyingFestival
502
+ LiveBandPerformanceInALocalVenue
503
+ Luau
504
+ MansionParty
505
+ MardiGras
506
+ MasqueradeBall
507
+ MotorcycleRally
508
+ MovieNight
509
+ MoviePremiere
510
+ MusicFestival
511
+ NewYearsEveCelebration
512
+ OpenMicNight
513
+ OutdoorActivity
514
+ OutdoorConcert
515
+ OutdoorMovieNight_WithAProjector
516
+ Parade
517
+ Party
518
+ PoolParty
519
+ Potluck
520
+ PotluckVegan
521
+ PreParty
522
+ ProductLaunch
523
+ ProfessionalNetworkingEvent
524
+ Rave_General
525
+ RetirementCelebration
526
+ Reunion_FamilyOrSchoolOrFriends
527
+ SafariAdventureParty
528
+ SchoolEvent_MiddleSchoolOrHighSchoolOrCollege
529
+ ScienceFictionThemedParty
530
+ SocialClubEvent
531
+ SportsTournament
532
+ SportsWatchParty
533
+ SuperheroThemedParty
534
+ SurfCompetition
535
+ ThanksgivingDinner
536
+ ThemedCostumeParty
537
+ ThemedDinnerParty
538
+ ThemedPubCrawl
539
+ Tournament
540
+ TravelAndTradeShow
541
+ TriviaNight
542
+ ValentinesDayParty
543
+ WeddingReception
544
+ WelcomeHomeParty
545
+ WellnessFestival
546
+ WineTastingEvent
547
+ Other
548
+ }
549
+
550
+ model CustomBashEventType {
551
+ id String @id @default(cuid())
552
+ key String @unique
553
+ displayName String
554
+ }
555
+
556
+ model AmountOfGuests {
557
+ id String @id @default(cuid())
558
+ bashEvent BashEvent?
559
+ exhibitor Exhibitor?
560
+ eventService EventService?
561
+ entertainmentService EntertainmentService?
562
+ vendor Vendor?
563
+ sponsor Sponsor?
564
+
565
+ minimum Int? @default(10)
566
+ ideal Int? @default(35)
567
+ showMinimumGuests Boolean @default(true)
568
+ showIdealGuests Boolean @default(true)
569
+ venueId String?
570
+ organizationId String?
571
+ }
572
+
573
+ enum Privacy {
574
+ Public
575
+ ConnectionsOnly
576
+ InviteOnly
577
+ }
578
+
579
+ model TargetAudience {
580
+ id String @id @default(cuid())
581
+ ageRange AgeRange[]
582
+ secondaryAgeRange AgeRange[]
583
+ gender Gender[]
584
+ secondaryGender Gender[]
585
+ occupation Occupation[]
586
+ secondaryOccupation Occupation[]
587
+ education Education[]
588
+ secondaryEducation Education[]
589
+ showOnDetailPage Boolean @default(true)
590
+ bashEvent BashEvent?
591
+ service Service?
592
+ }
593
+
594
+ enum AgeRange {
595
+ Sixteen_17
596
+ Eighteen_20
597
+ TwentyOne_25
598
+ TwentySix_34
599
+ ThirtyFive_49
600
+ Fifty_64
601
+ SixtyFivePlus
602
+ NoPreference
603
+ }
604
+
605
+ enum Occupation {
606
+ Students
607
+ Entrepreneurs
608
+ SmallBusinesses
609
+ Corporations
610
+ Professionals
611
+ Creatives
612
+ AngelInvestors
613
+ FamilyOffices
614
+ Retirees
615
+ Academics
616
+ Government
617
+ NonProfits
618
+ NoPreference
619
+ }
620
+
621
+ enum Education {
622
+ HighSchool
623
+ SomeCollege
624
+ InCollege
625
+ Bachelors
626
+ GraduateStudent
627
+ Masters
628
+ Doctorate
629
+ NoPreference
630
+ }
631
+
632
+ enum BashStatus {
633
+ Draft
634
+ PreSale
635
+ Published
636
+ }
637
+
638
+ enum ServiceStatus {
639
+ Draft
640
+ Created
641
+ }
642
+
643
+ enum ServiceCondition {
644
+ Pending
645
+ Published
646
+ Suspended
647
+ Deactivated
648
+ }
649
+
650
+ enum VolunteerServiceStatus {
651
+ Draft
652
+ Pending
653
+ Created
654
+ }
655
+
656
+ model DocumentID {
657
+ id String @id @default(cuid())
658
+ givenName String?
659
+ familyName String?
660
+ middleName String?
661
+ suffix String?
662
+ street String?
663
+ city String?
664
+ state String?
665
+ stateName String?
666
+ zipCode String?
667
+ idNumber String?
668
+ expires String?
669
+ dob String?
670
+ issueDate String?
671
+ idType String?
672
+ userId String? @unique
673
+ user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
674
+ }
675
+
676
+ model EventLink {
677
+ id String @id @default(cuid())
678
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
679
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
680
+ linkId String
681
+ bashEventId String
682
+ }
683
+
684
+ enum Gender {
685
+ Male
686
+ Female
687
+ Other
688
+ NoPreference
689
+ }
690
+
691
+ model Investment {
692
+ id String @id @default(cuid())
693
+ investorId String
694
+ bashEventId String
695
+ investor User @relation(fields: [investorId], references: [id], onDelete: Cascade)
696
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
697
+ amount Float
698
+ type InvestmentType
699
+ paidOn String?
700
+ }
701
+
702
+ enum InvestmentType {
703
+ Equity
704
+ Event
705
+ }
706
+
707
+ model Link {
708
+ id String @id @default(cuid())
709
+ url String
710
+ type String?
711
+ icon String?
712
+ eventLinks EventLink[]
713
+ userLinks UserLink[]
714
+ serviceLinks ServiceLink[]
715
+ volunteerServiceId String?
716
+ volunteerService VolunteerService? @relation("VolunteerServiceLinks", fields: [volunteerServiceId], references: [id])
717
+ }
718
+
719
+ model Media {
720
+ id String @id @default(cuid())
721
+ url String @unique
722
+ type MediaType
723
+ mimetype String?
724
+ bashEventsReferencingMe BashEvent[]
725
+ sponsoredEventsReferencingMe SponsoredEvent[]
726
+ serviceReferencingMe Service[]
727
+ volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
728
+ volunteerServiceId String?
729
+
730
+ stripeAccount StripeAccount[]
731
+ }
732
+
733
+ enum MediaType {
734
+ Unknown
735
+ Empty
736
+ Image
737
+ Video
738
+ }
739
+
740
+ model Prize {
741
+ id String @id @default(cuid())
742
+ prizeWorth Float?
743
+ prizeType PrizeType
744
+ name String
745
+ prizeLevel Int
746
+ description String
747
+ competition Competition? @relation(fields: [competitionId], references: [id], onDelete: SetNull)
748
+ competitionId String?
749
+ paidOn String?
750
+ winner User? @relation(fields: [winnerUserId], references: [id], onDelete: Cascade)
751
+ winnerUserId String?
752
+ }
753
+
754
+ enum PrizeType {
755
+ Monetary
756
+ Merchandise
757
+ Service
758
+ Combo
759
+ }
760
+
761
+ model Review {
762
+ id String @id @default(cuid())
763
+ rating Int
764
+ creatorId String
765
+ creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
766
+ bashEventId String
767
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
768
+ comments BashComment[]
769
+ }
770
+
771
+ model GoogleReview {
772
+ id String @id @default(cuid())
773
+ author_name String?
774
+ rating Float
775
+ text String?
776
+ createdAt DateTime @default(now())
777
+ serviceId String
778
+ // service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
779
+ }
780
+
781
+ model Session {
782
+ id String @id @default(cuid())
783
+ sessionToken String @unique
784
+ userId String
785
+ expires DateTime
786
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
787
+
788
+ @@index([userId])
789
+ }
790
+
791
+ enum Sex {
792
+ Male
793
+ Female
794
+ Other
795
+ }
796
+
797
+ model SponsoredEvent {
798
+ id String @id @default(cuid())
799
+ amount Float?
800
+ paidOn String?
801
+ sponsorType SponsorType
802
+ sponsorId String
803
+ bashEventId String
804
+ sponsor User @relation(fields: [sponsorId], references: [id], onDelete: Cascade)
805
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
806
+ media Media[]
807
+ }
808
+
809
+ enum SponsorType {
810
+ Marketing
811
+ Giveaway
812
+ Awareness
813
+ Trade
814
+ CompetitionPrizeProvider
815
+ }
816
+
817
+ model User {
818
+ id String @id @default(cuid())
819
+ email String @unique
820
+ createdOn DateTime @default(now())
821
+ stripeCustomerId String? @unique
822
+ stripeAccountId String? @unique
823
+ isSuperUser Boolean @default(false)
824
+ googleCalendarAccess String?
825
+ givenName String?
826
+ familyName String?
827
+ hash String?
828
+ emailVerified DateTime?
829
+ image String?
830
+ uploadedImage String?
831
+ dob DateTime?
832
+ gender Gender?
833
+ sex Sex?
834
+ roles UserRole[] @default([User])
835
+ ownedServices Service[] @relation("OwnedService")
836
+ createdServices Service[] @relation("CreatedService")
837
+ createdEvents BashEvent[] @relation("CreatedEvent")
838
+ ticketsISent Ticket[] @relation("TicketsISent")
839
+ ticketsIOwn Ticket[] @relation("TicketsIOwn")
840
+ reviews Review[]
841
+ sponsorships SponsoredEvent[]
842
+ investments Investment[]
843
+ sessions Session[]
844
+ eventTasks EventTask[]
845
+ clubMembers ClubMember[]
846
+ clubAdmins ClubAdmin[]
847
+ links UserLink[]
848
+ status UserStatus
849
+ competitions Competition[]
850
+ competitionSponsorships CompetitionSponsor[]
851
+ competitionPrizes Prize[]
852
+ userRatingGiven UserRatingGiven[]
853
+ userRating UserRating[]
854
+ magicLink String?
855
+ magicLinkExpiration DateTime?
856
+ magicLinkUsed DateTime?
857
+ idVerified DateTime?
858
+ street String?
859
+ city String?
860
+ state String?
861
+ zipCode String?
862
+ country String? @default("US")
863
+ phone String?
864
+ documentIDId String? @unique
865
+ documentID DocumentID?
866
+ comment BashComment[]
867
+ associatedBashes AssociatedBash[]
868
+ associatedServices AssociatedService[]
869
+ invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
870
+ invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
871
+ notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
872
+ remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
873
+ remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
874
+ eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
875
+ checkouts Checkout[]
876
+ ticketTiersWaitListsIveJoined TicketTier[]
877
+ contacts Contact[]
878
+ bashEventPromoCodesIUsed BashEventPromoCode[]
879
+ serviceCheckouts ServiceCheckout[]
880
+ bookingForMe Booking[]
881
+ userSubscription UserSubscription?
882
+ serviceSubcriptions ServiceSubscription[]
883
+ volunteerService VolunteerService[]
884
+ // rate Rate[]
885
+ stripeAccounts StripeAccount[]
886
+ }
887
+
888
+ model Contact {
889
+ id String @id @default(cuid())
890
+ contactOwnerId String
891
+ contactOwner User @relation(fields: [contactOwnerId], references: [id], onDelete: Cascade)
892
+ contactEmail String?
893
+ fullName String?
894
+ phone String?
895
+ requestToConnectSent DateTime?
896
+ requestToConnectAccepted DateTime?
897
+
898
+ @@unique([contactOwnerId, contactEmail])
899
+ @@index([contactEmail])
900
+ }
901
+
902
+ // 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
903
+ model AssociatedBash {
904
+ id String @id @default(cuid())
905
+ bashEventId String
906
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
907
+ invitationId String? @unique
908
+ invitation Invitation? @relation(fields: [invitationId], references: [id])
909
+ ownerEmail String?
910
+ ownerUserId String?
911
+ owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
912
+ isOrganizer Boolean?
913
+ isFavorite Boolean?
914
+ service Service[]
915
+
916
+ @@unique([ownerEmail, bashEventId])
917
+ }
918
+
919
+ // 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)
920
+ model AssociatedService {
921
+ id String @id @default(cuid())
922
+ serviceId String
923
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
924
+ // referralId String? @unique
925
+ // referral Referral? @relation(fields: [referralId], references: [id])
926
+ ownerEmail String?
927
+ ownerUserId String?
928
+ owner User? @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
929
+ isOrganizer Boolean?
930
+ isFavorite Boolean?
931
+
932
+ @@unique([ownerEmail, serviceId])
933
+ }
934
+
935
+ // Common data for all services; 1-1 relation between each individual service model such as Venue
936
+ model Service {
937
+ id String @id @default(cuid())
938
+
939
+ serviceType ServiceTypes?
940
+ serviceStatus ServiceStatus @default(Draft)
941
+ serviceCondition ServiceCondition @default(Pending)
942
+
943
+ // current owner
944
+ ownerId String?
945
+ owner User? @relation("OwnedService", fields: [ownerId], references: [id])
946
+
947
+ // original creator
948
+ creatorId String?
949
+ creator User? @relation("CreatedService", fields: [creatorId], references: [id])
950
+
951
+ createdAt DateTime @default(now())
952
+ updatedAt DateTime? @updatedAt
953
+
954
+ associatedBashesReferencingMe AssociatedBash[]
955
+ associatedServicesReferencingMe AssociatedService[]
956
+
957
+ serviceName String?
958
+ tagline String?
959
+
960
+ // this is not the business info but that which is associated with the service
961
+ place String?
962
+ googlePlaceId String?
963
+ street String?
964
+ city String?
965
+ state String?
966
+ zipCode String?
967
+ country String?
968
+ description String?
969
+ // email String?
970
+ // phone String?
971
+
972
+ pocName String?
973
+ pocPhoneNumber String?
974
+ pocBusinessEmail String?
975
+
976
+ additionalInfo String?
977
+ coverPhoto String?
978
+
979
+ mission String?
980
+ communityInvolvement String?
981
+ emergencyContact String?
982
+ contactDetails String?
983
+ // rates Rate[] @relation("MultipleRates")
984
+ cancellationPolicy String?
985
+ refundPolicy String?
986
+ insurancePolicy String?
987
+ // hoursOfOperation Json? @default("{}")
988
+
989
+ stripeAccountId String?
990
+ stripeAccount StripeAccount? @relation(fields: [stripeAccountId], references: [id], onDelete: Restrict)
991
+
992
+ targetAudienceId String? @unique
993
+ targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
994
+
995
+ visibility VisibilityPreference @default(Public)
996
+
997
+ bashesInterestedIn BashEventType[]
998
+ bookings Booking[]
999
+ media Media[]
1000
+ serviceLinks ServiceLink[]
1001
+
1002
+ volunteerServiceId String?
1003
+ volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
1004
+ eventService EventService?
1005
+ entertainmentService EntertainmentService?
1006
+ vendor Vendor?
1007
+ exhibitor Exhibitor?
1008
+ sponsor Sponsor?
1009
+ venue Venue?
1010
+ organization Organization?
1011
+
1012
+ serviceRatesAssociation ServiceRatesAssociation?
1013
+
1014
+ // googleReviews GoogleReview[]
1015
+
1016
+ bashEvent BashEvent[] // because a service needs to be associated with a bash to post to the bashfeed
1017
+ }
1018
+
1019
+ model StripeAccount {
1020
+ id String @id @default(cuid())
1021
+
1022
+ ownerId String
1023
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Restrict)
1024
+
1025
+ stripeAccountId String
1026
+
1027
+ logoId String?
1028
+ logo Media? @relation(fields: [logoId], references: [id], onDelete: SetNull)
1029
+
1030
+ createdAt DateTime @default(now())
1031
+ updatedAt DateTime @updatedAt
1032
+
1033
+ service Service[]
1034
+
1035
+ @@index([ownerId])
1036
+ }
1037
+
1038
+ model VolunteerService {
1039
+ id String @id @default(cuid())
1040
+ // service Service
1041
+ userId String?
1042
+ user User? @relation(fields: [userId], references: [id])
1043
+ serviceRangeId String?
1044
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1045
+ links Link[] @relation("VolunteerServiceLinks")
1046
+ // availableDateTimes ServiceAvailability[] @relation("AvailableDateTimes")
1047
+ fullName String?
1048
+ address String?
1049
+ email String?
1050
+ phone String?
1051
+ agreedToAgreement Boolean? @default(false)
1052
+ description String?
1053
+ status VolunteerServiceStatus?
1054
+ media Media[]
1055
+
1056
+ serviceRatesAssociation ServiceRatesAssociation?
1057
+
1058
+ service Service[]
1059
+ }
1060
+
1061
+ model EventService {
1062
+ id String @id @default(cuid())
1063
+ serviceId String @unique
1064
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1065
+ serviceRangeId String?
1066
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1067
+ eventServiceTypes EventServiceType[]
1068
+ eventServiceSubType String?
1069
+ yearsOfExperience YearsOfExperience
1070
+ crowdSizeId String? @unique
1071
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1072
+ goodsOrServices String[]
1073
+ menuItems String?
1074
+ venueTypes String[]
1075
+ secondaryVenueTypes String[] @default([])
1076
+ }
1077
+
1078
+ model EntertainmentService {
1079
+ id String @id @default(cuid())
1080
+ serviceId String @unique
1081
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1082
+ serviceRangeId String?
1083
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1084
+ entertainmentServiceTypes EntertainmentServiceType[]
1085
+ entertainmentServiceSubType String?
1086
+ genre MusicGenreType?
1087
+ yearsOfExperience YearsOfExperience
1088
+ crowdSizeId String? @unique
1089
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1090
+ goodsOrServices String[]
1091
+ venueTypes String[]
1092
+ secondaryVenueTypes String[] @default([])
1093
+ }
1094
+
1095
+ model Vendor {
1096
+ id String @id @default(cuid())
1097
+ serviceId String @unique
1098
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1099
+ serviceRangeId String?
1100
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1101
+ yearsOfExperience YearsOfExperience
1102
+ crowdSizeId String? @unique
1103
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1104
+ goodsOrServices String[]
1105
+ menuItems String?
1106
+ venueTypes String[]
1107
+ secondaryVenueTypes String[] @default([])
1108
+ }
1109
+
1110
+ model Exhibitor {
1111
+ id String @id @default(cuid())
1112
+ serviceId String @unique
1113
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1114
+ serviceRangeId String?
1115
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1116
+ yearsOfExperience YearsOfExperience
1117
+ crowdSizeId String? @unique
1118
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1119
+ goodsOrServices String[]
1120
+ venueTypes String[]
1121
+ secondaryVenueTypes String[] @default([])
1122
+ }
1123
+
1124
+ model Sponsor {
1125
+ id String @id @default(cuid())
1126
+ serviceId String @unique
1127
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1128
+ serviceRangeId String?
1129
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
1130
+ yearsOfExperience YearsOfExperience
1131
+ crowdSizeId String? @unique
1132
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1133
+ goodsOrServices String[]
1134
+ menuItems String?
1135
+ }
1136
+
1137
+ model Venue {
1138
+ id String @id @default(cuid())
1139
+ serviceId String @unique
1140
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1141
+ // serviceConnectionId String? //Check: ?
1142
+ // serviceConnection String?
1143
+ yearsInBusiness YearsOfExperience @default(LessThanOneYear)
1144
+ amenities String[]
1145
+ menuItems String?
1146
+ features String[]
1147
+ venueTypes String[]
1148
+ secondaryVenueTypes String[] @default([])
1149
+ pitch String?
1150
+ capacity Int?
1151
+ trademark Boolean?
1152
+ manager Boolean?
1153
+ allowed String?
1154
+ notAllowed String?
1155
+ vibe String?
1156
+ dress String?
1157
+
1158
+ pricingPlan VenuePricingPlan? @default(Percentage)
1159
+ subscriptionStatus SubscriptionStatus?
1160
+ subscriptionStartDate DateTime?
1161
+
1162
+ bashEvents BashEvent[]
1163
+ }
1164
+
1165
+ // model VenuePricing {
1166
+ // id String @id @default(cuid())
1167
+ // venuePricingPlan VenuePricingPlan
1168
+ // percentageRate Float? @default(0.15)
1169
+ // }
1170
+
1171
+ enum VenuePricingPlan {
1172
+ Percentage
1173
+ Subscription
1174
+ }
1175
+
1176
+ enum SubscriptionStatus {
1177
+ Active
1178
+ Canceled
1179
+ Suspended
1180
+ Expired
1181
+ }
1182
+
1183
+ model Organization {
1184
+ id String @id @default(cuid())
1185
+ serviceId String @unique
1186
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1187
+ organizationType OrganizationType[]
1188
+ goodsOrServices String[]
1189
+ venueTypes String[]
1190
+ secondaryVenueTypes String[] @default([])
1191
+ }
1192
+
1193
+ enum EventServiceType {
1194
+ Investor
1195
+ LongTermLoan
1196
+ ShortTermLoan
1197
+ EventPlanning
1198
+ Caterer
1199
+ Cleaner
1200
+ Decorator
1201
+ InteriorDesigner
1202
+ RentalEquipmentProvider
1203
+ FoodAndBeverageProvider
1204
+ MediaCapture
1205
+ AVTechnician
1206
+ GraphicDesigner
1207
+ Influencer
1208
+ Promoter
1209
+ CelebrityAppearance
1210
+ CrewHand
1211
+ EventManager
1212
+ VirtualAssistant
1213
+ Consulting
1214
+ Transportation
1215
+ }
1216
+
1217
+ enum EntertainmentServiceType {
1218
+ Emcees
1219
+ DJs
1220
+ Bands
1221
+ SoloMusicians
1222
+ Comedy
1223
+ VarietyActs
1224
+ PerformanceArtists
1225
+ Magic
1226
+ Dancers
1227
+ Aerialists
1228
+ Impersonators
1229
+ Speakers
1230
+ Auctioneers
1231
+ }
1232
+
1233
+ enum OrganizationType {
1234
+ Church
1235
+ GreekLife
1236
+ SocialClub
1237
+ Nonprofit
1238
+ Corporation
1239
+ EducationalInstitution
1240
+ Sports
1241
+ Government
1242
+ Cultural
1243
+ Lifestyle
1244
+ Political
1245
+ Tourism
1246
+ Youth
1247
+ Senior
1248
+ Tradeshow
1249
+ Conference
1250
+ FoodAndBeverage
1251
+ TechAndStartups
1252
+ }
1253
+
1254
+ enum YearsOfExperience {
1255
+ LessThanOneYear
1256
+ OneToThreeYears
1257
+ ThreeToFiveYears
1258
+ FivePlusYears
1259
+ }
1260
+
1261
+ model ServiceRange {
1262
+ id String @id @default(cuid())
1263
+ min Int @default(0)
1264
+ max Int @default(50)
1265
+ volunteerServices VolunteerService[]
1266
+ entertainmentServices EntertainmentService[]
1267
+ EventService EventService[]
1268
+ Vendor Vendor[]
1269
+ Exhibitor Exhibitor[]
1270
+ Sponsor Sponsor[]
1271
+ }
1272
+
1273
+ // model Availability {
1274
+ // id String @id @default(cuid())
1275
+ // dayOfWeek Int
1276
+ // startDateTime DateTime @db.Time
1277
+ // endDateTime DateTime @db.Time
1278
+ // // Rate Rate? @relation(fields: [rateId], references: [id])
1279
+ // rateId String?
1280
+ // }
1281
+
1282
+ // model Rate {
1283
+ // id String @id @default(cuid())
1284
+ // serviceMultipleRatesId String?
1285
+ // serviceMultipleRates Service? @relation("MultipleRates", fields: [serviceMultipleRatesId], references: [id], onDelete: Cascade)
1286
+ // bashEventId String?
1287
+ // bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
1288
+ // waitList User[]
1289
+ // price Int @default(0)
1290
+ // title String @default("Free")
1291
+ // sortOrder Int?
1292
+ // description String?
1293
+ // maximumNumberOfHours Int @default(24)
1294
+ // maximumHourCount Int @default(24)
1295
+ // isDonationTier Boolean?
1296
+ // hidden Boolean?
1297
+ // Availability Availability[]
1298
+
1299
+ // // promoCodes BashEventPromoCode[]
1300
+ // @@unique([bashEventId, title])
1301
+ // }
1302
+
1303
+ // model ServiceRate {
1304
+ // id String @id @default(cuid())
1305
+ // rateType ServiceRateType
1306
+ // rate Int?
1307
+ // ServiceSpecialRates ServiceSpecialRates[]
1308
+ // }
1309
+
1310
+ // model ServiceGeneralRates {
1311
+ // id String @id @default(cuid())
1312
+
1313
+ // serviceRateId String?
1314
+ // serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1315
+
1316
+ // // generalHourlyRate Int
1317
+ // // generalDailyRate Int
1318
+ // // generalWeeklyRate Int
1319
+ // // generalMonthlyRate Int
1320
+ // }
1321
+
1322
+ enum ServiceRateType {
1323
+ General
1324
+ Weekday
1325
+ Special
1326
+ // CLOSED
1327
+ // HOURLY
1328
+ // DAILY
1329
+ // WEEKLY
1330
+ }
1331
+
1332
+ //can optionally be associated with a package
1333
+ model ServiceAddon {
1334
+ id String @id @default(cuid())
1335
+ name String
1336
+ description String
1337
+ price Int?
1338
+ quantity Int
1339
+
1340
+ servicePackage ServicePackage? @relation(fields: [servicePackageId], references: [id], onDelete: Cascade)
1341
+ servicePackageId String?
1342
+
1343
+ serviceRatesAssociation ServiceRatesAssociation? @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1344
+ serviceRatesAssociationId String?
1345
+ }
1346
+
1347
+ model ServicePackage {
1348
+ id String @id @default(cuid())
1349
+ name String
1350
+ description String
1351
+ price Int
1352
+
1353
+ serviceAddons ServiceAddon[]
1354
+
1355
+ serviceRatesAssociation ServiceRatesAssociation? @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1356
+ serviceRatesAssociationId String?
1357
+ }
1358
+
1359
+ model ServiceRate {
1360
+ id String @id @default(cuid())
1361
+ rateType ServiceRateType
1362
+ hourlyRate Int?
1363
+ dailyRate Int?
1364
+ serviceSpecialRates ServiceSpecialRates?
1365
+ serviceDailyRates ServiceDailyRates?
1366
+ serviceRatesAssociation ServiceRatesAssociation?
1367
+
1368
+ @@index([rateType])
1369
+ }
1370
+
1371
+ // if isAvailable is false it is closed
1372
+ model ServiceSpecialRates {
1373
+ id String @id @default(cuid())
1374
+ startDate DateTime @db.Date
1375
+ endDate DateTime @db.Date
1376
+
1377
+ serviceRateId String?
1378
+ serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1379
+ isAvailable Boolean
1380
+
1381
+ serviceRatesAssociationId String
1382
+ serviceRatesAssociation ServiceRatesAssociation @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1383
+
1384
+ @@unique([serviceRateId])
1385
+ }
1386
+
1387
+ // different days of the week have different rates
1388
+ // can block of certain dates of the year and days of the week as being closed
1389
+ // can have special rates on different days of the year (single or range)
1390
+ // free trial period with promo code (1 or 2 months of listing for free)
1391
+ model ServiceDailyRates {
1392
+ id String @id @default(cuid())
1393
+ dayOfWeek DayOfWeek
1394
+ startTime DateTime @db.Time
1395
+ endTime DateTime @db.Time
1396
+
1397
+ serviceRateId String?
1398
+ serviceRate ServiceRate? @relation(fields: [serviceRateId], references: [id], onDelete: Cascade)
1399
+
1400
+ serviceRatesAssociationId String
1401
+ serviceRatesAssociation ServiceRatesAssociation @relation(fields: [serviceRatesAssociationId], references: [id], onDelete: Cascade)
1402
+
1403
+ @@unique([serviceRateId])
1404
+ }
1405
+
1406
+ model ServiceRatesAssociation {
1407
+ id String @id @default(cuid())
1408
+
1409
+ serviceId String?
1410
+ service Service? @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1411
+ volunteerServiceId String?
1412
+ volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id], onDelete: Cascade)
1413
+
1414
+ serviceGeneralRatesId String?
1415
+ serviceGeneralRates ServiceRate? @relation(fields: [serviceGeneralRatesId], references: [id], onDelete: Cascade)
1416
+
1417
+ serviceDailyRates ServiceDailyRates[]
1418
+ serviceSpecialRates ServiceSpecialRates[]
1419
+
1420
+ addons ServiceAddon[]
1421
+ packages ServicePackage[]
1422
+
1423
+ @@unique([serviceId])
1424
+ @@unique([volunteerServiceId])
1425
+ @@unique([serviceGeneralRatesId])
1426
+ }
1427
+
1428
+ enum VisibilityPreference {
1429
+ Public
1430
+ Private
1431
+ }
1432
+
1433
+ enum MusicGenreType {
1434
+ Classical
1435
+ Rock
1436
+ HipHop
1437
+ Country
1438
+ Pop
1439
+ EDM
1440
+ Indie
1441
+ Acoustic
1442
+ }
1443
+
1444
+ enum UserRole {
1445
+ User
1446
+ Vendor
1447
+ Sponsor
1448
+ Investor
1449
+ LoanProvider
1450
+ VenueProvider
1451
+ ServiceProvider
1452
+ SuperAdmin
1453
+ Exhibitor
1454
+ }
1455
+
1456
+ model UserLink {
1457
+ id String @id @default(cuid())
1458
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1459
+ linkId String
1460
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1461
+ userId String
1462
+ }
1463
+
1464
+ model UserRating {
1465
+ id String @id @default(cuid())
1466
+ rating Int
1467
+ comment String?
1468
+ givenBy UserRatingGiven @relation(fields: [userRatingGivenId], references: [id], onDelete: Cascade)
1469
+ userRatingGivenId String
1470
+ givenTo User @relation(fields: [userId], references: [id], onDelete: Cascade)
1471
+ userId String
1472
+ }
1473
+
1474
+ model UserRatingGiven {
1475
+ id String @id @default(cuid())
1476
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1477
+ userId String
1478
+ UserRating UserRating[]
1479
+ }
1480
+
1481
+ enum UserStatus {
1482
+ Active
1483
+ Inactive
1484
+ Suspended
1485
+ Deactivated
1486
+ }
1487
+
1488
+ model VerificationToken {
1489
+ identifier String
1490
+ token String @unique
1491
+ expires DateTime
1492
+
1493
+ @@unique([identifier, token])
1494
+ }
1495
+
1496
+ model ServiceLink {
1497
+ id String @id @default(cuid())
1498
+ serviceId String
1499
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1500
+ linkId String
1501
+ link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1502
+
1503
+ @@index([serviceId])
1504
+ }
1505
+
1506
+ enum ServiceTypes {
1507
+ EventServices
1508
+ EntertainmentServices
1509
+ Vendors
1510
+ Exhibitors
1511
+ Sponsors
1512
+ Venues
1513
+ Organizations
1514
+ }
1515
+
1516
+ enum EntityType {
1517
+ EVENT_SERVICE
1518
+ ENTERTAINMENT_SERVICE
1519
+ VENDOR
1520
+ EXHIBITOR
1521
+ SPONSOR
1522
+ VENUE
1523
+ ORGANIZATION
1524
+ BASH_EVENT // For BashEvents
1525
+ }