@bash-app/bash-common 25.5.0 → 26.1.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": "25.5.0",
3
+ "version": "26.1.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",
@@ -344,8 +344,8 @@ enum BookingStatus {
344
344
 
345
345
  model Booking {
346
346
  id String @id @default(cuid())
347
- businessId String
348
- business Business @relation(fields: [businessId], references: [id])
347
+ serviceId String
348
+ service Service @relation(fields: [serviceId], references: [id])
349
349
  validDate DateTime?
350
350
  forUserId String?
351
351
  forUser User? @relation(fields: [forUserId], references: [id])
@@ -360,7 +360,7 @@ model Booking {
360
360
  checkoutId String?
361
361
  checkout Checkout? @relation(fields: [checkoutId], references: [id])
362
362
 
363
- @@index([businessId])
363
+ @@index([serviceId])
364
364
  @@index([forUserId])
365
365
  @@index([checkoutId])
366
366
  }
@@ -571,7 +571,7 @@ model TargetAudience {
571
571
  showOnDetailPage Boolean @default(true)
572
572
 
573
573
  bashEvent BashEvent?
574
- business Business?
574
+ service Service?
575
575
  venue Venue?
576
576
  vendor Vendor?
577
577
  eventService EventService?
@@ -697,8 +697,7 @@ model Media {
697
697
  mimetype String?
698
698
  bashEventsReferencingMe BashEvent[]
699
699
  sponsoredEventsReferencingMe SponsoredEvent[]
700
- businessesReferencingMe Business[]
701
- venueReferencingMe Venue[]
700
+ serviceReferencingMe Service[]
702
701
  EventService EventService? @relation(fields: [eventServiceId], references: [id])
703
702
  eventServiceId String?
704
703
  entertainmentService EntertainmentService? @relation(fields: [entertainmentServiceId], references: [id])
@@ -709,6 +708,8 @@ model Media {
709
708
  exhibitorId String?
710
709
  sponsor Sponsor? @relation(fields: [sponsorId], references: [id])
711
710
  sponsorId String?
711
+ venue Venue? @relation(fields: [venueId], references: [id])
712
+ venueId String?
712
713
  organization Organization? @relation(fields: [organizationId], references: [id])
713
714
  organizationId String?
714
715
  volunteerServiceId String?
@@ -790,12 +791,12 @@ enum SponsorType {
790
791
  }
791
792
 
792
793
  model User {
793
- id String @id @default(cuid())
794
- email String @unique
795
- createdOn DateTime @default(now())
796
- stripeCustomerId String? @unique
797
- stripeAccountId String? @unique
798
- isSuperUser Boolean @default(false)
794
+ id String @id @default(cuid())
795
+ email String @unique
796
+ createdOn DateTime @default(now())
797
+ stripeCustomerId String? @unique
798
+ stripeAccountId String? @unique
799
+ isSuperUser Boolean @default(false)
799
800
  googleCalendarAccess String?
800
801
  givenName String?
801
802
  familyName String?
@@ -806,11 +807,11 @@ model User {
806
807
  dob DateTime?
807
808
  gender Gender?
808
809
  sex Sex?
809
- roles UserRole[] @default([User])
810
- businesses Business[]
811
- createdEvents BashEvent[] @relation("CreatedEvent")
812
- ticketsISent Ticket[] @relation("TicketsISent")
813
- ticketsIOwn Ticket[] @relation("TicketsIOwn")
810
+ roles UserRole[] @default([User])
811
+ createdServices Service[] @relation("CreatedService")
812
+ createdEvents BashEvent[] @relation("CreatedEvent")
813
+ ticketsISent Ticket[] @relation("TicketsISent")
814
+ ticketsIOwn Ticket[] @relation("TicketsIOwn")
814
815
  reviews Review[]
815
816
  sponsorships SponsoredEvent[]
816
817
  investments Investment[]
@@ -833,18 +834,18 @@ model User {
833
834
  city String?
834
835
  state String?
835
836
  zipCode String?
836
- country String? @default("US")
837
+ country String? @default("US")
837
838
  phone String?
838
- documentIDId String? @unique
839
+ documentIDId String? @unique
839
840
  documentID DocumentID?
840
841
  comment BashComment[]
841
842
  associatedBashes AssociatedBash[]
842
- invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
843
- invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
844
- notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
845
- remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
846
- remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
847
- eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
843
+ invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
844
+ invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
845
+ notificationsCreatedByMe BashNotification[] @relation("NotificationsCreatedByMe")
846
+ remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
847
+ remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
848
+ eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
848
849
  checkouts Checkout[]
849
850
  ticketTiersWaitListsIveJoined TicketTier[]
850
851
  contacts Contact[]
@@ -854,6 +855,13 @@ model User {
854
855
  userSubscription UserSubscription?
855
856
  serviceSubcriptions ServiceSubscription[]
856
857
  volunteerService VolunteerService[]
858
+ eventService EventService[]
859
+ entertainmentService EntertainmentService[]
860
+ vendor Vendor[]
861
+ exhibitor Exhibitor[]
862
+ sponsor Sponsor[]
863
+ venue Venue[]
864
+ organization Organization[]
857
865
  }
858
866
 
859
867
  model Contact {
@@ -885,13 +893,15 @@ model AssociatedBash {
885
893
  @@unique([ownerEmail, bashEventId])
886
894
  }
887
895
 
888
- model Business {
896
+ model Service {
889
897
  id String @id @default(cuid())
890
- ownerId String
891
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
898
+ // ownerId String
899
+ // owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
892
900
  // stripeServiceCustomerId String? @unique
893
- stripeBusinessId String @unique
894
- businessType String @default("Individual")
901
+ stripeBusinessId String @unique
902
+ // stripeBusinessType String @default("Individual")
903
+ creatorId String
904
+ creator User @relation("CreatedService", fields: [creatorId], references: [id], onDelete: Cascade)
895
905
  dateCreated DateTime @default(now())
896
906
  email String
897
907
  street String
@@ -900,7 +910,7 @@ model Business {
900
910
  zipCode String
901
911
  country String
902
912
  phone String
903
- name String @default("New Business")
913
+ name String @default("New Service")
904
914
  coverPhoto String?
905
915
  agreedToAgreement Boolean?
906
916
  media Media[]
@@ -937,30 +947,37 @@ model Business {
937
947
  @@index([phone])
938
948
  }
939
949
 
950
+ model ServiceStripeConnection {
951
+ id String @id @default(cuid())
952
+ stripeAccountId String?
953
+ }
954
+
940
955
  model VolunteerService {
941
- id String @id @default(cuid())
942
- businessId String?
943
- business Business? @relation(fields: [businessId], references: [id])
956
+ id String @id @default(cuid())
957
+ serviceId String?
958
+ service Service? @relation(fields: [serviceId], references: [id])
944
959
  userId String?
945
- user User? @relation(fields: [userId], references: [id])
960
+ user User? @relation(fields: [userId], references: [id])
946
961
  serviceRangeId String?
947
- serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
948
- media Media[] @relation("VolunteerServiceMedia")
949
- links Link[] @relation("VolunteerServiceLinks")
950
- availableDateTimes Availability[] @relation("AvailableDateTimes")
962
+ serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
963
+ media Media[] @relation("VolunteerServiceMedia")
964
+ links Link[] @relation("VolunteerServiceLinks")
965
+ availableDateTimes Availability[] @relation("AvailableDateTimes")
951
966
  fullName String?
952
967
  address String?
953
968
  email String?
954
969
  phone String?
955
- agreedToAgreement Boolean @default(false)
970
+ agreedToAgreement Boolean @default(false)
956
971
  description String?
957
972
  status VolunteerServiceStatus?
958
973
  }
959
974
 
960
975
  model EventService {
961
976
  id String @id @default(cuid())
962
- business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
963
- businessId String
977
+ ownerId String
978
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
979
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
980
+ serviceId String
964
981
  eventServiceName String
965
982
  eventServiceTypes EventServiceType[]
966
983
  eventServiceSubType String?
@@ -1000,8 +1017,10 @@ model EventService {
1000
1017
 
1001
1018
  model EntertainmentService {
1002
1019
  id String @id @default(cuid())
1003
- business Business @relation(fields: [businessId], references: [id])
1004
- businessId String
1020
+ ownerId String
1021
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
1022
+ service Service @relation(fields: [serviceId], references: [id])
1023
+ serviceId String
1005
1024
  entertainmentServiceName String
1006
1025
  entertainmentServiceTypes EntertainmentServiceType[]
1007
1026
  entertainmentServiceSubType String?
@@ -1041,8 +1060,10 @@ model EntertainmentService {
1041
1060
 
1042
1061
  model Vendor {
1043
1062
  id String @id @default(cuid())
1044
- business Business @relation(fields: [businessId], references: [id])
1045
- businessId String
1063
+ ownerId String
1064
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
1065
+ service Service @relation(fields: [serviceId], references: [id])
1066
+ serviceId String
1046
1067
  vendorName String
1047
1068
  email String
1048
1069
  street String
@@ -1080,8 +1101,10 @@ model Vendor {
1080
1101
 
1081
1102
  model Exhibitor {
1082
1103
  id String @id @default(cuid())
1083
- business Business @relation(fields: [businessId], references: [id])
1084
- businessId String
1104
+ ownerId String
1105
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
1106
+ service Service @relation(fields: [serviceId], references: [id])
1107
+ serviceId String
1085
1108
  exhibitorName String
1086
1109
  email String
1087
1110
  street String
@@ -1118,8 +1141,10 @@ model Exhibitor {
1118
1141
 
1119
1142
  model Sponsor {
1120
1143
  id String @id @default(cuid())
1121
- business Business @relation(fields: [businessId], references: [id])
1122
- businessId String
1144
+ ownerId String
1145
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
1146
+ service Service @relation(fields: [serviceId], references: [id])
1147
+ serviceId String
1123
1148
  sponsorName String
1124
1149
  email String
1125
1150
  street String
@@ -1156,8 +1181,12 @@ model Sponsor {
1156
1181
 
1157
1182
  model Venue {
1158
1183
  id String @id @default(cuid())
1159
- business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
1160
- businessId String
1184
+ ownerId String
1185
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
1186
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1187
+ serviceId String
1188
+ serviceConnectionId String?
1189
+ serviceConnection String?
1161
1190
  venueName String
1162
1191
  email String
1163
1192
  street String
@@ -1202,8 +1231,10 @@ model Venue {
1202
1231
 
1203
1232
  model Organization {
1204
1233
  id String @id @default(cuid())
1205
- business Business? @relation(fields: [businessId], references: [id])
1206
- businessId String?
1234
+ ownerId String
1235
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
1236
+ service Service? @relation(fields: [serviceId], references: [id])
1237
+ serviceId String?
1207
1238
  organizationName String
1208
1239
  organizationType OrganizationType[]
1209
1240
  email String
@@ -1406,8 +1437,8 @@ model VerificationToken {
1406
1437
 
1407
1438
  model ServiceLink {
1408
1439
  id String @id @default(cuid())
1409
- businessId String
1410
- business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
1440
+ serviceId String
1441
+ service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1411
1442
  linkId String
1412
1443
  link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1413
1444
  eventService EventService? @relation(fields: [eventServiceId], references: [id])
@@ -1425,7 +1456,7 @@ model ServiceLink {
1425
1456
  organization Organization? @relation(fields: [organizationId], references: [id])
1426
1457
  organizationId String?
1427
1458
 
1428
- @@index([businessId])
1459
+ @@index([serviceId])
1429
1460
  }
1430
1461
 
1431
1462
  enum ServiceTypes {
@@ -9,7 +9,7 @@ import {
9
9
  User,
10
10
  YearsOfExperience
11
11
  } from "@prisma/client";
12
- import {BusinessExt, CheckoutExt, PublicUser, VolunteerServiceExt} from "./extendedSchemas";
12
+ import { ServiceExt, CheckoutExt, PublicUser, VolunteerServiceExt} from "./extendedSchemas";
13
13
 
14
14
  export const PASSWORD_MIN_LENGTH = 10 as const;
15
15
  export const PASSWORD_REQUIREMENTS_REGEX = new RegExp(String.raw`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{${PASSWORD_MIN_LENGTH},}$`);
@@ -101,7 +101,7 @@ export const ServiceTypes = {
101
101
  'Sponsors': 'sponsors',
102
102
  'Exhibitors': 'exhibitors',
103
103
  'EntertainmentServices': 'entertainmentServices',
104
- } satisfies {[key: string]: keyof BusinessExt}
104
+ } satisfies {[key: string]: keyof ServiceExt}
105
105
 
106
106
  export type FilterFields = {
107
107
  price: string[];
@@ -6,7 +6,7 @@ import {
6
6
  Invitation,
7
7
  Ticket,
8
8
  User,
9
- TicketTier, Business, Review, Media, BashComment, Recurrence, Contact,
9
+ TicketTier, Service, Review, Media, BashComment, Recurrence, Contact,
10
10
  BashNotification, BashEventPromoCode,
11
11
  Reminder,
12
12
  Checkout,
@@ -131,7 +131,7 @@ export const EVENT_TASK_DATA_TO_INCLUDE = {
131
131
 
132
132
 
133
133
  export interface EventServiceExt extends EventService {
134
- business: Business;
134
+ service: Service;
135
135
  availableDateTimes: Availability[];
136
136
  targetAudience: TargetAudience;
137
137
  links: ServiceLinkExt[];
@@ -140,7 +140,7 @@ export interface EventServiceExt extends EventService {
140
140
  }
141
141
 
142
142
  export interface EntertainmentServiceExt extends EntertainmentService {
143
- business: Business;
143
+ service: Service;
144
144
  availableDateTimes: Availability[];
145
145
  targetAudience: TargetAudience;
146
146
  links: ServiceLinkExt[];
@@ -149,7 +149,7 @@ export interface EntertainmentServiceExt extends EntertainmentService {
149
149
  }
150
150
 
151
151
  export interface ExhibitorExt extends Exhibitor {
152
- business: Business;
152
+ service: Service;
153
153
  availableDateTimes: Availability[];
154
154
  targetAudience: TargetAudience;
155
155
  links: ServiceLinkExt[];
@@ -158,7 +158,7 @@ export interface ExhibitorExt extends Exhibitor {
158
158
  }
159
159
 
160
160
  export interface SponsorExt extends Sponsor {
161
- business: Business;
161
+ service: Service;
162
162
  availableDateTimes: Availability[];
163
163
  targetAudience: TargetAudience;
164
164
  links: ServiceLinkExt[];
@@ -167,7 +167,7 @@ export interface SponsorExt extends Sponsor {
167
167
  }
168
168
 
169
169
  export interface VendorExt extends Vendor {
170
- business: Business;
170
+ service: Service;
171
171
  availableDateTimes: Availability[];
172
172
  targetAudience?: TargetAudience;
173
173
  links: ServiceLinkExt[];
@@ -176,7 +176,6 @@ export interface VendorExt extends Vendor {
176
176
  }
177
177
 
178
178
  export const VENDOR_DATA_TO_INCLUDE = {
179
- business: true,
180
179
  availableDateTimes: true,
181
180
  targetAudience: true,
182
181
  links: true,
@@ -189,7 +188,7 @@ export const SERVICE_LINK_DATA_TO_INCLUDE = {
189
188
  } satisfies Prisma.ServiceLinkInclude;
190
189
 
191
190
  export interface VenueExt extends Venue {
192
- business: Business;
191
+ service?: Service;
193
192
  availableDateTimes: Availability[];
194
193
  targetAudience?: TargetAudience | null;
195
194
  links: ServiceLinkExt[];
@@ -199,7 +198,6 @@ export interface VenueExt extends Venue {
199
198
  }
200
199
 
201
200
  export const VENUE_DATA_TO_INCLUDE = {
202
- business: true,
203
201
  availableDateTimes: true,
204
202
  targetAudience: true,
205
203
  links: {
@@ -224,7 +222,7 @@ export const VOLUNTEER_DATA_TO_INCLUDE = {
224
222
 
225
223
 
226
224
  export interface OrganizationExt extends Organization {
227
- business: Business;
225
+ service?: Service;
228
226
  availableDateTimes: Availability[];
229
227
  targetAudience: TargetAudience;
230
228
  links: ServiceLinkExt[];
@@ -234,7 +232,7 @@ export interface OrganizationExt extends Organization {
234
232
  }
235
233
 
236
234
  export interface VolunteerServiceExt extends VolunteerService {
237
- business?: BusinessExt;
235
+ service?: ServiceExt;
238
236
  serviceRange?: ServiceRange | null;
239
237
  media?: Media[];
240
238
  links?: Link[];
@@ -250,9 +248,9 @@ export interface VolunteerServiceExt extends VolunteerService {
250
248
 
251
249
 
252
250
 
253
- export interface BusinessExt extends Business {
254
- owner: PublicUser;
255
- media: Media[];
251
+ export interface ServiceExt extends Service {
252
+ owner?: PublicUser;
253
+ media?: Media[];
256
254
  targetAudience?: TargetAudience | null;
257
255
  volunteerService?: VolunteerService | null;
258
256
  serviceLinks?: ServiceLinkExt[];
@@ -281,7 +279,7 @@ export const BUSINESS_DATA_TO_INCLUDE = {
281
279
  vendors: {
282
280
  include: VENDOR_DATA_TO_INCLUDE,
283
281
  },
284
- } satisfies Prisma.BusinessInclude;
282
+ }
285
283
 
286
284
 
287
285
  export interface ServiceLinkExt extends ServiceLink {
@@ -369,7 +367,7 @@ export interface UserExtraData extends User {
369
367
  }
370
368
 
371
369
  export interface UserExt extends User {
372
- businesses?: Business[] | null;
370
+ servicees?: Service[] | null;
373
371
 
374
372
  // Do not include in fetch as there could be thousands of these
375
373
  associatedBashes?: AssociatedBash[] | null;