@bash-app/bash-common 18.3.5 → 18.5.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": "18.3.5",
3
+ "version": "18.5.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?
@@ -485,21 +486,23 @@ model CustomBashEventType {
485
486
  }
486
487
 
487
488
  model AmountOfGuests {
488
- id String @id @default(cuid())
489
- bashEventId String? @unique
490
- bashEvent BashEvent? @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
491
- venueId String? @unique
492
- venue Venue? @relation(fields: [venueId], references: [id])
493
- minimum Int? @default(10)
494
- ideal Int? @default(35)
495
- showMinimumGuests Boolean @default(true)
496
- showIdealGuests Boolean @default(true)
497
- eventService EventService[]
498
- entertainmentService EntertainmentService[]
499
- vendor Vendor[]
500
- exhibitor Exhibitor[]
501
- sponsor Sponsor[]
502
- organization Organization[]
489
+ id String @id @default(cuid())
490
+ bashEvent BashEvent?
491
+ venue Venue?
492
+ exhibitor Exhibitor?
493
+ eventService EventService?
494
+ entertainmentService EntertainmentService?
495
+ vendor Vendor?
496
+ sponsor Sponsor?
497
+ organization Organization?
498
+ minimum Int? @default(10)
499
+ ideal Int? @default(35)
500
+ showMinimumGuests Boolean @default(true)
501
+ showIdealGuests Boolean @default(true)
502
+ venueId String?
503
+ eventServiceId String?
504
+ entertainmentServiceId String?
505
+ vendorId String?
503
506
  }
504
507
 
