@bash-app/bash-common 30.79.0 → 30.81.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 +66 -8
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -378,7 +378,7 @@ model UserReferralCode {
|
|
|
378
378
|
id String @id @default(cuid())
|
|
379
379
|
userId String @unique
|
|
380
380
|
referralCode String @unique
|
|
381
|
-
referralTier ReferralTier @default(
|
|
381
|
+
referralTier ReferralTier @default(None)
|
|
382
382
|
totalReferrals Int @default(0)
|
|
383
383
|
totalEarnings Int @default(0)
|
|
384
384
|
isActive Boolean @default(true)
|
|
@@ -411,6 +411,42 @@ model UserReferralToken {
|
|
|
411
411
|
@@index([redeemedByUserId])
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
+
model ScoutReferral {
|
|
415
|
+
id String @id @default(cuid())
|
|
416
|
+
referrerId String
|
|
417
|
+
referredUserId String
|
|
418
|
+
serviceProfileId String
|
|
419
|
+
creditsAwarded Int @default(75)
|
|
420
|
+
createdAt DateTime @default(now())
|
|
421
|
+
referrer User @relation("ScoutReferrer", fields: [referrerId], references: [id], onDelete: Cascade)
|
|
422
|
+
referredUser User @relation("ScoutReferred", fields: [referredUserId], references: [id], onDelete: Cascade)
|
|
423
|
+
serviceProfile Service @relation("ScoutServiceProfile", fields: [serviceProfileId], references: [id], onDelete: Cascade)
|
|
424
|
+
|
|
425
|
+
@@index([referrerId])
|
|
426
|
+
@@index([referredUserId])
|
|
427
|
+
@@index([serviceProfileId])
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
model BookingCommission {
|
|
431
|
+
id String @id @default(cuid())
|
|
432
|
+
bookingId String
|
|
433
|
+
referrerId String
|
|
434
|
+
serviceProfileId String
|
|
435
|
+
bookingAmount Int // Total booking in cents
|
|
436
|
+
commissionRate Decimal @db.Decimal(5, 2) // 3.00 or 6.00
|
|
437
|
+
commissionAmount Int // Bash Credits earned
|
|
438
|
+
status String @default("pending") // 'pending' | 'paid' | 'cancelled'
|
|
439
|
+
paidAt DateTime?
|
|
440
|
+
createdAt DateTime @default(now())
|
|
441
|
+
booking ServiceBooking @relation("BookingCommissions", fields: [bookingId], references: [id], onDelete: Cascade)
|
|
442
|
+
referrer User @relation("CommissionReferrer", fields: [referrerId], references: [id], onDelete: Cascade)
|
|
443
|
+
serviceProfile Service @relation("CommissionServiceProfile", fields: [serviceProfileId], references: [id], onDelete: Cascade)
|
|
444
|
+
|
|
445
|
+
@@index([referrerId])
|
|
446
|
+
@@index([bookingId])
|
|
447
|
+
@@index([status])
|
|
448
|
+
}
|
|
449
|
+
|
|
414
450
|
model TicketTier {
|
|
415
451
|
id String @id @default(cuid())
|
|
416
452
|
bashEventId String
|
|
@@ -782,6 +818,9 @@ model User {
|
|
|
782
818
|
ambashadorAwardedAt DateTime?
|
|
783
819
|
isBashInsider Boolean @default(false)
|
|
784
820
|
insiderAwardedAt DateTime?
|
|
821
|
+
scoutTier ScoutTier @default(None)
|
|
822
|
+
scoutAwardedAt DateTime?
|
|
823
|
+
totalServiceReferrals Int @default(0)
|
|
785
824
|
associatedBashes AssociatedBash[]
|
|
786
825
|
associatedServices AssociatedService[]
|
|
787
826
|
comment BashComment[]
|
|
@@ -872,6 +911,9 @@ model User {
|
|
|
872
911
|
redeemedVouchers Voucher[]
|
|
873
912
|
bashEventPromoCodesIUsed BashEventPromoCode[] @relation("BashEventPromoCodeToUser")
|
|
874
913
|
ticketTiersWaitListsIveJoined TicketTier[] @relation("TicketTierToUser")
|
|
914
|
+
scoutReferralsMade ScoutReferral[] @relation("ScoutReferrer")
|
|
915
|
+
scoutReferralsReceived ScoutReferral[] @relation("ScoutReferred")
|
|
916
|
+
bookingCommissionsEarned BookingCommission[] @relation("CommissionReferrer")
|
|
875
917
|
}
|
|
876
918
|
|
|
877
919
|
model UserPreferences {
|
|
@@ -1232,6 +1274,8 @@ model Service {
|
|
|
1232
1274
|
associatedBashesReferencingMe AssociatedBash[] @relation("AssociatedBashToService")
|
|
1233
1275
|
bashEvent BashEvent[] @relation("BashEventToService")
|
|
1234
1276
|
media Media[] @relation("MediaToService")
|
|
1277
|
+
scoutReferrals ScoutReferral[] @relation("ScoutServiceProfile")
|
|
1278
|
+
bookingCommissions BookingCommission[] @relation("CommissionServiceProfile")
|
|
1235
1279
|
|
|
1236
1280
|
@@index([serviceListingStripeSubscriptionId])
|
|
1237
1281
|
@@index([isFreeFirstListing])
|
|
@@ -1582,16 +1626,24 @@ model ServicePackage {
|
|
|
1582
1626
|
}
|
|
1583
1627
|
|
|
1584
1628
|
model ServiceRate {
|
|
1585
|
-
id String
|
|
1629
|
+
id String @id @default(cuid())
|
|
1586
1630
|
rateType ServiceRateType
|
|
1587
1631
|
hourlyRateCents Int?
|
|
1588
1632
|
dailyRateCents Int?
|
|
1589
1633
|
flatRateCents Int?
|
|
1590
1634
|
cleaningFeePerBookingCents Int?
|
|
1591
1635
|
minimumTimeBlockHours Int?
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1636
|
+
|
|
1637
|
+
// Market rate transparency fields
|
|
1638
|
+
pricingJustification String? // Provider's explanation for their pricing
|
|
1639
|
+
marketRateDeviation Float? // Percent deviation from market average
|
|
1640
|
+
shownMarketRateAtCreation Boolean @default(false) // Track if user saw market data
|
|
1641
|
+
marketRateSource String? // 'BLS', 'GLASSDOOR', 'NONE'
|
|
1642
|
+
marketRateSnapshot Json? // Store rate range shown at creation time
|
|
1643
|
+
|
|
1644
|
+
serviceDailyRates ServiceDailyRates?
|
|
1645
|
+
serviceRatesAssociation ServiceRatesAssociation?
|
|
1646
|
+
serviceSpecialRates ServiceSpecialRates?
|
|
1595
1647
|
|
|
1596
1648
|
@@index([rateType])
|
|
1597
1649
|
}
|
|
@@ -1749,6 +1801,7 @@ model ServiceBooking {
|
|
|
1749
1801
|
additionalFees ServiceBookingFee[]
|
|
1750
1802
|
messages ServiceBookingMessage[]
|
|
1751
1803
|
packages ServiceBookingPackage[]
|
|
1804
|
+
commissions BookingCommission[] @relation("BookingCommissions")
|
|
1752
1805
|
|
|
1753
1806
|
@@index([status])
|
|
1754
1807
|
@@index([creatorId])
|
|
@@ -3988,10 +4041,15 @@ enum CreditTransactionType {
|
|
|
3988
4041
|
}
|
|
3989
4042
|
|
|
3990
4043
|
enum ReferralTier {
|
|
4044
|
+
None
|
|
3991
4045
|
Ambashador
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
4046
|
+
Insider
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
enum ScoutTier {
|
|
4050
|
+
None
|
|
4051
|
+
Scout
|
|
4052
|
+
Agent
|
|
3995
4053
|
}
|
|
3996
4054
|
|
|
3997
4055
|
enum VoucherStatus {
|