@bash-app/bash-common 25.4.0 → 26.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 +1 -1
- package/prisma/schema.prisma +51 -31
- package/src/definitions.ts +2 -2
- package/src/extendedSchemas.ts +14 -16
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -344,8 +344,8 @@ enum BookingStatus {
|
|
|
344
344
|
|
|
345
345
|
model Booking {
|
|
346
346
|
id String @id @default(cuid())
|
|
347
|
-
|
|
348
|
-
|
|
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([
|
|
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
|
-
|
|
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
|
-
|
|
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?
|
|
@@ -807,7 +808,7 @@ model User {
|
|
|
807
808
|
gender Gender?
|
|
808
809
|
sex Sex?
|
|
809
810
|
roles UserRole[] @default([User])
|
|
810
|
-
|
|
811
|
+
createdServices Service[] @relation("CreatedService")
|
|
811
812
|
createdEvents BashEvent[] @relation("CreatedEvent")
|
|
812
813
|
ticketsISent Ticket[] @relation("TicketsISent")
|
|
813
814
|
ticketsIOwn Ticket[] @relation("TicketsIOwn")
|
|
@@ -885,13 +886,15 @@ model AssociatedBash {
|
|
|
885
886
|
@@unique([ownerEmail, bashEventId])
|
|
886
887
|
}
|
|
887
888
|
|
|
888
|
-
model
|
|
889
|
+
model Service {
|
|
889
890
|
id String @id @default(cuid())
|
|
890
|
-
ownerId String
|
|
891
|
-
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
|
891
|
+
// ownerId String
|
|
892
|
+
// owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
|
892
893
|
// stripeServiceCustomerId String? @unique
|
|
893
894
|
stripeBusinessId String @unique
|
|
894
|
-
|
|
895
|
+
// stripeBusinessType String @default("Individual")
|
|
896
|
+
creatorId String
|
|
897
|
+
creator User @relation("CreatedService", fields: [creatorId], references: [id], onDelete: Cascade)
|
|
895
898
|
dateCreated DateTime @default(now())
|
|
896
899
|
email String
|
|
897
900
|
street String
|
|
@@ -900,7 +903,7 @@ model Business {
|
|
|
900
903
|
zipCode String
|
|
901
904
|
country String
|
|
902
905
|
phone String
|
|
903
|
-
name String @default("New
|
|
906
|
+
name String @default("New Service")
|
|
904
907
|
coverPhoto String?
|
|
905
908
|
agreedToAgreement Boolean?
|
|
906
909
|
media Media[]
|
|
@@ -937,10 +940,15 @@ model Business {
|
|
|
937
940
|
@@index([phone])
|
|
938
941
|
}
|
|
939
942
|
|
|
943
|
+
model ServiceStripeConnection {
|
|
944
|
+
id String @id @default(cuid())
|
|
945
|
+
stripeAccountId String?
|
|
946
|
+
}
|
|
947
|
+
|
|
940
948
|
model VolunteerService {
|
|
941
949
|
id String @id @default(cuid())
|
|
942
|
-
|
|
943
|
-
|
|
950
|
+
serviceId String?
|
|
951
|
+
service Service? @relation(fields: [serviceId], references: [id])
|
|
944
952
|
userId String?
|
|
945
953
|
user User? @relation(fields: [userId], references: [id])
|
|
946
954
|
serviceRangeId String?
|
|
@@ -959,8 +967,8 @@ model VolunteerService {
|
|
|
959
967
|
|
|
960
968
|
model EventService {
|
|
961
969
|
id String @id @default(cuid())
|
|
962
|
-
|
|
963
|
-
|
|
970
|
+
service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
|
|
971
|
+
serviceId String
|
|
964
972
|
eventServiceName String
|
|
965
973
|
eventServiceTypes EventServiceType[]
|
|
966
974
|
eventServiceSubType String?
|
|
@@ -1000,8 +1008,8 @@ model EventService {
|
|
|
1000
1008
|
|
|
1001
1009
|
model EntertainmentService {
|
|
1002
1010
|
id String @id @default(cuid())
|
|
1003
|
-
|
|
1004
|
-
|
|
1011
|
+
service Service @relation(fields: [serviceId], references: [id])
|
|
1012
|
+
serviceId String
|
|
1005
1013
|
entertainmentServiceName String
|
|
1006
1014
|
entertainmentServiceTypes EntertainmentServiceType[]
|
|
1007
1015
|
entertainmentServiceSubType String?
|
|
@@ -1041,8 +1049,8 @@ model EntertainmentService {
|
|
|
1041
1049
|
|
|
1042
1050
|
model Vendor {
|
|
1043
1051
|
id String @id @default(cuid())
|
|
1044
|
-
|
|
1045
|
-
|
|
1052
|
+
service Service @relation(fields: [serviceId], references: [id])
|
|
1053
|
+
serviceId String
|
|
1046
1054
|
vendorName String
|
|
1047
1055
|
email String
|
|
1048
1056
|
street String
|
|
@@ -1080,8 +1088,8 @@ model Vendor {
|
|
|
1080
1088
|
|
|
1081
1089
|
model Exhibitor {
|
|
1082
1090
|
id String @id @default(cuid())
|
|
1083
|
-
|
|
1084
|
-
|
|
1091
|
+
service Service @relation(fields: [serviceId], references: [id])
|
|
1092
|
+
serviceId String
|
|
1085
1093
|
exhibitorName String
|
|
1086
1094
|
email String
|
|
1087
1095
|
street String
|
|
@@ -1118,8 +1126,8 @@ model Exhibitor {
|
|
|
1118
1126
|
|
|
1119
1127
|
model Sponsor {
|
|
1120
1128
|
id String @id @default(cuid())
|
|
1121
|
-
|
|
1122
|
-
|
|
1129
|
+
service Service @relation(fields: [serviceId], references: [id])
|
|
1130
|
+
serviceId String
|
|
1123
1131
|
sponsorName String
|
|
1124
1132
|
email String
|
|
1125
1133
|
street String
|
|
@@ -1156,8 +1164,10 @@ model Sponsor {
|
|
|
1156
1164
|
|
|
1157
1165
|
model Venue {
|
|
1158
1166
|
id String @id @default(cuid())
|
|
1159
|
-
|
|
1160
|
-
|
|
1167
|
+
service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
|
|
1168
|
+
serviceId String
|
|
1169
|
+
serviceConnectionId String?
|
|
1170
|
+
serviceConnection String?
|
|
1161
1171
|
venueName String
|
|
1162
1172
|
email String
|
|
1163
1173
|
street String
|
|
@@ -1202,8 +1212,8 @@ model Venue {
|
|
|
1202
1212
|
|
|
1203
1213
|
model Organization {
|
|
1204
1214
|
id String @id @default(cuid())
|
|
1205
|
-
|
|
1206
|
-
|
|
1215
|
+
service Service? @relation(fields: [serviceId], references: [id])
|
|
1216
|
+
serviceId String?
|
|
1207
1217
|
organizationName String
|
|
1208
1218
|
organizationType OrganizationType[]
|
|
1209
1219
|
email String
|
|
@@ -1406,8 +1416,8 @@ model VerificationToken {
|
|
|
1406
1416
|
|
|
1407
1417
|
model ServiceLink {
|
|
1408
1418
|
id String @id @default(cuid())
|
|
1409
|
-
|
|
1410
|
-
|
|
1419
|
+
serviceId String
|
|
1420
|
+
service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade)
|
|
1411
1421
|
linkId String
|
|
1412
1422
|
link Link @relation(fields: [linkId], references: [id], onDelete: Cascade)
|
|
1413
1423
|
eventService EventService? @relation(fields: [eventServiceId], references: [id])
|
|
@@ -1425,5 +1435,15 @@ model ServiceLink {
|
|
|
1425
1435
|
organization Organization? @relation(fields: [organizationId], references: [id])
|
|
1426
1436
|
organizationId String?
|
|
1427
1437
|
|
|
1428
|
-
@@index([
|
|
1438
|
+
@@index([serviceId])
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
enum ServiceTypes {
|
|
1442
|
+
EventServices
|
|
1443
|
+
EntertainmentServices
|
|
1444
|
+
Vendors
|
|
1445
|
+
Exhibitors
|
|
1446
|
+
Sponsors
|
|
1447
|
+
Venues
|
|
1448
|
+
Organizations
|
|
1429
1449
|
}
|
package/src/definitions.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
User,
|
|
10
10
|
YearsOfExperience
|
|
11
11
|
} from "@prisma/client";
|
|
12
|
-
import {
|
|
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
|
|
104
|
+
} satisfies {[key: string]: keyof ServiceExt}
|
|
105
105
|
|
|
106
106
|
export type FilterFields = {
|
|
107
107
|
price: string[];
|
package/src/extendedSchemas.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
Invitation,
|
|
7
7
|
Ticket,
|
|
8
8
|
User,
|
|
9
|
-
TicketTier,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
254
|
-
owner
|
|
255
|
-
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
|
-
}
|
|
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
|
-
|
|
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;
|