505
508
  enum Privacy {
@@ -516,15 +519,15 @@ model TargetAudience {
516
519
  education Education @default(NoPreference)
517
520
  showOnDetailPage Boolean @default(true)
518
521
 
519
- bashEvents BashEvent[]
520
- services Service[]
521
- venues Venue[]
522
- vendors Vendor[]
523
- eventService EventService[]
524
- entertainmentService EntertainmentService[]
525
- exhibitor Exhibitor[]
526
- sponsor Sponsor[]
527
- organization Organization[]
522
+ bashEvent BashEvent?
523
+ service Service?
524
+ venue Venue?
525
+ vendor Vendor?
526
+ eventService EventService?
527
+ entertainmentService EntertainmentService?
528
+ exhibitor Exhibitor?
529
+ sponsor Sponsor?
530
+ organization Organization?
528
531
  }
529
532
 
530
533
  enum AgeRange {
@@ -727,11 +730,11 @@ enum SponsorType {
727
730
  }
728
731
 
729
732
  model User {
730
- id String @id @default(cuid())
731
- email String @unique
732
- createdOn DateTime @default(now())
733
- stripeCustomerId String? @unique
734
- stripeAccountId String? @unique
733
+ id String @id @default(cuid())
734
+ email String @unique
735
+ createdOn DateTime @default(now())
736
+ stripeCustomerId String? @unique
737
+ stripeAccountId String? @unique
735
738
  googleCalendarAccess String?
736
739
  givenName String?
737
740
  familyName String?
@@ -742,22 +745,16 @@ model User {
742
745
  dob DateTime?
743
746
  gender Gender?
744
747
  sex Sex?
745
- roles UserRole[] @default([User])
748
+ roles UserRole[] @default([User])
746
749
  services Service[]
747
- createdEvents BashEvent[] @relation("CreatedEvent")
748
- ticketsISent Ticket[] @relation("TicketsISent")
749
- ticketsIOwn Ticket[] @relation("TicketsIOwn")
750
+ createdEvents BashEvent[] @relation("CreatedEvent")
751
+ ticketsISent Ticket[] @relation("TicketsISent")
752
+ ticketsIOwn Ticket[] @relation("TicketsIOwn")
750
753
  reviews Review[]
751
754
  sponsorships SponsoredEvent[]
752
755
  investments Investment[]
753
756
  sessions Session[]
754
757
  eventTasks EventTask[]
755
- eventServices EventService[]
756
- entertainmentServices EntertainmentService[]
757
- vendors Vendor[]
758
- exhibitors Exhibitor[]
759
- sponsors Sponsor[]
760
- organizations Organization[]
761
758
  clubMembers ClubMember[]
762
759
  clubAdmins ClubAdmin[]
763
760
  links UserLink[]
@@ -775,18 +772,18 @@ model User {
775
772
  city String?
776
773
  state String?
777
774
  postalCode String?
778
- country String? @default("US")
775
+ country String? @default("US")
779
776
  phone String?
780
- documentIDId String? @unique
777
+ documentIDId String? @unique
781
778
  documentID DocumentID?
782
779
  comment BashComment[]
783
780
  associatedBashes AssociatedBash[]
784
- invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
785
- invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
786
- notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
787
- remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
788
- remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
789
- eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
781
+ invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
782
+ invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
783
+ notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
784
+ remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
785
+ remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
786
+ eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
790
787
  checkouts Checkout[]
791
788
  ticketTiersWaitListsIveJoined TicketTier[]
792
789
  contacts Contact[]
@@ -851,7 +848,7 @@ model Service {
851
848
  serviceRangeId String @unique
852
849
  serviceRange ServiceRange @relation("ServiceRange", fields: [serviceRangeId], references: [id], onDelete: Cascade)
853
850
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
854
- targetAudienceId String?
851
+ targetAudienceId String? @unique
855
852
  eventService EventService[]
856
853
  entertainmentService EntertainmentService[]
857
854
  vendor Vendor[]
@@ -883,7 +880,8 @@ model EventService {
883
880
  status ServiceStatus @default(Draft)
884
881
  yearsOfExperience YearsOfExperience
885
882
  description String?
886
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
883
+ crowdSizeId String? @unique
884
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
887
885
  additionalInfo String?
888
886
  goodsOrServices String[]
889
887
  menuItems String?
@@ -900,10 +898,7 @@ model EventService {
900
898
  bashesInterestedIn BashEventType[]
901
899
  links ServiceLink[]
902
900
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
903
- targetAudienceId String?
904
- crowdSizeId String?
905
- User User? @relation(fields: [userId], references: [id])
906
- userId String?
901
+ targetAudienceId String? @unique
907
902
  }
908
903
 
909
904
  model EntertainmentService {
@@ -927,7 +922,8 @@ model EntertainmentService {
927
922
  status ServiceStatus @default(Draft)
928
923
  yearsOfExperience YearsOfExperience
929
924
  description String?
930
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
925
+ crowdSizeId String? @unique
926
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
931
927
  additionalInfo String?
932
928
  goodsOrServices String[]
933
929
  venueTypes String[]
@@ -943,10 +939,7 @@ model EntertainmentService {
943
939
  bashesInterestedIn BashEventType[]
944
940
  links ServiceLink[]
945
941
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
946
- targetAudienceId String?
947
- crowdSizeId String?
948
- User User? @relation(fields: [userId], references: [id])
949
- userId String?
942
+ targetAudienceId String? @unique
950
943
  }
951
944
 
952
945
  model Vendor {
@@ -967,7 +960,8 @@ model Vendor {
967
960
  status ServiceStatus @default(Draft)
968
961
  yearsOfExperience YearsOfExperience
969
962
  description String?
970
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
963
+ crowdSizeId String? @unique
964
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
971
965
  additionalInfo String?
972
966
  goodsOrServices String[]
973
967
  menuItems String?
@@ -984,10 +978,7 @@ model Vendor {
984
978
  bashesInterestedIn BashEventType[]
985
979
  links ServiceLink[]
986
980
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
987
- targetAudienceId String?
988
- User User? @relation(fields: [userId], references: [id])
989
- userId String?
990
- crowdSizeId String?
981
+ targetAudienceId String? @unique
991
982
  }
992
983
 
993
984
  model Exhibitor {
@@ -1007,7 +998,10 @@ model Exhibitor {
1007
998
  visibility VisibilityPreference @default(Public)
1008
999
  yearsOfExperience YearsOfExperience
1009
1000
  description String?
1010
- crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1001
+ crowdSizeId String? @unique
1002
+ crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
1003
+ targetAudienceId String? @unique
1004
+ targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1011
1005
  additionalInfo String?
1012
1006
  goodsOrServices String[]
1013
1007
  venueTypes String[]
@@ -1023,11 +1017,6 @@ model Exhibitor {
1023
1017
  insurancePolicy String?
1024
1018
  bashesInterestedIn BashEventType[]
1025
1019
  links ServiceLink[]
1026
- targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1027
- targetAudienceId String?
1028
- User User? @relation(fields: [userId], references: [id])
1029
- userId String?
1030
- crowdSizeId String?
1031
1020
  }
1032
1021
 
1033
1022
  model Sponsor {
@@ -1048,6 +1037,7 @@ model Sponsor {
1048
1037
  status ServiceStatus @default(Draft)
1049
1038
  yearsOfExperience YearsOfExperience
1050
1039
  description String?
1040
+ crowdSizeId String? @unique
1051
1041
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1052
1042
  additionalInfo String?
1053
1043
  goodsOrServices String[]
@@ -1065,16 +1055,13 @@ model Sponsor {
1065
1055
  bashesInterestedIn BashEventType[]
1066
1056
  links ServiceLink[]
1067
1057
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1068
- targetAudienceId String?
1069
- crowdSizeId String?
1070
- User User? @relation(fields: [userId], references: [id])
1071
- userId String?
1058
+ targetAudienceId String? @unique
1072
1059
  }
1073
1060
 
1074
1061
  model Venue {
1075
1062
  id String @id @default(cuid())
1076
- service Service? @relation(fields: [serviceId], references: [id])
1077
- serviceId String?
1063
+ service Service @relation(fields: [serviceId], references: [id])
1064
+ serviceId String
1078
1065
  venueName String
1079
1066
  email String
1080
1067
  streetAddress String
@@ -1089,7 +1076,8 @@ model Venue {
1089
1076
  status ServiceStatus @default(Draft)
1090
1077
  yearsInBusiness YearsOfExperience
1091
1078
  description String?
1092
- capacity AmountOfGuests?
1079
+ capacityId String? @unique
1080
+ capacity AmountOfGuests? @relation(fields: [capacityId], references: [id], onDelete: Cascade)
1093
1081
  amenities String[]
1094
1082
  menuItems String?
1095
1083
  additionalInfo String?
@@ -1108,7 +1096,7 @@ model Venue {
1108
1096
  safetyPolicy String?
1109
1097
  insurancePolicy String?
1110
1098
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1111
- targetAudienceId String?
1099
+ targetAudienceId String? @unique
1112
1100
  bashesInterestedIn BashEventType[]
1113
1101
  links ServiceLink[]
1114
1102
  }
@@ -1131,6 +1119,7 @@ model Organization {
1131
1119
  visibility VisibilityPreference @default(Public)
1132
1120
  status ServiceStatus @default(Draft)
1133
1121
  description String?
1122
+ crowdSizeId String? @unique
1134
1123
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
1135
1124
  additionalInfo String?
1136
1125
  goodsOrServices String[]
@@ -1147,10 +1136,7 @@ model Organization {
1147
1136
  bashesInterestedIn BashEventType[]
1148
1137
  links ServiceLink[]
1149
1138
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id])
1150
- targetAudienceId String?
1151
- crowdSizeId String?
1152
- User User? @relation(fields: [userId], references: [id])
1153
- userId String?
1139
+ targetAudienceId String? @unique
1154
1140
  }
1155
1141
 
1156
1142
  enum EventServiceType {
@@ -74,14 +74,24 @@ export const BASH_EVENT_DATA_TO_INCLUDE = {
74
74
  }
75
75
 
76
76
  export const BASH_EVENT_DATA_TO_CLONE = [
77
- 'targetAudience',
78
- 'amountOfGuests',
79
77
  'ticketTiers',
80
78
  'media',
81
79
  'recurrence',
82
80
  'invitations',
83
81
  ] as const;
84
82
 
83
+ type RemoveCommonProperties<T, U> = keyof (Omit<T, keyof U> & Omit<U, keyof T>);
84
+ export type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
85
+ type BashEventExtMinusDataToCloneType = Omit<BashEventExt, UnionFromArray<typeof BASH_EVENT_DATA_TO_CLONE>>;
86
+
87
+ export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEventExtMinusDataToCloneType>[] = [
88
+ 'creator',
89
+ 'eventTasks',
90
+ 'tickets',
91
+ 'targetAudience',
92
+ 'amountOfGuests',
93
+ ];
94
+
85
95
  export interface BashNotificationExt extends BashNotification {
86
96
  creator?: PublicUser;
87
97
  bashEvent?: BashEvent;
@@ -118,15 +128,6 @@ export const EVENT_TASK_DATA_TO_INCLUDE = {
118
128
  }
119
129
  }
120
130
 
121
- type RemoveCommonProperties<T, U> = keyof (Omit<T, keyof U> & Omit<U, keyof T>);
122
- type UnionFromArray<T extends ReadonlyArray<any>> = T[number];
123
- type BashEventExtMinusDataToCloneType = Omit<BashEventExt, UnionFromArray<typeof BASH_EVENT_DATA_TO_CLONE>>;
124
-
125
- export const BASH_EVENT_DATA_TO_REMOVE: RemoveCommonProperties<BashEvent, BashEventExtMinusDataToCloneType>[] = [
126
- 'creator',
127
- 'eventTasks',
128
- 'tickets'
129
- ];
130
131
 
131
132
  export interface EventServiceExt extends EventService {
132
133
  service: Service;
@@ -167,7 +168,7 @@ export interface SponsorExt extends Sponsor {
167
168
  export interface VendorExt extends Vendor {
168
169
  service: Service;
169
170
  availableDateTimes: Availability[];
170
- targetAudience: TargetAudience;
171
+ targetAudience?: TargetAudience;
171
172
  links: ServiceLinkExt[];
172
173
  crowdSize?: AmountOfGuests;
173
174
  media?: Media[];
@@ -176,9 +177,9 @@ export interface VendorExt extends Vendor {
176
177
  export interface VenueExt extends Venue {
177
178
  service: Service;
178
179
  availableDateTimes: Availability[];
179
- targetAudience: TargetAudience;
180
+ targetAudience?: TargetAudience | null;
180
181
  links: ServiceLinkExt[];
181
- capacity?: AmountOfGuests;
182
+ capacity?: AmountOfGuests | null;
182
183
  media?: Media[];
183
184
  }
184
185