@bash-app/bash-common 30.68.0 → 30.69.1
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 +2 -1
- package/prisma/schema.prisma +331 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bash-app/bash-common",
|
|
3
|
-
"version": "30.
|
|
3
|
+
"version": "30.69.1",
|
|
4
4
|
"description": "Common data and scripts to use on the frontend and backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"tsx": "^4.10.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
+
"@playwright/test": "^1.54.2",
|
|
41
42
|
"@types/jest": "^29.5.5",
|
|
42
43
|
"@types/luxon": "^3.4.2",
|
|
43
44
|
"@types/mixpanel-browser": "^2.60.0",
|
package/prisma/schema.prisma
CHANGED
|
@@ -396,6 +396,12 @@ model BashEvent {
|
|
|
396
396
|
|
|
397
397
|
// Vendor booking relations
|
|
398
398
|
vendorBookingRequests VendorBookingRequest[] @relation("VendorBookingEvent")
|
|
399
|
+
|
|
400
|
+
// Exhibitor booking relations
|
|
401
|
+
exhibitorBookingRequests ExhibitorBookingRequest[] @relation("ExhibitorBookingEvent")
|
|
402
|
+
|
|
403
|
+
// Sponsor booking relations
|
|
404
|
+
sponsorBookingRequests SponsorBookingRequest[] @relation("SponsorBookingEvent")
|
|
399
405
|
}
|
|
400
406
|
|
|
401
407
|
model Coordinates {
|
|
@@ -1056,6 +1062,18 @@ model SponsoredEvent {
|
|
|
1056
1062
|
sponsor User @relation(fields: [sponsorId], references: [id], onDelete: Cascade)
|
|
1057
1063
|
bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
|
|
1058
1064
|
media Media[]
|
|
1065
|
+
|
|
1066
|
+
// Enhanced sponsor display fields
|
|
1067
|
+
displayName String? // Custom display name for sponsor
|
|
1068
|
+
logoUrl String? // Direct logo URL
|
|
1069
|
+
websiteUrl String? // Sponsor website
|
|
1070
|
+
description String? // Sponsor description
|
|
1071
|
+
displayOrder Int? // Order for displaying multiple sponsors
|
|
1072
|
+
isActive Boolean @default(true) // Whether to show this sponsorship
|
|
1073
|
+
tier SponsorTier @default(Bronze) // Sponsorship tier for display priority
|
|
1074
|
+
|
|
1075
|
+
createdAt DateTime @default(now())
|
|
1076
|
+
updatedAt DateTime @updatedAt
|
|
1059
1077
|
}
|
|
1060
1078
|
|
|
1061
1079
|
enum SponsorType {
|
|
@@ -1066,6 +1084,14 @@ enum SponsorType {
|
|
|
1066
1084
|
CompetitionPrizeProvider
|
|
1067
1085
|
}
|
|
1068
1086
|
|
|
1087
|
+
enum SponsorTier {
|
|
1088
|
+
Platinum
|
|
1089
|
+
Gold
|
|
1090
|
+
Silver
|
|
1091
|
+
Bronze
|
|
1092
|
+
Community
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1069
1095
|
model SocialMediaProfile {
|
|
1070
1096
|
id String @id @default(uuid())
|
|
1071
1097
|
platform SocialMediaPlatform
|
|
@@ -1153,29 +1179,38 @@ model User {
|
|
|
1153
1179
|
totalRatings Int?
|
|
1154
1180
|
magicLink String?
|
|
1155
1181
|
magicLinkExpiration DateTime?
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1182
|
+
|
|
1183
|
+
// Founding Host tracking
|
|
1184
|
+
hostNumber Int? // Sequential number for host registration (1-100 for founding hosts)
|
|
1185
|
+
foundingHostBadgeAwarded Boolean @default(false) // Whether they've received the founding host badge
|
|
1186
|
+
firstBashWithAttendeesDate DateTime? // Date when they first completed a bash with attendees
|
|
1187
|
+
bashesCreatedCount Int @default(0) // Total bashes created
|
|
1188
|
+
bashesPublishedCount Int @default(0) // Total bashes published
|
|
1189
|
+
bashesApprovedCount Int @default(0) // Total bashes approved
|
|
1190
|
+
bashesCompletedCount Int @default(0) // Total bashes completed with attendees
|
|
1191
|
+
magicLinkUsed DateTime?
|
|
1192
|
+
idVerified DateTime?
|
|
1193
|
+
street String?
|
|
1194
|
+
city String?
|
|
1195
|
+
state String?
|
|
1196
|
+
zipCode String?
|
|
1197
|
+
country String? @default("US")
|
|
1198
|
+
phone String?
|
|
1199
|
+
socialMediaProfiles SocialMediaProfile[]
|
|
1200
|
+
documentIDId String? @unique
|
|
1201
|
+
documentID DocumentID?
|
|
1202
|
+
comment BashComment[]
|
|
1203
|
+
associatedBashes AssociatedBash[]
|
|
1204
|
+
associatedServices AssociatedService[]
|
|
1205
|
+
invitationsCreatedByMe Invitation[] @relation("InvitationsCreatedByMe")
|
|
1206
|
+
invitationsSentToMe Invitation[] @relation("InvitationsSentToMe")
|
|
1207
|
+
notificationsCreatedByMe Notification[] @relation("NotificationsCreatedByMe")
|
|
1208
|
+
remindersCreatedByMe Reminder[] @relation("RemindersCreatedByMe")
|
|
1209
|
+
remindersAssignedToMe Reminder[] @relation("RemindersAssignedToMe")
|
|
1210
|
+
eventTasksAssignedToMe EventTask[] @relation("TasksAssignedToMe")
|
|
1211
|
+
contacts Contact[]
|
|
1212
|
+
contactLists ContactList[] @relation("UserContactLists")
|
|
1213
|
+
contactlist ContactList[]
|
|
1179
1214
|
|
|
1180
1215
|
bashEventPromoCodesIUsed BashEventPromoCode[]
|
|
1181
1216
|
userSubscription UserSubscription?
|
|
@@ -1263,9 +1298,28 @@ model User {
|
|
|
1263
1298
|
|
|
1264
1299
|
// Vendor booking relations
|
|
1265
1300
|
vendorBookingRequestsAsHost VendorBookingRequest[] @relation("VendorBookingHost")
|
|
1266
|
-
|
|
1301
|
+
|
|
1302
|
+
// Exhibitor booking relations
|
|
1303
|
+
exhibitorBookingRequestsAsHost ExhibitorBookingRequest[] @relation("ExhibitorBookingHost")
|
|
1304
|
+
|
|
1305
|
+
// Sponsor booking relations
|
|
1306
|
+
sponsorBookingRequestsAsHost SponsorBookingRequest[] @relation("SponsorBookingHost")
|
|
1307
|
+
|
|
1267
1308
|
// Vendor booking messages
|
|
1268
1309
|
vendorBookingMessages VendorBookingMessage[] @relation("VendorMessageSender")
|
|
1310
|
+
|
|
1311
|
+
// Unified service booking messages
|
|
1312
|
+
serviceBookingMessages ServiceBookingMessage[] @relation("ServiceMessageSender")
|
|
1313
|
+
|
|
1314
|
+
// Identity Verification (Additional Security Layer)
|
|
1315
|
+
isVerified Boolean @default(false) // Has completed identity verification
|
|
1316
|
+
verificationMethod String? // "biometric", "document", "manual", etc.
|
|
1317
|
+
verifiedAt DateTime? // When verification was completed
|
|
1318
|
+
verificationScore Int @default(0) // Trust score (0-100)
|
|
1319
|
+
biometricFingerprint String? // Unique biometric hash for anti-fraud
|
|
1320
|
+
|
|
1321
|
+
// Biometric authentication
|
|
1322
|
+
biometricCredentials BiometricCredential[]
|
|
1269
1323
|
}
|
|
1270
1324
|
|
|
1271
1325
|
model UserPreferences {
|
|
@@ -1309,6 +1363,11 @@ model UserPreferences {
|
|
|
1309
1363
|
trackFirstEventAttended Boolean @default(true) // NEW - remember which bash connected you
|
|
1310
1364
|
autoAddServiceClients Boolean @default(true) // NEW - auto-add service clients to contacts
|
|
1311
1365
|
|
|
1366
|
+
// Contact Information Privacy (NEW SECTION)
|
|
1367
|
+
showEmailPublicly Boolean @default(true) // Email visibility in contact lists (default public since already exposed)
|
|
1368
|
+
showPhonePublicly Boolean @default(false) // Phone visibility in contact lists (default private, opt-in)
|
|
1369
|
+
showAddressPublicly Boolean @default(false) // Address visibility in contact lists (default private)
|
|
1370
|
+
|
|
1312
1371
|
// UI/UX Preferences
|
|
1313
1372
|
theme String @default("system") // Updated to lowercase, matches our UI
|
|
1314
1373
|
language String @default("en") // Simplified from en-US
|
|
@@ -1377,6 +1436,31 @@ model UserFollowing {
|
|
|
1377
1436
|
@@unique([userId, followingId])
|
|
1378
1437
|
}
|
|
1379
1438
|
|
|
1439
|
+
model BiometricCredential {
|
|
1440
|
+
id String @id @default(cuid())
|
|
1441
|
+
userId String
|
|
1442
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
1443
|
+
credentialId String @unique // WebAuthn credential ID (base64 encoded)
|
|
1444
|
+
publicKey String // WebAuthn public key (base64 encoded)
|
|
1445
|
+
counter Int @default(0) // WebAuthn signature counter
|
|
1446
|
+
deviceType String? // e.g., "Touch ID", "Face ID", "Windows Hello"
|
|
1447
|
+
deviceInfo Json? // Additional device information
|
|
1448
|
+
isActive Boolean @default(true)
|
|
1449
|
+
lastUsedAt DateTime?
|
|
1450
|
+
createdAt DateTime @default(now())
|
|
1451
|
+
updatedAt DateTime @updatedAt
|
|
1452
|
+
|
|
1453
|
+
// Verification system fields
|
|
1454
|
+
usedForVerification Boolean @default(false) // Was this credential used to verify identity?
|
|
1455
|
+
verificationLevel String? // "basic", "enhanced", "premium"
|
|
1456
|
+
biometricHash String? // Unique hash for anti-fraud detection
|
|
1457
|
+
|
|
1458
|
+
@@index([userId])
|
|
1459
|
+
@@index([credentialId])
|
|
1460
|
+
@@index([isActive])
|
|
1461
|
+
@@index([usedForVerification])
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1380
1464
|
model Contact {
|
|
1381
1465
|
id String @id @default(cuid())
|
|
1382
1466
|
contactOwnerId String
|
|
@@ -1639,12 +1723,14 @@ model Service {
|
|
|
1639
1723
|
|
|
1640
1724
|
// googleReviews GoogleReview[]
|
|
1641
1725
|
|
|
1642
|
-
bashEvent
|
|
1643
|
-
userPromoCodeRedemption
|
|
1644
|
-
bookings
|
|
1645
|
-
notification
|
|
1646
|
-
favoritedBy
|
|
1647
|
-
vendorBookingRequests
|
|
1726
|
+
bashEvent BashEvent[] // because a service needs to be associated with a bash to post to the bashfeed
|
|
1727
|
+
userPromoCodeRedemption UserPromoCodeRedemption[]
|
|
1728
|
+
bookings ServiceBooking[]
|
|
1729
|
+
notification Notification[]
|
|
1730
|
+
favoritedBy UserFavorite[]
|
|
1731
|
+
vendorBookingRequests VendorBookingRequest[] @relation("VendorBookingService")
|
|
1732
|
+
exhibitorBookingRequests ExhibitorBookingRequest[] @relation("ExhibitorBookingService")
|
|
1733
|
+
sponsorBookingRequests SponsorBookingRequest[] @relation("SponsorBookingService")
|
|
1648
1734
|
}
|
|
1649
1735
|
|
|
1650
1736
|
model StripeAccount {
|
|
@@ -3469,6 +3555,9 @@ model ServiceBooking {
|
|
|
3469
3555
|
addOns ServiceBookingAddOn[] // for services that aren't billed by time, but have add-ons
|
|
3470
3556
|
packages ServiceBookingPackage[] // for services that aren't billed by time, but have packages
|
|
3471
3557
|
|
|
3558
|
+
// Messages relation
|
|
3559
|
+
messages ServiceBookingMessage[]
|
|
3560
|
+
|
|
3472
3561
|
totalATBCents Int
|
|
3473
3562
|
subtotalATBCents Int @default(0) //subtotal before taxes, fees, and discounts
|
|
3474
3563
|
|
|
@@ -3544,10 +3633,13 @@ model VendorBookingRequest {
|
|
|
3544
3633
|
// Response from vendor
|
|
3545
3634
|
vendorResponse String? // Vendor's message when accepting/rejecting
|
|
3546
3635
|
respondedAt DateTime?
|
|
3547
|
-
|
|
3636
|
+
|
|
3548
3637
|
// Messages relation
|
|
3549
3638
|
messages VendorBookingMessage[]
|
|
3550
3639
|
|
|
3640
|
+
// Unified messages relation
|
|
3641
|
+
serviceMessages ServiceBookingMessage[] @relation("ServiceBookingMessages")
|
|
3642
|
+
|
|
3551
3643
|
@@index([hostUserId])
|
|
3552
3644
|
@@index([vendorServiceId])
|
|
3553
3645
|
@@index([status])
|
|
@@ -3563,18 +3655,18 @@ model VendorBookingMessage {
|
|
|
3563
3655
|
// Relations
|
|
3564
3656
|
vendorBookingRequestId String
|
|
3565
3657
|
vendorBookingRequest VendorBookingRequest @relation(fields: [vendorBookingRequestId], references: [id], onDelete: Cascade)
|
|
3566
|
-
|
|
3658
|
+
|
|
3567
3659
|
senderId String
|
|
3568
3660
|
sender User @relation("VendorMessageSender", fields: [senderId], references: [id], onDelete: Cascade)
|
|
3569
|
-
|
|
3661
|
+
|
|
3570
3662
|
// Message content
|
|
3571
3663
|
message String @db.Text
|
|
3572
3664
|
messageType String @default("text") // "text", "system", "payment_update", etc.
|
|
3573
|
-
|
|
3665
|
+
|
|
3574
3666
|
// Read status
|
|
3575
|
-
isRead
|
|
3576
|
-
readAt
|
|
3577
|
-
|
|
3667
|
+
isRead Boolean @default(false)
|
|
3668
|
+
readAt DateTime?
|
|
3669
|
+
|
|
3578
3670
|
// Metadata
|
|
3579
3671
|
metadata Json? // For storing additional message data like payment info, etc.
|
|
3580
3672
|
|
|
@@ -3583,6 +3675,47 @@ model VendorBookingMessage {
|
|
|
3583
3675
|
@@index([createdAt])
|
|
3584
3676
|
}
|
|
3585
3677
|
|
|
3678
|
+
// Unified messaging system for all service bookings
|
|
3679
|
+
model ServiceBookingMessage {
|
|
3680
|
+
id String @id @default(cuid())
|
|
3681
|
+
createdAt DateTime @default(now())
|
|
3682
|
+
updatedAt DateTime @updatedAt
|
|
3683
|
+
|
|
3684
|
+
// Relations - can be linked to ServiceBooking, VendorBookingRequest, ExhibitorBookingRequest, or SponsorBookingRequest
|
|
3685
|
+
serviceBookingId String?
|
|
3686
|
+
serviceBooking ServiceBooking? @relation(fields: [serviceBookingId], references: [id], onDelete: Cascade)
|
|
3687
|
+
|
|
3688
|
+
vendorBookingRequestId String?
|
|
3689
|
+
vendorBookingRequest VendorBookingRequest? @relation("ServiceBookingMessages", fields: [vendorBookingRequestId], references: [id], onDelete: Cascade)
|
|
3690
|
+
|
|
3691
|
+
exhibitorBookingRequestId String?
|
|
3692
|
+
exhibitorBookingRequest ExhibitorBookingRequest? @relation("ExhibitorServiceMessages", fields: [exhibitorBookingRequestId], references: [id], onDelete: Cascade)
|
|
3693
|
+
|
|
3694
|
+
sponsorBookingRequestId String?
|
|
3695
|
+
sponsorBookingRequest SponsorBookingRequest? @relation("SponsorServiceMessages", fields: [sponsorBookingRequestId], references: [id], onDelete: Cascade)
|
|
3696
|
+
|
|
3697
|
+
senderId String
|
|
3698
|
+
sender User @relation("ServiceMessageSender", fields: [senderId], references: [id], onDelete: Cascade)
|
|
3699
|
+
|
|
3700
|
+
// Message content
|
|
3701
|
+
message String @db.Text
|
|
3702
|
+
messageType String @default("text") // "text", "system", "booking_update", "payment_update", etc.
|
|
3703
|
+
|
|
3704
|
+
// Read status
|
|
3705
|
+
isRead Boolean @default(false)
|
|
3706
|
+
readAt DateTime?
|
|
3707
|
+
|
|
3708
|
+
// Metadata for different message types
|
|
3709
|
+
metadata Json? // For storing additional message data like booking changes, payment info, etc.
|
|
3710
|
+
|
|
3711
|
+
@@index([serviceBookingId])
|
|
3712
|
+
@@index([vendorBookingRequestId])
|
|
3713
|
+
@@index([exhibitorBookingRequestId])
|
|
3714
|
+
@@index([sponsorBookingRequestId])
|
|
3715
|
+
@@index([senderId])
|
|
3716
|
+
@@index([createdAt])
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3586
3719
|
enum VendorBookingStatus {
|
|
3587
3720
|
PENDING // Initial request sent
|
|
3588
3721
|
ACCEPTED // Vendor accepted, awaiting payment
|
|
@@ -3593,6 +3726,167 @@ enum VendorBookingStatus {
|
|
|
3593
3726
|
EXPIRED // Request expired without response
|
|
3594
3727
|
}
|
|
3595
3728
|
|
|
3729
|
+
model ExhibitorBookingRequest {
|
|
3730
|
+
id String @id @default(cuid())
|
|
3731
|
+
createdAt DateTime @default(now())
|
|
3732
|
+
updatedAt DateTime @updatedAt
|
|
3733
|
+
|
|
3734
|
+
// Relations
|
|
3735
|
+
hostUserId String
|
|
3736
|
+
hostUser User @relation("ExhibitorBookingHost", fields: [hostUserId], references: [id], onDelete: Cascade)
|
|
3737
|
+
exhibitorServiceId String
|
|
3738
|
+
exhibitorService Service @relation("ExhibitorBookingService", fields: [exhibitorServiceId], references: [id], onDelete: Cascade)
|
|
3739
|
+
bashEventId String?
|
|
3740
|
+
bashEvent BashEvent? @relation("ExhibitorBookingEvent", fields: [bashEventId], references: [id], onDelete: SetNull)
|
|
3741
|
+
|
|
3742
|
+
// Request data (structured fields)
|
|
3743
|
+
spaceOffered String
|
|
3744
|
+
customSpaceOffered String?
|
|
3745
|
+
providingTent Boolean @default(false)
|
|
3746
|
+
providingTables Int @default(0)
|
|
3747
|
+
providingChairs Boolean @default(false)
|
|
3748
|
+
providingElectricity Boolean @default(false)
|
|
3749
|
+
providingWater Boolean @default(false)
|
|
3750
|
+
providingInternet Boolean @default(false)
|
|
3751
|
+
|
|
3752
|
+
expectedGuests Int
|
|
3753
|
+
eventDuration String
|
|
3754
|
+
setupTime String
|
|
3755
|
+
breakdownTime String
|
|
3756
|
+
|
|
3757
|
+
exhibitorFee Float?
|
|
3758
|
+
feeStructure String // "flat", "percentage", "free", "negotiable"
|
|
3759
|
+
percentageRate Float?
|
|
3760
|
+
|
|
3761
|
+
eventDescription String @db.Text
|
|
3762
|
+
specialRequests String @db.Text
|
|
3763
|
+
contactPreference String @default("email") // "email", "phone", "either"
|
|
3764
|
+
urgency String @default("flexible") // "asap", "within_week", "flexible"
|
|
3765
|
+
|
|
3766
|
+
paymentTiming String @default("advance") // "advance", "day_of", "after_event", "deposit_balance"
|
|
3767
|
+
depositPercentage Float?
|
|
3768
|
+
|
|
3769
|
+
budgetRange String
|
|
3770
|
+
competitorRestrictions String @db.Text
|
|
3771
|
+
insuranceRequired Boolean @default(false)
|
|
3772
|
+
permitRequirements String @db.Text
|
|
3773
|
+
weatherContingency String @db.Text
|
|
3774
|
+
cancellationPolicy String @db.Text
|
|
3775
|
+
|
|
3776
|
+
// Exhibitor-specific fields
|
|
3777
|
+
leadGenerationExpected Boolean @default(false)
|
|
3778
|
+
materialDistribution String @db.Text
|
|
3779
|
+
demonstrationNeeds String @db.Text
|
|
3780
|
+
|
|
3781
|
+
// Status and workflow
|
|
3782
|
+
status ExhibitorBookingStatus @default(PENDING)
|
|
3783
|
+
|
|
3784
|
+
// Payment information (populated when exhibitor accepts)
|
|
3785
|
+
paymentAmount Float?
|
|
3786
|
+
paymentStatus String?
|
|
3787
|
+
stripePaymentIntentId String?
|
|
3788
|
+
paidAt DateTime?
|
|
3789
|
+
|
|
3790
|
+
// Response from exhibitor
|
|
3791
|
+
responseMessage String? // Exhibitor's message when accepting/rejecting
|
|
3792
|
+
respondedAt DateTime?
|
|
3793
|
+
|
|
3794
|
+
// Unified messages relation
|
|
3795
|
+
serviceMessages ServiceBookingMessage[] @relation("ExhibitorServiceMessages")
|
|
3796
|
+
|
|
3797
|
+
@@index([hostUserId])
|
|
3798
|
+
@@index([exhibitorServiceId])
|
|
3799
|
+
@@index([status])
|
|
3800
|
+
@@index([createdAt])
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
enum ExhibitorBookingStatus {
|
|
3804
|
+
PENDING // Initial request sent
|
|
3805
|
+
ACCEPTED // Exhibitor accepted, awaiting payment
|
|
3806
|
+
PAID // Exhibitor has paid host
|
|
3807
|
+
COMPLETED // Event completed successfully
|
|
3808
|
+
REJECTED // Exhibitor rejected request
|
|
3809
|
+
CANCELLED // Host or exhibitor cancelled
|
|
3810
|
+
EXPIRED // Request expired without response
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
model SponsorBookingRequest {
|
|
3814
|
+
id String @id @default(cuid())
|
|
3815
|
+
createdAt DateTime @default(now())
|
|
3816
|
+
updatedAt DateTime @updatedAt
|
|
3817
|
+
|
|
3818
|
+
// Relations
|
|
3819
|
+
hostUserId String
|
|
3820
|
+
hostUser User @relation("SponsorBookingHost", fields: [hostUserId], references: [id], onDelete: Cascade)
|
|
3821
|
+
sponsorServiceId String
|
|
3822
|
+
sponsorService Service @relation("SponsorBookingService", fields: [sponsorServiceId], references: [id], onDelete: Cascade)
|
|
3823
|
+
bashEventId String?
|
|
3824
|
+
bashEvent BashEvent? @relation("SponsorBookingEvent", fields: [bashEventId], references: [id], onDelete: SetNull)
|
|
3825
|
+
|
|
3826
|
+
// Sponsorship details
|
|
3827
|
+
sponsorshipLevel String
|
|
3828
|
+
customSponsorshipLevel String?
|
|
3829
|
+
sponsorshipBudget String
|
|
3830
|
+
customBudget Float?
|
|
3831
|
+
sponsorFee Float @default(0)
|
|
3832
|
+
feeStructure String @default("flat") // "flat", "percentage", "free", "negotiable"
|
|
3833
|
+
percentageRate Float?
|
|
3834
|
+
paymentTiming String @default("advance") // "advance", "day_of", "after_event", "deposit_balance"
|
|
3835
|
+
depositPercentage Float?
|
|
3836
|
+
|
|
3837
|
+
// Benefits offered (stored as JSON for complex data)
|
|
3838
|
+
benefitsOffered String @db.Text // JSON string containing benefit categories and custom benefits
|
|
3839
|
+
|
|
3840
|
+
// Deliverables required (stored as JSON for complex data)
|
|
3841
|
+
deliverablesRequired String @db.Text // JSON string containing required deliverables
|
|
3842
|
+
|
|
3843
|
+
expectedGuests Int
|
|
3844
|
+
eventDuration String
|
|
3845
|
+
eventDescription String @db.Text
|
|
3846
|
+
specialRequests String @db.Text
|
|
3847
|
+
contactPreference String @default("email") // "email", "phone", "either"
|
|
3848
|
+
urgency String @default("flexible") // "asap", "within_week", "flexible"
|
|
3849
|
+
|
|
3850
|
+
competitorRestrictions String @db.Text
|
|
3851
|
+
exclusivityRequirements String @db.Text
|
|
3852
|
+
roiExpectations String @db.Text
|
|
3853
|
+
reportingRequirements String @db.Text
|
|
3854
|
+
cancellationPolicy String @db.Text
|
|
3855
|
+
mentionRequirements String @db.Text
|
|
3856
|
+
socialMediaRequirements String @db.Text
|
|
3857
|
+
|
|
3858
|
+
// Status and workflow
|
|
3859
|
+
status SponsorBookingStatus @default(PENDING)
|
|
3860
|
+
|
|
3861
|
+
// Payment information (populated when sponsor accepts)
|
|
3862
|
+
paymentAmount Float?
|
|
3863
|
+
paymentStatus String?
|
|
3864
|
+
stripePaymentIntentId String?
|
|
3865
|
+
paidAt DateTime?
|
|
3866
|
+
|
|
3867
|
+
// Response from sponsor
|
|
3868
|
+
responseMessage String? // Sponsor's message when accepting/rejecting
|
|
3869
|
+
respondedAt DateTime?
|
|
3870
|
+
|
|
3871
|
+
// Unified messages relation
|
|
3872
|
+
serviceMessages ServiceBookingMessage[] @relation("SponsorServiceMessages")
|
|
3873
|
+
|
|
3874
|
+
@@index([hostUserId])
|
|
3875
|
+
@@index([sponsorServiceId])
|
|
3876
|
+
@@index([status])
|
|
3877
|
+
@@index([createdAt])
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
enum SponsorBookingStatus {
|
|
3881
|
+
PENDING // Initial request sent
|
|
3882
|
+
ACCEPTED // Sponsor accepted, awaiting payment
|
|
3883
|
+
PAID // Sponsor has paid host
|
|
3884
|
+
COMPLETED // Event completed successfully
|
|
3885
|
+
REJECTED // Sponsor rejected request
|
|
3886
|
+
CANCELLED // Host or sponsor cancelled
|
|
3887
|
+
EXPIRED // Request expired without response
|
|
3888
|
+
}
|
|
3889
|
+
|
|
3596
3890
|
enum VisibilityPreference {
|
|
3597
3891
|
Public
|
|
3598
3892
|
Private
|