@bash-app/bash-common 20.0.0 → 20.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "20.0.0",
3
+ "version": "20.2.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -205,9 +205,10 @@ model BashEvent {
205
205
  startDateTime DateTime? @default(now())
206
206
  endDateTime DateTime? @default(now())
207
207
  ticketTiers TicketTier[]
208
- targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
209
- targetAudienceId String?
210
- amountOfGuests AmountOfGuests?
208
+ targetAudienceId String? @unique
209
+ targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
210
+ amountOfGuestsId String? @unique
211
+ amountOfGuests AmountOfGuests? @relation(fields: [amountOfGuestsId], references: [id], onDelete: Cascade)
211
212
  recurrence Recurrence?
212
213
  vibe String?
213
214
  occasion String?
@@ -243,7 +244,7 @@ model BashEvent {
243
244
  subtitle String?
244
245
  isFeatured Boolean?
245
246
  isTrending Boolean?
246
- ServiceCheckout ServiceCheckout[]
247
+ serviceCheckout ServiceCheckout[]
247
248
  }
248
249
 
249
250
  model Checkout {
@@ -255,7 +256,7 @@ model Checkout {
255
256
  checkoutDateTime DateTime? @default(now())
256
257
  tickets Ticket[]
257
258
  stripeCheckoutSessionId String? @unique
258
- Booking Booking[]
259
+ bookings Booking[]
259
260
 
260
261
  @@index(bashEventId)
261
262
  }
@@ -532,21 +533,23 @@ model CustomBashEventType {
532
533
  }
533
534
 
534
535
  model AmountOfGuests {
535
- id String @id @default(cuid())
536
- bashEventId String? @unique
537
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
538
- venueId String? @unique
539
- venue Venue? @relation(fields: [venueId], references: [id])
540
- minimum Int? @default(10)
541
- ideal Int? @default(35)
542
- showMinimumGuests Boolean @default(true)
543
- showIdealGuests Boolean @default(true)
544
- eventService EventService[]
545
- entertainmentService EntertainmentService[]
546
- vendor Vendor[]
547
- exhibitor Exhibitor[]
548
- sponsor Sponsor[]
549
- organization Organization[]
536
+ id String @id @default(cuid())
537
+ bashEvent BashEvent?
538
+ venue Venue?
539
+ exhibitor Exhibitor?
540
+ eventService EventService?
541
+ entertainmentService EntertainmentService?
542
+ vendor Vendor?
543
+ sponsor Sponsor?
544
+ organization Organization?
545
+ minimum Int? @default(10)
546
+ ideal Int? @default(35)
547
+ showMinimumGuests Boolean @default(true)
548
+ showIdealGuests Boolean @default(true)
549
+ venueId String?
550
+ eventServiceId String?
551
+ entertainmentServiceId String?
552
+ vendorId String?
550
553
  }
551
554
 
552
555
  enum Privacy {
@@ -563,15 +566,15 @@ model TargetAudience {
563
566
  education Education @default(NoPreference)
564
567
  showOnDetailPage Boolean @default(true)
565
568
 
566
- bashEvents BashEvent[]
567
- services Service[]
568
- venues Venue[]
569
- vendors Vendor[]
570
- eventService EventService[]
571
- entertainmentService EntertainmentService[]
572
- exhibitor Exhibitor[]
573
- sponsor Sponsor[]
574
- organization Organization[]
569
+ bashEvent BashEvent?
570
+ service Service?
571
+ venue Venue?
572
+ vendor Vendor?
573
+ eventService EventService?
574
+ entertainmentService EntertainmentService?
575
+ exhibitor Exhibitor?
576
+ sponsor Sponsor?
577
+ organization Organization?
575
578
  }
576
579
 
577
580
  enum AgeRange {
@@ -774,11 +777,11 @@ enum SponsorType {
774
777
  }
775
778
 
776
779
  model User {
777
- id String @id @default(cuid())
778
- email String @unique
779
- createdOn DateTime @default(now())
780
- stripeCustomerId String? @unique
781
- stripeAccountId String? @unique
780
+ id String @id @default(cuid())
781
+ email String @unique
782
+ createdOn DateTime @default(now())
783
+ stripeCustomerId String? @unique
784
+ stripeAccountId String? @unique
782
785
  googleCalendarAccess String?
783
786
  givenName String?
784
787
  familyName String?
@@ -789,23 +792,16 @@ model User {
789
792
  dob DateTime?
790
793
  gender Gender?
791
794
  sex Sex?
792
- roles UserRole[] @default([User])
795
+ roles UserRole[] @default([User])
793
796
  services Service[]
794
- createdEvents BashEvent[] @relation("CreatedEvent")
795
- ticketsISent Ticket[] @relation("TicketsISent")
796
- ticketsIOwn Ticket[] @relation("TicketsIOwn")
797
+ createdEvents BashEvent[] @relation("CreatedEvent")
798
+ ticketsISent Ticket[] @relation("TicketsISent")
799
+ ticketsIOwn Ticket[] @relation("TicketsIOwn")
797
800
  reviews Review[]
798
801
  sponsorships SponsoredEvent[]
799
802
  investments Investment[]
800
803
  sessions Session[]
801
804
  eventTasks EventTask[]
802
- eventServices EventService[]
803
- entertainmentServices EntertainmentService[]
804
- vendors Vendor[]
805
- exhibitors Exhibitor[]
806
- sponsors Sponsor[]
807
- venues Venue[]
808
- organizations Organization[]
809
805
  clubMembers ClubMember[]
810
806
  clubAdmins ClubAdmin[]
811
807
  links UserLink[]
@@ -823,18 +819,18 @@ model User {
823
819
  city String?
824
820
  state String?
825
821
  postalCode String?
826
- country String? @default("US")
822
+ country String? @default("US")
827
823
  phone String?
828
- documentIDId String? @unique
824
+ documentIDId String? @unique
829
825
  documentID DocumentID?
830
826
  comment BashComment[]
831
827
  associatedBashes AssociatedBash[]
832
- invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
833
- invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
834
- notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
835
- remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
836
- remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
837
- eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
828
+ invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
829
+ invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
830
+ notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
831
+ remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
832
+ remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
833
+ eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
838
834
  checkouts Checkout[]
839
835
  ticketTiersWaitListsIveJoined TicketTier[]
840
836
  contacts Contact[]
@@ -904,7 +900,7 @@ model Service {
904
900
  serviceRangeId String @unique
905
901
  serviceRange ServiceRange @relation("ServiceRange", fields: [serviceRangeId], references: [id], onDelete: Cascade)
906
902
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
907
- targetAudienceId String?
903
+ targetAudienceId String? @unique
908
904
  eventService EventService[]
909
905
  entertainmentService EntertainmentService[]
910
906
  vendor Vendor[]
@@ -945,7 +941,8 @@ model EventService {
945
941
  status ServiceStatus @default(Draft)
946
942
  yearsOfExperience YearsOfExperience
947
943
  description String?
948
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
944
+ crowdSizeId String? @unique
945
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
949
946
  additionalInfo String?
950
947
  goodsOrServices String[]
951
948
  menuItems String?
@@ -962,10 +959,7 @@ model EventService {
962
959
  bashesInterestedIn BashEventType[]
963
960
  links ServiceLink[]
964
961
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
965
- targetAudienceId String?
966
- crowdSizeId String?
967
- User User? @relation(fields: [userId], references: [id])
968
- userId String?
962
+ targetAudienceId String? @unique
969
963
  }
970
964
 
971
965
  model EntertainmentService {
@@ -989,7 +983,8 @@ model EntertainmentService {
989
983
  status ServiceStatus @default(Draft)
990
984
  yearsOfExperience YearsOfExperience
991
985
  description String?
992
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
986
+ crowdSizeId String? @unique
987
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
993
988
  additionalInfo String?
994
989
  goodsOrServices String[]
995
990
  venueTypes String[]
@@ -1005,10 +1000,7 @@ model EntertainmentService {
1005
1000
  bashesInterestedIn BashEventType[]
1006
1001
  links ServiceLink[]
1007
1002
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1008
- targetAudienceId String?
1009
- crowdSizeId String?
1010
- User User? @relation(fields: [userId], references: [id])
1011
- userId String?
1003
+ targetAudienceId String? @unique
1012
1004
  }
1013
1005
 
1014
1006
  model Vendor {
@@ -1029,7 +1021,8 @@ model Vendor {
1029
1021
  status ServiceStatus @default(Draft)
1030
1022
  yearsOfExperience YearsOfExperience
1031
1023
  description String?
1032
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1024
+ crowdSizeId String? @unique
1025
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1033
1026
  additionalInfo String?
1034
1027
  goodsOrServices String[]
1035
1028
  menuItems String?
@@ -1046,10 +1039,7 @@ model Vendor {
1046
1039
  bashesInterestedIn BashEventType[]
1047
1040
  links ServiceLink[]
1048
1041
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1049
- targetAudienceId String?
1050
- User User? @relation(fields: [userId], references: [id])
1051
- userId String?
1052
- crowdSizeId String?
1042
+ targetAudienceId String? @unique
1053
1043
  }
1054
1044
 
1055
1045
  model Exhibitor {
@@ -1069,7 +1059,10 @@ model Exhibitor {
1069
1059
  visibility VisibilityPreference @default(Public)
1070
1060
  yearsOfExperience YearsOfExperience
1071
1061
  description String?
1072
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1062
+ crowdSizeId String? @unique
1063
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1064
+ targetAudienceId String? @unique
1065
+ targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1073
1066
  additionalInfo String?
1074
1067
  goodsOrServices String[]
1075
1068
  venueTypes String[]
@@ -1085,11 +1078,6 @@ model Exhibitor {
1085
1078
  insurancePolicy String?
1086
1079
  bashesInterestedIn BashEventType[]
1087
1080
  links ServiceLink[]
1088
- targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1089
- targetAudienceId String?
1090
- User User? @relation(fields: [userId], references: [id])
1091
- userId String?
1092
- crowdSizeId String?
1093
1081
  }
1094
1082
 
1095
1083
  model Sponsor {
@@ -1110,6 +1098,7 @@ model Sponsor {
1110
1098
  status ServiceStatus @default(Draft)
1111
1099
  yearsOfExperience YearsOfExperience
1112
1100
  description String?
1101
+ crowdSizeId String? @unique
1113
1102
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1114
1103
  additionalInfo String?
1115
1104
  goodsOrServices String[]
@@ -1127,16 +1116,13 @@ model Sponsor {
1127
1116
  bashesInterestedIn BashEventType[]
1128
1117
  links ServiceLink[]
1129
1118
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1130
- targetAudienceId String?
1131
- crowdSizeId String?
1132
- User User? @relation(fields: [userId], references: [id])
1133
- userId String?
1119
+ targetAudienceId String? @unique
1134
1120
  }
1135
1121
 
1136
1122
  model Venue {
1137
1123
  id String @id @default(cuid())
1138
- service Service? @relation(fields: [serviceId], references: [id])
1139
- serviceId String?
1124
+ service Service @relation(fields: [serviceId], references: [id])
1125
+ serviceId String
1140
1126
  venueName String
1141
1127
  email String
1142
1128
  streetAddress String
@@ -1151,7 +1137,8 @@ model Venue {
1151
1137
  status ServiceStatus @default(Draft)
1152
1138
  yearsInBusiness YearsOfExperience
1153
1139
  description String?
1154
- capacity AmountOfGuests?
1140
+ capacityId String? @unique
1141
+ capacity AmountOfGuests? @relation(fields: [capacityId], references: [id], onDelete: Cascade)
1155
1142
  amenities String[]
1156
1143
  menuItems String?
1157
1144
  additionalInfo String?
@@ -1170,11 +1157,9 @@ model Venue {
1170
1157
  safetyPolicy String?
1171
1158
  insurancePolicy String?
1172
1159
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1173
- targetAudienceId String?
1160
+ targetAudienceId String? @unique
1174
1161
  bashesInterestedIn BashEventType[]
1175
1162
  links ServiceLink[]
1176
- User User? @relation(fields: [userId], references: [id])
1177
- userId String?
1178
1163
  }
1179
1164
 
1180
1165
  model Organization {
@@ -1195,6 +1180,7 @@ model Organization {
1195
1180
  visibility VisibilityPreference @default(Public)
1196
1181
  status ServiceStatus @default(Draft)
1197
1182
  description String?
1183
+ crowdSizeId String? @unique
1198
1184
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1199
1185
  additionalInfo String?
1200
1186
  goodsOrServices String[]
@@ -1211,10 +1197,7 @@ model Organization {
1211
1197
  bashesInterestedIn BashEventType[]
1212
1198
  links ServiceLink[]
1213
1199
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1214
- targetAudienceId String?
1215
- crowdSizeId String?
1216
- User User? @relation(fields: [userId], references: [id])
1217
- userId String?
1200
+ targetAudienceId String? @unique
1218
1201
  }
1219
1202
 
1220
1203
  enum EventServiceType {
@@ -20,8 +20,9 @@ import {
20
20
  Exhibitor,
21
21
  Sponsor,
22
22
  Organization,
23
+ Booking,
24
+ ServiceType,
23
25
  } from "@prisma/client";
24
- import { AttendeeOfBashEvent } from "./definitions";
25
26
 
26
27
  export const FRONT_END_USER_DATA_TO_SELECT = {
27
28
  id: true,
@@ -75,14 +76,24 @@ export const BASH_EVENT_DATA_TO_INCLUDE = {
75
76
  }
76
77
 
77
78
  export const BASH_EVENT_DATA_TO_CLONE = [
78
- 'targetAudience',
79
- 'amountOfGuests',
80
79
  'ticketTiers',
81
80
  'media',
82
81
  'recurrence',
83
82
  'invitations',
84
83
  ] as const;
85
84
 
85
+ type RemoveCommonProperties<T, U> = keyof (Omit<T, keyof U> & Omit<U, keyof T>);
86
+ export type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
87
+ type BashEventExtMinusDataToCloneType = Omit<BashEventExt, UnionFromArray<typeof BASH_EVENT_DATA_TO_CLONE>>;
88
+
89
+ export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEventExtMinusDataToCloneType>[] = [
90
+ 'creator',
91
+ 'eventTasks',
92
+ 'tickets',
93
+ 'targetAudience',
94
+ 'amountOfGuests',
95
+ ];
96
+
86
97
  export interface BashNotificationExt extends BashNotification {
87
98
  creator?: PublicUser;
88
99
  bashEvent?: BashEvent;
@@ -119,15 +130,6 @@ export const EVENT_TASK_DATA_TO_INCLUDE = {
119
130
  }
120
131
  }
121
132
 
122
- type RemoveCommonProperties<T, U> = keyof (Omit<T, keyof U> & Omit<U, keyof T>);
123
- type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
124
- type BashEventExtMinusDataToCloneType = Omit<BashEventExt, UnionFromArray<typeof BASH_EVENT_DATA_TO_CLONE>>;
125
-
126
- export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEventExtMinusDataToCloneType>[] = [
127
- 'creator',
128
- 'eventTasks',
129
- 'tickets'
130
- ];
131
133
 
132
134
  export interface EventServiceExt extends EventService {
133
135
  service: Service;
@@ -136,7 +138,6 @@ export interface EventServiceExt extends EventService {
136
138
  links: ServiceLinkExt[];
137
139
  crowdSize?: AmountOfGuests;
138
140
  media?: Media[];
139
- status: ServiceStatus;
140
141
  }
141
142
 
142
143
  export interface EntertainmentServiceExt extends EntertainmentService {
@@ -146,7 +147,6 @@ export interface EntertainmentServiceExt extends EntertainmentService {
146
147
  links: ServiceLinkExt[];
147
148
  crowdSize?: AmountOfGuests;
148
149
  media?: Media[];
149
- status: ServiceStatus;
150
150
  }
151
151
 
152
152
  export interface ExhibitorExt extends Exhibitor {
@@ -156,7 +156,6 @@ export interface ExhibitorExt extends Exhibitor {
156
156
  links: ServiceLinkExt[];
157
157
  crowdSize?: AmountOfGuests;
158
158
  media?: Media[];
159
- status: ServiceStatus;
160
159
  }
161
160
 
162
161
  export interface SponsorExt extends Sponsor {
@@ -166,27 +165,24 @@ export interface SponsorExt extends Sponsor {
166
165
  links: ServiceLinkExt[];
167
166
  crowdSize?: AmountOfGuests;
168
167
  media?: Media[];
169
- status: ServiceStatus;
170
168
  }
171
169
 
172
170
  export interface VendorExt extends Vendor {
173
171
  service: Service;
174
172
  availableDateTimes: Availability[];
175
- targetAudience: TargetAudience;
173
+ targetAudience?: TargetAudience;
176
174
  links: ServiceLinkExt[];
177
175
  crowdSize?: AmountOfGuests;
178
176
  media?: Media[];
179
- status: ServiceStatus;
180
177
  }
181
178
 
182
179
  export interface VenueExt extends Venue {
183
180
  service: Service;
184
181
  availableDateTimes: Availability[];
185
- targetAudience: TargetAudience;
182
+ targetAudience?: TargetAudience | null;
186
183
  links: ServiceLinkExt[];
187
- capacity?: AmountOfGuests;
184
+ capacity?: AmountOfGuests | null;
188
185
  media?: Media[];
189
- status: ServiceStatus;
190
186
  }
191
187
 
192
188
  export interface OrganizationExt extends Organization {
@@ -221,6 +217,8 @@ export interface ServiceExt extends Service {
221
217
  exhibitor?: Exhibitor[];
222
218
  sponsor?: Sponsor[];
223
219
  organization?: Organization[];
220
+ bookings?: Booking[];
221
+ serviceType?: ServiceType[];
224
222
  }
225
223
 
226
224
  export interface ServiceLinkExt extends ServiceLink {