@bash-app/bash-common 20.5.1 → 21.0.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.5.1",
3
+ "version": "21.0.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",
@@ -11,15 +11,6 @@ datasource db {
11
11
  directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
12
12
  }
13
13
 
14
- model Business {
15
- id String @id @default(cuid())
16
- name String
17
- ein String?
18
- dba String?
19
- address String?
20
- media Media[]
21
- }
22
-
23
14
  model Club {
24
15
  id String @id @default(cuid())
25
16
  name String
@@ -337,11 +328,10 @@ enum UserSubscriptionType {
337
328
  }
338
329
 
339
330
  model SubServiceSubscription {
340
- id String @id @default(cuid())
331
+ id String @id @default(cuid())
341
332
  ownerId String
342
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
343
- type ServiceType
344
- slots Int @default(0)
333
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
334
+ slots Int @default(0)
345
335
  stripeSubscriptionId String?
346
336
  }
347
337
 
@@ -354,7 +344,7 @@ enum BookingStatus {
354
344
  model Booking {
355
345
  id String @id @default(cuid())
356
346
  serviceId String
357
- service Service @relation(fields: [serviceId], references: [id])
347
+ service Business @relation(fields: [serviceId], references: [id])
358
348
  validDate DateTime?
359
349
  forUserId String?
360
350
  forUser User? @relation(fields: [forUserId], references: [id])
@@ -583,7 +573,7 @@ model TargetAudience {
583
573
  showOnDetailPage Boolean @default(true)
584
574
 
585
575
  bashEvent BashEvent?
586
- service Service?
576
+ service Business?
587
577
  venue Venue?
588
578
  vendor Vendor?
589
579
  eventService EventService?
@@ -700,9 +690,8 @@ model Media {
700
690
  type MediaType
701
691
  mimetype String?
702
692
  bashEventsReferencingMe BashEvent[]
703
- businessesReferencingMe Business[]
704
693
  sponsoredEventsReferencingMe SponsoredEvent[]
705
- servicesReferencingMe Service[]
694
+ businessesReferencingMe Business[]
706
695
  venueReferencingMe Venue[]
707
696
  EventService EventService? @relation(fields: [eventServiceId], references: [id])
708
697
  eventServiceId String?
@@ -809,7 +798,7 @@ model User {
809
798
  gender Gender?
810
799
  sex Sex?
811
800
  roles UserRole[] @default([User])
812
- services Service[]
801
+ services Business[]
813
802
  createdEvents BashEvent[] @relation("CreatedEvent")
814
803
  ticketsISent Ticket[] @relation("TicketsISent")
815
804
  ticketsIOwn Ticket[] @relation("TicketsIOwn")
@@ -886,7 +875,7 @@ model AssociatedBash {
886
875
  @@unique([ownerEmail, bashEventId])
887
876
  }
888
877
 
889
- model Service {
878
+ model Business {
890
879
  id String @id @default(cuid())
891
880
  ownerId String
892
881
  owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
@@ -939,7 +928,7 @@ model Service {
939
928
 
940
929
  model EventService {
941
930
  id String @id @default(cuid())
942
- service Service? @relation(fields: [serviceId], references: [id])
931
+ service Business? @relation(fields: [serviceId], references: [id])
943
932
  serviceId String?
944
933
  eventServiceName String
945
934
  eventServiceTypes EventServiceType[]
@@ -980,7 +969,7 @@ model EventService {
980
969
 
981
970
  model EntertainmentService {
982
971
  id String @id @default(cuid())
983
- service Service? @relation(fields: [serviceId], references: [id])
972
+ service Business? @relation(fields: [serviceId], references: [id])
984
973
  serviceId String?
985
974
  entertainmentServiceName String
986
975
  entertainmentServiceTypes EntertainmentServiceType[]
@@ -1021,7 +1010,7 @@ model EntertainmentService {
1021
1010
 
1022
1011
  model Vendor {
1023
1012
  id String @id @default(cuid())
1024
- service Service? @relation(fields: [serviceId], references: [id])
1013
+ service Business? @relation(fields: [serviceId], references: [id])
1025
1014
  serviceId String?
1026
1015
  vendorName String
1027
1016
  email String
@@ -1060,7 +1049,7 @@ model Vendor {
1060
1049
 
1061
1050
  model Exhibitor {
1062
1051
  id String @id @default(cuid())
1063
- service Service? @relation(fields: [serviceId], references: [id])
1052
+ service Business? @relation(fields: [serviceId], references: [id])
1064
1053
  serviceId String?
1065
1054
  exhibitorName String
1066
1055
  email String
@@ -1098,7 +1087,7 @@ model Exhibitor {
1098
1087
 
1099
1088
  model Sponsor {
1100
1089
  id String @id @default(cuid())
1101
- service Service? @relation(fields: [serviceId], references: [id])
1090
+ service Business? @relation(fields: [serviceId], references: [id])
1102
1091
  serviceId String?
1103
1092
  sponsorName String
1104
1093
  email String
@@ -1137,7 +1126,7 @@ model Sponsor {
1137
1126
 
1138
1127
  model Venue {
1139
1128
  id String @id @default(cuid())
1140
- service Service @relation(fields: [serviceId], references: [id])
1129
+ service Business @relation(fields: [serviceId], references: [id])
1141
1130
  serviceId String
1142
1131
  venueName String
1143
1132
  email String
@@ -1180,7 +1169,7 @@ model Venue {
1180
1169
 
1181
1170
  model Organization {
1182
1171
  id String @id @default(cuid())
1183
- service Service? @relation(fields: [serviceId], references: [id])
1172
+ service Business? @relation(fields: [serviceId], references: [id])
1184
1173
  serviceId String?
1185
1174
  organizationName String
1186
1175
  organizationType OrganizationType[]
@@ -1285,10 +1274,10 @@ enum YearsOfExperience {
1285
1274
  }
1286
1275
 
1287
1276
  model ServiceRange {
1288
- id String @id @default(cuid())
1289
- min Int @default(0)
1290
- max Int @default(50)
1291
- serviceServiceRange Service? @relation("ServiceRange")
1277
+ id String @id @default(cuid())
1278
+ min Int @default(0)
1279
+ max Int @default(50)
1280
+ serviceServiceRange Business? @relation("ServiceRange")
1292
1281
  }
1293
1282
 
1294
1283
  model Availability {
@@ -1393,7 +1382,7 @@ model VerificationToken {
1393
1382
  model ServiceLink {
1394
1383
  id String @id @default(cuid())
1395
1384
  serviceId String
1396
- service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1385
+ service Business @relation(fields: [serviceId], references: [id], onDelete: Cascade)
1397
1386
  linkId String
1398
1387
  link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
1399
1388
  eventService EventService? @relation(fields: [eventServiceId], references: [id])
@@ -6,7 +6,7 @@ import {
6
6
  Invitation,
7
7
  Ticket,
8
8
  User,
9
- TicketTier, Service, Review, Media, BashComment, Recurrence, Contact,
9
+ TicketTier, Business, Review, Media, BashComment, Recurrence, Contact,
10
10
  BashNotification, BashEventPromoCode,
11
11
  Reminder, ServiceRange,
12
12
  Checkout,
@@ -132,7 +132,7 @@ export const EVENT_TASK_DATA_TO_INCLUDE = {
132
132
 
133
133
 
134
134
  export interface EventServiceExt extends EventService {
135
- service: Service;
135
+ business: Business;
136
136
  availableDateTimes: Availability[];
137
137
  targetAudience: TargetAudience;
138
138
  links: ServiceLinkExt[];
@@ -141,7 +141,7 @@ export interface EventServiceExt extends EventService {
141
141
  }
142
142
 
143
143
  export interface EntertainmentServiceExt extends EntertainmentService {
144
- service: Service;
144
+ business: Business;
145
145
  availableDateTimes: Availability[];
146
146
  targetAudience: TargetAudience;
147
147
  links: ServiceLinkExt[];
@@ -150,7 +150,7 @@ export interface EntertainmentServiceExt extends EntertainmentService {
150
150
  }
151
151
 
152
152
  export interface ExhibitorExt extends Exhibitor {
153
- service: Service;
153
+ business: Business;
154
154
  availableDateTimes: Availability[];
155
155
  targetAudience: TargetAudience;
156
156
  links: ServiceLinkExt[];
@@ -159,7 +159,7 @@ export interface ExhibitorExt extends Exhibitor {
159
159
  }
160
160
 
161
161
  export interface SponsorExt extends Sponsor {
162
- service: Service;
162
+ business: Business;
163
163
  availableDateTimes: Availability[];
164
164
  targetAudience: TargetAudience;
165
165
  links: ServiceLinkExt[];
@@ -168,7 +168,7 @@ export interface SponsorExt extends Sponsor {
168
168
  }
169
169
 
170
170
  export interface VendorExt extends Vendor {
171
- service: Service;
171
+ business: Business;
172
172
  availableDateTimes: Availability[];
173
173
  targetAudience?: TargetAudience;
174
174
  links: ServiceLinkExt[];
@@ -177,7 +177,7 @@ export interface VendorExt extends Vendor {
177
177
  }
178
178
 
179
179
  export interface VenueExt extends Venue {
180
- service: Service;
180
+ business: Business;
181
181
  availableDateTimes: Availability[];
182
182
  targetAudience?: TargetAudience | null;
183
183
  links: ServiceLinkExt[];
@@ -186,7 +186,7 @@ export interface VenueExt extends Venue {
186
186
  }
187
187
 
188
188
  export interface OrganizationExt extends Organization {
189
- service: Service;
189
+ business: Business;
190
190
  availableDateTimes: Availability[];
191
191
  targetAudience: TargetAudience;
192
192
  links: ServiceLinkExt[];
@@ -212,7 +212,7 @@ export const VENDOR_DATA_TO_INCLUDE = {
212
212
  media: true,
213
213
  }
214
214
 
215
- export interface ServiceExt extends Service {
215
+ export interface ServiceExt extends Business {
216
216
  owner: PublicUser;
217
217
  media: Media[];
218
218
  serviceRange: ServiceRange;
@@ -337,7 +337,7 @@ export interface UserExtraData extends User {
337
337
  }
338
338
 
339
339
  export interface UserExt extends User {
340
- services?: Service[] | null;
340
+ services?: Business[] | null;
341
341
 
342
342
  // Do not include in fetch as there could be thousands of these
343
343
  associatedBashes?: AssociatedBash[] | null;