@bash-app/bash-common 30.6.0 → 30.8.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 +45 -19
- package/src/index.ts +1 -0
- package/src/utils/service/regexUtils.ts +11 -0
- package/src/utils/service/serviceUtils.ts +1 -1
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -113,6 +113,7 @@ enum TaskStatus {
|
|
|
113
113
|
Rejected
|
|
114
114
|
Completed
|
|
115
115
|
Assigned
|
|
116
|
+
Pending
|
|
116
117
|
Open
|
|
117
118
|
}
|
|
118
119
|
|
|
@@ -214,7 +215,7 @@ model BashNotification {
|
|
|
214
215
|
reminders Reminder[]
|
|
215
216
|
redirectUrl String?
|
|
216
217
|
|
|
217
|
-
@@unique([creatorId, email, bashEventId])
|
|
218
|
+
@@unique([creatorId, email, bashEventId, taskId])
|
|
218
219
|
@@unique([creatorId, email, invitationId])
|
|
219
220
|
@@unique([creatorId, email, serviceBookingId])
|
|
220
221
|
@@index([creatorId])
|
|
@@ -244,8 +245,14 @@ model Invitation {
|
|
|
244
245
|
@@index([email])
|
|
245
246
|
}
|
|
246
247
|
|
|
248
|
+
enum BashEventSource {
|
|
249
|
+
Bash
|
|
250
|
+
Eventbrite
|
|
251
|
+
}
|
|
252
|
+
|
|
247
253
|
model BashEvent {
|
|
248
254
|
id String @id @default(cuid())
|
|
255
|
+
source BashEventSource @default(Bash)
|
|
249
256
|
title String
|
|
250
257
|
creatorId String
|
|
251
258
|
creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
|
|
@@ -1203,7 +1210,7 @@ model Service {
|
|
|
1203
1210
|
serviceLinks ServiceLink[]
|
|
1204
1211
|
|
|
1205
1212
|
volunteerServiceId String? @unique
|
|
1206
|
-
volunteerService VolunteerService? @relation(
|
|
1213
|
+
volunteerService VolunteerService? @relation("ServiceToVolunteer")
|
|
1207
1214
|
eventServiceId String? @unique
|
|
1208
1215
|
eventService EventService? @relation(fields: [eventServiceId], references: [id], onDelete: Cascade)
|
|
1209
1216
|
entertainmentServiceId String? @unique
|
|
@@ -1251,26 +1258,38 @@ model StripeAccount {
|
|
|
1251
1258
|
}
|
|
1252
1259
|
|
|
1253
1260
|
model VolunteerService {
|
|
1254
|
-
id
|
|
1255
|
-
//
|
|
1256
|
-
userId
|
|
1257
|
-
|
|
1258
|
-
serviceRangeId
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1261
|
+
id String @id @default(cuid())
|
|
1262
|
+
userId String // Make required, not nullable
|
|
1263
|
+
user User @relation(fields: [userId], references: [id])
|
|
1264
|
+
serviceRangeId String?
|
|
1265
|
+
serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
|
|
1266
|
+
links Link[] @relation("VolunteerServiceLinks")
|
|
1267
|
+
fullName String?
|
|
1268
|
+
address String?
|
|
1269
|
+
email String?
|
|
1270
|
+
phone String?
|
|
1271
|
+
agreedToAgreement Boolean @default(false) // Remove nullable
|
|
1272
|
+
description String @default("") // Make required with default
|
|
1273
|
+
status VolunteerServiceStatus @default(Draft) // Make required with default
|
|
1274
|
+
media Media[]
|
|
1275
|
+
skills String?
|
|
1276
|
+
experienceLevel String?
|
|
1277
|
+
preferredEventTypes String[] @default([])
|
|
1278
|
+
availability String[] @default([])
|
|
1279
|
+
physicalCapabilities String?
|
|
1280
|
+
equipment String?
|
|
1281
|
+
transportation String?
|
|
1282
|
+
emergencyContactName String?
|
|
1283
|
+
emergencyContactPhone String?
|
|
1270
1284
|
|
|
1271
1285
|
serviceRatesAssociation ServiceRatesAssociation?
|
|
1272
1286
|
|
|
1273
|
-
|
|
1287
|
+
// Make this a required one-to-one relationship
|
|
1288
|
+
service Service @relation("ServiceToVolunteer", fields: [serviceId], references: [id])
|
|
1289
|
+
serviceId String @unique
|
|
1290
|
+
|
|
1291
|
+
// Add indexes for better performance
|
|
1292
|
+
@@index([userId])
|
|
1274
1293
|
}
|
|
1275
1294
|
|
|
1276
1295
|
model EventService {
|
|
@@ -1550,6 +1569,11 @@ enum ServiceRateType {
|
|
|
1550
1569
|
// WEEKLY
|
|
1551
1570
|
}
|
|
1552
1571
|
|
|
1572
|
+
enum ServiceAddonStatus {
|
|
1573
|
+
Enabled
|
|
1574
|
+
Disabled
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1553
1577
|
//can optionally be associated with a package
|
|
1554
1578
|
model ServiceAddon {
|
|
1555
1579
|
id String @id @default(cuid())
|
|
@@ -1558,6 +1582,8 @@ model ServiceAddon {
|
|
|
1558
1582
|
priceCents Int
|
|
1559
1583
|
quantity Int
|
|
1560
1584
|
|
|
1585
|
+
status ServiceAddonStatus @default(Enabled)
|
|
1586
|
+
|
|
1561
1587
|
servicePackage ServicePackage? @relation(fields: [servicePackageId], references: [id], onDelete: Cascade)
|
|
1562
1588
|
servicePackageId String?
|
|
1563
1589
|
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./utils/arrayUtils";
|
|
|
15
15
|
export * from "./utils/promoCodesUtils";
|
|
16
16
|
export * from "./utils/userPromoCodeUtils";
|
|
17
17
|
export * from "./utils/userSubscriptionUtils";
|
|
18
|
+
export * from "./utils/service/regexUtils";
|
|
18
19
|
export * from "./utils/service/serviceUtils";
|
|
19
20
|
export * from "./utils/service/venueUtils";
|
|
20
21
|
export * from "./utils/service/attendeeOptionUtils";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function isPositiveInt(str: string): boolean {
|
|
2
|
+
return /^\d*$/.test(str);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function isPositiveFloat(str: string): boolean {
|
|
6
|
+
return /^\d*\.?\d*$/.test(str);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function isPrice(str: string): boolean {
|
|
10
|
+
return /^\d*\.?\d{0,2}$/.test(str);
|
|
11
|
+
}
|